diff options
author | Matthew J. Francis <mjay.francis@gmail.com> | 2014-10-29 14:39:32 +0800 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-11-26 11:18:06 +0000 |
commit | 9673698f35ad249bc96506965b5e467d1f7ea0e9 (patch) | |
tree | fc3f724dce0be8ff884fff3e6b49c48863204703 /sw/source/uibase/uiview | |
parent | d90d47e513f21b07095722559db997fa41d1645e (diff) |
fdo#83308 Show thousand separators in document word/character counts
Change-Id: I7ef59f3c40c475c25dd6f110f298fcda3f0f1079
Reviewed-on: https://gerrit.libreoffice.org/12130
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'sw/source/uibase/uiview')
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 1cffd55052b9..64ff288b8005 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1364,18 +1364,16 @@ void SwView::StateStatusLine(SfxItemSet &rSet) { SwDocStat selectionStats; SwDocStat documentStats; - { - rShell.CountWords(selectionStats); - documentStats = rShell.GetDoc()->getIDocumentStatistics().GetUpdatedDocStat( true /* complete-async */, false /* don't update fields */ ); - } - - 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)); + rShell.CountWords(selectionStats); + documentStats = rShell.GetDoc()->getIDocumentStatistics().GetUpdatedDocStat( true /* complete-async */, false /* don't update fields */ ); + + sal_uLong nWord = selectionStats.nWord ? selectionStats.nWord : documentStats.nWord; + sal_uLong nChar = selectionStats.nChar ? selectionStats.nChar : documentStats.nChar; + OUString aWordCount( SW_RES( selectionStats.nWord ? STR_STATUSBAR_WORDCOUNT : STR_STATUSBAR_WORDCOUNT_NO_SELECTION ) ); + const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper(); + aWordCount = aWordCount.replaceFirst( "%1", rLocaleData.getNum( nWord, 0 ) ); + aWordCount = aWordCount.replaceFirst( "%2", rLocaleData.getNum( nChar, 0 ) ); + rSet.Put( SfxStringItem( FN_STAT_WORDCOUNT, aWordCount ) ); SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); if (pWrdCnt) |