sw/source/filter/html/wrthtml.cxx |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

New commits:
commit de7fced095e32e0d1c003ebd25c0ec884508b27d
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Sep 4 15:19:48 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Sep 5 15:55:57 2022 +0200

    Simplify by using replaceAll instead of replaceAt in 2 loops in sw
    
    Change-Id: Ib33adfaf7e0d2f5caf530169fefcdfcba64bb758
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139367
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/filter/html/wrthtml.cxx 
b/sw/source/filter/html/wrthtml.cxx
index e17f24c8cf59..2889ab268ff8 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -745,18 +745,8 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& 
rHTMLWrt,
                 rHTMLWrt.Strm().WriteCharPtr( pDelim );
         if( !aSection.isEmpty() )
         {
-            sal_Int32 nPos = aSection.indexOf( '%' );
-            while( nPos != -1 )
-            {
-                aSection = aSection.replaceAt(nPos, 1, u"%25");
-                nPos = aSection.indexOf( '%', nPos+3 );
-            }
-            nPos = aSection.indexOf( cDelim );
-            while( nPos != -1 )
-            {
-                aSection = aSection.replaceAt(nPos, 1, u"%FF" );
-                nPos = aSection.indexOf( cDelim, nPos+3 );
-            }
+            aSection = aSection.replaceAll(u"%", u"%25");
+            aSection = aSection.replaceAll(OUStringChar(cDelim), u"%FF");
             HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aSection );
         }
         sOut.append('\"');

Reply via email to