[Libreoffice-commits] libcdr.git: src/lib

Fridrich Å trba fridrich.strba at bluewin.ch
Thu May 2 13:27:28 PDT 2013


 src/lib/CDRSVGGenerator.cpp |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

New commits:
commit 1dcce015b4137c12d09d5533630b5c9150daf797
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu May 2 22:26:20 2013 +0200

    libwpd already does this conversion, so don't dupplicate

diff --git a/src/lib/CDRSVGGenerator.cpp b/src/lib/CDRSVGGenerator.cpp
index 910f0d7..91fa2e5 100644
--- a/src/lib/CDRSVGGenerator.cpp
+++ b/src/lib/CDRSVGGenerator.cpp
@@ -36,23 +36,10 @@
 
 static std::string doubleToString(const double value)
 {
-  std::ostringstream tempStream;
-  tempStream << value;
-#ifndef __ANDROID__
-  std::string decimalPoint(localeconv()->decimal_point);
-#else
-  std::string decimalPoint(".");
-#endif
-  if ((decimalPoint.size() == 0) || (decimalPoint == "."))
-    return tempStream.str();
-  std::string stringValue(tempStream.str());
-  if (!stringValue.empty())
-  {
-    std::string::size_type pos;
-    while ((pos = stringValue.find(decimalPoint)) != std::string::npos)
-      stringValue.replace(pos,decimalPoint.size(),".");
-  }
-  return stringValue;
+  WPXProperty *prop = WPXPropertyFactory::newDoubleProp(value);
+  std::string retVal = prop->getStr().cstr();
+  delete prop;
+  return retVal;
 }
 
 static unsigned stringToColour(const ::WPXString &s)


More information about the Libreoffice-commits mailing list