Kaydet (Commit) 8ed3a427 authored tarafından Muhammad Haggag's avatar Muhammad Haggag Kaydeden (comit) Tor Lillqvist

Followup to fdo#34772: Add resource strings for word-count messages

Change-Id: I7b32f5b6ed973fd4ad4635a5265d75d4e51f04ba
üst ce14342c
...@@ -550,6 +550,16 @@ String STR_OUTLINE_NUMBERING ...@@ -550,6 +550,16 @@ String STR_OUTLINE_NUMBERING
Text [ en-US ] = "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 ToolBox RID_MODULE_TOOLBOX
{ {
HelpID = HID_MODULE_TOOLBOX ; HelpID = HID_MODULE_TOOLBOX ;
......
...@@ -125,7 +125,11 @@ ...@@ -125,7 +125,11 @@
#define STR_FDLG_STYLE (RC_APP_BEGIN + 106) #define STR_FDLG_STYLE (RC_APP_BEGIN + 106)
//<-end,zhaojianwei //<-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 #if APP_ACT_END > RC_APP_END
#error Resource-Id Ueberlauf in #file, #line #error Resource-Id Ueberlauf in #file, #line
......
...@@ -1210,10 +1210,15 @@ void SwView::StateStatusLine(SfxItemSet &rSet) ...@@ -1210,10 +1210,15 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
documentStats = rShell.GetUpdatedDocStat(); documentStats = rShell.GetUpdatedDocStat();
rShell.EndAction(); rShell.EndAction();
} }
rSet.Put(SfxStringItem(FN_STAT_WORDCOUNT, rtl::OUStringBuffer("Words: ")
.append(rtl::OUString::valueOf(static_cast<sal_Int64>(selectionStats.nWord))) const sal_uInt32 stringId = selectionStats.nWord? STR_STATUSBAR_WORDCOUNT : STR_STATUSBAR_WORDCOUNT_NO_SELECTION;
.append('/') rtl::OUString wordCount(SW_RES(stringId));
.append(rtl::OUString::valueOf(static_cast<sal_Int64>(documentStats.nWord))).makeStringAndClear())); 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; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment