Kaydet (Commit) 9673698f authored tarafından Matthew J. Francis's avatar Matthew J. Francis Kaydeden (comit) Samuel Mehrbrodt

fdo#83308 Show thousand separators in document word/character counts

Change-Id: I7ef59f3c40c475c25dd6f110f298fcda3f0f1079
Reviewed-on: https://gerrit.libreoffice.org/12130Reviewed-by: 's avatarSamuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: 's avatarSamuel Mehrbrodt <s.mehrbrodt@gmail.com>
üst d90d47e5
......@@ -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)
......
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