1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 #ifdef SW_DLLIMPLEMENTATION
27 #undef SW_DLLIMPLEMENTATION
28 #endif
29 #include <swtypes.hxx>
30 #include <wordcountdialog.hxx>
31 #include <docstat.hxx>
32 
33 #include <dialog.hrc>
34 #include <layout/layout-pre.hxx>
35 #include <wordcountdialog.hrc>
36 
37 #if ENABLE_LAYOUT
38 #undef SW_RES
39 #define SW_RES(x) #x
40 #undef SfxModalDialog
41 #define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id )
42 #define SW_WORDCOUNTDIALOG_HRC
43 #include <helpid.h>
44 #endif /* ENABLE_LAYOUT */
45 
46 /*-- 06.04.2004 16:05:55---------------------------------------------------
47 
48   -----------------------------------------------------------------------*/
SwWordCountDialog(Window * pParent)49 SwWordCountDialog::SwWordCountDialog(Window* pParent) :
50     SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)),
51 #if defined _MSC_VER
52 #pragma warning (disable : 4355)
53 #endif
54     aCurrentFL( this, SW_RES(              FL_CURRENT            )),
55     aCurrentWordFT( this, SW_RES(          FT_CURRENTWORD        )),
56     aCurrentWordFI( this, SW_RES(          FI_CURRENTWORD        )),
57     aCurrentCharacterFT( this, SW_RES(     FT_CURRENTCHARACTER   )),
58     aCurrentCharacterFI( this, SW_RES(     FI_CURRENTCHARACTER   )),
59 
60     aDocFL( this, SW_RES(                  FL_DOC                )),
61     aDocWordFT( this, SW_RES(              FT_DOCWORD            )),
62     aDocWordFI( this, SW_RES(              FI_DOCWORD            )),
63     aDocCharacterFT( this, SW_RES(         FT_DOCCHARACTER       )),
64     aDocCharacterFI( this, SW_RES(         FI_DOCCHARACTER       )),
65     aBottomFL(this, SW_RES(                FL_BOTTOM             )),
66     aOK( this, SW_RES(                     PB_OK                 )),
67     aHelp( this, SW_RES(                   PB_HELP               ))
68 #if defined _MSC_VER
69 #pragma warning (default : 4355)
70 #endif
71 {
72 #if ENABLE_LAYOUT
73     SetHelpId (HID_DLG_WORDCOUNT);
74 #endif /* ENABLE_LAYOUT */
75     FreeResource();
76 }
77 /*-- 06.04.2004 16:05:56---------------------------------------------------
78 
79   -----------------------------------------------------------------------*/
~SwWordCountDialog()80 SwWordCountDialog::~SwWordCountDialog()
81 {
82 }
83 /*-- 06.04.2004 16:05:57---------------------------------------------------
84 
85   -----------------------------------------------------------------------*/
SetValues(const SwDocStat & rCurrent,const SwDocStat & rDoc)86 void  SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
87 {
88     aCurrentWordFI.SetText(     String::CreateFromInt32(rCurrent.nWord ));
89     aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar ));
90     aDocWordFI.SetText(         String::CreateFromInt32(rDoc.nWord ));
91     aDocCharacterFI.SetText(    String::CreateFromInt32(rDoc.nChar ));
92 }
93 
94 
95 
96