From c7c6f0af6c836ebe0968967a1e7c8320b0ac17d6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 23 Apr 2021 16:07:32 +0200 Subject: loplugin:stringadd convert chained append to + which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sfx2/source/bastyp/frmhtmlw.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sfx2/source/bastyp') diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 4c8b237bb90a..1b83c2be8b1e 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -61,13 +61,13 @@ void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm, rStrm.WriteCharPtr( pIndent ); OStringBuffer sOut; - sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_meta).append(' ') + sOut.append("<" OOO_STRING_SVTOOLS_HTML_meta " ") .append(bHTTPEquiv ? OOO_STRING_SVTOOLS_HTML_O_httpequiv : OOO_STRING_SVTOOLS_HTML_O_name).append("=\""); rStrm.WriteOString( sOut.makeStringAndClear() ); HTMLOutFuncs::Out_String( rStrm, rName, eDestEnc, pNonConvertableChars ); - sOut.append("\" ").append(OOO_STRING_SVTOOLS_HTML_O_content).append("=\""); + sOut.append("\" " OOO_STRING_SVTOOLS_HTML_O_content "=\""); rStrm.WriteOString( sOut.makeStringAndClear() ); HTMLOutFuncs::Out_String( rStrm, rContent, eDestEnc, pNonConvertableChars ).WriteCharPtr( "\"/>" ); @@ -239,8 +239,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( { aURL = URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL ); - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_src) - .append("=\""); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_src "=\""); rOut.WriteOString( sOut.makeStringAndClear() ); HTMLOutFuncs::Out_String( rOut, aURL, eDestEnc, pNonConvertableChars ); sOut.append('\"'); @@ -250,8 +249,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( aAny = xSet->getPropertyValue("FrameName"); if ( (aAny >>= aStr) && !aStr.isEmpty() ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name) - .append("=\""); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_name "=\""); rOut.WriteOString( sOut.makeStringAndClear() ); HTMLOutFuncs::Out_String( rOut, aStr, eDestEnc, pNonConvertableChars ); sOut.append('\"'); @@ -279,8 +277,8 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( if ( aAny >>= bVal ) { const char *pStr = bVal ? sHTML_SC_yes : sHTML_SC_no; - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrolling) - .append(pStr); + sOut.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_scrolling) + + pStr); } } -- cgit