diff options
author | Muhammad Haggag <mhaggag@gmail.com> | 2012-05-24 19:49:41 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-05-25 09:54:59 +0300 |
commit | 8ed3a427245a07bb787c521a178cfb421fa46854 (patch) | |
tree | 0704bef179d45b4e5bf10414fdaeffb2c4c07efd | |
parent | ce14342c4292628a641a72d4f63d9c048e030c6a (diff) |
Followup to fdo#34772: Add resource strings for word-count messages
Change-Id: I7b32f5b6ed973fd4ad4635a5265d75d4e51f04ba
-rw-r--r-- | sw/source/ui/app/app.src | 10 | ||||
-rw-r--r-- | sw/source/ui/inc/app.hrc | 6 | ||||
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 13 |
3 files changed, 24 insertions, 5 deletions
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 890e8b982aed..3dc412b04c0d 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -550,6 +550,16 @@ String STR_OUTLINE_NUMBERING Text [ en-US ] = "Outline Numbering"; }; +String STR_STATUSBAR_WORDCOUNT_NO_SELECTION +{ + Text [ en-US ] = "Words: $1"; +}; + +String STR_STATUSBAR_WORDCOUNT +{ + Text [ en-US ] = "Words: $1 Selected: $2"; +}; + ToolBox RID_MODULE_TOOLBOX { HelpID = HID_MODULE_TOOLBOX ; diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc index 5de05376a882..95356a5858c4 100644 --- a/sw/source/ui/inc/app.hrc +++ b/sw/source/ui/inc/app.hrc @@ -125,7 +125,11 @@ #define STR_FDLG_STYLE (RC_APP_BEGIN + 106) //<-end,zhaojianwei -#define APP_ACT_END STR_FDLG_STYLE +// Status bar strings +#define STR_STATUSBAR_WORDCOUNT_NO_SELECTION (RC_APP_BEGIN + 110) +#define STR_STATUSBAR_WORDCOUNT (RC_APP_BEGIN + 111) + +#define APP_ACT_END STR_STATUSBAR_WORDCOUNT #if APP_ACT_END > RC_APP_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 9292185b5c96..58b5ce4289b3 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1210,10 +1210,15 @@ void SwView::StateStatusLine(SfxItemSet &rSet) documentStats = rShell.GetUpdatedDocStat(); rShell.EndAction(); } - rSet.Put(SfxStringItem(FN_STAT_WORDCOUNT, rtl::OUStringBuffer("Words: ") - .append(rtl::OUString::valueOf(static_cast<sal_Int64>(selectionStats.nWord))) - .append('/') - .append(rtl::OUString::valueOf(static_cast<sal_Int64>(documentStats.nWord))).makeStringAndClear())); + + const sal_uInt32 stringId = selectionStats.nWord? STR_STATUSBAR_WORDCOUNT : STR_STATUSBAR_WORDCOUNT_NO_SELECTION; + rtl::OUString wordCount(SW_RES(stringId)); + wordCount = wordCount.replaceAll("$1", rtl::OUString::valueOf(static_cast<sal_Int64>(documentStats.nWord))); + if (selectionStats.nWord) + { + wordCount = wordCount.replaceAll("$2", rtl::OUString::valueOf(static_cast<sal_Int64>(selectionStats.nWord))); + } + rSet.Put(SfxStringItem(FN_STAT_WORDCOUNT, wordCount)); } break; |