X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.cpp;h=4f85f9d479f00c202728b20dc39186dcee5ffb02;hb=88e5e5fd345c280b0927ad84785657cbc9e55f77;hp=7ac41ab02d91058f26a34ad354feb52db123b661;hpb=489dca71cd99bbc78780fa40311a2eb042c0320e;p=lyx.git diff --git a/src/insets/ExternalTransforms.cpp b/src/insets/ExternalTransforms.cpp index 7ac41ab02d..4f85f9d479 100644 --- a/src/insets/ExternalTransforms.cpp +++ b/src/insets/ExternalTransforms.cpp @@ -78,7 +78,7 @@ namespace { typedef Translator OriginTranslator; OriginTranslator const & originTranslator(); -} // namespace anon +} // namespace void RotationData::origin(string const & o) @@ -183,7 +183,7 @@ ostream & operator<<(ostream & os, RotationData::OriginType type) return os; } -} // namespace anon +} // namespace string const RotationLatexCommand::front_impl() const @@ -285,8 +285,7 @@ string const sanitizeLatexOption(string const & input) lyx::smatch what; 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; } @@ -310,10 +308,7 @@ string const sanitizeLatexOption(string const & input) // Strip any trailing commas // "...foo,,,]" -> "...foo" ("...foo,,," may be empty) static lyx::regex const back("^(.*[^,])?,*\\] *$"); - // false positive from coverity - // coverity[CHECKED_RETURN] - regex_match(output, what, back); - if (!what[0].matched) { + if (!regex_match(output, what, back)) { lyxerr << "Unable to sanitize LaTeX \"Option\": " << output << '\n'; return string(); @@ -338,11 +333,11 @@ void extractIt(boost::any const & any_factory, return; Factory factory = boost::any_cast(any_factory); - if (!factory) + if (factory) transformer = factory(data); } -} // namespace anon +} // namespace TransformCommand::ptr_type @@ -431,7 +426,7 @@ OriginTranslator const & originTranslator() return translator; } -} // namespace anon +} // namespace } // namespace external } // namespace lyx