]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalTransforms.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / ExternalTransforms.C
index ee31553ba42af59be7fe5fe9764f08f71185bcf1..3a6059a288c6f4b43327b217cabff08e4df83db7 100644 (file)
@@ -19,8 +19,9 @@
 #include "support/translator.h"
 
 #include <boost/regex.hpp>
-#include "support/std_sstream.h"
+
 #include <cmath> // std::abs
+#include <sstream>
 
 using lyx::support::float_equal;
 
@@ -94,7 +95,7 @@ string const ResizeLatexCommand::front_impl() const
        if (data.no_resize())
                return string();
 
-        std::ostringstream os;
+       std::ostringstream os;
        if (data.usingScale()) {
                double const scl = data.scale / 100.0;
                os << "\\scalebox{" << scl << "}{" << scl << "}{";
@@ -187,14 +188,14 @@ string const RotationLatexCommand::front_impl() const
        if (data.no_rotation())
                return string();
 
-        std::ostringstream os;
-        os << "\\rotatebox";
+       std::ostringstream os;
+       os << "\\rotatebox";
 
        if (data.origin() != RotationData::DEFAULT)
                os << "[origin=" << data.origin() << ']';
 
        os << '{' << data.angle() << "}{";
-        return os.str();
+       return os.str();
 }
 
 
@@ -226,7 +227,7 @@ string const ResizeLatexOption::option_impl() const
        if (data.no_resize())
                return string();
 
-        std::ostringstream os;
+       std::ostringstream os;
        if (data.usingScale()) {
                if (!float_equal(data.scale, 100.0, 0.05))
                        os << "scale=" << data.scale / 100.0 << ',';
@@ -272,7 +273,7 @@ string const sanitizeLatexOption(string const & input)
        string::const_iterator it = begin;
 
        // Strip any leading commas
-       // "[,,,,foo..." -> "foo..."
+       // "[,,,,foo..." -> "foo..." ("foo..." may be empty)
        string output;
        boost::smatch what;
        static boost::regex const front("^( *[[],*)(.*)$");
@@ -280,7 +281,7 @@ string const sanitizeLatexOption(string const & input)
        regex_match(it, end, what, front, boost::match_partial);
        if (!what[0].matched) {
                lyxerr << "Unable to sanitize LaTeX \"Option\": "
-                      << output << '\n';
+                      << input << '\n';
                return string();
        }
        it =  what[1].second;
@@ -300,8 +301,8 @@ string const sanitizeLatexOption(string const & input)
        }
 
        // Strip any trailing commas
-       // "...foo,,,]" -> "...foo"
-       static boost::regex const back("^(.*[^,])(,*[]] *)$");
+       // "...foo,,,]" -> "...foo" ("...foo,,," may be empty)
+       static boost::regex const back("^(.*[^,])?,*[]] *$");
        regex_match(output, what, back);
        if (!what[0].matched) {
                lyxerr << "Unable to sanitize LaTeX \"Option\": "