Hello,

This patch add non blank characters count in Properties in Writter.

Patch under LGPLv3+/MPL.

Thanks

-- 
Arnaud Versini
From 35ce02c195ad93c8684e3d80fe9c9cffb19da1cc Mon Sep 17 00:00:00 2001
From: Arnaud Versini <arnaud.vers...@gmail.com>
Date: Fri, 4 Mar 2011 21:46:43 +0100
Subject: [PATCH] Add non blank characters in Writter properties dialog.

---
 sw/source/ui/dialog/docstdlg.cxx |    3 +++
 sw/source/ui/dialog/docstdlg.hrc |    2 ++
 sw/source/ui/dialog/docstdlg.src |   33 +++++++++++++++++++++++----------
 sw/source/ui/inc/docstdlg.hxx    |    2 ++
 4 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 5b88900..e6bce47 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -69,6 +69,7 @@ SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
     aParaLbl	(this, SW_RES( FT_PARA		 )),
     aWordLbl	(this, SW_RES( FT_WORD		 )),
     aCharLbl	(this, SW_RES( FT_CHAR 	     )),
+    aCharExclSpacesLbl	(this, SW_RES( FT_CHAR_EXCL_SPACES )),
     aLineLbl    (this, SW_RES( FT_LINE       )),
 
     aTableNo    (this, SW_RES( FT_TABLE_COUNT)),
@@ -78,6 +79,7 @@ SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) :
     aParaNo		(this, SW_RES( FT_PARA_COUNT )),
     aWordNo		(this, SW_RES( FT_WORD_COUNT )),
     aCharNo		(this, SW_RES( FT_CHAR_COUNT )),
+    aCharExclSpacesNo (this, SW_RES( FT_CHAR_COUNT_EXCL_SPACES )),
     aLineNo		(this, SW_RES( FT_LINE_COUNT )),
     aUpdatePB	(this, SW_RES( PB_PDATE      ))
 {
@@ -128,6 +130,7 @@ void SwDocStatPage::SetData(const SwDocStat &rStat)
     aParaNo.SetText(String::CreateFromInt32( rStat.nPara ));
     aWordNo.SetText(String::CreateFromInt32( rStat.nWord ));
     aCharNo.SetText(String::CreateFromInt32( rStat.nChar ));
+    aCharExclSpacesNo.SetText(String::CreateFromInt32( rStat.nCharExcludingSpaces ));
 }
 
 /*------------------------------------------------------------------------
diff --git a/sw/source/ui/dialog/docstdlg.hrc b/sw/source/ui/dialog/docstdlg.hrc
index 358b277..ccd79a5 100644
--- a/sw/source/ui/dialog/docstdlg.hrc
+++ b/sw/source/ui/dialog/docstdlg.hrc
@@ -32,6 +32,7 @@
 #define FT_PARA				5
 #define FT_WORD				6
 #define FT_CHAR 			9
+#define FT_CHAR_EXCL_SPACES            21
 #define FT_TABLE_COUNT		10
 #define FT_GRF_COUNT		11
 #define FT_OLE_COUNT		12
@@ -39,6 +40,7 @@
 #define FT_PARA_COUNT		14
 #define FT_WORD_COUNT		15
 #define FT_CHAR_COUNT		16
+#define FT_CHAR_COUNT_EXCL_SPACES	20
 #define FT_LINE             17
 #define FT_LINE_COUNT       18
 #define PB_PDATE            19
diff --git a/sw/source/ui/dialog/docstdlg.src b/sw/source/ui/dialog/docstdlg.src
index 5926321..c0f0f83 100644
--- a/sw/source/ui/dialog/docstdlg.src
+++ b/sw/source/ui/dialog/docstdlg.src
@@ -83,64 +83,77 @@ TabPage TP_DOC_STAT
         Text [ en-US ] = "Number of Characters:" ;
         Left = TRUE ;
     };
-    FixedText FT_LINE
+    FixedText FT_CHAR_EXCL_SPACES
     {
         Pos = MAP_APPFONT ( 6 , 96 ) ;
+        Size = MAP_APPFONT ( 138 , 8 ) ;
+        Text [ en-US ] = "Number of non blank Characters:" ;
+        Left = TRUE ;
+    };
+    FixedText FT_LINE
+    {
+        Pos = MAP_APPFONT ( 6 , 110 ) ;
         Size = MAP_APPFONT ( 90 , 8 ) ;
         Text [ en-US ] = "Number of Lines:" ;
     };
     FixedText FT_PAGE_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 6 ) ;
+        Pos = MAP_APPFONT ( 138 , 6 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_TABLE_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 18 ) ;
+        Pos = MAP_APPFONT ( 138 , 18 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_GRF_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 30 ) ;
+        Pos = MAP_APPFONT ( 138 , 30 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_OLE_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 42 ) ;
+        Pos = MAP_APPFONT ( 138 , 42 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_PARA_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 54 ) ;
+        Pos = MAP_APPFONT ( 138 , 54 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_WORD_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 68 ) ;
+        Pos = MAP_APPFONT ( 138 , 68 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_CHAR_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 82 ) ;
+        Pos = MAP_APPFONT ( 138 , 82 ) ;
+        Size = MAP_APPFONT ( 27 , 8 ) ;
+        Left = TRUE ;
+    };
+    FixedText FT_CHAR_COUNT_EXCL_SPACES
+    {
+        Pos = MAP_APPFONT ( 138 , 96 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
     };
     FixedText FT_LINE_COUNT
     {
-        Pos = MAP_APPFONT ( 114 , 96 ) ;
+        Pos = MAP_APPFONT ( 138 , 110 ) ;
         Size = MAP_APPFONT ( 27 , 8 ) ;
         Left = TRUE ;
         Text = "..." ;
     };
     PushButton PB_PDATE
     {
-        Pos = MAP_APPFONT ( 204 , 94 ) ;
+        Pos = MAP_APPFONT ( 204 , 108 ) ;
         Size = MAP_APPFONT ( 50 , 14 ) ;
         Text [ en-US ] = "~Update" ;
     };
diff --git a/sw/source/ui/inc/docstdlg.hxx b/sw/source/ui/inc/docstdlg.hxx
index 388e12e..235fff1 100644
--- a/sw/source/ui/inc/docstdlg.hxx
+++ b/sw/source/ui/inc/docstdlg.hxx
@@ -60,6 +60,7 @@ private:
     FixedText       aParaLbl;
     FixedText       aWordLbl;
     FixedText       aCharLbl;
+    FixedText       aCharExclSpacesLbl;
     FixedText       aLineLbl;
 
     FixedInfo       aTableNo;
@@ -69,6 +70,7 @@ private:
     FixedInfo       aParaNo;
     FixedInfo       aWordNo;
     FixedInfo       aCharNo;
+    FixedInfo       aCharExclSpacesNo;
     FixedInfo       aLineNo;
 
     PushButton		aUpdatePB;
-- 
1.7.4.1

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to