sw/source/filter/html/swhtml.cxx  |    6 +-----
 sw/source/filter/html/wrthtml.cxx |    5 ++---
 2 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 14ece9f5702909525a9b5814d51c789b714c8bfb
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon May 12 11:13:38 2025 +0200
Commit:     Mike Kaganski <[email protected]>
CommitDate: Mon May 12 14:31:36 2025 +0200

    startsWith has an optional argument to return the rest
    
    Change-Id: I30cc10122b6d64923a8c87a79fa239eebb1c6c05
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185202
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

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;
         }
     }
 

Reply via email to