Code

clean up tabs and DOS-ishness
[inkscape.git] / src / svg / stringstream.cpp
index 5ef5c2ec06ddce94f6d2d1282b49920183f49107..65c01e7b687b3332f138f5ee9f941643687b663c 100644 (file)
@@ -1,5 +1,6 @@
 #include "svg/stringstream.h"
 #include "svg/strip-trailing-zeros.h"
+#include "prefs-utils.h"
 
 Inkscape::SVGOStringStream::SVGOStringStream()
 {
@@ -11,7 +12,7 @@ Inkscape::SVGOStringStream::SVGOStringStream()
     /* This one is (currently) needed though, as we currently use ostr.precision as a sort of
        variable for storing the desired precision: see our two precision methods and our operator<<
        methods for float and double. */
-    ostr.precision(8);
+    ostr.precision(prefs_get_int_attribute("options.svgoutput", "numericprecision", 8));
 }
 
 Inkscape::SVGOStringStream &
@@ -19,7 +20,7 @@ operator<<(Inkscape::SVGOStringStream &os, float d)
 {
     /* Try as integer first. */
     {
-        long const n = long(d);
+        int const n = int(d);
         if (d == n) {
             os << n;
             return os;
@@ -40,7 +41,7 @@ operator<<(Inkscape::SVGOStringStream &os, double d)
 {
     /* Try as integer first. */
     {
-        long const n = long(d);
+        int const n = int(d);
         if (d == n) {
             os << n;
             return os;