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