diff options
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 4568de7e50c3..0ddf8ee2f468 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -5647,12 +5647,8 @@ void HTMLReader::SetupFilterOptions() return; OUString aFilterOptions = pItem->GetValue(); - static constexpr OUString aXhtmlNsKey(u"xhtmlns="_ustr); - if (aFilterOptions.startsWith(aXhtmlNsKey)) - { - OUString aNamespace = aFilterOptions.copy(aXhtmlNsKey.getLength()); + if (OUString aNamespace; aFilterOptions.startsWith("xhtmlns=", &aNamespace)) m_aNamespace = aNamespace; - } } namespace diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index a458a8607c0d..956641333222 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -231,16 +231,15 @@ void SwHTMLWriter::SetupFilterOptions(std::u16string_view rFilterOptions) const uno::Sequence<OUString> aOptionSeq = comphelper::string::convertCommaSeparated(rFilterOptions); - static constexpr OUString aXhtmlNsKey(u"xhtmlns="_ustr); for (const auto& rOption : aOptionSeq) { if (rOption == "XHTML") { aStoreMap[u"XHTML"_ustr] <<= true; } - else if (rOption.startsWith(aXhtmlNsKey)) + else if (OUString aNamespace; rOption.startsWith("xhtmlns=", &aNamespace)) { - aStoreMap[u"XhtmlNs"_ustr] <<= rOption.copy(aXhtmlNsKey.getLength()); + aStoreMap[u"XhtmlNs"_ustr] <<= aNamespace; } } |