summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/ui/app/app.src4
-rw-r--r--sw/source/ui/uiview/view2.cxx15
2 files changed, 8 insertions, 11 deletions
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index e5c6ac6cdef7..bc8cd0e61de7 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -506,12 +506,12 @@ String STR_OUTLINE_NUMBERING
String STR_STATUSBAR_WORDCOUNT_NO_SELECTION
{
- Text [ en-US ] = "Words (characters): $1 ($2)";
+ Text [ en-US ] = "%1 words, %2 characters";
};
String STR_STATUSBAR_WORDCOUNT
{
- Text [ en-US ] = "Words (characters): $1 ($2) Selected: $3 ($4)";
+ Text [ en-US ] = "%1 words, %2 characters selected";
};
String STR_CONVERT_TEXT_TABLE
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index eae1397718ff..388cf6af5487 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1266,15 +1266,12 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
documentStats = rShell.GetDoc()->GetUpdatedDocStat( true /* complete-async */, false /* don't update fields */ );
}
- const sal_uInt32 stringId = selectionStats.nWord? STR_STATUSBAR_WORDCOUNT : STR_STATUSBAR_WORDCOUNT_NO_SELECTION;
- OUString wordCount(SW_RES(stringId));
- wordCount = wordCount.replaceAll("$1", OUString::number(documentStats.nWord));
- wordCount = wordCount.replaceAll("$2", OUString::number(documentStats.nChar));
- if (selectionStats.nWord)
- {
- wordCount = wordCount.replaceAll("$3", OUString::number(selectionStats.nWord));
- wordCount = wordCount.replaceAll("$4", OUString::number(selectionStats.nChar));
- }
+ OUString wordCount(SW_RES(selectionStats.nWord ?
+ STR_STATUSBAR_WORDCOUNT : STR_STATUSBAR_WORDCOUNT_NO_SELECTION));
+ wordCount = wordCount.replaceFirst("%1",
+ OUString::number(selectionStats.nWord ? selectionStats.nWord : documentStats.nWord));
+ wordCount = wordCount.replaceFirst("%2",
+ OUString::number(selectionStats.nChar ? selectionStats.nChar : documentStats.nChar));
rSet.Put(SfxStringItem(FN_STAT_WORDCOUNT, wordCount));
SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId());