diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-06-27 20:44:19 +0200 |
---|---|---|
committer | Bosdonnat Cedric <cedric.bosdonnat@free.fr> | 2013-07-01 13:26:19 +0000 |
commit | 9b557cfd01131544639285dace81e11ed3c49aa7 (patch) | |
tree | 3ab422284114907d25cc7627df9aeafee87e8d1b /sc | |
parent | d4d5c97b4eb0b0d28aac635482bca547d60b7cdc (diff) |
use the local setting aware method for the UI, fdo#64754
Change-Id: Ie3117c26b347e1a8996ef9cbcb8b0d6ee561b5b3
(cherry picked from commit a539cf2c09bdd62d1c4a0124ed536f88d4fd01d5)
Reviewed-on: https://gerrit.libreoffice.org/4612
Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/condformat/condformatdlgentry.cxx | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index d8acc85b123b..46feaa800240 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -596,6 +596,14 @@ void ScFormulaFrmtEntry::SetInactive() namespace { +OUString convertNumberToString(double nVal, ScDocument* pDoc) +{ + SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); + OUString aText; + pNumberFormatter->GetInputLineString(nVal, 0, aText); + return aText; +} + void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit, ColorListBox& rLbCol, ScDocument* pDoc ) { // entry Automatic is not available for color scales @@ -612,10 +620,7 @@ void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, case COLORSCALE_PERCENT: { double nVal = rEntry.GetValue(); - SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); - OUString aText; - pNumberFormatter->GetInputLineString(nVal, 0, aText); - rEdit.SetText(aText); + rEdit.SetText(convertNumberToString(nVal, pDoc)); } break; case COLORSCALE_FORMULA: @@ -1259,14 +1264,15 @@ class ScIconSetFrmtDataEntry : public Control ListBox maLbEntryType; public: - ScIconSetFrmtDataEntry( Window* pParent, ScIconSetType eType, sal_Int32 i, const ScColorScaleEntry* pEntry = NULL ); + ScIconSetFrmtDataEntry( Window* pParent, ScIconSetType eType, ScDocument* pDoc, + sal_Int32 i, const ScColorScaleEntry* pEntry = NULL ); ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const; void SetFirstEntry(); }; -ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( Window* pParent, ScIconSetType eType, sal_Int32 i, const ScColorScaleEntry* pEntry ): +ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry ): Control( pParent, ScResId( RID_ICON_SET_ENTRY ) ), maImgIcon( this, ScResId( IMG_ICON ) ), maFtEntry( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ), @@ -1280,15 +1286,15 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( Window* pParent, ScIconSetType e { case COLORSCALE_VALUE: maLbEntryType.SelectEntryPos(0); - maEdEntry.SetText(OUString::valueOf(pEntry->GetValue())); + maEdEntry.SetText(convertNumberToString(pEntry->GetValue(), pDoc)); break; case COLORSCALE_PERCENTILE: maLbEntryType.SelectEntryPos(2); - maEdEntry.SetText(OUString::valueOf(pEntry->GetValue())); + maEdEntry.SetText(convertNumberToString(pEntry->GetValue(), pDoc)); break; case COLORSCALE_PERCENT: maLbEntryType.SelectEntryPos(1); - maEdEntry.SetText(OUString::valueOf(pEntry->GetValue())); + maEdEntry.SetText(convertNumberToString(pEntry->GetValue(), pDoc)); break; case COLORSCALE_FORMULA: maLbEntryType.SelectEntryPos(3); @@ -1367,7 +1373,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry( Window* pParent, ScDocument* pDoc, const for(size_t i = 0, n = pIconSetFormatData->maEntries.size(); i < n; ++i) { - maEntries.push_back( new ScIconSetFrmtDataEntry( this, eType, i, &pIconSetFormatData->maEntries[i] ) ); + maEntries.push_back( new ScIconSetFrmtDataEntry( this, eType, pDoc, i, &pIconSetFormatData->maEntries[i] ) ); Point aPos = maEntries[0].GetPosPixel(); aPos.Y() += maEntries[0].GetSizePixel().Height() * i * 1.2; maEntries[i].SetPosPixel( aPos ); @@ -1397,7 +1403,7 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl ) for(size_t i = 0; i < nElements; ++i) { - maEntries.push_back( new ScIconSetFrmtDataEntry( this, static_cast<ScIconSetType>(nPos), i ) ); + maEntries.push_back( new ScIconSetFrmtDataEntry( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) ); Point aPos = maEntries[0].GetPosPixel(); aPos.Y() += maEntries[0].GetSizePixel().Height() * i * 1.2; maEntries[i].SetPosPixel( aPos ); |