commit 6a5aa1cab18fb5c7e71c798771e6230d539a509a
Author: Enrico Forestieri <for...@lyx.org>
Date:   Fri Jul 11 16:12:08 2014 +0200

    Fix scale parameter for fonts.
    
    When a font is scaled by a certain percentage in the document settings,
    LyX was outputting a ridiculous parameter value. For example, if the
    font is scaled 90%, the corresponding parameter was "scaled=0.899999976".
    The patch avoids this and, in the previous case, one gets "scaled=0.9".
    This is not only cosmetic, because in roundtrip conversions the parameter
    would be continuosly changing.
    
    This commit and b60b505f should be backported to the 2.1.x branch, where
    reimporting with tex2lyx an exported document produces wrong results
    (also in version 2.1.0).

diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp
index 676179f..9010615 100644
--- a/src/LaTeXFonts.cpp
+++ b/src/LaTeXFonts.cpp
@@ -259,8 +259,9 @@ string const LaTeXFont::getPackageOptions(bool ot1, bool 
complete, bool sc, bool
            && providesScale(ot1, complete, nomath)) {
                if (!os.str().empty())
                        os << ',';
-               os << subst(to_ascii(scaleoption_), "$$val",
-                           convert<std::string>(float(scale) / 100));
+               ostringstream value;
+               value << float(scale) / 100;
+               os << subst(to_ascii(scaleoption_), "$$val", value.str());
        }
        return os.str();
 }

Reply via email to