diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-04-03 03:14:35 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-04-09 14:33:59 +0200 |
commit | 8d56cc95c1b61106ad3d156ca9485499051377f2 (patch) | |
tree | bf8698df8aa39be5b1be839c449e1f48077892ed | |
parent | test color scale entries (diff) | |
download | core-8d56cc95c1b61106ad3d156ca9485499051377f2.tar.gz core-8d56cc95c1b61106ad3d156ca9485499051377f2.zip |
use correct double to string functions
Conflicts:
sc/source/ui/condformat/colorformat.cxx
Change-Id: I4fe1dfdb02a28d2d283057921483faa6020caf92
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 581da4846aea..eaa241733a01 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::valueOf(pEntry->GetValue())); + aEdit.SetText(convertNumberToString(pEntry->GetValue(), pDoc)); else aEdit.Disable(); } @@ -107,8 +115,8 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma } ::SetType(rData.mpLowerLimit.get(), maLbTypeMin); ::SetType(rData.mpUpperLimit.get(), maLbTypeMax); - SetValue(rData.mpLowerLimit.get(), maEdMin); - SetValue(rData.mpUpperLimit.get(), maEdMax); + SetValue(mpDoc, rData.mpLowerLimit.get(), maEdMin); + SetValue(mpDoc, rData.mpUpperLimit.get(), maEdMax); maLbAxisCol.SelectEntry(rData.maAxisColor); TypeSelectHdl(NULL); |