sw/source/uibase/uiview/view2.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
New commits: commit 9673698f35ad249bc96506965b5e467d1f7ea0e9 Author: Matthew J. Francis <mjay.fran...@gmail.com> Date: Wed Oct 29 14:39:32 2014 +0800 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.mehrbr...@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbr...@gmail.com> diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 1cffd55..64ff288 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits