diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-04-03 03:14:35 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-03 03:21:16 +0200 |
commit | fefe034126e45db005f7fc45e5162c41ae69b05a (patch) | |
tree | 562f621fe8d081e119293f8f294fac78a082d16f | |
parent | 2390d3b6064d3fc0ec814620947ce18410d657f6 (diff) |
use correct double to string functions
Change-Id: I4fe1dfdb02a28d2d283057921483faa6020caf92
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index c29f0fb43df7..dc044be47ac7 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -48,12 +48,20 @@ void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, } } -void SetValue( ScColorScaleEntry* pEntry, Edit& aEdit) +OUString convertNumberToString(double nVal, ScDocument* pDoc) +{ + SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); + OUString aText; + pNumberFormatter->GetInputLineString(nVal, 0, aText); + return aText; +} + +void SetValue( ScDocument* pDoc, ScColorScaleEntry* pEntry, Edit& aEdit) { if(pEntry->GetType() == COLORSCALE_FORMULA) aEdit.SetText(pEntry->GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); else if(pEntry->GetType() != COLORSCALE_MIN && pEntry->GetType() != COLORSCALE_MAX) - aEdit.SetText(OUString::number(pEntry->GetValue())); + aEdit.SetText(convertNumberToString(pEntry->GetValue(), pDoc)); else aEdit.Disable(); } @@ -103,10 +111,10 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar } ::SetType(rData.mpLowerLimit.get(), *mpLbTypeMin); ::SetType(rData.mpUpperLimit.get(), *mpLbTypeMax); - SetValue(rData.mpLowerLimit.get(), *mpEdMin); - SetValue(rData.mpUpperLimit.get(), *mpEdMax); - mpLenMin->SetText(OUString::number(rData.mnMinLength)); - mpLenMax->SetText(OUString::number(rData.mnMaxLength)); + SetValue(mpDoc, rData.mpLowerLimit.get(), *mpEdMin); + SetValue(mpDoc, rData.mpUpperLimit.get(), *mpEdMax); + mpLenMin->SetText(convertNumberToString(rData.mnMinLength, mpDoc)); + mpLenMax->SetText(convertNumberToString(rData.mnMaxLength, mpDoc)); mpLbAxisCol->SelectEntry(rData.maAxisColor); TypeSelectHdl(NULL); |