summaryrefslogtreecommitdiff
path: root/sw/source/filter/html
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-09-04 15:19:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-05 15:55:57 +0200
commitde7fced095e32e0d1c003ebd25c0ec884508b27d (patch)
tree44b6e33312436f9278de481cca7633351ad957da /sw/source/filter/html
parent8be964f0386308a10d02ce4e214da29a77890507 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/html')
-rw-r--r--sw/source/filter/html/wrthtml.cxx14
1 files changed, 2 insertions, 12 deletions
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('\"');