summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-27 20:44:19 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-29 00:08:16 +0200
commita539cf2c09bdd62d1c4a0124ed536f88d4fd01d5 (patch)
tree47826bbc97b638bb3ad7efa761b5e643e8462916
parent04c8425e2f3d2e187445632683e5780108864e3e (diff)
use the local setting aware method for the UI, fdo#64754
Change-Id: Ie3117c26b347e1a8996ef9cbcb8b0d6ee561b5b3
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx28
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 );