basic/source/uno/namecont.cxx | 5 - chart2/source/tools/ObjectIdentifier.cxx | 8 +- chart2/source/tools/PotentialRegressionCurveCalculator.cxx | 4 - comphelper/source/misc/errcode.cxx | 4 - configmgr/source/data.cxx | 3 connectivity/source/drivers/dbase/DIndex.cxx | 3 editeng/source/accessibility/AccessibleStaticTextBase.cxx | 3 extensions/source/abpilot/abpfinalpage.cxx | 4 - extensions/source/scanner/sanedlg.cxx | 8 +- fpicker/source/office/fileview.cxx | 7 + framework/source/fwe/classes/addonsoptions.cxx | 7 - sc/source/core/tool/chartarr.cxx | 7 - sc/source/core/tool/dbdata.cxx | 9 -- sc/source/filter/html/htmlexp2.cxx | 14 +-- sc/source/ui/miscdlgs/solveroptions.cxx | 16 ++-- sd/source/filter/html/htmlex.cxx | 15 +--- sfx2/source/appl/sfxhelp.cxx | 10 +- sfx2/source/control/listview.cxx | 8 +- sfx2/source/devtools/ObjectInspectorTreeHandler.cxx | 4 - sfx2/source/dialog/StyleList.cxx | 3 stoc/source/implementationregistration/implreg.cxx | 6 - stoc/source/uriproc/UriReferenceFactory.cxx | 36 +++------- stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx | 3 svtools/source/svhtml/htmlout.cxx | 12 +-- sw/source/core/doc/doc.cxx | 14 +-- sw/source/core/undo/unins.cxx | 32 ++++---- sw/source/filter/ww8/rtfattributeoutput.cxx | 10 +- sw/source/filter/ww8/wrtw8nds.cxx | 13 ++- sw/source/filter/xml/xmltble.cxx | 7 - sw/source/uibase/docvw/edtwin2.cxx | 4 - sw/source/uibase/uiview/srcview.cxx | 17 ++-- sw/source/uibase/uiview/view2.cxx | 3 ucb/source/core/ucbstore.cxx | 31 ++++---- ucb/source/ucp/hierarchy/hierarchycontent.cxx | 7 - ucb/source/ucp/package/pkgcontent.cxx | 7 - xmloff/source/core/xmlexp.cxx | 5 - xmloff/source/style/xmlexppr.cxx | 8 -- xmloff/source/text/txtparae.cxx | 17 +--- 38 files changed, 161 insertions(+), 213 deletions(-)
New commits: commit e810bd2b99777e192fb464572fa64a34bc0768fe Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu May 25 14:24:11 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu May 25 18:43:52 2023 +0200 merge some stringadds found with a lightly tweaked version of the loplugin:stringadd and some hand-holding. Change-Id: I146aadcaf665e98fea89a9cad2df4dc3935622f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index ca8beee5e74e..8c084d51a93c 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1788,10 +1788,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto sal_Int32 index = 0; do { - OUStringBuffer aTempTargetName( aTempTargetNameBase ); - aTempTargetName.append( index++ ); - - sTargetLibrariesStoreName = aTempTargetName.makeStringAndClear(); + sTargetLibrariesStoreName = aTempTargetNameBase + OUString::number( index++ ); if ( !i_rStorage->hasByName( sTargetLibrariesStoreName ) ) { break; diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index dae390073fc6..eed5cbe6a8b9 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -448,8 +448,8 @@ OUString ObjectIdentifier::createClassifiedIdentifierForParticles( if( eObjectType == OBJECTTYPE_UNKNOWN ) eObjectType = ObjectIdentifier::getObjectType( rParentParticle ); - OUStringBuffer aRet( m_aProtocol ); - aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString )); + OUStringBuffer aRet( m_aProtocol + + lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString )); if(aRet.getLength() > m_aProtocol.getLength()) aRet.append("/"); @@ -577,8 +577,8 @@ OUString ObjectIdentifier::createClassifiedIdentifierWithParent( { //e.g. "MultiClick/Series=2:Point=34" - OUStringBuffer aRet( m_aProtocol ); - aRet.append( lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString )); + OUStringBuffer aRet( m_aProtocol + + lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString )); if(aRet.getLength() > m_aProtocol.getLength()) aRet.append("/"); aRet.append(rParentPartical); diff --git a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx index 01aa5b2548fb..504048641b59 100644 --- a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx +++ b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx @@ -174,8 +174,8 @@ OUString PotentialRegressionCurveCalculator::ImplGetRepresentation( } if( m_fSlope != 0.0 ) // add slope value { - aTmpBuf.append( mXName + "^" ); - aTmpBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength )); + aTmpBuf.append( mXName + "^" + + getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope, pValueLength )); } addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth ); } diff --git a/comphelper/source/misc/errcode.cxx b/comphelper/source/misc/errcode.cxx index b8d8230d0a7a..77d58ac364be 100644 --- a/comphelper/source/misc/errcode.cxx +++ b/comphelper/source/misc/errcode.cxx @@ -144,9 +144,7 @@ COMPHELPER_DLLPUBLIC OUString ErrCode::toString() const pClass = u"Compiler"; break; } - buf.append(OUString::Concat(" Class:") + pClass); - - buf.append(" Code:" + OUString::number(GetCode())); + buf.append(OUString::Concat(" Class:") + pClass + " Code:" + OUString::number(GetCode())); } buf.append(")"); return buf.makeStringAndClear(); diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx index b0cad8042962..dd15026c17de 100644 --- a/configmgr/source/data.cxx +++ b/configmgr/source/data.cxx @@ -220,8 +220,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation( return p; } if (canonicRepresentation != nullptr) { - canonic.append('/'); - canonic.append(createSegment(templateName, seg)); + canonic.append("/" + createSegment(templateName, seg)); } if (path != nullptr) { path->push_back(seg); diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index 89013ab58481..cc489ad77c54 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -387,8 +387,7 @@ void ODbaseIndex::createINFEntry() bool bCase = isCaseSensitive(); while (aNewEntry.isEmpty()) { - aNewEntry = OString("NDX"); - aNewEntry += OString::number(++nSuffix); + aNewEntry = "NDX" + OString::number(++nSuffix); for (sal_uInt16 i = 0; i < aInfFile.GetKeyCount(); i++) { aKeyName = aInfFile.GetKeyName(i); diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index 93fcb9e997e4..954117189798 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -701,8 +701,7 @@ namespace accessibility // paragraphs inbetween are fully included for( ; i<aEndIndex.nPara; ++i ) { - aRes.append(cNewLine); - aRes.append(mpImpl->GetParagraph(i).getText()); + aRes.append(OUStringChar(cNewLine) + mpImpl->GetParagraph(i).getText()); } if( i<=aEndIndex.nPara ) diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 045a66d3f211..78756b28b5eb 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -95,8 +95,8 @@ namespace abp INetURLObject aURL( rSettings.sDataSourceName ); if( aURL.GetProtocol() == INetProtocol::NotValid ) { - OUString sPath = SvtPathOptions().GetWorkPath(); - sPath += "/" + rSettings.sDataSourceName; + OUString sPath = SvtPathOptions().GetWorkPath() + + "/" + rSettings.sDataSourceName; std::shared_ptr<const SfxFilter> pFilter = lcl_getBaseFilter(); if ( pFilter ) diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 35f2b37d63c7..f186d6c5ed27 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -1033,8 +1033,8 @@ void SaneDlg::EstablishQuantumRange() mxQuantumRangeBox->set_active_text( OUString( pBuf, strlen(pBuf), osl_getThreadTextEncoding() ) ); } mxQuantumRangeBox->show(); - OUString aText( mrSane.GetOptionName( mnCurrentOption ) + " " ); - aText += mrSane.GetOptionUnitName( mnCurrentOption ); + OUString aText = mrSane.GetOptionName( mnCurrentOption ) + " " + + mrSane.GetOptionUnitName( mnCurrentOption ); mxOptionDescTxt->set_label(aText); mxOptionDescTxt->show(); } @@ -1050,8 +1050,8 @@ void SaneDlg::EstablishNumericOption() return; char pBuf[256]; - OUString aText( mrSane.GetOptionName( mnCurrentOption ) + " " ); - aText += mrSane.GetOptionUnitName( mnCurrentOption ); + OUString aText = mrSane.GetOptionName( mnCurrentOption ) + " " + + mrSane.GetOptionUnitName( mnCurrentOption ); if( mfMin != mfMax ) { o3tl::sprintf( pBuf, " < %g ; %g >", mfMin, mfMax ); diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx index 2568779b6bfe..4e3b5e2b50a9 100644 --- a/fpicker/source/office/fileview.cxx +++ b/fpicker/source/office/fileview.cxx @@ -409,10 +409,11 @@ namespace nDec = 3; } - OUString aSizeStr( ::rtl::math::doubleToUString( fSize, + OUString aSizeStr = + ::rtl::math::doubleToUString( fSize, rtl_math_StringFormat_F, nDec, - SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) ); - aSizeStr += aUnitStr; + SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) + + aUnitStr; return aSizeStr; } diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 5aa0638481e8..eb49e5778350 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -923,12 +923,7 @@ void AddonsOptions_Impl::ReadImages( ImageManager& aImageManager ) OUString AddonsOptions_Impl::GeneratePrefixURL() { // Create a unique prefixed Add-On popup menu URL so it can be identified later as a runtime popup menu. - OUString aPopupMenuURL; - OUStringBuffer aBuf( m_aRootAddonPopupMenuURLPrexfix.getLength() + 3 ); - aBuf.append( m_aRootAddonPopupMenuURLPrexfix ); - aBuf.append( ++m_nRootAddonPopupMenuId ); - aPopupMenuURL = aBuf.makeStringAndClear(); - return aPopupMenuURL; + return m_aRootAddonPopupMenuURLPrexfix + OUString::number( ++m_nRootAddonPopupMenuId ); } void AddonsOptions_Impl::ReadMenuMergeInstructions( MergeMenuInstructionContainer& aContainer ) diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index e9e277601fed..58f1b1221502 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -253,11 +253,8 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle() } if (aString.isEmpty()) { - OUStringBuffer aBuf; - aBuf.append(ScResId(STR_ROW)); - aBuf.append(' '); - aBuf.append(static_cast<sal_Int32>(aRows[nRow]+1)); - aString = aBuf.makeStringAndClear(); + aString = ScResId(STR_ROW) + " " + + OUString::number(static_cast<sal_Int32>(aRows[nRow]+1)); } pMemChart->SetRowText( nRow, aString); } diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 293bb20a4976..d6f2a91b2256 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -260,14 +260,9 @@ ScDBData::~ScDBData() OUString ScDBData::GetSourceString() const { - OUStringBuffer aBuf; if (mpImportParam->bImport) - { - aBuf.append(mpImportParam->aDBName); - aBuf.append('/'); - aBuf.append(mpImportParam->aStatement); - } - return aBuf.makeStringAndClear(); + return mpImportParam->aDBName + "/" + mpImportParam->aStatement; + return OUString(); } OUString ScDBData::GetOperations() const diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index 165dc1be06db..380a58bc24c3 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -112,16 +112,16 @@ void ScHTMLExport::FillGraphList( const SdrPage* pPage, SCTAB nTab, void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE ) { SdrObject* pObject = pE->pObject; - OStringBuffer aBuf; - 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()))); + OStringBuffer aBuf = + " " OOO_STRING_SVTOOLS_HTML_O_width "=" + + OString::number(static_cast<sal_Int32>(pE->aSize.Width())) + + " " OOO_STRING_SVTOOLS_HTML_O_height "=" + + OString::number(static_cast<sal_Int32>(pE->aSize.Height())); if ( pE->bInCell ) { 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.Width())) + + " " OOO_STRING_SVTOOLS_HTML_O_vspace "=" + OString::number(static_cast<sal_Int32>(pE->aSpace.Height()))); } OString aOpt = aBuf.makeStringAndClear(); diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 3541084906cc..3d5b2b47c178 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -208,10 +208,10 @@ void ScSolverOptionsDialog::FillListBox() if (aValue >>= fDoubleValue) m_aOptions.back()->SetDoubleValue(fDoubleValue); - OUString sTxt = aVisName + ": "; - sTxt += rtl::math::doubleToUString(fDoubleValue, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::getLocaleData().getNumDecimalSep()[0], true ); + OUString sTxt = aVisName + ": " + + rtl::math::doubleToUString(fDoubleValue, + rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, + ScGlobal::getLocaleData().getNumDecimalSep()[0], true ); m_xLbSettings->set_text(nPos, sTxt, 0); } @@ -264,10 +264,10 @@ void ScSolverOptionsDialog::EditOption() { pStringItem->SetDoubleValue(m_xValDialog->GetValue()); - OUString sTxt(pStringItem->GetText() + ": "); - sTxt += rtl::math::doubleToUString(pStringItem->GetDoubleValue(), - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - ScGlobal::getLocaleData().getNumDecimalSep()[0], true ); + OUString sTxt(pStringItem->GetText() + ": " + + rtl::math::doubleToUString(pStringItem->GetDoubleValue(), + rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, + ScGlobal::getLocaleData().getNumDecimalSep()[0], true )); m_xLbSettings->set_text(nEntry, sTxt, 0); } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 37e41a594aec..7c526539d9ee 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1412,10 +1412,8 @@ OUString HtmlExport::ParagraphToHTMLString( SdrOutliner const * pOutliner, sal_I SfxItemSet aSet( rEditEngine.GetAttribs( aSelection ) ); - OUString aPortion(StringToHTMLString(rEditEngine.GetText( aSelection ))); - - aStr.append(TextAttribToHTMLString( &aSet, &aState, rBackgroundColor )); - aStr.append(aPortion); + aStr.append(TextAttribToHTMLString( &aSet, &aState, rBackgroundColor ) + + StringToHTMLString(rEditEngine.GetText( aSelection ))); nPos1 = nPos2; } @@ -1569,9 +1567,9 @@ bool HtmlExport::CreateHtmlForPresPages() } // HTML Head - OUStringBuffer aStr(gaHTMLHeader); - aStr.append(CreateMetaCharset()); - aStr.append(" <title>" + StringToHTMLString(maPageNames[nSdPage]) + "</title>\r\n"); + OUStringBuffer aStr(gaHTMLHeader + + CreateMetaCharset() + + " <title>" + StringToHTMLString(maPageNames[nSdPage]) + "</title>\r\n"); // insert timing information pPage = maPages[ nSdPage ]; @@ -2612,8 +2610,7 @@ OUString HtmlExport::CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const // to Index page if (mbContentsPage) { - aStr.append(CreateLink(maIndex, aStrNavContent)); - aStr.append(' '); + aStr.append(CreateLink(maIndex, aStrNavContent) + " "); } // Text/Graphics diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 203e81eaa3b5..507a00c4e2ae 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -510,11 +510,11 @@ OUString SfxHelp::CreateHelpURL_Impl( const OUString& aCommandURL, const OUStrin aHelpURL.append("/start"); else { - aHelpURL.append('/'); - aHelpURL.append(rtl::Uri::encode(aCommandURL, - rtl_UriCharClassRelSegment, - rtl_UriEncodeKeepEscapes, - RTL_TEXTENCODING_UTF8)); + aHelpURL.append("/" + + rtl::Uri::encode(aCommandURL, + rtl_UriCharClassRelSegment, + rtl_UriEncodeKeepEscapes, + RTL_TEXTENCODING_UTF8)); OUStringBuffer aTempURL = aHelpURL; AppendConfigToken( aTempURL, true ); diff --git a/sfx2/source/control/listview.cxx b/sfx2/source/control/listview.cxx index ca3818ab9d70..579e7463611e 100644 --- a/sfx2/source/control/listview.cxx +++ b/sfx2/source/control/listview.cxx @@ -393,10 +393,10 @@ static OUString getDisplayFileSize(const OUString& rURL) nDec = 3; } - OUString aSizeStr( - ::rtl::math::doubleToUString(fSize, rtl_math_StringFormat_F, nDec, - SvtSysLocale().GetLocaleData().getNumDecimalSep()[0])); - aSizeStr += aUnitStr; + OUString aSizeStr + = ::rtl::math::doubleToUString(fSize, rtl_math_StringFormat_F, nDec, + SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]) + + aUnitStr; return aSizeStr; } diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx index d99fa2388f99..c5aa79c2d036 100644 --- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx +++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx @@ -654,8 +654,8 @@ public: { int nLength = mxIdlArray->getLen(maAny); - OUString aType = getAnyType(maAny).replaceAll(u"[]", u""); - aType += u"[" + OUString::number(nLength) + u"]"; + OUString aType + = getAnyType(maAny).replaceAll(u"[]", u"") + u"[" + OUString::number(nLength) + u"]"; OUString aValue = SfxResId(STR_PROPERTY_VALUE_SEQUENCE).replaceFirst("%1", OUString::number(nLength)); diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 27481e062590..0247e01e7340 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -1341,8 +1341,7 @@ void StyleList::DeleteHdl() weld::TreeView* pTreeView = m_xTreeBox->get_visible() ? m_xTreeBox.get() : m_xFmtLb.get(); const SfxStyleFamilyItem* pItem = GetFamilyItem(); - OUStringBuffer aMsg; - aMsg.append(SfxResId(STR_DELETE_STYLE_USED) + SfxResId(STR_DELETE_STYLE)); + OUStringBuffer aMsg(SfxResId(STR_DELETE_STYLE_USED) + SfxResId(STR_DELETE_STYLE)); pTreeView->selected_foreach( [this, pTreeView, pItem, &aList, &bUsedStyle, &aMsg](weld::TreeIter& rEntry) { diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 9efdc32850dd..0f711b7dcf63 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -517,9 +517,9 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest, hasSubKeys = true; OUString linkTarget = xKey->getLinkTarget(relativKey); - OUString linkName(xKey->getKeyName().copy(xUnoKey->getKeyName().getLength())); - - linkName += "/" + relativKey; + OUString linkName( + OUString::Concat(xKey->getKeyName().subView(xUnoKey->getKeyName().getLength())) + + "/" + relativKey); if (bRegister) { diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx index 39b9229633ca..6b78fa079d15 100644 --- a/stoc/source/uriproc/UriReferenceFactory.cxx +++ b/stoc/source/uriproc/UriReferenceFactory.cxx @@ -424,8 +424,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( auto const path = uriReference->getPath(); auto [segments, proc] = processSegments(path, {}, true); if (proc) { - OUStringBuffer abs(uriReference->getScheme()); - abs.append(':'); + OUStringBuffer abs(uriReference->getScheme() + ":"); if (uriReference->hasAuthority()) { abs.append("//" + uriReference->getAuthority()); } @@ -454,12 +453,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( abs.append(i.segment); } if (uriReference->hasQuery()) { - abs.append('?'); - abs.append(uriReference->getQuery()); + abs.append("?" + uriReference->getQuery()); } if (uriReference->hasFragment()) { - abs.append('#'); - abs.append(uriReference->getFragment()); + abs.append("#" + uriReference->getFragment()); } return parse(abs.makeStringAndClear()); } @@ -467,28 +464,23 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( return clone(uriReference); } else if (!uriReference->hasAuthority() && uriReference->getPath().isEmpty()) { - OUStringBuffer abs(baseUriReference->getScheme()); - abs.append(':'); + OUStringBuffer abs(baseUriReference->getScheme() + ":"); if (baseUriReference->hasAuthority()) { abs.append("//" + baseUriReference->getAuthority()); } abs.append(baseUriReference->getPath()); if (uriReference->hasQuery()) { - abs.append('?'); - abs.append(uriReference->getQuery()); + abs.append("?" + uriReference->getQuery()); } else if (baseUriReference->hasQuery()) { - abs.append('?'); - abs.append(baseUriReference->getQuery()); + abs.append("?" + baseUriReference->getQuery()); } if (uriReference->hasFragment()) { - abs.append('#'); - abs.append(uriReference->getFragment()); + abs.append("#" + uriReference->getFragment()); } return parse(abs.makeStringAndClear()); } else { OUStringBuffer abs(128); - abs.append(baseUriReference->getScheme()); - abs.append(':'); + abs.append(baseUriReference->getScheme() + ":"); if (uriReference->hasAuthority()) { abs.append("//" + uriReference->getAuthority()); } else if (baseUriReference->hasAuthority()) { @@ -568,12 +560,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( } } if (uriReference->hasQuery()) { - abs.append('?'); - abs.append(uriReference->getQuery()); + abs.append("?" + uriReference->getQuery()); } if (uriReference->hasFragment()) { - abs.append('#'); - abs.append(uriReference->getFragment()); + abs.append("#" + uriReference->getFragment()); } return parse(abs.makeStringAndClear()); } @@ -690,12 +680,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative( } } if (!omitQuery && uriReference->hasQuery()) { - rel.append('?'); - rel.append(uriReference->getQuery()); + rel.append("?" + uriReference->getQuery()); } if (uriReference->hasFragment()) { - rel.append('#'); - rel.append(uriReference->getFragment()); + rel.append("#" + uriReference->getFragment()); } return parse(rel.makeStringAndClear()); } diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx index a8203a811ce0..1f533516935b 100644 --- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx +++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx @@ -293,8 +293,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value) newPath.append(m_base.m_path.subView(0, i)); if (!bExistent) { newPath.append( m_base.m_path.indexOf('?') < 0 ? '?' : '&' ); - newPath.append(encodeNameOrParamFragment(key)); - newPath.append('='); + newPath.append(encodeNameOrParamFragment(key) + "="); } newPath.append(encodeNameOrParamFragment(value)); if (bExistent) { diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 1c2856050d0f..4f027b0c10de 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -605,12 +605,12 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, if( rOutName.isEmpty() ) return rStream; - OStringBuffer sOut; - sOut.append(OString::Concat("<") + - OOO_STRING_SVTOOLS_HTML_map - " " - OOO_STRING_SVTOOLS_HTML_O_name - "=\""); + OStringBuffer sOut = + OString::Concat("<") + + OOO_STRING_SVTOOLS_HTML_map + " " + OOO_STRING_SVTOOLS_HTML_O_name + "=\""; rStream.WriteOString( sOut ); sOut.setLength(0); Out_String( rStream, rOutName ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 5c686f1f8c3a..7d7d1e250bff 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -567,21 +567,21 @@ static void lcl_FormatPostIt( pIDCO->SplitNode( *aPam.GetPoint(), false ); } - OUString aStr( SwViewShell::GetShellRes()->aPostItPage ); - aStr += sTmp + + OUString aStr = SwViewShell::GetShellRes()->aPostItPage + + sTmp + OUString::number( nPageNo ) + " "; if( nLineNo ) { - aStr += SwViewShell::GetShellRes()->aPostItLine; - aStr += sTmp + + aStr += SwViewShell::GetShellRes()->aPostItLine + + sTmp + OUString::number( nLineNo ) + " "; } - aStr += SwViewShell::GetShellRes()->aPostItAuthor; - aStr += sTmp + pField->GetPar1() + " "; SvtSysLocale aSysLocale; - aStr += /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() ); + aStr += SwViewShell::GetShellRes()->aPostItAuthor + + sTmp + pField->GetPar1() + " " + + /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() ); if(pField->GetResolved()) aStr += " " + SwResId(STR_RESOLVED); pIDCO->InsertString( aPam, aStr ); diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 29eb0408d5bc..a9e75f7f8140 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -535,31 +535,31 @@ MakeUndoReplaceRewriter(sal_uLong const occurrences, aResult.AddRule(UndoArg1, OUString::number(occurrences)); aResult.AddRule(UndoArg2, SwResId(STR_OCCURRENCES_OF)); - OUString aTmpStr = SwResId(STR_START_QUOTE); - aTmpStr += ShortenString(sOld, nUndoStringLength, - SwResId(STR_LDOTS)); - aTmpStr += SwResId(STR_END_QUOTE); + OUString aTmpStr = + SwResId(STR_START_QUOTE) + + ShortenString(sOld, nUndoStringLength, SwResId(STR_LDOTS)) + + SwResId(STR_END_QUOTE); aResult.AddRule(UndoArg3, aTmpStr); } else if (1 == occurrences) { { - OUString aTmpStr = SwResId(STR_START_QUOTE); // #i33488 # - aTmpStr += ShortenString(sOld, nUndoStringLength, - SwResId(STR_LDOTS)); - aTmpStr += SwResId(STR_END_QUOTE); + OUString aTmpStr = + SwResId(STR_START_QUOTE) + + ShortenString(sOld, nUndoStringLength, SwResId(STR_LDOTS)) + + SwResId(STR_END_QUOTE); aResult.AddRule(UndoArg1, aTmpStr); } aResult.AddRule(UndoArg2, SwResId(STR_YIELDS)); { - OUString aTmpStr = SwResId(STR_START_QUOTE); // #i33488 # - aTmpStr += ShortenString(sNew, nUndoStringLength, - SwResId(STR_LDOTS)); - aTmpStr += SwResId(STR_END_QUOTE); + OUString aTmpStr = + SwResId(STR_START_QUOTE) + + ShortenString(sNew, nUndoStringLength, SwResId(STR_LDOTS)) + + SwResId(STR_END_QUOTE); aResult.AddRule(UndoArg3, aTmpStr); } } @@ -998,10 +998,10 @@ SwRewriter SwUndoInsertLabel::CreateRewriter(const OUString &rStr) if (!rStr.isEmpty()) { - aTmpStr += SwResId(STR_START_QUOTE); - aTmpStr += ShortenString(rStr, nUndoStringLength, - SwResId(STR_LDOTS)); - aTmpStr += SwResId(STR_END_QUOTE); + aTmpStr = + SwResId(STR_START_QUOTE) + + ShortenString(rStr, nUndoStringLength, SwResId(STR_LDOTS)) + + SwResId(STR_END_QUOTE); } aRewriter.AddRule(UndoArg1, aTmpStr); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 1780a6182fdf..59ed71f198bc 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -198,8 +198,7 @@ static OString OutBorderLine(RtfExport const& rExport, const editeng::SvxBorderL const char* pStr, sal_uInt16 nDist, SvxShadowLocation eShadowLocation = SvxShadowLocation::NONE) { - OStringBuffer aRet; - aRet.append(OutTBLBorderLine(rExport, pLine, pStr)); + OStringBuffer aRet(OutTBLBorderLine(rExport, pLine, pStr)); if (pLine) { aRet.append(OOO_STRING_SVTOOLS_RTF_BRSP + OString::number(static_cast<sal_Int32>(nDist))); @@ -528,10 +527,9 @@ void RtfAttributeOutput::StartRuby(const SwTextNode& rNode, sal_Int32 /*nPos*/, const SwFormatRuby& rRuby) { WW8Ruby aWW8Ruby(rNode, rRuby, GetExport()); - OUString aStr(FieldString(ww::eEQ) + "\\* jc"); - aStr += OUString::number(aWW8Ruby.GetJC()) + " \\* \"Font:" + aWW8Ruby.GetFontFamily() - + "\" \\* hps"; - aStr += OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + " \\o"; + OUString aStr = FieldString(ww::eEQ) + "\\* jc" + OUString::number(aWW8Ruby.GetJC()) + + " \\* \"Font:" + aWW8Ruby.GetFontFamily() + "\" \\* hps" + + OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + " \\o"; if (aWW8Ruby.GetDirective()) { aStr += "\\a" + OUStringChar(aWW8Ruby.GetDirective()); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 71f33f3a7d14..8b7a6195be1f 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -894,10 +894,15 @@ const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const void WW8AttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 /*nPos*/, const SwFormatRuby& rRuby ) { WW8Ruby aWW8Ruby(rNode, rRuby, GetExport()); - OUString aStr( FieldString( ww::eEQ ) + "\\* jc" ); - aStr += OUString::number(aWW8Ruby.GetJC()) + " \\* \"Font:" + aWW8Ruby.GetFontFamily() - + "\" \\* hps"; - aStr += OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + " \\o"; + OUString aStr = + FieldString( ww::eEQ ) + + "\\* jc" + + OUString::number(aWW8Ruby.GetJC()) + + " \\* \"Font:" + + aWW8Ruby.GetFontFamily() + + "\" \\* hps" + + OUString::number((aWW8Ruby.GetRubyHeight() + 5) / 10) + + " \\o"; if (aWW8Ruby.GetDirective()) { aStr += OUString::Concat(u"\\a") + OUStringChar(aWW8Ruby.GetDirective()); diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 31b24dc02005..b6a9cd1e9499 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -556,9 +556,9 @@ void SwXMLExport::ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol ) { SvXMLElementExport aElem( *this, XML_NAMESPACE_STYLE, XML_STYLE, true, true ); - OUStringBuffer sValue; if( rCol.GetWidthOpt() ) { + OUStringBuffer sValue; GetTwipUnitConverter().convertMeasureToXML( sValue, rCol.GetWidthOpt() ); AddAttribute( XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH, @@ -566,10 +566,9 @@ void SwXMLExport::ExportTableColumnStyle( const SwXMLTableColumn_Impl& rCol ) } if( rCol.GetRelWidth() ) { - sValue.append( static_cast<sal_Int32>(rCol.GetRelWidth()) ); - sValue.append( '*' ); + OUString sValue = OUString::number(static_cast<sal_Int32>(rCol.GetRelWidth()) ) + "*"; AddAttribute( XML_NAMESPACE_STYLE, XML_REL_COLUMN_WIDTH, - sValue.makeStringAndClear() ); + sValue ); } { diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 0efbd852df7d..bafd9570a726 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -492,8 +492,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) case IsAttrAtPos::RefMark: if(aContentAtPos.aFnd.pAttr) { - sText = SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) + ": "; - sText += static_cast<const SwFormatRefMark*>(aContentAtPos.aFnd.pAttr)->GetRefName(); + sText = SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) + ": " + + static_cast<const SwFormatRefMark*>(aContentAtPos.aFnd.pAttr)->GetRefName(); } break; diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 7cfce2b14438..0a936b67f311 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -421,12 +421,13 @@ void SwSrcView::GetState(SfxItemSet& rSet) break; case SID_TABLE_CELL: { - OUString aPos( SwResId(STR_SRCVIEW_ROW) ); TextSelection aSel = pTextView->GetSelection(); - aPos += OUString::number( aSel.GetEnd().GetPara()+1 ); - aPos += " : " + - SwResId(STR_SRCVIEW_COL); - aPos += OUString::number( aSel.GetEnd().GetIndex()+1 ); + OUString aPos = + SwResId(STR_SRCVIEW_ROW) + + OUString::number( aSel.GetEnd().GetPara()+1 ) + + " : " + + SwResId(STR_SRCVIEW_COL) + + OUString::number( aSel.GetEnd().GetIndex()+1 ); SvxStatusItem aItem( SID_TABLE_CELL, aPos, StatusCategory::RowColumn ); rSet.Put( aItem ); } @@ -475,8 +476,7 @@ void SwSrcView::GetState(SfxItemSet& rSet) nCount = rMgr.GetUndoActionCount(); if(nCount) { - OUString aStr(SvtResId( STR_UNDO)); - aStr += rMgr.GetUndoActionComment(--nCount); + OUString aStr = SvtResId( STR_UNDO) + rMgr.GetUndoActionComment(--nCount); rSet.Put(SfxStringItem(nWhich, aStr)); } else @@ -487,8 +487,7 @@ void SwSrcView::GetState(SfxItemSet& rSet) nCount = rMgr.GetRedoActionCount(); if(nCount) { - OUString aStr(SvtResId( STR_REDO)); - aStr += rMgr.GetRedoActionComment(--nCount); + OUString aStr = SvtResId( STR_REDO) + rMgr.GetRedoActionComment(--nCount); rSet.Put(SfxStringItem(nWhich,aStr)); } else diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 1df6910a2a20..45dcfddb0be4 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1967,8 +1967,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if( rShell.IsCursorInTable() ) { // table name + cell coordinate - sStr = rShell.GetTableFormat()->GetName() + ":"; - sStr += rShell.GetBoxNms(); + sStr = rShell.GetTableFormat()->GetName() + ":" + rShell.GetBoxNms(); eCategory = StatusCategory::TableCell; } else diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 882e0773ddd6..1aae1235c0f0 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -702,8 +702,7 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey, // Fill new item... // Set Values - OUString aKey = aOldValuesKey; - aKey += makeHierarchalNameSegment( rPropName ); + OUString aKey = aOldValuesKey + makeHierarchalNameSegment( rPropName ); // ... handle OUString aNewKey1 = aKey + aHandleKey; @@ -1122,8 +1121,8 @@ void SAL_CALL PersistentPropertySet::setPropertyValue( const OUString& aProperty m_pCreator->getRootConfigReadAccess(), UNO_QUERY ); if ( xRootHierNameAccess.is() ) { - OUString aFullPropName( getFullKeyImpl(aCGuard) + "/" ); - aFullPropName += makeHierarchalNameSegment( aPropertyName ); + OUString aFullPropName( getFullKeyImpl(aCGuard) + "/" + + makeHierarchalNameSegment( aPropertyName ) ); // Does property exist? if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) ) @@ -1213,8 +1212,8 @@ Any SAL_CALL PersistentPropertySet::getPropertyValue( m_pCreator->getRootConfigReadAccess(), UNO_QUERY ); if ( xNameAccess.is() ) { - OUString aFullPropName( getFullKeyImpl(aGuard) + "/" ); - aFullPropName += makeHierarchalNameSegment( PropertyName ) + "/Value"; + OUString aFullPropName( getFullKeyImpl(aGuard) + "/" + + makeHierarchalNameSegment( PropertyName ) + "/Value" ); try { return xNameAccess->getByHierarchicalName( aFullPropName ); @@ -1342,8 +1341,8 @@ void SAL_CALL PersistentPropertySet::addProperty( if ( xRootHierNameAccess.is() ) { aFullValuesName = getFullKeyImpl(aGuard); - OUString aFullPropName = aFullValuesName + "/"; - aFullPropName += makeHierarchalNameSegment( Name ); + OUString aFullPropName = aFullValuesName + "/" + + makeHierarchalNameSegment( Name ); if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) ) { @@ -1485,8 +1484,8 @@ void SAL_CALL PersistentPropertySet::removeProperty( const OUString& Name ) if ( xRootHierNameAccess.is() ) { OUString aFullValuesName = getFullKeyImpl(aGuard); - OUString aFullPropName = aFullValuesName + "/"; - aFullPropName += makeHierarchalNameSegment( Name ); + OUString aFullPropName = aFullValuesName + "/" + + makeHierarchalNameSegment( Name ); // Property in set? if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) ) @@ -1787,8 +1786,8 @@ void SAL_CALL PersistentPropertySet::setPropertyValues( { const OUString& rName = rNewValue.Name; - OUString aFullPropName = aFullPropNamePrefix; - aFullPropName += makeHierarchalNameSegment( rName ); + OUString aFullPropName = aFullPropNamePrefix + + makeHierarchalNameSegment( rName ); // Does property exist? if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) ) @@ -2096,8 +2095,8 @@ Property SAL_CALL PropertySetInfo_Impl::getPropertyByName( UNO_QUERY ); if ( xRootHierNameAccess.is() ) { - OUString aFullPropName( m_pOwner->getFullKey() + "/" ); - aFullPropName += makeHierarchalNameSegment( aName ); + OUString aFullPropName( m_pOwner->getFullKey() + "/" + + makeHierarchalNameSegment( aName ) ); // Does property exist? if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) ) @@ -2175,8 +2174,8 @@ sal_Bool SAL_CALL PropertySetInfo_Impl::hasPropertyByName( UNO_QUERY ); if ( xRootHierNameAccess.is() ) { - OUString aFullPropName( m_pOwner->getFullKey() + "/" ); - aFullPropName += makeHierarchalNameSegment( Name ); + OUString aFullPropName( m_pOwner->getFullKey() + "/" + + makeHierarchalNameSegment( Name ) ); return xRootHierNameAccess->hasByHierarchicalName( aFullPropName ); } diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 61a495267814..798ba88ea079 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -699,8 +699,8 @@ HierarchyContent::makeNewIdentifier( const OUString& rTitle ) // Assemble new content identifier... HierarchyUri aUri( m_xIdentifier->getContentIdentifier() ); - OUString aNewURL = aUri.getParentUri() + "/"; - aNewURL += ::ucb_impl::urihelper::encodeSegment( rTitle ); + OUString aNewURL = aUri.getParentUri() + "/" + + ::ucb_impl::urihelper::encodeSegment( rTitle ); return uno::Reference< ucb::XContentIdentifier >( new ::ucbhelper::ContentIdentifier( aNewURL ) ); @@ -1348,8 +1348,7 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, do { - OUString aNewId = xId->getContentIdentifier() + "_"; - aNewId += OUString::number( ++nTry ); + OUString aNewId = xId->getContentIdentifier() + "_" + OUString::number( ++nTry ); xId = new ::ucbhelper::ContentIdentifier( aNewId ); } while ( hasData( xId ) && ( nTry < 1000 ) ); diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 8bf7e4bc2873..a0cff94b9c4b 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -1259,8 +1259,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues( uno::Reference< ucb::XContentIdentifier > xOldId = m_xIdentifier; // Assemble new content identifier... - OUString aNewURL = m_aUri.getParentUri() + "/"; - aNewURL += ::ucb_impl::urihelper::encodeSegment( aNewTitle ); + OUString aNewURL = m_aUri.getParentUri() + "/" + + ::ucb_impl::urihelper::encodeSegment( aNewTitle ); uno::Reference< ucb::XContentIdentifier > xNewId = new ::ucbhelper::ContentIdentifier( aNewURL ); @@ -1538,8 +1538,7 @@ void Content::insert( do { - OUString aNew = aNewUri.getUri() + "_"; - aNew += OUString::number( ++nTry ); + OUString aNew = aNewUri.getUri() + "_" + OUString::number( ++nTry ); aNewUri.setUri( aNew ); } while ( hasData( aNewUri ) && ( nTry < 1000 ) ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index f98ad0540896..03277884ae0b 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -876,12 +876,9 @@ SvXMLExport::EnsureNamespace(OUString const & i_rNamespace) sPrefix = aPreferredPrefix; nKey = GetNamespaceMap_().GetKeyByPrefix( sPrefix ); sal_Int32 n( 0 ); - OUStringBuffer buf; while( nKey != USHRT_MAX ) { - buf.append( aPreferredPrefix ); - buf.append( ++n ); - sPrefix = buf.makeStringAndClear(); + sPrefix = aPreferredPrefix + OUString::number(++n); nKey = GetNamespaceMap_().GetKeyByPrefix( sPrefix ); } diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 4cb8e7b05150..b296ee8e9d98 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -965,7 +965,6 @@ void SvXMLExportPropertyMapper::_exportXML( const uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() ); - OUStringBuffer sNameBuffer; xml::AttributeData aData; for( const auto& rAttribName : aAttribNames ) { @@ -1008,9 +1007,7 @@ void SvXMLExportPropertyMapper::_exportXML( OUString sOrigPrefix( sPrefix ); do { - sNameBuffer.append( sOrigPrefix ); - sNameBuffer.append( ++n ); - sPrefix = sNameBuffer.makeStringAndClear(); + sPrefix = sOrigPrefix + OUString::number( ++n ); nKey = pNamespaceMap->GetKeyByPrefix( sPrefix ); } while( nKey != USHRT_MAX ); @@ -1024,8 +1021,7 @@ void SvXMLExportPropertyMapper::_exportXML( sPrefix = pNamespaceMap->GetPrefixByKey( nKey ); } // In any case, the attribute name has to be adapted. - sNameBuffer.append(sPrefix + ":" + rAttribName.subView(nColonPos+1)); - sAttribName = sNameBuffer.makeStringAndClear(); + sAttribName = sPrefix + ":" + rAttribName.subView(nColonPos+1); } if( bAddNamespace ) diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index d621d2c75cd6..e5344665b5e6 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1201,10 +1201,9 @@ void XMLTextParagraphExport::exportListChange( { if ( rNextInfo.HasStartValue() ) { - OUStringBuffer aBuffer; - aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetStartValue()) ); + OUString aTmp = OUString::number( static_cast<sal_Int32>(rNextInfo.GetStartValue()) ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, - aBuffer.makeStringAndClear() ); + aTmp ); } else if (bRestartNumberingAtContinuedList) { @@ -1276,19 +1275,15 @@ void XMLTextParagraphExport::exportListChange( GetExport().CheckAttrList(); if( rNextInfo.HasStartValue() ) { - OUStringBuffer aBuffer; - aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetStartValue()) ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, - aBuffer.makeStringAndClear() ); + OUString aTmp = OUString::number( static_cast<sal_Int32>(rNextInfo.GetStartValue()) ); + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aTmp ); } // Handle restart without start value on list level 1 (#i103745#) else if ( rNextInfo.IsRestart() && /*!rNextInfo.HasStartValue() &&*/ rNextInfo.GetLevel() == 1 ) { - OUStringBuffer aBuffer; - aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetListLevelStartValue()) ); - GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, - aBuffer.makeStringAndClear() ); + OUString aTmp = OUString::number( static_cast<sal_Int32>(rNextInfo.GetListLevelStartValue()) ); + GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aTmp ); } if ( ( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) && GetExport().getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012)