[Libreoffice-commits] core.git: chart2/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Mon Jan 4 08:39:20 PST 2016
chart2/source/view/charttypes/VSeriesPlotter.cxx | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 6415b9e4d1ee58029837ca76843c03e589c18ba4
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Jan 4 17:36:56 2016 +0100
use correct decimal separator
Change-Id: I342e9b5355c3ea09eede6c47b0f209f538ee82cb
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index d0f230f..475eca9 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -80,6 +80,8 @@
#include <svx/unoshape.hxx>
#include <comphelper/sequence.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/settings.hxx>
#include <functional>
#include <map>
@@ -413,7 +415,11 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries& rDataSeries
}
else
{
- sal_Unicode cDecSeparator = '.';//@todo get this locale dependent
+
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ OUString aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
+ assert(aNumDecimalSep.getLength() > 0);
+ sal_Unicode cDecSeparator = aNumDecimalSep.getStr()[0];
aNumber = ::rtl::math::doubleToUString( fValue, rtl_math_StringFormat_G /*rtl_math_StringFormat*/
, 3/*DecPlaces*/ , cDecSeparator );
}
@@ -1269,7 +1275,10 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
}
else
{
- sal_Unicode aDecimalSep( '.' );//@todo get this locale dependent
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ OUString aNumDecimalSep = rLocaleDataWrapper.getNumDecimalSep();
+ assert(aNumDecimalSep.getLength() > 0);
+ sal_Unicode aDecimalSep = aNumDecimalSep.getStr()[0];
aFormula.append( ::rtl::math::doubleToUString(
fR*fR, rtl_math_StringFormat_G, 4, aDecimalSep, true ));
}
More information about the Libreoffice-commits
mailing list