diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-07 12:12:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-07 12:16:52 +0100 |
commit | eae2e87ba4de1ae59779cbfc56109aa6c27fbc17 (patch) | |
tree | 36c4e8538bc5d16ec6dade1e3f9b52a2e6eb9a0b | |
parent | 66154591e8d7b611d330b642714aacc72f9bc28d (diff) |
Resolves: fdo#51818 format word count numbers with locale rules
Change-Id: Ia203a622ab2cd63d644895bb792b0569a61eb81a
-rw-r--r-- | sw/source/ui/dialog/wordcountdialog.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index ff2e582ef461..7fe4ec61d77c 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -29,7 +29,9 @@ #include <comphelper/string.hxx> #include <sfx2/viewfrm.hxx> #include <svl/cjkoptions.hxx> +#include <unotools/localedatawrapper.hxx> #include <vcl/msgbox.hxx> +#include <vcl/settings.hxx> IMPL_LINK_NOARG(SwWordCountFloatDlg, CloseHdl) { @@ -48,23 +50,23 @@ SwWordCountFloatDlg::~SwWordCountFloatDlg() namespace { - void setValue(FixedText *pWidget, sal_uLong nValue) + void setValue(FixedText *pWidget, sal_uLong nValue, const LocaleDataWrapper& rLocaleData) { - OUString sValue(OUString::number(nValue)); - pWidget->SetText(sValue); + pWidget->SetText(rLocaleData.getNum(nValue, 0)); } } void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) { - setValue(m_pCurrentWordFT, rCurrent.nWord); - setValue(m_pCurrentCharacterFT, rCurrent.nChar); - setValue(m_pCurrentCharacterExcludingSpacesFT, rCurrent.nCharExcludingSpaces); - setValue(m_pCurrentCjkcharsFT, rCurrent.nAsianWord); - setValue(m_pDocWordFT, rDoc.nWord); - setValue(m_pDocCharacterFT, rDoc.nChar); - setValue(m_pDocCharacterExcludingSpacesFT, rDoc.nCharExcludingSpaces); - setValue(m_pDocCjkcharsFT, rDoc.nAsianWord); + const LocaleDataWrapper& rLocaleData = GetSettings().GetUILocaleDataWrapper(); + setValue(m_pCurrentWordFT, rCurrent.nWord, rLocaleData); + setValue(m_pCurrentCharacterFT, rCurrent.nChar, rLocaleData); + setValue(m_pCurrentCharacterExcludingSpacesFT, rCurrent.nCharExcludingSpaces, rLocaleData); + setValue(m_pCurrentCjkcharsFT, rCurrent.nAsianWord, rLocaleData); + setValue(m_pDocWordFT, rDoc.nWord, rLocaleData); + setValue(m_pDocCharacterFT, rDoc.nChar, rLocaleData); + setValue(m_pDocCharacterExcludingSpacesFT, rDoc.nCharExcludingSpaces, rLocaleData); + setValue(m_pDocCjkcharsFT, rDoc.nAsianWord, rLocaleData); bool bShowCJK = (SvtCJKOptions().IsAnyEnabled() || rDoc.nAsianWord); bool bToggleCJK = m_pCurrentCjkcharsFT->IsVisible() != bShowCJK; |