summaryrefslogtreecommitdiff
path: root/svtools/source/svhtml
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-02-22 12:59:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-03-08 07:06:13 +0100
commit7840effb1d5efd1fd7f6798c7c504b05292a7793 (patch)
tree845e03d4c2cfad1d5bbcaaf9dc3ec1aeece7c864 /svtools/source/svhtml
parentbf35f2b36fc00f9b37397422b2ee425c6a697540 (diff)
use more string_view
found by tweaking the stringview loplugin Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/svhtml')
-rw-r--r--svtools/source/svhtml/htmlout.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 4f027b0c10de..5dd6b099ec9f 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -34,6 +34,7 @@
#include <svl/urihelper.hxx>
#include <rtl/character.hxx>
#include <tools/debug.hxx>
+#include <o3tl/string_view.hxx>
#include <sstream>
@@ -495,13 +496,13 @@ static OString lcl_FlushToAscii()
return aDest.makeStringAndClear();
}
-OString HTMLOutFuncs::ConvertStringToHTML( const OUString& rSrc,
+OString HTMLOutFuncs::ConvertStringToHTML( std::u16string_view rSrc,
OUString *pNonConvertableChars )
{
OStringBuffer aDest;
- for( sal_Int32 i=0, nLen = rSrc.getLength(); i < nLen; )
+ for( sal_Int32 i=0, nLen = rSrc.size(); i < nLen; )
aDest.append(lcl_ConvertCharToHTML(
- rSrc.iterateCodePoints(&i), pNonConvertableChars));
+ o3tl::iterateCodePoints(rSrc, &i), pNonConvertableChars));
aDest.append(lcl_FlushToAscii());
return aDest.makeStringAndClear();
}
@@ -527,12 +528,12 @@ SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_uInt32 c,
return rStream;
}
-SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, const OUString& rOUStr,
+SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, std::u16string_view rOUStr,
OUString *pNonConvertableChars )
{
- sal_Int32 nLen = rOUStr.getLength();
+ sal_Int32 nLen = rOUStr.size();
for( sal_Int32 n = 0; n < nLen; )
- HTMLOutFuncs::Out_Char( rStream, rOUStr.iterateCodePoints(&n),
+ HTMLOutFuncs::Out_Char( rStream, o3tl::iterateCodePoints(rOUStr, &n),
pNonConvertableChars );
HTMLOutFuncs::FlushToAscii( rStream );
return rStream;
@@ -773,7 +774,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
const OUString& rBaseURL,
std::u16string_view rSource,
- const OUString& rLanguage,
+ std::u16string_view rLanguage,
ScriptType eScriptType,
const OUString& rSrc,
const OUString *pSBLibrary,
@@ -782,7 +783,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
// script is not indented!
OStringBuffer sOut("<" OOO_STRING_SVTOOLS_HTML_script);
- if( !rLanguage.isEmpty() )
+ if( !rLanguage.empty() )
{
sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_language "=\"");
rStrm.WriteOString( sOut );