merge the formfield patch from ooo-build
[ooovba.git] / sw / source / ui / dialog / wordcountdialog.cxx
blob8ae35e684a98bc3ecf37af2900932d53b8366066
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wordcountdialog.cxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
33 #ifdef SW_DLLIMPLEMENTATION
34 #undef SW_DLLIMPLEMENTATION
35 #endif
36 #include <swtypes.hxx>
37 #include <wordcountdialog.hxx>
38 #include <docstat.hxx>
40 #include <dialog.hrc>
41 #include <layout/layout-pre.hxx>
42 #include <wordcountdialog.hrc>
44 #if ENABLE_LAYOUT
45 #undef SW_RES
46 #define SW_RES(x) #x
47 #undef SfxModalDialog
48 #define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id )
49 #define SW_WORDCOUNTDIALOG_HRC
50 #include <helpid.h>
51 #endif /* ENABLE_LAYOUT */
53 /*-- 06.04.2004 16:05:55---------------------------------------------------
55 -----------------------------------------------------------------------*/
56 SwWordCountDialog::SwWordCountDialog(Window* pParent) :
57 SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)),
58 #if defined _MSC_VER
59 #pragma warning (disable : 4355)
60 #endif
61 aCurrentFL( this, SW_RES( FL_CURRENT )),
62 aCurrentWordFT( this, SW_RES( FT_CURRENTWORD )),
63 aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )),
64 aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )),
65 aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )),
67 aDocFL( this, SW_RES( FL_DOC )),
68 aDocWordFT( this, SW_RES( FT_DOCWORD )),
69 aDocWordFI( this, SW_RES( FI_DOCWORD )),
70 aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )),
71 aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )),
72 aBottomFL(this, SW_RES( FL_BOTTOM )),
73 aOK( this, SW_RES( PB_OK )),
74 aHelp( this, SW_RES( PB_HELP ))
75 #if defined _MSC_VER
76 #pragma warning (default : 4355)
77 #endif
79 #if ENABLE_LAYOUT
80 SetHelpId (HID_DLG_WORDCOUNT);
81 #endif /* ENABLE_LAYOUT */
82 FreeResource();
84 /*-- 06.04.2004 16:05:56---------------------------------------------------
86 -----------------------------------------------------------------------*/
87 SwWordCountDialog::~SwWordCountDialog()
90 /*-- 06.04.2004 16:05:57---------------------------------------------------
92 -----------------------------------------------------------------------*/
93 void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
95 aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord ));
96 aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar ));
97 aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord ));
98 aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar ));