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