diff options
47 files changed, 182 insertions, 212 deletions
diff --git a/compilerplugins/clang/stringadd.cxx b/compilerplugins/clang/stringadd.cxx index f090455e280f..1bf414e6d261 100644 --- a/compilerplugins/clang/stringadd.cxx +++ b/compilerplugins/clang/stringadd.cxx @@ -276,10 +276,6 @@ bool StringAdd::VisitCXXMemberCallExpr(CXXMemberCallExpr const* methodCall) if (!tc1.Class("OUStringBuffer").Namespace("rtl").GlobalNamespace() && !tc1.Class("OStringBuffer").Namespace("rtl").GlobalNamespace()) return true; - auto paramType = methodDecl->getParamDecl(0)->getType(); - // char is still a pain to work with, when constructing a chained + - if (paramType->isCharType() || loplugin::TypeCheck(paramType).Typedef("sal_Unicode")) - return true; auto arg = methodCall->getArg(0); // I don't think the OUStringAppend functionality can handle this efficiently if (isa<ConditionalOperator>(ignore(arg))) @@ -296,10 +292,6 @@ bool StringAdd::VisitCXXMemberCallExpr(CXXMemberCallExpr const* methodCall) if (!methodDecl2->getIdentifier() || methodDecl2->getName() != "append" || methodCall2->getNumArgs() == 0) return true; - auto paramType2 = methodDecl2->getParamDecl(0)->getType(); - // char is still a pain to work with, when constructing a chained + - if (paramType2->isCharType() || loplugin::TypeCheck(paramType2).Typedef("sal_Unicode")) - return true; arg = methodCall2->getArg(0); // I don't think the OUStringAppend functionality can handle this efficiently if (isa<ConditionalOperator>(ignore(arg))) diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 8774ad120225..71ac0594cd15 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1044,7 +1044,7 @@ static OUString lcl_getDatePatternsConfigString( const LocaleDataWrapper& rLocal const OUString* pPatterns = aDateAcceptancePatterns.getConstArray(); aBuf.append( pPatterns[0]); for (sal_Int32 i=1; i < nPatterns; ++i) - aBuf.append(';').append( pPatterns[i]); + aBuf.append(";" + pPatterns[i]); } return aBuf.makeStringAndClear(); } diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index cfac4ddea89d..267da80894f0 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -127,11 +127,12 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal assert( 0 <= breakType && breakType <= 9 && 0 <= rBreakType && rBreakType <= 9 && 0 <= nWordType && nWordType <= 9); const OString aLangtagStr( LanguageTag::convertToBcp47( rLocale).toUtf8()); OStringBuffer aKeyBuf(64); - aKeyBuf.append( aLangtagStr).append(';'); + aKeyBuf.append( aLangtagStr + ";" ); if (rule) aKeyBuf.append(rule); - aKeyBuf.append(';').append( static_cast<char>('0'+breakType)).append(';'). - append( static_cast<char>('0'+rBreakType)).append(';').append( static_cast<char>('0'+nWordType)); + aKeyBuf.append(";" + OStringChar(static_cast<char>('0'+breakType)) + ";" + + OStringChar(static_cast<char>('0'+rBreakType)) + ";" + + OStringChar( static_cast<char>('0'+nWordType))); // langtag;rule;breakType;rBreakType;nWordType const OString aBIMapGlobalKey( aKeyBuf.makeStringAndClear()); diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 68e0fe2bb704..8ab363672f9e 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -366,7 +366,7 @@ static OUString toRoman( sal_Int32 n ) case 3: sTmp.append(*cRomanStr); [[fallthrough]]; case 2: sTmp.append(*cRomanStr); [[fallthrough]]; case 1: sTmp.append(*cRomanStr); break; - case 4: sTmp.append(*cRomanStr).append(*(cRomanStr-nDiff)); break; + case 4: sTmp.append(OUStringChar(*cRomanStr) + OUStringChar(*(cRomanStr-nDiff))); break; case 5: sTmp.append(*(cRomanStr-nDiff)); break; } diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx index d058c939e4f9..7e5369126803 100644 --- a/include/sfx2/bindings.hxx +++ b/include/sfx2/bindings.hxx @@ -24,6 +24,7 @@ #include <cstddef> #include <memory> #include <optional> +#include <string_view> #include <o3tl/typed_flags_set.hxx> #include <sfx2/dllapi.h> @@ -164,8 +165,8 @@ public: void SetActiveFrame( const css::uno::Reference< css::frame::XFrame > & rFrame ); css::uno::Reference< css::frame::XFrame > GetActiveFrame() const; // Reconfig - sal_uInt16 EnterRegistrations(const char *pFile = nullptr, int nLine = 0); - void LeaveRegistrations( const char *pFile = nullptr, int nLine = 0 ); + sal_uInt16 EnterRegistrations( std::string_view pFile = {}, int nLine = 0); + void LeaveRegistrations( std::string_view pFile = {}, int nLine = 0 ); void Register( SfxControllerItem& rBinding ); void Release( SfxControllerItem& rBinding ); SfxDispatcher* GetDispatcher() const @@ -192,9 +193,9 @@ public: #define ENTERREGISTRATIONS() EnterRegistrations(__FILE__, __LINE__) #define LEAVEREGISTRATIONS() LeaveRegistrations(__FILE__, __LINE__) #define DENTERREGISTRATIONS() \ - EnterRegistrations( OStringBuffer(__FILE__).append('(').append(reinterpret_cast<sal_Int64>(this)).append(')').getStr(), __LINE__ ) + EnterRegistrations( Concat2View(OString::Concat(__FILE__) + "(" + OString::number(reinterpret_cast<sal_Int64>(this)) + ")"), __LINE__ ) #define DLEAVEREGISTRATIONS( ) \ - LeaveRegistrations( OStringBuffer(__FILE__).append('(').append(reinterpret_cast<sal_Int64>(this)).append(')').getStr(), __LINE__ ) + LeaveRegistrations( Concat2View(OString::Concat(__FILE__) + "(" + OString::number(reinterpret_cast<sal_Int64>(this)) + ")"), __LINE__ ) #else #define ENTERREGISTRATIONS() EnterRegistrations() #define LEAVEREGISTRATIONS() LeaveRegistrations() diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx index 8e9d676de800..898b5b702161 100644 --- a/oox/source/drawingml/lineproperties.cxx +++ b/oox/source/drawingml/lineproperties.cxx @@ -277,11 +277,11 @@ void lclPushMarkerProperties( ShapePropertyMap& rPropMap, sal_Int32 nWidth = lclGetArrowSize( rArrowProps.moArrowWidth.value_or( XML_med ) ); sal_Int32 nNameIndex = nWidth * 3 + nLength + 1; - aBuffer.append( ' ' ).append( nNameIndex ); + aBuffer.append( " " + OUString::number( nNameIndex )); if (bIsArrow) { // Arrow marker form depends also on line width - aBuffer.append(' ').append(nLineWidth); + aBuffer.append(" " + OUString::number(nLineWidth)); } OUString aMarkerName = aBuffer.makeStringAndClear(); diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 497795050f38..0263396928c1 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -267,7 +267,7 @@ void StringHelper::appendHex( OUStringBuffer& rStr, sal_uInt8 nData, bool bPrefi static const sal_Unicode spcHexDigits[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; if( bPrefix ) rStr.append( "0x" ); - rStr.append( spcHexDigits[ (nData >> 4) & 0x0F ] ).append( spcHexDigits[ nData & 0x0F ] ); + rStr.append( OUStringChar(spcHexDigits[ (nData >> 4) & 0x0F ] ) + OUStringChar( spcHexDigits[ nData & 0x0F ] ) ); } void StringHelper::appendHex( OUStringBuffer& rStr, sal_Int8 nData, bool bPrefix ) @@ -524,7 +524,7 @@ void StringHelper::appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx ) { OUStringBuffer aToken; appendDec( aToken, nIdx ); - rStr.append( '[' ).append( aToken ).append( ']' ); + rStr.append( "[" + aToken + "]" ); } std::u16string_view StringHelper::getToken( std::u16string_view rData, sal_Int32& rnPos, sal_Unicode cSep ) diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 3a7fb417f2fc..2844be0bc8da 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -1084,7 +1084,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& buf.append( " ( " ); for ( int nCount = opt.nProp.size(); nCount; --nCount ) { - buf.append( static_cast<sal_Int32>(*pIt), 16 ).append(' '); + buf.append( OString::number(static_cast<sal_Int32>(*pIt), 16) + " "); ++pIt; } buf.append( ")" ); diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index 6f1682df070b..4bd93cec132c 100644 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -255,7 +255,7 @@ OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) // normal source code line if( !mbExecutable ) aSourceCode.append( "Rem " ); - aSourceCode.append( aCodeLine ).append( '\n' ); + aSourceCode.append( aCodeLine + "\n" ); } } } diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx index 4f94207619f2..53cc6b455a14 100644 --- a/oox/source/vml/vmlinputstream.cxx +++ b/oox/source/vml/vmlinputstream.cxx @@ -138,7 +138,7 @@ void lclProcessAttribs( OStringBuffer& rBuffer, const char* pcBeg, const char* p // if no error has occurred, build the resulting attribute list if( bOk ) for (auto const& attrib : aAttributes) - rBuffer.append( ' ' ).append( attrib.second ); + rBuffer.append( " " + attrib.second ); // on error, just append the complete passed string else lclAppendToBuffer( rBuffer, pcBeg, pcEnd ); diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 85f228955367..e9ef4494c5de 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1492,13 +1492,11 @@ static void convertTime( if (i_rDateTime.Hours < 10) { i_rBuffer.append('0'); } - i_rBuffer.append( static_cast<sal_Int32>(i_rDateTime.Hours) ) - .append(':'); + i_rBuffer.append( OUString::number(static_cast<sal_Int32>(i_rDateTime.Hours)) + ":"); if (i_rDateTime.Minutes < 10) { i_rBuffer.append('0'); } - i_rBuffer.append( static_cast<sal_Int32>(i_rDateTime.Minutes) ) - .append(':'); + i_rBuffer.append( OUString::number(static_cast<sal_Int32>(i_rDateTime.Minutes) ) + ":"); if (i_rDateTime.Seconds < 10) { i_rBuffer.append('0'); } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index e242633e84d1..5d74944cf161 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1623,7 +1623,7 @@ struct ConventionXL_OOX : public ConventionXL_A1 static void makeExternalDocStr( OUStringBuffer& rBuffer, sal_uInt16 nFileId ) { - rBuffer.append('[').append( static_cast<sal_Int32>(nFileId+1) ).append(']'); + rBuffer.append("[" + OUString::number( static_cast<sal_Int32>(nFileId+1) ) + "]"); } }; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 7826522a89bf..52bab34899ff 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -3029,7 +3029,7 @@ void ScInterpreter::ScRoman() else nSteps = nMode; } - aRoman.append( pChars[ nIndex ] ).append( pChars[ nIndex2 ] ); + aRoman.append( OUStringChar(pChars[ nIndex ]) + OUStringChar(pChars[ nIndex2 ]) ); nVal = sal::static_int_cast<sal_uInt16>( nVal + pValues[ nIndex ] ); nVal = sal::static_int_cast<sal_uInt16>( nVal - pValues[ nIndex2 ] ); } diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 2025e65a7bd2..997c1b2c507d 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -903,12 +903,12 @@ OUString lclEncodeDosPath( if ( path.length() > 2 && o3tl::starts_with(path, u"\\\\") ) { // UNC - aBuf.append(EXC_URL_DOSDRIVE).append('@'); + aBuf.append(OUStringChar(EXC_URL_DOSDRIVE) + "@"); path = path.substr(2); } else if ( path.length() > 2 && o3tl::starts_with(path.substr(1), u":\\") ) { - aBuf.append(EXC_URL_DOSDRIVE).append(path[0]); + aBuf.append(OUStringChar(EXC_URL_DOSDRIVE) + OUStringChar(path[0])); path = path.substr(3); } else if ( !bIsRel ) @@ -926,14 +926,14 @@ OUString lclEncodeDosPath( // Excel seems confused by this token). aBuf.append(EXC_URL_PARENTDIR); else - aBuf.append(path.substr(0,nPos)).append(EXC_URL_SUBDIR); + aBuf.append(path.substr(0,nPos) + OUStringChar(EXC_URL_SUBDIR)); path = path.substr(nPos + 1); } // file name if (pTableName) // enclose file name in brackets if table name follows - aBuf.append('[').append(path).append(']'); + aBuf.append(OUString::Concat("[") + path + "]"); else aBuf.append(path); } diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index cf4ea663dec1..07dea311bea7 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -379,7 +379,7 @@ void XclImpHyperlink::ConvertToValidTabName(OUString& rUrl) // quite. When this occurs, the whole table name needs to be // quoted. bQuoteTabName = true; - aTabName.append(c).append(c); + aTabName.append(OUStringChar(c) + OUStringChar(c)); ++i; continue; } diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 7940758bffc5..9647ca5565ba 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -4392,11 +4392,11 @@ void XclImpObjectManager::ConvertObjects() OUString XclImpObjectManager::GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const { - OUStringBuffer aDefName; + OUString aDefName; DefObjNameMap::const_iterator aIt = maDefObjNames.find( rDrawObj.GetObjType() ); if( aIt != maDefObjNames.end() ) - aDefName.append(aIt->second); - return aDefName.append(' ').append(static_cast<sal_Int32>(rDrawObj.GetObjId())).makeStringAndClear(); + aDefName = aIt->second; + return aDefName + " " + OUString::number(static_cast<sal_Int32>(rDrawObj.GetObjId())); } ScRange XclImpObjectManager::GetUsedArea( SCTAB nScTab ) const diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index d8d4eaa631c4..4c7ef0e25841 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -704,7 +704,7 @@ void XclImpPivotCache::ReadPivotCacheStream( const XclImpStream& rStrm ) rDoc.MakeTable( nScTab ); OUStringBuffer aDummyName("DPCache"); if( maTabName.getLength() > 0 ) - aDummyName.append( '_' ).append( maTabName ); + aDummyName.append( "_" + maTabName ); OUString aName = aDummyName.makeStringAndClear(); rDoc.CreateValidTabName( aName ); rDoc.RenameTab( nScTab, aName ); diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 16db15316121..d1fd673e2bd9 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -867,9 +867,9 @@ void ScHTMLExport::WriteTables() { // clear <TABLE ALIGN=LEFT> with <BR CLEAR=LEFT> aByteStrOut.append(OOO_STRING_SVTOOLS_HTML_linebreak); - aByteStrOut.append(' '). - append(OOO_STRING_SVTOOLS_HTML_O_clear).append('='). - append(OOO_STRING_SVTOOLS_HTML_AL_left); + aByteStrOut.append(" " + OOO_STRING_SVTOOLS_HTML_O_clear "=" + OOO_STRING_SVTOOLS_HTML_AL_left); TAG_ON_LF( aByteStrOut.makeStringAndClear().getStr() ); } } @@ -956,8 +956,8 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SC nC = rMergeAttr.GetColMerge(); if ( nC > 1 ) { - aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_colspan). - append('=').append(static_cast<sal_Int32>(nC)); + aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_O_colspan + "=" + OString::number(static_cast<sal_Int32>(nC))); nC = nC + nCol; for ( jC=nCol, v=0; jC<nC; jC++ ) v += pDoc->GetColWidth( jC, nTab ); @@ -970,8 +970,8 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SC nR = rMergeAttr.GetRowMerge(); if ( nR > 1 ) { - aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rowspan). - append('=').append(static_cast<sal_Int32>(nR)); + aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_O_rowspan + "=" + OString::number(static_cast<sal_Int32>(nR))); nR += nRow; v = pDoc->GetRowHeight( nRow, nR-1, nTab ); nHeightPixel = ToPixel( static_cast< sal_uInt16 >( v ) ); @@ -1075,14 +1075,12 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SC } if ( pChar ) { - aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_valign). - append('=').append(pChar); + aStrTD.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_valign "=") + pChar); } if ( aHTMLStyle.aBackgroundColor != aBgColor ) { - aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor). - append('='); + aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_O_bgcolor "="); aStrTD.append(lcl_makeHTMLColorTriplet(aBgColor)); } @@ -1160,8 +1158,8 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SC } if ( nSetFontSizeNumber ) { - aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size). - append('=').append(static_cast<sal_Int32>(nSetFontSizeNumber)); + aStr.append(" " OOO_STRING_SVTOOLS_HTML_O_size "=" + + OString::number(static_cast<sal_Int32>(nSetFontSizeNumber))); } if ( bSetFontColor ) { @@ -1171,8 +1169,8 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SC if ( aColor == COL_AUTO ) aColor = COL_BLACK; - aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_color). - append('=').append(lcl_makeHTMLColorTriplet(aColor)); + aStr.append(" " OOO_STRING_SVTOOLS_HTML_O_color "=" + + lcl_makeHTMLColorTriplet(aColor)); } TAG_ON(aStr.makeStringAndClear().getStr()); } diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index 475fea96c8f8..5189ec92aafd 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -113,16 +113,16 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE ) { SdrObject* pObject = pE->pObject; OStringBuffer aBuf; - aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).append('='). - append(static_cast<sal_Int32>(pE->aSize.Width())); - aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).append('='). - append(static_cast<sal_Int32>(pE->aSize.Height())); + aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_width "=" + + OString::number(static_cast<sal_Int32>(pE->aSize.Width()))); + aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_height "=" + + OString::number(static_cast<sal_Int32>(pE->aSize.Height()))); if ( pE->bInCell ) { - aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_hspace).append('='). - append(static_cast<sal_Int32>(pE->aSpace.Width())); - aBuf.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_vspace).append('='). - append(static_cast<sal_Int32>(pE->aSpace.Height())); + aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_hspace "=" + + OString::number(static_cast<sal_Int32>(pE->aSpace.Width()))); + aBuf.append(" " OOO_STRING_SVTOOLS_HTML_O_vspace "=" + + OString::number(static_cast<sal_Int32>(pE->aSpace.Height()))); } OString aOpt = aBuf.makeStringAndClear(); switch ( pObject->GetObjIdentifier() ) diff --git a/sc/source/filter/oox/autofilterbuffer.cxx b/sc/source/filter/oox/autofilterbuffer.cxx index b7f14d8a2fb2..8c8050509f38 100644 --- a/sc/source/filter/oox/autofilterbuffer.cxx +++ b/sc/source/filter/oox/autofilterbuffer.cxx @@ -139,11 +139,11 @@ bool lclConvertWildcardsToRegExp( OUString& rValue ) aBuffer.append( '.' ); break; case '*': - aBuffer.append( '.' ).append( '*' ); + aBuffer.append( ".*" ); break; case '\\': case '.': case '|': case '(': case ')': case '^': case '$': // quote RE meta characters - aBuffer.append( '\\' ).append( *pcChar ); + aBuffer.append( "\\" + OUStringChar(*pcChar) ); break; default: aBuffer.append( *pcChar ); diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 5fb1cd029972..2d5416b37756 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -751,8 +751,8 @@ sal_uInt32 VmlDrawing::convertControlTextColor( std::u16string_view aTextColor ) return OleHelper::encodeOleColor( (nR << 16) | (nG << 8) | nB ); } - OSL_ENSURE( false, OStringBuffer( "VmlDrawing::convertControlTextColor - invalid color name '" ). - append( OUStringToOString( aTextColor, RTL_TEXTENCODING_ASCII_US ) ).append( '\'' ).getStr() ); + OSL_ENSURE( false, OStringBuffer( "VmlDrawing::convertControlTextColor - invalid color name '" + + OUStringToOString( aTextColor, RTL_TEXTENCODING_ASCII_US ) + "\'" ).getStr() ); return AX_SYSCOLOR_WINDOWTEXT; } diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 1fe793a47f9e..764ad4750e01 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -1328,17 +1328,17 @@ bool OpCodeProviderImpl::initFuncOpCode( FunctionInfo& orFuncInfo, const ApiToke (orFuncInfo.mnApiOpCode != OPCODE_UNKNOWN) && (orFuncInfo.mnApiOpCode != OPCODE_NONAME); OSL_ENSURE( bIsValid, - OStringBuffer( "OpCodeProviderImpl::initFuncOpCode - no valid opcode for ODF function \"" ). - append( OUStringToOString( orFuncInfo.maOdfFuncName, RTL_TEXTENCODING_ASCII_US ) ). - append( '"' ).getStr() ); + OStringBuffer( "OpCodeProviderImpl::initFuncOpCode - no valid opcode for ODF function \"" + + OUStringToOString( orFuncInfo.maOdfFuncName, RTL_TEXTENCODING_ASCII_US ) + + "\"" ).getStr() ); if( bIsValid && (orFuncInfo.mnApiOpCode == OPCODE_EXTERNAL) ) { bIsValid = (aIt->second.Data >>= orFuncInfo.maExtProgName) && !orFuncInfo.maExtProgName.isEmpty(); OSL_ENSURE( bIsValid, - OStringBuffer( "OpCodeProviderImpl::initFuncOpCode - no programmatical name for external function \"" ). - append( OUStringToOString( orFuncInfo.maOdfFuncName, RTL_TEXTENCODING_ASCII_US ) ). - append( '"' ).getStr() ); + OStringBuffer( "OpCodeProviderImpl::initFuncOpCode - no programmatical name for external function \"" + + OUStringToOString( orFuncInfo.maOdfFuncName, RTL_TEXTENCODING_ASCII_US ) + + "\"" ).getStr() ); } // add to parser map, if OOXML function name exists diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index 5bc5466e2c7e..447878000226 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -1841,9 +1841,9 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, OSL_ENSURE( rFmtCode.startsWith( "#\\ ?/" ) || rFmtCode.startsWith( "#\\ ?\?/" ) || rFmtCode.startsWith( "#\\ ?\?\?/" ), - OStringBuffer( "lclCreateFormat - cannot create number format '" ). - append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ). - append( '\'' ).getStr() ); + OStringBuffer( "lclCreateFormat - cannot create number format '" + + OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) + + "\'" ).getStr() ); } } return nIndex; diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index 021f1c266352..7f6e762aaf98 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -795,9 +795,9 @@ Reference<text::XTextContent> HeaderFooterParser::createField( const OUString& r } catch( Exception& ) { - OSL_FAIL( OStringBuffer( "HeaderFooterParser::createField - error while creating text field \"" ). - append( OUStringToOString( rServiceName, RTL_TEXTENCODING_ASCII_US ) ). - append( '"' ).getStr() ); + OSL_FAIL( OStringBuffer( "HeaderFooterParser::createField - error while creating text field \"" + + OUStringToOString( rServiceName, RTL_TEXTENCODING_ASCII_US ) + + "\"" ).getStr() ); } return xContent; } diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 7bf652107475..6ea756f884ce 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -1014,7 +1014,7 @@ OUString WorksheetGlobals::getHyperlinkUrl( const HyperlinkModel& rHyperlink ) c if( !rHyperlink.maTarget.isEmpty() ) aUrlBuffer.append( getBaseFilter().getAbsoluteUrl( rHyperlink.maTarget ) ); if( !rHyperlink.maLocation.isEmpty() ) - aUrlBuffer.append( '#' ).append( rHyperlink.maLocation ); + aUrlBuffer.append( "#" + rHyperlink.maLocation ); OUString aUrl = aUrlBuffer.makeStringAndClear(); if( aUrl.startsWith("#") ) diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx index 2bd35542130b..17190b9cf62d 100644 --- a/sc/source/ui/vba/vbahyperlink.cxx +++ b/sc/source/ui/vba/vbahyperlink.cxx @@ -221,7 +221,7 @@ void ScVbaHyperlink::setUrlComponents( const UrlComponents& rUrlComp ) ensureTextField(); OUStringBuffer aUrl( rUrlComp.first ); if( !rUrlComp.second.isEmpty() ) - aUrl.append( '#' ).append( rUrlComp.second ); + aUrl.append( "#" + rUrlComp.second ); mxTextField->setPropertyValue("URL", uno::Any( aUrl.makeStringAndClear() ) ); } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 84b8d3595502..1c6817c0bfec 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2377,7 +2377,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) OUStringBuffer aBuffer; for (const auto& rName : aNames) { - aBuffer.append(rName).append(' '); + aBuffer.append(rName + " "); } pHdl->InsertFunction( aBuffer.makeStringAndClear(), false ); // without "()" } diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 77583ab898e4..34057df0e05f 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -480,7 +480,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) OUStringBuffer aBuffer; for (const auto& rName : aNames) { - aBuffer.append(rName).append(' '); + aBuffer.append(rName + " "); } const OUString s = aBuffer.makeStringAndClear(); pTableView->InsertText(s); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 98b20b05d2f0..fe84c8f44a17 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -600,7 +600,6 @@ void IndexTabPage_Impl::InitializeIndex() { int ndx,tmp; OUString aIndex, aTempString; - OUStringBuffer aData( 128 ); // Capacity of up to 128 characters sfx2::KeywordInfo::iterator it; for ( int i = 0; i < aKeywordList.getLength(); ++i ) @@ -646,8 +645,7 @@ void IndexTabPage_Impl::InitializeIndex() { if ( aAnchorList[0].getLength() > 0 ) { - aData.append( aRefList[0] ).append( '#' ).append( aAnchorList[0] ); - sId = weld::toId(new IndexEntry_Impl(aData.makeStringAndClear(), insert)); + sId = weld::toId(new IndexEntry_Impl(aRefList[0] + "#" + aAnchorList[0], insert)); } else sId = weld::toId(new IndexEntry_Impl(aRefList[0], insert)); @@ -662,20 +660,10 @@ void IndexTabPage_Impl::InitializeIndex() for ( sal_uInt32 j = 1; j < nRefListLen ; ++j ) { - aData - .append( aKeywordPair ) - .append( ' ' ) - .append( '-' ) - .append( ' ' ) - .append( aTitleList[j] ); - - aTempString = aData.makeStringAndClear(); + aTempString = aKeywordPair + " - " + aTitleList[j]; if ( aAnchorList[j].getLength() > 0 ) - { - aData.append( aRefList[j] ).append( '#' ).append( aAnchorList[j] ); - sId = weld::toId(new IndexEntry_Impl(aData.makeStringAndClear(), insert)); - } + sId = weld::toId(new IndexEntry_Impl(aRefList[j] + "#" + aAnchorList[j], insert)); else sId = weld::toId(new IndexEntry_Impl(aRefList[j], insert)); diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 9b539ec82fc8..5c8f4b5351f3 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -253,14 +253,14 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( aAny = xSet->getPropertyValue("FrameMarginWidth"); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_marginwidth) - .append('=').append(nVal); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_marginwidth + "=" + OString::number(nVal)); } aAny = xSet->getPropertyValue("FrameMarginHeight"); if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_marginheight) - .append('=').append(nVal); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_marginheight + "=" + OString::number(nVal)); } bool bVal = true; @@ -284,8 +284,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_frameborder) - .append('=').append(pStr); + sOut.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_frameborder + "=") + pStr); } } rOut.WriteOString( sOut ); diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 51d6b36d237f..5eb19de835ca 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1310,13 +1310,13 @@ bool SfxBindings::NextJob_Impl(Timer const * pTimer) } -sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) +sal_uInt16 SfxBindings::EnterRegistrations(std::string_view pFile, int nLine) { SAL_INFO( "sfx.control", std::setw(std::min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this << " Level = " << nRegLevel << " SfxBindings::EnterRegistrations " - << (pFile + << (!pFile.empty() ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : "")); // When bindings are locked, also lock sub bindings. @@ -1351,7 +1351,7 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) } -void SfxBindings::LeaveRegistrations( const char *pFile, int nLine ) +void SfxBindings::LeaveRegistrations( std::string_view pFile, int nLine ) { DBG_ASSERT( nRegLevel, "Leave without Enter" ); @@ -1412,7 +1412,7 @@ void SfxBindings::LeaveRegistrations( const char *pFile, int nLine ) "sfx.control", std::setw(std::min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this << " Level = " << nRegLevel << " SfxBindings::LeaveRegistrations " - << (pFile + << (!pFile.empty() ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : "")); } diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 70d18b54edae..6cf26ca47433 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -581,7 +581,7 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, if (!rItem.first.isEmpty() && !rItem.second.isEmpty()) { aPayload.append(", \"" + rItem.first + "\": \"" + - rItem.second).append('"'); + rItem.second + "\""); } } aPayload.append('}'); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 17d6f108c503..3baa04812142 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -4516,7 +4516,7 @@ OUString NfCurrencyEntry::BuildSymbolString(bool bBank, if ( !bWithoutExtension && eLanguage != LANGUAGE_DONTKNOW && eLanguage != LANGUAGE_SYSTEM ) { sal_Int32 nLang = static_cast<sal_uInt16>(eLanguage); - aBuf.append('-').append(OUString::number(nLang, 16).toAsciiUpperCase()); + aBuf.append("-" + OUString::number(nLang, 16).toAsciiUpperCase()); } } aBuf.append(']'); diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 3c9090f1062a..ca107cb0b016 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -436,7 +436,7 @@ static OString lcl_ConvertCharToHTML( sal_uInt32 c, char *pBuffer = cBuffer; while( nLen-- ) aDest.append(*pBuffer++); - aDest.append('&').append(pStr).append(';'); + aDest.append(OString::Concat("&") + pStr + ";"); } else { @@ -465,9 +465,9 @@ static OString lcl_ConvertCharToHTML( sal_uInt32 c, while( nLen-- ) aDest.append(*pBuffer++); - aDest.append('&').append('#').append(static_cast<sal_Int32>(c)) + aDest.append("&#" + OString::number(static_cast<sal_Int32>(c)) // Unicode code points guaranteed to fit into sal_Int32 - .append(';'); + + ";"); if( pNonConvertableChars ) { OUString cs(&c, 1); @@ -634,15 +634,14 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, pShape = OOO_STRING_SVTOOLS_HTML_SH_rect; tools::Rectangle aRect( pRectObj->GetRectangle() ); - aCoords = OStringBuffer() - .append(static_cast<sal_Int32>(aRect.Left())) - .append(',') - .append(static_cast<sal_Int32>(aRect.Top())) - .append(',') - .append(static_cast<sal_Int32>(aRect.Right())) - .append(',') - .append(static_cast<sal_Int32>(aRect.Bottom())) - .makeStringAndClear(); + aCoords = + OString::number(static_cast<sal_Int32>(aRect.Left())) + + "," + + OString::number(static_cast<sal_Int32>(aRect.Top())) + + "," + + OString::number(static_cast<sal_Int32>(aRect.Right())) + + "," + + OString::number(static_cast<sal_Int32>(aRect.Bottom()));; } break; case IMapObjectType::Circle: @@ -653,13 +652,12 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, Point aCenter( pCirc->GetCenter() ); tools::Long nOff = pCirc->GetRadius(); - aCoords = OStringBuffer() - .append(static_cast<sal_Int32>(aCenter.X())) - .append(',') - .append(static_cast<sal_Int32>(aCenter.Y())) - .append(',') - .append(static_cast<sal_Int32>(nOff)) - .makeStringAndClear(); + aCoords = + OString::number(static_cast<sal_Int32>(aCenter.X())) + + "," + + OString::number(static_cast<sal_Int32>(aCenter.Y())) + + "," + + OString::number(static_cast<sal_Int32>(nOff)); } break; case IMapObjectType::Polygon: @@ -669,23 +667,24 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, pShape= OOO_STRING_SVTOOLS_HTML_SH_poly; tools::Polygon aPoly( pPolyObj->GetPolygon() ); sal_uInt16 nCount = aPoly.GetSize(); - OStringBuffer aTmpBuf; + OString aTmpBuf; if( nCount>0 ) { const Point& rPoint = aPoly[0]; - aTmpBuf.append(static_cast<sal_Int32>(rPoint.X())) - .append(',') - .append(static_cast<sal_Int32>(rPoint.Y())); + aTmpBuf = OString::number(static_cast<sal_Int32>(rPoint.X())) + + "," + + OString::number(static_cast<sal_Int32>(rPoint.Y())); } for( sal_uInt16 j=1; j<nCount; j++ ) { const Point& rPoint = aPoly[j]; - aTmpBuf.append(',') - .append(static_cast<sal_Int32>(rPoint.X())) - .append(',') - .append(static_cast<sal_Int32>(rPoint.Y())); + aTmpBuf = + "," + + OString::number(static_cast<sal_Int32>(rPoint.X())) + + "," + + OString::number(static_cast<sal_Int32>(rPoint.Y())); } - aCoords = aTmpBuf.makeStringAndClear(); + aCoords = aTmpBuf; } break; default: @@ -781,9 +780,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, const OUString *pSBModule ) { // script is not indented! - OStringBuffer sOut; - sOut.append('<') - .append(OOO_STRING_SVTOOLS_HTML_script); + OStringBuffer sOut("<" OOO_STRING_SVTOOLS_HTML_script); if( !rLanguage.isEmpty() ) { @@ -947,8 +944,10 @@ OString HTMLOutFuncs::CreateTableDataOptionsValNum( } else nLang = LANGUAGE_SYSTEM; - aStrTD.append(static_cast<sal_Int32>(static_cast<sal_uInt16>(nLang))).append(';'). - append(aNumStr); + aStrTD.append( + OString::number(static_cast<sal_Int32>(static_cast<sal_uInt16>(nLang))) + + ";" + + aNumStr); } aStrTD.append('\"'); } diff --git a/sw/qa/uibase/fldui/fldui.cxx b/sw/qa/uibase/fldui/fldui.cxx index c7186d863c43..79a53c842a46 100644 --- a/sw/qa/uibase/fldui/fldui.cxx +++ b/sw/qa/uibase/fldui/fldui.cxx @@ -79,7 +79,7 @@ CPPUNIT_TEST_FIXTURE(Test, testBiblioPageNumberUpdate) OUStringBuffer aFieldBuffer; for (const auto& rField : aCoreFields) { - aFieldBuffer.append(rField).append(TOX_STYLE_DELIMITER); + aFieldBuffer.append(rField + OUStringChar(TOX_STYLE_DELIMITER)); } SwFieldMgr aMgr(pWrtShell); aMgr.UpdateCurField(0, aFieldBuffer.makeStringAndClear(), OUString()); diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 02ecda68477d..e215672febe6 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -572,8 +572,8 @@ void SwTableFormula::BoxNmsToPtr( const SwTable& rTable, OUStringBuffer& rNewStr } pBox = rTable.GetTableBox( rFirstBox ); - rNewStr.append(reinterpret_cast<sal_IntPtr>(pBox)) - .append(rFirstBox[ rFirstBox.getLength()-1 ]); // get label for the box + rNewStr.append(OUString::number(reinterpret_cast<sal_IntPtr>(pBox)) + + OUStringChar(rFirstBox[ rFirstBox.getLength()-1 ])); // get label for the box } /// create external formula (for UI) @@ -1233,8 +1233,8 @@ void SwTableFormula::SplitMergeBoxNm_( const SwTable& rTable, OUStringBuffer& rN if( pLastBox ) rNewStr.append(OUString::number(reinterpret_cast<sal_IntPtr>(pEndBox)) + ":"); - rNewStr.append(reinterpret_cast<sal_IntPtr>(pSttBox)) - .append(rFirstBox[ rFirstBox.getLength()-1] ); + rNewStr.append(OUString::number(reinterpret_cast<sal_IntPtr>(pSttBox)) + + OUStringChar(rFirstBox[ rFirstBox.getLength()-1] )); } /// Create external formula but remember that the formula is placed in a split/merged table diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index d22c1b00a866..14ea4ad28d73 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -124,8 +124,7 @@ SwHTMLWriter& OutHTML_DrawFrameFormatAsMarquee( SwHTMLWriter& rWrt, if( !pOutlinerParaObj ) return rWrt; - OStringBuffer sOut; - sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_marquee); + OStringBuffer sOut("<" OOO_STRING_SVTOOLS_HTML_marquee); // get attributes of the object const SfxItemSet& rItemSet = pTextObj->GetMergedItemSet(); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 6d37a88966e8..fb34dc56ff01 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -268,21 +268,20 @@ static SwHTMLWriter& OutHTML_SwField( SwHTMLWriter& rWrt, const SwField* pField, // Output the <sdfield> tag. if( pTypeStr ) { - OStringBuffer sOut; - sOut.append('<'); - sOut.append(rWrt.GetNamespace()); - sOut.append(OOO_STRING_SVTOOLS_HTML_sdfield).append(' '). - append(OOO_STRING_SVTOOLS_HTML_O_type).append('='). - append(pTypeStr); + OStringBuffer sOut("<" + + rWrt.GetNamespace() + + OOO_STRING_SVTOOLS_HTML_sdfield " " + OOO_STRING_SVTOOLS_HTML_O_type "=" + + pTypeStr); if( pSubStr ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_subtype). - append('=').append(pSubStr); + sOut.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_subtype "=") + + pSubStr); } if( pFormatStr ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_format). - append('=').append(pFormatStr); + sOut.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_format "=") + + pFormatStr); } if( !aName.isEmpty() ) { @@ -309,7 +308,7 @@ static SwHTMLWriter& OutHTML_SwField( SwHTMLWriter& rWrt, const SwField* pField, } if( bFixed ) { - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_sdfixed); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_sdfixed); } sOut.append('>'); rWrt.Strm().WriteOString( sOut ); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 94d4972adb47..b35d25dc7ab6 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -700,7 +700,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_width "=\""); if( nPercentWidth ) - sOut.append(static_cast<sal_Int32>(nPercentWidth)).append('%'); + sOut.append(OString::number(static_cast<sal_Int32>(nPercentWidth)) + "%"); else sOut.append(static_cast<sal_Int32>(aPixelSz.Width())); sOut.append("\""); @@ -711,7 +711,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_height "=\""); if( nPercentHeight ) - sOut.append(static_cast<sal_Int32>(nPercentHeight)).append('%'); + sOut.append(OString::number(static_cast<sal_Int32>(nPercentHeight)) + "%"); else sOut.append(static_cast<sal_Int32>(aPixelSz.Height())); sOut.append("\""); @@ -1521,7 +1521,7 @@ SwHTMLWriter& OutHTML_BulletImage( SwHTMLWriter& rWrt, OStringBuffer sOut; if( pTag ) - sOut.append('<').append(pTag); + sOut.append(OString::Concat("<") + pTag); sOut.append(' '); sOut.append(OOO_STRING_SVTOOLS_HTML_O_style "=\""); @@ -1609,8 +1609,7 @@ static SwHTMLWriter & OutHTML_FrameFormatAsMulticol( SwHTMLWriter& rWrt, if( rWrt.m_bLFPossible ) rWrt.OutNewLine(); - OStringBuffer sOut; - sOut.append('<').append(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol); + OStringBuffer sOut("<" + rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol); const SwFormatCol& rFormatCol = rFrameFormat.GetCol(); @@ -1717,8 +1716,7 @@ static SwHTMLWriter& OutHTML_FrameFormatAsDivOrSpan( SwHTMLWriter& rWrt, if( rWrt.m_bLFPossible ) rWrt.OutNewLine(); - OStringBuffer sOut; - sOut.append('<').append(rWrt.GetNamespace() + aTag); + OStringBuffer sOut("<" + rWrt.GetNamespace() + aTag); rWrt.Strm().WriteOString( sOut ); sOut.setLength(0); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 4a7df0582a3b..c9b1c01c6ef6 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1295,7 +1295,7 @@ SwHTMLWriter& OutHTML_FrameFormatOLENode( SwHTMLWriter& rWrt, const SwFrameForma css::text::WrapTextMode_THROUGH == rFrameFormat.GetSurround().GetSurround() ) { // A HIDDEN plug-in - sOut.append(' ').append(OOO_STRING_SW_HTML_O_Hidden); + sOut.append(" " OOO_STRING_SW_HTML_O_Hidden); nFrameOpts = HTML_FRMOPTS_HIDDEN_EMBED; bHiddenEmbed = true; } @@ -1354,7 +1354,7 @@ SwHTMLWriter& OutHTML_FrameFormatOLENode( SwHTMLWriter& rWrt, const SwFrameForma aAny = xSet->getPropertyValue("AppletIsScript"); aAny >>= bScript; if( bScript ) - sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_mayscript); + sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_mayscript); nFrameOpts = bInCntnr ? HTML_FRMOPTS_APPLET_CNTNR : HTML_FRMOPTS_APPLET; diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 9d546c95f37b..17a7874a7d28 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -379,7 +379,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_width "=\""); if( nPercentWidth != SAL_MAX_UINT32 ) { - sOut.append(static_cast<sal_Int32>(nPercentWidth)).append('%'); + sOut.append(OString::number(static_cast<sal_Int32>(nPercentWidth)) + "%"); } else { @@ -642,8 +642,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, if( rWrt.m_bLFPossible ) rWrt.OutNewLine(); // <TABLE> in new line - OStringBuffer sOut; - sOut.append('<').append(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_table); + OStringBuffer sOut("<" + rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_table); const SvxFrameDirection nOldDirection = rWrt.m_nDirection; if( pFrameFormat ) @@ -677,7 +676,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign, { sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_width "=\""); if( HasRelWidths() ) - sOut.append(static_cast<sal_Int32>(m_nTabWidth)).append('%'); + sOut.append(OString::number(static_cast<sal_Int32>(m_nTabWidth)) + "%"); else if( Application::GetDefaultDevice() ) { sal_Int32 nPixWidth = Application::GetDefaultDevice()->LogicToPixel( diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 05413a8d2eb6..6b7713795551 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -301,7 +301,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl unsigned char nSegmentType = (nSeg & 0xE000) >> 13; unsigned short nSegmentCount = nSeg & 0x03FF; - aSegmentInfo.append(';').append(static_cast<sal_Int32>(nSeg)); + aSegmentInfo.append(";" + OString::number(static_cast<sal_Int32>(nSeg))); switch (nSegmentType) { case msopathLineTo: @@ -534,7 +534,7 @@ sal_Int32 RtfSdrExport::StartShape() if (ESCHER_ShpInst_PictureFrame == m_nShapeType) impl_writeGraphic(); - m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHP); + m_rAttrOutput.RunText().append("{" OOO_STRING_SVTOOLS_RTF_SHP); m_rAttrOutput.RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPINST); @@ -669,7 +669,7 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj, TextTypes e bool bShape = eType == TXT_HFTXTBOX; if (bShape) - m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHPTXT).append(' '); + m_rAttrOutput.RunText().append("{" OOO_STRING_SVTOOLS_RTF_SHPTXT " "); for (sal_Int32 n = 0; n < nPara; ++n) { if (n) @@ -720,7 +720,7 @@ void RtfSdrExport::EndShape(sal_Int32 nShapeElement) if (nShapeElement >= 0) { // end of the shape - m_rAttrOutput.RunText().append('}').append('}'); + m_rAttrOutput.RunText().append("}}"); } } diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 4c9ea292bee7..9b1004ee526f 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1314,7 +1314,7 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl, weld::Button&, void) OUStringBuffer sFields; for(OUString & s : m_sFields) { - sFields.append(s).append(TOX_STYLE_DELIMITER); + sFields.append(s + OUStringChar(TOX_STYLE_DELIMITER)); } if(m_bNewEntry) { diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index f6119c8d2d82..dddfcbb31da7 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -91,7 +91,7 @@ static OUString lcl_GetRedlineHelp( const SwRangeRedline& rRedl, bool bBalloon, sBuf.append(" - "); sBuf.append(GetAppLangDateTimeString(rRedl.GetTimeStamp())); if( bBalloon && !rRedl.GetComment().isEmpty() ) - sBuf.append('\n').append(rRedl.GetComment()); + sBuf.append("\n" + rRedl.GetComment()); } return sBuf.makeStringAndClear(); } diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 2a57c099c93f..1d4f05b0e9da 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -139,30 +139,34 @@ void writeUTF8(OStringBuffer & rSink, sal_uInt32 nChar) if (nChar < 0x80) rSink.append(char(nChar)); else if (nChar < 0x800) - rSink.append(char(nChar >> 6 | 0xC0)) - .append(char((nChar & 0x3F) | 0x80)); + rSink.append(OStringChar(char(nChar >> 6 | 0xC0)) + + OStringChar(char((nChar & 0x3F) | 0x80))); else if (nChar < 0x10000) - rSink.append(char(nChar >> 12 | 0xE0)) - .append(char((nChar >> 6 & 0x3F) | 0x80)) - .append(char((nChar & 0x3F) | 0x80)); + rSink.append( + OStringChar(char(nChar >> 12 | 0xE0)) + + OStringChar(char((nChar >> 6 & 0x3F) | 0x80)) + + OStringChar(char((nChar & 0x3F) | 0x80))); else if (nChar < 0x200000) - rSink.append(char(nChar >> 18 | 0xF0)) - .append(char((nChar >> 12 & 0x3F) | 0x80)) - .append(char((nChar >> 6 & 0x3F) | 0x80)) - .append(char((nChar & 0x3F) | 0x80)); + rSink.append( + OStringChar(char(nChar >> 18 | 0xF0)) + + OStringChar(char((nChar >> 12 & 0x3F) | 0x80)) + + OStringChar(char((nChar >> 6 & 0x3F) | 0x80)) + + OStringChar(char((nChar & 0x3F) | 0x80))); else if (nChar < 0x4000000) - rSink.append(char(nChar >> 24 | 0xF8)) - .append(char((nChar >> 18 & 0x3F) | 0x80)) - .append(char((nChar >> 12 & 0x3F) | 0x80)) - .append(char((nChar >> 6 & 0x3F) | 0x80)) - .append(char((nChar & 0x3F) | 0x80)); + rSink.append( + OStringChar(char(nChar >> 24 | 0xF8)) + + OStringChar(char((nChar >> 18 & 0x3F) | 0x80)) + + OStringChar(char((nChar >> 12 & 0x3F) | 0x80)) + + OStringChar(char((nChar >> 6 & 0x3F) | 0x80)) + + OStringChar(char((nChar & 0x3F) | 0x80))); else - rSink.append(char(nChar >> 30 | 0xFC)) - .append(char((nChar >> 24 & 0x3F) | 0x80)) - .append(char((nChar >> 18 & 0x3F) | 0x80)) - .append(char((nChar >> 12 & 0x3F) | 0x80)) - .append(char((nChar >> 6 & 0x3F) | 0x80)) - .append(char((nChar & 0x3F) | 0x80)); + rSink.append( + OStringChar(char(nChar >> 30 | 0xFC)) + + OStringChar(char((nChar >> 24 & 0x3F) | 0x80)) + + OStringChar(char((nChar >> 18 & 0x3F) | 0x80)) + + OStringChar(char((nChar >> 12 & 0x3F) | 0x80)) + + OStringChar(char((nChar >> 6 & 0x3F) | 0x80)) + + OStringChar(char((nChar & 0x3F) | 0x80))); } bool translateUTF8Char(const char *& rBegin, diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 13b7e839c3e9..09f88e4db952 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -258,17 +258,14 @@ OUString FTPURL::ident(bool withslash,bool internal) const if((m_bShowPassword || internal) && !aPassword.isEmpty() ) - bff.append(':') - .append(aPassword); + bff.append(":" + aPassword); bff.append('@'); } bff.append(m_aHost); if( m_aPort != "21" ) - bff.append(':') - .append(m_aPort) - .append('/'); + bff.append(":" + m_aPort + "/"); else bff.append('/'); @@ -276,7 +273,7 @@ OUString FTPURL::ident(bool withslash,bool internal) const if(i == 0) bff.append(m_aPathSegmentVec[i]); else - bff.append('/').append(m_aPathSegmentVec[i]); + bff.append("/" + m_aPathSegmentVec[i]); if(withslash) if(!bff.isEmpty() && bff[bff.getLength()-1] != '/') bff.append('/'); @@ -303,8 +300,7 @@ OUString FTPURL::parent(bool internal) const aAccount); if((internal || m_bShowPassword) && !aPassword.isEmpty()) - bff.append(':') - .append(aPassword); + bff.append(":" + aPassword); bff.append('@'); } @@ -312,9 +308,7 @@ OUString FTPURL::parent(bool internal) const bff.append(m_aHost); if( m_aPort != "21" ) - bff.append(':') - .append(m_aPort) - .append('/'); + bff.append(":" + m_aPort + "/"); else bff.append('/'); @@ -326,7 +320,7 @@ OUString FTPURL::parent(bool internal) const else if(i == 0) bff.append(m_aPathSegmentVec[i]); else - bff.append('/').append(m_aPathSegmentVec[i]); + bff.append("/" + m_aPathSegmentVec[i]); if(last.isEmpty()) bff.append(".."); diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index ac747bd71aef..eb66017d98fa 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -951,7 +951,7 @@ namespace UScriptCode eScript = static_cast<UScriptCode>(script); OStringBuffer aBuf(unicode::getExemplarLanguageForUScriptCode(eScript)); if (const char* pScriptCode = uscript_getShortName(eScript)) - aBuf.append('-').append(pScriptCode); + aBuf.append(OStringChar('-') + pScriptCode); return OStringToOUString(aBuf, RTL_TEXTENCODING_UTF8); } } |