merge the formfield patch from ooo-build
[ooovba.git] / toolkit / workben / layout / wordcountdialog.cxx
blob1eebbe5d9f02ca4b626ae0005c6dcc9aa343f98a
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 #if !TEST_LAYOUT
32 // MARKER(update_precomp.py): autogen include statement, do not remove
33 #include "precompiled_sw.hxx"
34 #ifdef SW_DLLIMPLEMENTATION
35 #undef SW_DLLIMPLEMENTATION
36 #endif
37 #include <swtypes.hxx>
38 #endif /* !TEST_LAYOUT */
39 #include <wordcountdialog.hxx>
40 #if !TEST_LAYOUT
41 #include <docstat.hxx>
43 #include <dialog.hrc>
44 #endif /* !TEST_LAYOUT */
45 #include <layout/layout-pre.hxx>
46 #if !TEST_LAYOUT
47 #include <wordcountdialog.hrc>
48 #endif /* !TEST_LAYOUT */
50 #if ENABLE_LAYOUT
51 #undef SW_RES
52 #define SW_RES(x) #x
53 #undef SfxModalDialog
54 #define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id )
55 #define SW_WORDCOUNTDIALOG_HRC
56 #include <helpid.h>
57 #endif /* ENABLE_LAYOUT */
59 /*-- 06.04.2004 16:05:55---------------------------------------------------
61 -----------------------------------------------------------------------*/
62 SwWordCountDialog::SwWordCountDialog(Window* pParent) :
63 SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)),
64 #if defined _MSC_VER
65 #pragma warning (disable : 4355)
66 #endif
67 aCurrentFL( this, SW_RES( FL_CURRENT )),
68 aCurrentWordFT( this, SW_RES( FT_CURRENTWORD )),
69 aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )),
70 aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )),
71 aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )),
73 aDocFL( this, SW_RES( FL_DOC )),
74 aDocWordFT( this, SW_RES( FT_DOCWORD )),
75 aDocWordFI( this, SW_RES( FI_DOCWORD )),
76 aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )),
77 aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )),
78 aBottomFL(this, SW_RES( FL_BOTTOM )),
79 aOK( this, SW_RES( PB_OK )),
80 aHelp( this, SW_RES( PB_HELP ))
81 #if defined _MSC_VER
82 #pragma warning (default : 4355)
83 #endif
85 #if ENABLE_LAYOUT
86 SetHelpId (HID_DLG_WORDCOUNT);
87 #endif /* ENABLE_LAYOUT */
88 FreeResource();
90 /*-- 06.04.2004 16:05:56---------------------------------------------------
92 -----------------------------------------------------------------------*/
93 SwWordCountDialog::~SwWordCountDialog()
96 /*-- 06.04.2004 16:05:57---------------------------------------------------
98 -----------------------------------------------------------------------*/
99 void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
101 #if TEST_LAYOUT
102 (void) rCurrent;
103 (void) rDoc;
104 #else /* !TEST_LAYOUT */
105 aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord ));
106 aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar ));
107 aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord ));
108 aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar ));
109 #endif /* !TEST_LAYOUT */