sfx2/source/appl/sfxhelp.cxx                   |    2 -
 sfx2/source/bastyp/frmhtmlw.cxx                |   15 +++++---
 shell/source/unix/exec/shellexec.cxx           |    2 -
 starmath/source/ooxmlexport.cxx                |    2 -
 starmath/source/ooxmlimport.cxx                |    4 +-
 svgio/source/svgreader/svgnode.cxx             |    3 +
 svgio/source/svgreader/svgstylenode.cxx        |   12 ++++---
 svtools/source/svhtml/htmlout.cxx              |   41 ++++++++++++++++--------
 svtools/source/svhtml/parhtml.cxx              |    8 ++--
 svtools/source/svrtf/parrtf.cxx                |   10 ++++-
 unoidl/source/sourcetreeprovider.cxx           |    2 -
 unotools/source/i18n/localedatawrapper.cxx     |    2 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   42 ++++++++++++++-----------
 writerfilter/source/rtftok/rtftokenizer.cxx    |    3 +
 14 files changed, 93 insertions(+), 55 deletions(-)

New commits:
commit 42572c6d0d1f1c84b3774f6c790e28e8abc7b45a
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Jul 21 18:51:02 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 22 11:13:45 2022 +0200

    elide some makeStringAndClear() calls
    
    Change-Id: I3b7ae370b41638c0a67374d5132b7bdf56e7c672
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137311
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/unoidl/source/sourcetreeprovider.cxx 
b/unoidl/source/sourcetreeprovider.cxx
index 399329f30e40..629e50fbf8f3 100644
--- a/unoidl/source/sourcetreeprovider.cxx
+++ b/unoidl/source/sourcetreeprovider.cxx
@@ -284,7 +284,7 @@ rtl::Reference<Entity> 
SourceTreeProvider::findEntity(OUString const & name)
         throw FileFormatException( //TODO
             "", "Illegal UNOIDL identifier \"" + name + "\"");
     }
-    OUString uri(uri_ + buf.makeStringAndClear());
+    OUString uri(uri_ + buf);
     rtl::Reference<Entity> ent;
     // Prevent conflicts between foo/ and Foo.idl on case-preserving file
     // systems:
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 55cde4a360a4..220d850885cb 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -353,7 +353,7 @@ const std::vector< LanguageType >& 
LocaleDataWrapper::getInstalledLanguageTypes(
                     
aMsg.append(static_cast<sal_Int32>(static_cast<sal_uInt16>(eLang)), 16);
                     aMsg.append("  ->  ");
                     aMsg.append(aBackLanguageTag.getBcp47());
-                    outputCheckMessage( aMsg.makeStringAndClear() );
+                    outputCheckMessage( aMsg );
                 }
                 eLang = LANGUAGE_DONTKNOW;
             }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e8db8d68f12e..71e25f4571f8 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -855,8 +855,9 @@ void RTFDocumentImpl::resolvePict(bool const bInline, 
uno::Reference<drawing::XS
         int count = 2;
 
         // Feed the destination text to a stream.
-        OString aStr = 
OUStringToOString(m_aStates.top().getDestinationText().makeStringAndClear(),
-                                         RTL_TEXTENCODING_ASCII_US);
+        auto& rDestinationTextBuffer = m_aStates.top().getDestinationText();
+        OString aStr = OUStringToOString(rDestinationTextBuffer, 
RTL_TEXTENCODING_ASCII_US);
+        rDestinationTextBuffer.setLength(0);
         for (int i = 0; i < aStr.getLength(); ++i)
         {
             char ch = aStr[i];
@@ -2551,12 +2552,13 @@ RTFError 
RTFDocumentImpl::beforePopState(RTFParserState& rState)
         {
             if (m_bFormField)
             {
-                if (&m_aStates.top().getDestinationText()
-                    != m_aStates.top().getCurrentDestinationText())
+                OUStringBuffer* pCurrentDestinationText
+                    = m_aStates.top().getCurrentDestinationText();
+                if (&m_aStates.top().getDestinationText() != 
pCurrentDestinationText)
                     break; // not for nested group
-                OString aStr = OUStringToOString(
-                    
m_aStates.top().getCurrentDestinationText()->makeStringAndClear(),
-                    rState.getCurrentEncoding());
+                OString aStr
+                    = OUStringToOString(*pCurrentDestinationText, 
rState.getCurrentEncoding());
+                pCurrentDestinationText->setLength(0);
                 // decode hex dump
                 OStringBuffer aBuf;
                 int b = 0;
@@ -2638,8 +2640,13 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& 
rState)
                 != m_aStates.top().getCurrentDestinationText())
                 break; // not for nested group
             if (m_xDocumentProperties.is())
-                
m_xDocumentProperties->setKeywords(comphelper::string::convertCommaSeparated(
-                    
m_aStates.top().getCurrentDestinationText()->makeStringAndClear()));
+            {
+                OUStringBuffer* pCurrentDestinationText
+                    = m_aStates.top().getCurrentDestinationText();
+                m_xDocumentProperties->setKeywords(
+                    
comphelper::string::convertCommaSeparated(*pCurrentDestinationText));
+                pCurrentDestinationText->setLength(0);
+            }
             break;
         case Destination::COMMENT:
             if (&m_aStates.top().getDestinationText()
@@ -2757,13 +2764,12 @@ RTFError 
RTFDocumentImpl::beforePopState(RTFParserState& rState)
         break;
         case Destination::ANNOTATIONDATE:
         {
-            if (&m_aStates.top().getDestinationText()
-                != m_aStates.top().getCurrentDestinationText())
+            OUStringBuffer* pCurrentDestinationText = 
m_aStates.top().getCurrentDestinationText();
+            if (&m_aStates.top().getDestinationText() != 
pCurrentDestinationText)
                 break; // not for nested group
-            OUString aStr(OStringToOUString(
-                DTTM22OString(
-                    
m_aStates.top().getCurrentDestinationText()->makeStringAndClear().toInt32()),
-                rState.getCurrentEncoding()));
+            OUString 
aStr(OStringToOUString(DTTM22OString(o3tl::toInt32(*pCurrentDestinationText)),
+                                            rState.getCurrentEncoding()));
+            pCurrentDestinationText->setLength(0);
             auto pValue = new RTFValue(aStr);
             RTFSprms aAnnAttributes;
             aAnnAttributes.set(NS_ooxml::LN_CT_TrackChange_date, pValue);
@@ -3620,9 +3626,9 @@ RTFError RTFDocumentImpl::popState()
 
 RTFError RTFDocumentImpl::handleEmbeddedObject()
 {
-    OString aStr
-        = 
OUStringToOString(m_aStates.top().getCurrentDestinationText()->makeStringAndClear(),
-                            RTL_TEXTENCODING_ASCII_US);
+    OUStringBuffer* pCurrentDestinationText = 
m_aStates.top().getCurrentDestinationText();
+    OString aStr = OUStringToOString(*pCurrentDestinationText, 
RTL_TEXTENCODING_ASCII_US);
+    pCurrentDestinationText->setLength(0);
     std::unique_ptr<SvStream> pStream(new SvMemoryStream());
     if (!msfilter::rtfutil::ExtractOLE2FromObjdata(aStr, *pStream))
         return RTFError::HEX_INVALID;
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index 4dc80416c64f..420c6d36f0c3 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "rtftokenizer.hxx"
+#include <o3tl/string_view.hxx>
 #include <tools/stream.hxx>
 #include <svx/dialmgr.hxx>
 #include <svx/strings.hrc>
@@ -237,7 +238,7 @@ RTFError RTFTokenizer::resolveKeyword()
                 break;
             }
         }
-        nParam = aParameter.makeStringAndClear().toInt32();
+        nParam = o3tl::toInt32(aParameter);
         if (bNeg)
             nParam = -nParam;
     }
commit aa2067dda63852b0eb84d5c32497f5a28177bb1c
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Jul 21 18:50:22 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 22 11:13:28 2022 +0200

    elide some makeStringAndClear() calls
    
    Change-Id: Iccdb04df53bc981e2240240daddf15e9e1bb5a16
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137310
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index d11c99b30b12..7c72ee4cc189 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -518,7 +518,7 @@ OUString SfxHelp::CreateHelpURL_Impl( const OUString& 
aCommandURL, const OUStrin
 
         OUStringBuffer aTempURL = aHelpURL;
         AppendConfigToken( aTempURL, true );
-        bHasAnchor = GetHelpAnchor_Impl(aTempURL.makeStringAndClear(), 
aAnchor);
+        bHasAnchor = GetHelpAnchor_Impl(aTempURL, aAnchor);
     }
 
     AppendConfigToken( aHelpURL, true );
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 5569ab63996b..9b539ec82fc8 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -62,12 +62,14 @@ void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
     OStringBuffer sOut;
     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() );
+    rStrm.WriteOString( sOut );
+    sOut.setLength(0);
 
     HTMLOutFuncs::Out_String( rStrm, rName, pNonConvertableChars );
 
     sOut.append("\" " OOO_STRING_SVTOOLS_HTML_O_content "=\"");
-    rStrm.WriteOString( sOut.makeStringAndClear() );
+    rStrm.WriteOString( sOut );
+    sOut.setLength(0);
 
     HTMLOutFuncs::Out_String( rStrm, rContent, pNonConvertableChars 
).WriteCharPtr( "\"/>" );
 }
@@ -230,7 +232,8 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
                 aURL = URIHelper::simpleNormalizedMakeRelative(
                     rBaseURL, aURL );
                 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_src "=\"");
-                rOut.WriteOString( sOut.makeStringAndClear() );
+                rOut.WriteOString( sOut );
+                sOut.setLength(0);
                 HTMLOutFuncs::Out_String( rOut, aURL );
                 sOut.append('\"');
             }
@@ -240,7 +243,8 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
         if ( (aAny >>= aStr) && !aStr.isEmpty() )
         {
             sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_name "=\"");
-            rOut.WriteOString( sOut.makeStringAndClear() );
+            rOut.WriteOString( sOut );
+            sOut.setLength(0);
             HTMLOutFuncs::Out_String( rOut, aStr );
             sOut.append('\"');
         }
@@ -284,7 +288,8 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
                     .append('=').append(pStr);
             }
         }
-        rOut.WriteOString( sOut.makeStringAndClear() );
+        rOut.WriteOString( sOut );
+        sOut.setLength(0);
     }
     catch (const uno::Exception&)
     {
diff --git a/shell/source/unix/exec/shellexec.cxx 
b/shell/source/unix/exec/shellexec.cxx
index 195a697888c2..97334fcd32c3 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -231,7 +231,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, 
const OUString& aPar
     OString cmd =
 #ifdef LINUX
         // avoid blocking (call it in background)
-        "( " + aBuffer.makeStringAndClear() +  " ) &";
+        "( " + aBuffer +  " ) &";
 #else
         aBuffer.makeStringAndClear();
 #endif
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx
index 8a94b890888d..1c349c080be3 100644
--- a/starmath/source/ooxmlexport.cxx
+++ b/starmath/source/ooxmlexport.cxx
@@ -168,7 +168,7 @@ void SmOoxmlExport::HandleText( const SmNode* pNode, int 
/*nLevel*/)
         }
 #endif
     }
-    m_pSerializer->writeEscaped(buf.makeStringAndClear());
+    m_pSerializer->writeEscaped(buf);
     m_pSerializer->endElementNS( XML_m, XML_t );
     m_pSerializer->endElementNS( XML_m, XML_r );
 }
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index b096d80ba1f1..f040265ad31d 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -383,7 +383,7 @@ OUString SmOoxmlImport::handleEqArr()
         ret.append(" ");
     } while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( e ))));
     m_rStream.ensureClosingTag( M_TOKEN( eqArr ));
-    return "stack {" + ret.makeStringAndClear() + "}";
+    return "stack {" + ret + "}";
 }
 
 OUString SmOoxmlImport::handleF()
@@ -500,7 +500,7 @@ OUString SmOoxmlImport::handleM()
         m_rStream.ensureClosingTag( M_TOKEN( mr ));
     } while( !m_rStream.atEnd() && m_rStream.findTag( OPENING( M_TOKEN( mr 
))));
     m_rStream.ensureClosingTag( M_TOKEN( m ));
-    return "matrix {" + allrows.makeStringAndClear() + "}";
+    return "matrix {" + allrows + "}";
 }
 
 OUString SmOoxmlImport::handleNary()
diff --git a/svgio/source/svgreader/svgnode.cxx 
b/svgio/source/svgreader/svgnode.cxx
index 9ac07afb0f81..02954f986d96 100644
--- a/svgio/source/svgreader/svgnode.cxx
+++ b/svgio/source/svgreader/svgnode.cxx
@@ -94,7 +94,8 @@ namespace svgio::svgreader
                         const sal_Int32 nInitPos(nPos);
                         copyToLimiter(rClassList, u' ', nPos, aToken, nLen);
                         skip_char(rClassList, u' ', nPos, nLen);
-                        const OUString 
aPart(aToken.makeStringAndClear().trim());
+                        const OUString aPart(o3tl::trim(aToken));
+                        aToken.setLength(0);
 
                         if(aPart.getLength())
                         {
diff --git a/svgio/source/svgreader/svgstylenode.cxx 
b/svgio/source/svgreader/svgstylenode.cxx
index 474b0a0e92e8..ac4c86d13ccc 100644
--- a/svgio/source/svgreader/svgstylenode.cxx
+++ b/svgio/source/svgreader/svgstylenode.cxx
@@ -89,7 +89,8 @@ namespace svgio::svgreader
                 const sal_Int32 nInitPos(nPos);
                 copyToLimiter(aSelectors, u' ', nPos, aToken, nLen);
                 skip_char(aSelectors, u' ', nPos, nLen);
-                const OUString 
aSelectorPart(aToken.makeStringAndClear().trim());
+                const OUString aSelectorPart(o3tl::trim(aToken));
+                aToken.setLength(0);
 
                 if(!aSelectorPart.isEmpty())
                 {
@@ -151,7 +152,8 @@ namespace svgio::svgreader
                 copyToLimiter(aSelectors, u',', nPos, aToken, nLen);
                 skip_char(aSelectors, u' ', u',', nPos, nLen);
 
-                const OUString aSingleName(aToken.makeStringAndClear().trim());
+                const OUString aSingleName(o3tl::trim(aToken));
+                aToken.setLength(0);
 
                 // add the current css class only if wasn't previously added
                 auto [aIterator, bIsNew] = 
maSvgStyleAttributes.try_emplace(aSingleName);
@@ -197,7 +199,8 @@ namespace svgio::svgreader
                 copyToLimiter(aSelectorsAndContent, u'{', nPos, aToken, nLen);
                 skip_char(aSelectorsAndContent, u' ', u'{', nPos, nLen);
 
-                const OUString aSelectors(aToken.makeStringAndClear().trim());
+                const OUString aSelectors(o3tl::trim(aToken));
+                aToken.setLength(0);
                 OUString aContent;
 
                 if(!aSelectors.isEmpty() && nPos < nLen)
@@ -206,7 +209,8 @@ namespace svgio::svgreader
                     copyToLimiter(aSelectorsAndContent, u'}', nPos, aToken, 
nLen);
                     skip_char(aSelectorsAndContent, u' ', u'}', nPos, nLen);
 
-                    aContent = aToken.makeStringAndClear().trim();
+                    aContent = o3tl::trim(aToken);
+                    aToken.setLength(0);
                 }
 
                 if(!aSelectors.isEmpty() && !aContent.isEmpty())
diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index 473be3c3fb1c..3c9090f1062a 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -611,7 +611,8 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
             " "
             OOO_STRING_SVTOOLS_HTML_O_name
             "=\"");
-    rStream.WriteOString( sOut.makeStringAndClear() );
+    rStream.WriteOString( sOut );
+    sOut.setLength(0);
     Out_String( rStream, rOutName );
     rStream.WriteCharPtr( "\">" );
 
@@ -704,7 +705,8 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
                         "=" + pShape + " "
                         OOO_STRING_SVTOOLS_HTML_O_coords "=\"" +
                         aCoords + "\" ");
-                rStream.WriteOString( sOut.makeStringAndClear() );
+                rStream.WriteOString( sOut );
+                sOut.setLength(0);
 
                 OUString aURL( pObj->GetURL() );
                 if( !aURL.isEmpty() && pObj->IsActive() )
@@ -712,7 +714,8 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
                     aURL = URIHelper::simpleNormalizedMakeRelative(
                         rBaseURL, aURL );
                     sOut.append(OOO_STRING_SVTOOLS_HTML_O_href "=\"");
-                    rStream.WriteOString( sOut.makeStringAndClear() );
+                    rStream.WriteOString( sOut );
+                    sOut.setLength(0);
                     Out_String( rStream, aURL ).WriteChar( '\"' );
                 }
                 else
@@ -722,7 +725,8 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
                 if( !rObjName.isEmpty() )
                 {
                     sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_name "=\"");
-                    rStream.WriteOString( sOut.makeStringAndClear() );
+                    rStream.WriteOString( sOut );
+                    sOut.setLength(0);
                     Out_String( rStream, rObjName ).WriteChar( '\"' );
                 }
 
@@ -730,7 +734,8 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
                 if( !rTarget.isEmpty() && pObj->IsActive() )
                 {
                     sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_target "=\"");
-                    rStream.WriteOString( sOut.makeStringAndClear() );
+                    rStream.WriteOString( sOut );
+                    sOut.setLength(0);
                     Out_String( rStream, rTarget ).WriteChar( '\"' );
                 }
 
@@ -741,7 +746,8 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
                 if( !rDesc.isEmpty() )
                 {
                     sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_alt "=\"");
-                    rStream.WriteOString( sOut.makeStringAndClear() );
+                    rStream.WriteOString( sOut );
+                    sOut.setLength(0);
                     Out_String( rStream, rDesc ).WriteChar( '\"' );
                 }
 
@@ -782,7 +788,8 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
     if( !rLanguage.isEmpty() )
     {
         sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_language "=\"");
-        rStrm.WriteOString( sOut.makeStringAndClear() );
+        rStrm.WriteOString( sOut );
+        sOut.setLength(0);
         Out_String( rStrm, rLanguage );
         sOut.append('\"');
     }
@@ -790,7 +797,8 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
     if( !rSrc.isEmpty() )
     {
         sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_src "=\"");
-        rStrm.WriteOString( sOut.makeStringAndClear() );
+        rStrm.WriteOString( sOut );
+        sOut.setLength(0);
         Out_String( rStrm, URIHelper::simpleNormalizedMakeRelative(rBaseURL, 
rSrc) );
         sOut.append('\"');
     }
@@ -798,7 +806,8 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
     if( STARBASIC != eScriptType && pSBLibrary )
     {
         sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_sdlibrary "=\"");
-        rStrm.WriteOString( sOut.makeStringAndClear() );
+        rStrm.WriteOString( sOut );
+        sOut.setLength(0);
         Out_String( rStrm, *pSBLibrary );
         sOut.append('\"');
     }
@@ -806,14 +815,16 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
     if( STARBASIC != eScriptType && pSBModule )
     {
         sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_sdmodule "=\"");
-        rStrm.WriteOString( sOut.makeStringAndClear() );
+        rStrm.WriteOString( sOut );
+        sOut.setLength(0);
         Out_String( rStrm, *pSBModule );
         sOut.append('\"');
     }
 
     sOut.append('>');
 
-    rStrm.WriteOString( sOut.makeStringAndClear() );
+    rStrm.WriteOString( sOut );
+    sOut.setLength(0);
 
     if( !rSource.empty() || pSBLibrary || pSBModule )
     {
@@ -831,14 +842,16 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
             {
                 sOut.append("' " OOO_STRING_SVTOOLS_HTML_SB_library " " +
                             OUStringToOString(*pSBLibrary, 
RTL_TEXTENCODING_UTF8));
-                rStrm.WriteOString( sOut.makeStringAndClear() ).WriteCharPtr( 
SAL_NEWLINE_STRING );
+                rStrm.WriteOString( sOut ).WriteCharPtr( SAL_NEWLINE_STRING );
+                sOut.setLength(0);
             }
 
             if( pSBModule )
             {
                 sOut.append("' " OOO_STRING_SVTOOLS_HTML_SB_module " " +
                         OUStringToOString(*pSBModule, RTL_TEXTENCODING_UTF8));
-                rStrm.WriteOString( sOut.makeStringAndClear() ).WriteCharPtr( 
SAL_NEWLINE_STRING );
+                rStrm.WriteOString( sOut ).WriteCharPtr( SAL_NEWLINE_STRING );
+                sOut.setLength(0);
             }
         }
 
@@ -974,7 +987,7 @@ void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, 
std::string_view aAtt
         sBuffer.append(sStringStream.str().c_str());
     }
 
-    rHtmlWriter.attribute(aAttributeName, sBuffer.makeStringAndClear());
+    rHtmlWriter.attribute(aAttributeName, sBuffer);
 }
 
 
diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index d29027449181..0ac10578981c 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1140,7 +1140,8 @@ HtmlTokenId HTMLParser::GetNextToken_()
                             if( !bDone )
                                 nNextCh = GetNextChar();
                         }
-                        aToken = sTmpBuffer.makeStringAndClear();
+                        aToken = sTmpBuffer;
+                        sTmpBuffer.setLength(0);
                         if( !bDone && IsParserWorking() && nCStreamPos )
                         {
                             rInput.Seek( nCStreamPos );
@@ -1246,7 +1247,8 @@ HtmlTokenId HTMLParser::GetNextToken_()
                             nRet = HtmlTokenId::TEXTTOKEN;
                             break;
                         }
-                        aToken = aTmpBuffer.makeStringAndClear();
+                        aToken = aTmpBuffer;
+                        aTmpBuffer.setLength(0);
                         if( IsParserWorking() )
                         {
                             sSaveToken = aToken;
@@ -1608,7 +1610,7 @@ HtmlTokenId HTMLParser::FilterPRE( HtmlTokenId nToken )
             {
                 using comphelper::string::padToLength;
                 OUStringBuffer aBuf(aToken);
-                aToken = padToLength(aBuf, nSpaces, ' ').makeStringAndClear();
+                aToken = padToLength(aBuf, nSpaces, ' ');
             }
             nPre_LinePos += nSpaces;
             nToken = HtmlTokenId::TEXTTOKEN;
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 24272800f49c..8f55ae448d44 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -342,7 +342,10 @@ void SvRTFParser::ScanText()
                                 if (next>0xFF) // fix for #i43933# and #i35653#
                                 {
                                     if (!aByteString.isEmpty())
-                                        aToken.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
+                                    {
+                                        aToken.append( 
OStringToOUString(aByteString, GetSrcEncoding()) );
+                                        aByteString.setLength(0);
+                                    }
                                     
aToken.append(static_cast<sal_Unicode>(next));
 
                                     continue;
@@ -383,7 +386,10 @@ void SvRTFParser::ScanText()
                         bNextCh = false;
 
                         if (!aByteString.isEmpty())
-                            aToken.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
+                        {
+                            aToken.append( OStringToOUString(aByteString, 
GetSrcEncoding()) );
+                            aByteString.setLength(0);
+                        }
                     }
                     break;
                 case '\\':

Reply via email to