]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalTransforms.cpp
Handle the case of TeX fonts LuaTeX
[lyx.git] / src / insets / ExternalTransforms.cpp
index 8a29f38961125a373a4e5bc184dcc80f8913ec16..e7c8cf66c317967c74d7ef39dfa3284c59482cb4 100644 (file)
@@ -218,7 +218,10 @@ string const  ClipLatexOption::option_impl() const
 
        ostringstream os;
        if (!data.bbox.empty())
-               os << "bb=" << data.bbox << ',';
+               os << "bb=" << data.bbox.xl.asLatexString() << ' '
+                  << data.bbox.yb.asLatexString() << ' '
+                  << data.bbox.xr.asLatexString() << ' '
+                  << data.bbox.yt.asLatexString() << ',';
        if (data.clip)
                os << "clip,";
        return os.str();
@@ -280,9 +283,9 @@ string const sanitizeLatexOption(string const & input)
        // "[,,,,foo..." -> "foo..." ("foo..." may be empty)
        string output;
        lyx::smatch what;
-       static lyx::regex const front("^( *[[],*)(.*)$");
+       static lyx::regex const front("^( *\\[,*)(.*)$");
 
-       regex_match(it, end, what, front, regex_constants::match_partial);
+       regex_match(it, end, what, front);
        if (!what[0].matched) {
                lyxerr << "Unable to sanitize LaTeX \"Option\": "
                       << input << '\n';
@@ -295,7 +298,7 @@ string const sanitizeLatexOption(string const & input)
        // with iterator now pointing to 'b'
        static lyx::regex const commas("([^,]*)(,,*)(.*)$");
        for (; it != end;) {
-               regex_match(it, end, what, commas, regex_constants::match_partial);
+               regex_match(it, end, what, commas);
                if (!what[0].matched) {
                        output += string(it, end);
                        break;
@@ -306,7 +309,9 @@ string const sanitizeLatexOption(string const & input)
 
        // Strip any trailing commas
        // "...foo,,,]" -> "...foo" ("...foo,,," may be empty)
-       static lyx::regex const back("^(.*[^,])?,*[]] *$");
+       static lyx::regex const back("^(.*[^,])?,*\\] *$");
+       // false positive from coverity
+       // coverity[CHECKED_RETURN]
        regex_match(output, what, back);
        if (!what[0].matched) {
                lyxerr << "Unable to sanitize LaTeX \"Option\": "
@@ -333,7 +338,7 @@ void extractIt(boost::any const & any_factory,
                return;
 
        Factory factory = boost::any_cast<Factory>(any_factory);
-       if (!factory.empty())
+       if (factory)
                transformer = factory(data);
 }