X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.cpp;h=2381241b9a28441557833e456b32997f6eab7c2b;hb=62b06c64ed624d51cce785e083d59cab18b36b69;hp=f8ce18d3ec09fd0c53e573a967859e35af7c6c8e;hpb=b63421b7dc65e0c721f8928d1330b9bb2cff43d8;p=lyx.git diff --git a/src/insets/ExternalTransforms.cpp b/src/insets/ExternalTransforms.cpp index f8ce18d3ec..2381241b9a 100644 --- a/src/insets/ExternalTransforms.cpp +++ b/src/insets/ExternalTransforms.cpp @@ -283,10 +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); - if (!what[0].matched) { + if (!regex_match(it, end, what, front)) { lyxerr << "Unable to sanitize LaTeX \"Option\": " << input << '\n'; return string(); @@ -298,8 +297,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); - if (!what[0].matched) { + if (!regex_match(it, end, what, commas)) { output += string(it, end); break; } @@ -309,9 +307,8 @@ string const sanitizeLatexOption(string const & input) // Strip any trailing commas // "...foo,,,]" -> "...foo" ("...foo,,," may be empty) - static lyx::regex const back("^(.*[^,])?,*[]] *$"); - regex_match(output, what, back); - if (!what[0].matched) { + static lyx::regex const back("^(.*[^,])?,*\\] *$"); + if (!regex_match(output, what, back)) { lyxerr << "Unable to sanitize LaTeX \"Option\": " << output << '\n'; return string(); @@ -336,7 +333,7 @@ void extractIt(boost::any const & any_factory, return; Factory factory = boost::any_cast(any_factory); - if (!factory.empty()) + if (factory) transformer = factory(data); }