summaryrefslogtreecommitdiffstats
path: root/src/svg/stringstream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/svg/stringstream.cpp')
-rw-r--r--src/svg/stringstream.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/svg/stringstream.cpp b/src/svg/stringstream.cpp
index 6b9e512a1..431d5d97b 100644
--- a/src/svg/stringstream.cpp
+++ b/src/svg/stringstream.cpp
@@ -66,6 +66,31 @@ operator<<(Inkscape::SVGOStringStream &os, Geom::Point const & p)
return os;
}
+Inkscape::SVGIStringStream::SVGIStringStream():std::istringstream()
+{
+ this->imbue(std::locale::classic());
+ this->setf(std::ios::showpoint);
+
+ /* 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. */
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ this->precision(prefs->getInt("/options/svgoutput/numericprecision", 8));
+}
+
+Inkscape::SVGIStringStream::SVGIStringStream(const std::string& str):std::istringstream(str)
+{
+ this->imbue(std::locale::classic());
+ this->setf(std::ios::showpoint);
+
+ /* 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. */
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ this->precision(prefs->getInt("/options/svgoutput/numericprecision", 8));
+}
+
+
/*
Local Variables:
mode:c++