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