]> 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 f8ce18d3ec09fd0c53e573a967859e35af7c6c8e..e7c8cf66c317967c74d7ef39dfa3284c59482cb4 100644 (file)
@@ -283,7 +283,7 @@ 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);
        if (!what[0].matched) {
@@ -309,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\": "
@@ -336,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);
 }