commit 24737eecebdf39fdf964de2255d335e1c383100f
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Mar 5 12:44:02 2015 +0100

    Reset stream properties after changing them
    
    Fixes coverity issue 23468.

diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index b6462d5..bfb0d35 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -1901,6 +1901,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, 
string const & name) c
                    != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
                    font_sizes[FONT_SIZE_HUGER]
                    != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
+                       streamsize old_prec = os.precision();
                        os.setf(ios::fixed);
                        os.precision(2);
                        os << "\\screen_font_sizes"
@@ -1915,6 +1916,8 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, 
string const & name) c
                           << ' ' << font_sizes[FONT_SIZE_HUGE]
                           << ' ' << font_sizes[FONT_SIZE_HUGER]
                           << '\n';
+                       os.precision(old_prec);
+                       os.unsetf(ios::fixed);
                }
                if (tag != RC_LAST)
                        break;

Reply via email to