X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.cpp;h=76578b2ea0814edc6fbc25ef6459fa213483c7c7;hb=8124e6c02ea1fd6779bb6c47ffe2bca2c8bd2d97;hp=f8ce18d3ec09fd0c53e573a967859e35af7c6c8e;hpb=81e592603d1c87ecd993ba3f1e7f6498d12e919f;p=lyx.git diff --git a/src/insets/ExternalTransforms.cpp b/src/insets/ExternalTransforms.cpp index f8ce18d3ec..76578b2ea0 100644 --- a/src/insets/ExternalTransforms.cpp +++ b/src/insets/ExternalTransforms.cpp @@ -18,9 +18,8 @@ #include "support/lyxlib.h" // float_equal #include "support/Translator.h" -#include "support/regex.h" - #include // abs +#include #include using namespace std; @@ -78,7 +77,7 @@ namespace { typedef Translator OriginTranslator; OriginTranslator const & originTranslator(); -} // namespace anon +} // namespace void RotationData::origin(string const & o) @@ -183,7 +182,7 @@ ostream & operator<<(ostream & os, RotationData::OriginType type) return os; } -} // namespace anon +} // namespace string const RotationLatexCommand::front_impl() const @@ -282,11 +281,10 @@ string const sanitizeLatexOption(string const & input) // Strip any leading commas // "[,,,,foo..." -> "foo..." ("foo..." may be empty) string output; - lyx::smatch what; - static lyx::regex const front("^( *[[],*)(.*)$"); + smatch what; + static 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(); @@ -296,10 +294,9 @@ string const sanitizeLatexOption(string const & input) // Replace any consecutive commas with a single one // "foo,,,,bar" -> "foo,bar" // with iterator now pointing to 'b' - static lyx::regex const commas("([^,]*)(,,*)(.*)$"); + static 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 +306,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 regex const back("^(.*[^,])?,*\\] *$"); + if (!regex_match(output, what, back)) { lyxerr << "Unable to sanitize LaTeX \"Option\": " << output << '\n'; return string(); @@ -329,18 +325,18 @@ string const sanitizeLatexOption(string const & input) namespace { template -void extractIt(boost::any const & any_factory, +void extractIt(any const & any_factory, Data const & data, Transformer & transformer) { if (any_factory.type() != typeid(Factory)) return; - Factory factory = boost::any_cast(any_factory); - if (!factory.empty()) + Factory factory = any_cast(any_factory); + if (factory) transformer = factory(data); } -} // namespace anon +} // namespace TransformCommand::ptr_type @@ -429,7 +425,7 @@ OriginTranslator const & originTranslator() return translator; } -} // namespace anon +} // namespace } // namespace external } // namespace lyx