bridges/source/jni_uno/jni_info.cxx | 4 chart2/qa/extras/chart2dump/chart2dump.cxx | 4 chart2/qa/extras/xshape/chart2xshape.cxx | 5 - chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx | 2 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx | 2 compilerplugins/clang/stringview.cxx | 2 compilerplugins/clang/test/stringview.cxx | 4 configmgr/source/winreg.cxx | 2 connectivity/source/drivers/firebird/PreparedStatement.cxx | 2 connectivity/source/drivers/firebird/Util.cxx | 2 connectivity/source/drivers/mysql_jdbc/YTables.cxx | 2 connectivity/source/parse/sqlnode.cxx | 2 cppu/source/uno/lbenv.cxx | 2 cui/source/dialogs/scriptdlg.cxx | 4 cui/source/options/personalization.cxx | 2 dbaccess/source/ui/dlg/dbwizsetup.cxx | 4 dbaccess/source/ui/dlg/directsql.cxx | 10 +- desktop/source/deployment/manager/dp_manager.cxx | 4 desktop/source/lib/init.cxx | 2 desktop/source/migration/migration.cxx | 4 desktop/source/pkgchk/unopkg/unopkg_app.cxx | 6 - desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 16 +-- desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 4 desktop/source/splash/splash.cxx | 4 framework/source/uielement/subtoolbarcontroller.cxx | 2 i18nlangtag/source/languagetag/languagetag.cxx | 2 i18npool/source/indexentry/indexentrysupplier.cxx | 4 i18npool/source/localedata/LocaleNode.cxx | 2 include/rtl/string.hxx | 10 +- include/rtl/stringconcat.hxx | 42 +++----- include/rtl/ustring.hxx | 10 +- l10ntools/source/po.cxx | 8 - lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx | 4 linguistic/source/dicimp.cxx | 2 oox/source/core/xmlfilterbase.cxx | 4 oox/source/export/drawingml.cxx | 12 +- oox/source/export/shapes.cxx | 2 oox/source/ole/vbaexport.cxx | 12 +- sal/qa/rtl/strings/test_oustring_compare.cxx | 4 sal/qa/rtl/textenc/rtl_textcvt.cxx | 34 +++---- sc/qa/extras/vba-macro-test.cxx | 2 sc/source/filter/excel/xecontent.cxx | 2 sc/source/filter/excel/xelink.cxx | 2 sd/qa/unit/import-tests.cxx | 2 sd/source/core/drawdoc3.cxx | 2 sd/source/filter/eppt/pptx-epptooxml.cxx | 20 ++-- sd/source/filter/html/htmlex.cxx | 4 sdext/source/presenter/PresenterHelpView.cxx | 2 sfx2/source/appl/newhelp.cxx | 4 sfx2/source/control/unoctitm.cxx | 2 sfx2/source/doc/guisaveas.cxx | 2 sfx2/source/view/classificationhelper.cxx | 2 shell/source/backends/desktopbe/desktopbackend.cxx | 2 shell/source/win32/jumplist/JumpList.cxx | 46 ++++----- stoc/source/implementationregistration/implreg.cxx | 16 +-- svl/source/misc/lockfilecommon.cxx | 2 svl/source/misc/msodocumentlockfile.cxx | 2 svl/source/numbers/zforlist.cxx | 2 svl/source/numbers/zformat.cxx | 4 svtools/source/dialogs/PlaceEditDialog.cxx | 2 svtools/source/dialogs/ServerDetailsControls.cxx | 2 svtools/source/svhtml/HtmlWriter.cxx | 4 svx/source/gallery2/gallery1.cxx | 2 svx/source/gallery2/gallerybinaryengineentry.cxx | 2 svx/source/tbxctrls/PaletteManager.cxx | 2 sw/qa/extras/globalfilter/globalfilter.cxx | 2 sw/qa/extras/uiwriter/uiwriter7.cxx | 2 sw/source/core/crsr/crossrefbookmark.cxx | 2 sw/source/core/edit/edfcol.cxx | 2 sw/source/filter/ascii/ascatr.cxx | 2 sw/source/filter/html/css1atr.cxx | 8 - sw/source/filter/html/htmlatr.cxx | 48 +++++----- sw/source/filter/html/htmldrawwriter.cxx | 2 sw/source/filter/html/htmlfldw.cxx | 4 sw/source/filter/html/htmlflywriter.cxx | 24 ++--- sw/source/filter/html/htmlforw.cxx | 8 - sw/source/filter/html/htmlftn.cxx | 10 +- sw/source/filter/html/htmlnumwriter.cxx | 6 - sw/source/filter/html/htmlplug.cxx | 18 +-- sw/source/filter/html/htmltabw.cxx | 42 ++++---- sw/source/filter/html/wrthtml.cxx | 18 +-- sw/source/filter/ww8/docxattributeoutput.cxx | 10 +- sw/source/filter/ww8/docxexport.cxx | 4 sw/source/filter/ww8/ww8par5.cxx | 2 sw/source/ui/dbui/dbinsdlg.cxx | 2 sw/source/ui/dbui/mmaddressblockpage.cxx | 2 sw/source/ui/index/cnttab.cxx | 2 ucb/source/ucp/hierarchy/hierarchyuri.cxx | 2 ucb/source/ucp/webdav-curl/CurlSession.cxx | 2 unoidl/source/unoidl-check.cxx | 4 unoidl/source/unoidl-read.cxx | 2 unotest/source/cpp/gettestargument.cxx | 2 unotest/source/cpp/macros_test.cxx | 4 vcl/source/app/brand.cxx | 6 - vcl/source/image/ImplImageTree.cxx | 2 vcl/source/window/dialog.cxx | 4 vcl/unx/generic/print/glyphset.cxx | 2 vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx | 2 writerfilter/qa/cppunittests/misc/misc.cxx | 2 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 2 writerperfect/qa/unit/ImportTest.cxx | 2 xmlsecurity/source/helper/documentsignaturehelper.cxx | 16 +-- 102 files changed, 322 insertions(+), 335 deletions(-)
New commits: commit 3d236177be255b2027a997bfc12fe0833ca9a2f7 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Oct 11 10:23:28 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Oct 11 12:46:01 2022 +0200 Deduplicate O(U)StringConcatenation And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index 4fd935987463..3dd00d01c24d 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -171,7 +171,7 @@ JNI_interface_type_info::JNI_interface_type_info( OString method_signature( sig_buf.makeStringAndClear() ); OString method_name( OUStringToOString( - rtl::OUStringConcatenation("get" + member_name), + rtl::Concat2View("get" + member_name), RTL_TEXTENCODING_JAVA_UTF8 ) ); m_methods[ nMethodIndex ] = jni->GetMethodID( static_cast<jclass>(jo_class.get()), method_name.getStr(), @@ -188,7 +188,7 @@ JNI_interface_type_info::JNI_interface_type_info( sig_buf.append( ")V" ); method_signature = sig_buf.makeStringAndClear(); method_name = OUStringToOString( - rtl::OUStringConcatenation("set" + member_name), + rtl::Concat2View("set" + member_name), RTL_TEXTENCODING_JAVA_UTF8 ); m_methods[ nMethodIndex ] = jni->GetMethodID( static_cast<jclass>(jo_class.get()), method_name.getStr(), diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx b/chart2/qa/extras/chart2dump/chart2dump.cxx index faaa3ccd9677..d3ec24de68e9 100644 --- a/chart2/qa/extras/chart2dump/chart2dump.cxx +++ b/chart2/qa/extras/chart2dump/chart2dump.cxx @@ -124,7 +124,7 @@ protected: { if (m_aReferenceFile.is_open()) m_aReferenceFile.close(); - OString sReferenceFile = OUStringToOString(OUStringConcatenation(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8); + OString sReferenceFile = OUStringToOString(Concat2View(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8); m_aReferenceFile.open(sReferenceFile.getStr(), std::ios_base::in); CPPUNIT_ASSERT_MESSAGE(OString("Can't open reference file: " + sReferenceFile).getStr(), m_aReferenceFile.is_open()); } @@ -132,7 +132,7 @@ protected: { if (m_aDumpFile.is_open()) m_aDumpFile.close(); - OString sDumpFile = OUStringToOString(OUStringConcatenation(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8); + OString sDumpFile = OUStringToOString(Concat2View(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8); m_aDumpFile.open(sDumpFile.getStr(), std::ios_base::out | std::ofstream::binary | std::ofstream::trunc); CPPUNIT_ASSERT_MESSAGE(OString("Can't open dump file: " + sDumpFile).getStr(), m_aDumpFile.is_open()); } diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx index 97a62f71f5a0..5088621725b4 100644 --- a/chart2/qa/extras/xshape/chart2xshape.cxx +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -89,9 +89,8 @@ void Chart2XShapeTest::compareAgainstReference(const OUString& rDump, { checkDumpAgainstFile( rDump, - OUStringConcatenation( - m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/") - + rReferenceFile), + Concat2View(m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/") + + rReferenceFile), OUStringToOString( m_directories.getPathFromSrc(u"/chart2/qa/extras/xshape/data/reference/tolerance.xml"), RTL_TEXTENCODING_UTF8) diff --git a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx index ffd1808dfd22..5e68235d14cd 100644 --- a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx +++ b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx @@ -175,7 +175,7 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation( addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth ); } - if ( std::u16string_view(aBuf) == OUStringConcatenation(mYName + " = ") ) + if ( std::u16string_view(aBuf) == Concat2View(mYName + " = ") ) aBuf.append( "0" ); return aBuf.makeStringAndClear(); diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx index 3d7f1c07601b..f8921d73c266 100644 --- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx +++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx @@ -381,7 +381,7 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation( } addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth ); } - if ( std::u16string_view(aBuf) == OUStringConcatenation( mYName + " = ") ) + if ( std::u16string_view(aBuf) == Concat2View( mYName + " = ") ) aBuf.append( "0" ); return aBuf.makeStringAndClear(); diff --git a/compilerplugins/clang/stringview.cxx b/compilerplugins/clang/stringview.cxx index 1be16fb89a4f..c1606908dbc7 100644 --- a/compilerplugins/clang/stringview.cxx +++ b/compilerplugins/clang/stringview.cxx @@ -264,7 +264,7 @@ void StringView::handleCXXConstructExpr(CXXConstructExpr const* expr) "instead of an %0%select{| constructed from a %2}1, pass a" " '%select{std::string_view|std::u16string_view}3'" "%select{| (or an '%select{rtl::OStringChar|rtl::OUStringChar}3')|" - " via '%select{rtl::OStringConcatenation|rtl::OUStringConcatenation}3'}4", + " via '%select{rtl::Concat2View|rtl::Concat2View}3'}4", expr->getExprLoc()) << expr->getType() << (argType.isNull() ? 0 : 1) << argType << (loplugin::TypeCheck(expr->getType()).Class("OString").Namespace("rtl").GlobalNamespace() diff --git a/compilerplugins/clang/test/stringview.cxx b/compilerplugins/clang/test/stringview.cxx index a2b07501a49e..f578a5f50e8d 100644 --- a/compilerplugins/clang/test/stringview.cxx +++ b/compilerplugins/clang/test/stringview.cxx @@ -167,7 +167,7 @@ void f5(char const* s1, sal_Int32 n1, char16_t const* s2, sal_Int32 n2, OString call_view(OString(std::string_view("foo"))); // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'OStringNumber<int>', pass a 'std::string_view' [loplugin:stringview]}} call_view(OString(OString::number(0))); - // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'typename std::enable_if_t<ToStringHelper<OString>::allowOStringConcat && ToStringHelper<OString>::allowOStringConcat, OStringConcat<OString, OString>{{ ?}}>' (aka 'rtl::OStringConcat<rtl::OString, rtl::OString>'), pass a 'std::string_view' via 'rtl::OStringConcatenation' [loplugin:stringview]}} + // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OString' constructed from a 'typename std::enable_if_t<ToStringHelper<OString>::allowOStringConcat && ToStringHelper<OString>::allowOStringConcat, OStringConcat<OString, OString>{{ ?}}>' (aka 'rtl::OStringConcat<rtl::OString, rtl::OString>'), pass a 'std::string_view' via 'rtl::Concat2View' [loplugin:stringview]}} call_view(OString(s3 + s3)); // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString', pass a 'std::u16string_view' [loplugin:stringview]}} call_view(OUString()); @@ -192,7 +192,7 @@ void f5(char const* s1, sal_Int32 n1, char16_t const* s2, sal_Int32 n2, OString call_view(OUString(std::u16string_view(u"foo"))); // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'OUStringNumber<int>', pass a 'std::u16string_view' [loplugin:stringview]}} call_view(OUString(OUString::number(0))); - // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'typename std::enable_if_t<ToStringHelper<OUString>::allowOUStringConcat && ToStringHelper<OUString>::allowOUStringConcat, OUStringConcat<OUString, OUString>{{ ?}}>' (aka 'rtl::OUStringConcat<rtl::OUString, rtl::OUString>'), pass a 'std::u16string_view' via 'rtl::OUStringConcatenation' [loplugin:stringview]}} + // expected-error-re@+1 {{instead of an '{{(rtl::)?}}OUString' constructed from a 'typename std::enable_if_t<ToStringHelper<OUString>::allowOUStringConcat && ToStringHelper<OUString>::allowOUStringConcat, OUStringConcat<OUString, OUString>{{ ?}}>' (aka 'rtl::OUStringConcat<rtl::OUString, rtl::OUString>'), pass a 'std::u16string_view' via 'rtl::Concat2View' [loplugin:stringview]}} call_view(OUString(s4 + s4)); (void)(s3 == l1); diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index 381150fc2d5e..0e90752d4d6d 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -238,7 +238,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil else { writeAttributeValue( - aFileHandle, OUStringConcatenation("/" + aNextPathPart)); + aFileHandle, Concat2View("/" + aNextPathPart)); } } else diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index fe30054ebda3..608d05c274e0 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -570,7 +570,7 @@ void OPreparedStatement::openBlobForWriting(isc_blob_handle& rBlobHandle, ISC_QU if (aErr) { evaluateStatusVector(m_statusVector, - OUStringConcatenation("setBlob failed on " + m_sSqlStatement), + Concat2View("setBlob failed on " + m_sSqlStatement), *this); assert(false); } diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index c015f2d47d14..a792e032939c 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -420,7 +420,7 @@ OUString firebird::escapeWith( const OUString& sText, const char aKey, const cha aIndex = sRet.indexOf(aKey, aIndex); if ( aIndex <= 0 || aIndex >= sRet.getLength()) break; - sRet = sRet.replaceAt(aIndex, 1, rtl::OUStringConcatenation(OUStringChar(aEscapeChar) + OUStringChar(aKey)) ); + sRet = sRet.replaceAt(aIndex, 1, rtl::Concat2View(OUStringChar(aEscapeChar) + OUStringChar(aKey)) ); aIndex += 2; } diff --git a/connectivity/source/drivers/mysql_jdbc/YTables.cxx b/connectivity/source/drivers/mysql_jdbc/YTables.cxx index c28f8e44ef76..0460053192c0 100644 --- a/connectivity/source/drivers/mysql_jdbc/YTables.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YTables.cxx @@ -153,7 +153,7 @@ OUString OTables::adjustSQL(const OUString& _sSql) sal_Int32 nPos = nIndex + strlen(s_sUNSIGNED); OUString sNewUnsigned(sSQL.copy(nPos, nParen - nPos + 1)); sSQL = sSQL.replaceAt(nIndex, strlen(s_sUNSIGNED) + sNewUnsigned.getLength(), - rtl::OUStringConcatenation(sNewUnsigned + s_sUNSIGNED)); + rtl::Concat2View(sNewUnsigned + s_sUNSIGNED)); nIndex = sSQL.indexOf(s_sUNSIGNED, nIndex + strlen(s_sUNSIGNED) + sNewUnsigned.getLength()); } return sSQL; diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 44e0c2bba2a9..d98e8cc80064 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -362,7 +362,7 @@ bool OSQLParseNode::parseNodeToExecutableStatement( OUString& _out_rString, cons { constexpr char SELECT_KEYWORD[] = "SELECT"; sBuffer.insert(sBuffer.indexOf(SELECT_KEYWORD) + strlen(SELECT_KEYWORD), - OUStringConcatenation(" FIRST " + sLimitValue)); + Concat2View(" FIRST " + sLimitValue)); } _out_rString = sBuffer.makeStringAndClear(); diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 55195bc228b7..6847e2486c58 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -787,7 +787,7 @@ extern "C" void SAL_CALL uno_dumpEnvironmentByName( { writeLine( stream, - OUStringConcatenation("environment \"" + OUString::unacquired(&pEnvDcp) + "\" does not exist!"), + Concat2View("environment \"" + OUString::unacquired(&pEnvDcp) + "\" does not exist!"), pFilter ); } } diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 9742bc2ebaab..fc27b3fbf3b6 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -758,7 +758,7 @@ void SvxScriptOrgDialog::createEntry(const weld::TreeIter& rEntry) } for( const Reference< browse::XBrowseNode >& n : std::as_const(childNodes) ) { - if (OUStringConcatenation(aNewName+extn) == n->getName()) + if (Concat2View(aNewName+extn) == n->getName()) { bFound = true; break; @@ -785,7 +785,7 @@ void SvxScriptOrgDialog::createEntry(const weld::TreeIter& rEntry) bValid = true; for( const Reference< browse::XBrowseNode >& n : std::as_const(childNodes) ) { - if (OUStringConcatenation(aUserSuppliedName+extn) == n->getName()) + if (Concat2View(aUserSuppliedName+extn) == n->getName()) { bValid = false; OUString aError = m_createErrStr + m_createDupStr; diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index ec62fb105353..3cc3aab9a9ef 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -130,7 +130,7 @@ void SvxPersonalizationTabPage::LoadDefaultImages() m_vDefaultPersonaSettings.push_back(aPersonaSetting); - INetURLObject aURLObj(rtl::OUStringConcatenation(gallery + aPreviewFile)); + INetURLObject aURLObj(rtl::Concat2View(gallery + aPreviewFile)); aFilter.ImportGraphic(aGraphic, aURLObj); Size aSize(aGraphic.GetSizePixel()); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 4543affd0f0f..93db6c8fa9d6 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -814,7 +814,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() if (bFolderExists) { i++; - pURL->setName(OUStringConcatenation(sLastSegmentName + OUString::number(i))); + pURL->setName(Concat2View(sLastSegmentName + OUString::number(i))); } } } @@ -832,7 +832,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() bElementExists = xSimpleFileAccess->exists( aExistenceCheck.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); if ( bElementExists ) { - aExistenceCheck.setBase( OUStringConcatenation(BaseName + OUString::number( i ) )); + aExistenceCheck.setBase( Concat2View(BaseName + OUString::number( i ) )); ++i; } } diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index eaee775622cb..9080e63dca3f 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -235,7 +235,7 @@ namespace dbaui } else addOutputText( - OUStringConcatenation(OUString::number(xMR->getUpdateCount()) + " rows updated\n")); + Concat2View(OUString::number(xMR->getUpdateCount()) + " rows updated\n")); for (;;) { hasRS = xMR->getMoreResults(); @@ -255,17 +255,17 @@ namespace dbaui if (upperStatement.startsWith("UPDATE")) { sal_Int32 resultCount = xStatement->executeUpdate(_rStatement); - addOutputText(OUStringConcatenation(OUString::number(resultCount) + " rows updated\n")); + addOutputText(Concat2View(OUString::number(resultCount) + " rows updated\n")); } else if (upperStatement.startsWith("INSERT")) { sal_Int32 resultCount = xStatement->executeUpdate(_rStatement); - addOutputText(OUStringConcatenation(OUString::number(resultCount) + " rows inserted\n")); + addOutputText(Concat2View(OUString::number(resultCount) + " rows inserted\n")); } else if (upperStatement.startsWith("DELETE")) { sal_Int32 resultCount = xStatement->executeUpdate(_rStatement); - addOutputText(OUStringConcatenation(OUString::number(resultCount) + " rows deleted\n")); + addOutputText(Concat2View(OUString::number(resultCount) + " rows deleted\n")); } else if (upperStatement.startsWith("CREATE")) { @@ -281,7 +281,7 @@ namespace dbaui else { sal_Int32 resultCount = xStatement->executeUpdate(_rStatement); - addOutputText(OUStringConcatenation(OUString::number(resultCount) + " rows updated\n")); + addOutputText(Concat2View(OUString::number(resultCount) + " rows updated\n")); } } // successful diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index b26d1004a053..d4226aa6d4c4 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -1201,7 +1201,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions( //shared repository including the temporary name OUString url = makeURL(m_activePackages, elem.second.temporaryName); if (bShared) - url = makeURLAppendSysPathSegment( OUStringConcatenation(url + "_"), elem.second.fileName); + url = makeURLAppendSysPathSegment( Concat2View(url + "_"), elem.second.fileName); bool bRemoved = false; //Check if the URL to the extension is still the same @@ -1447,7 +1447,7 @@ Sequence< Reference<deployment::XPackage> > PackageManagerImpl::getExtensionsWit //Prepare the URL to the extension OUString url = makeURL(m_activePackages, elem.second.temporaryName); if (bShared) - url = makeURLAppendSysPathSegment( OUStringConcatenation(url + "_"), elem.second.fileName); + url = makeURLAppendSysPathSegment( Concat2View(url + "_"), elem.second.fileName); Reference<deployment::XPackage> p = m_xRegistry->bindPackage( url, OUString(), false, OUString(), xCmdEnv ); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index bf088d2a4f52..2be264d39a33 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2659,7 +2659,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, if (x.mOriginalFont.indexOf('/') == -1) for (const auto &j : x.mUsedFonts) if (j == x.mOriginalFont || - j.startsWith(OUStringConcatenation(x.mOriginalFont + "/"))) + j.startsWith(Concat2View(x.mOriginalFont + "/"))) return true; return false; diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 4ae3482a55c9..38c8ccb61167 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -472,11 +472,11 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions) ( aInfo.userdata.isEmpty() || aProfileName.equalsIgnoreAsciiCase( utl::ConfigManager::getProductName() ) ) ) { - setInstallInfoIfExist(aInfo, OUStringConcatenation(aTopConfigDir + aProfileName), aVersion); + setInstallInfoIfExist(aInfo, Concat2View(aTopConfigDir + aProfileName), aVersion); #if defined UNX && ! defined MACOSX //try preXDG path if the new one does not exist if ( aInfo.userdata.isEmpty()) - setInstallInfoIfExist(aInfo, OUStringConcatenation(aPreXDGTopConfigDir + aProfileName), aVersion); + setInstallInfoIfExist(aInfo, Concat2View(aPreXDGTopConfigDir + aProfileName), aVersion); #endif } } diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 5e3828dea8b2..c235eba1f523 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -290,7 +290,7 @@ extern "C" int unopkg_main() if (cmdArg[ 0 ] == '-') { // is option: - dp_misc::writeConsoleError(OUStringConcatenation( + dp_misc::writeConsoleError(Concat2View( "\nERROR: unexpected option " + cmdArg + "!\n Use " APP_NAME " " + @@ -497,7 +497,7 @@ extern "C" int unopkg_main() vec_packages.size(), false); dp_misc::writeConsole( - OUStringConcatenation("All deployed " + repository + " extensions:\n\n")); + Concat2View("All deployed " + repository + " extensions:\n\n")); } else { @@ -632,7 +632,7 @@ extern "C" int unopkg_main() catch (const LockFileException & e) { // No logger since it requires UNO which we don't have here - dp_misc::writeConsoleError(OUStringConcatenation(e.Message + "\n")); + dp_misc::writeConsoleError(Concat2View(e.Message + "\n")); bShowFailedMsg = false; } catch (const css::uno::Exception & e ) { diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index 2acf82a5bf30..a902f956d8d5 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -142,9 +142,9 @@ void CommandEnvironmentImpl::printLicense( OUString sNewLine("\n"); - dp_misc::writeConsole(OUStringConcatenation(sNewLine + sNewLine + s1 + sNewLine + sNewLine)); - dp_misc::writeConsole(OUStringConcatenation(sLicense + sNewLine + sNewLine)); - dp_misc::writeConsole(OUStringConcatenation(s2 + sNewLine)); + dp_misc::writeConsole(Concat2View(sNewLine + sNewLine + s1 + sNewLine + sNewLine)); + dp_misc::writeConsole(Concat2View(sLicense + sNewLine + sNewLine)); + dp_misc::writeConsole(Concat2View(s2 + sNewLine)); dp_misc::writeConsole(s3); //the user may enter "yes" or "no", we compare in a case insensitive way @@ -171,7 +171,7 @@ void CommandEnvironmentImpl::printLicense( } else { - dp_misc::writeConsole(OUStringConcatenation(sNewLine + sNewLine + s4 + sNewLine)); + dp_misc::writeConsole(Concat2View(sNewLine + sNewLine + s4 + sNewLine)); } } while(true); @@ -257,7 +257,7 @@ void CommandEnvironmentImpl::handle( { OUString sMsg(DpResId(RID_STR_UNSUPPORTED_PLATFORM)); sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName()); - dp_misc::writeConsole(OUStringConcatenation("\n" + sMsg + "\n\n")); + dp_misc::writeConsole(Concat2View("\n" + sMsg + "\n\n")); approve = true; } else { @@ -275,7 +275,7 @@ void CommandEnvironmentImpl::handle( if (abort && m_option_verbose) { OUString msg = ::comphelper::anyToString(request); - dp_misc::writeConsoleError(OUStringConcatenation("\nERROR: " + msg + "\n")); + dp_misc::writeConsoleError(Concat2View("\nERROR: " + msg + "\n")); } // select: @@ -348,9 +348,9 @@ void CommandEnvironmentImpl::update_( Any const & Status ) } if (bUseErr) - dp_misc::writeConsoleError(OUStringConcatenation(msg + "\n")); + dp_misc::writeConsoleError(Concat2View(msg + "\n")); else - dp_misc::writeConsole(OUStringConcatenation(msg + "\n")); + dp_misc::writeConsole(Concat2View(msg + "\n")); } diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 402833aa5019..c9c9b33674ac 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -229,7 +229,7 @@ void printf_line( std::u16string_view name, std::u16string_view value, sal_Int32 level ) { printf_space( level ); - dp_misc::writeConsole(OUStringConcatenation(OUString::Concat(name) + ": " + value + "\n")); + dp_misc::writeConsole(Concat2View(OUString::Concat(name) + ": " + value + "\n")); } @@ -359,7 +359,7 @@ Reference<XComponentContext> connectToOffice( if (verbose) { - dp_misc::writeConsole(OUStringConcatenation( + dp_misc::writeConsole(Concat2View( "Raising process: " + appURL + "\nArguments: --nologo --nodefault " + args[2] + "\n")); diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 1f5461ecaf21..f3146b2b5782 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -474,10 +474,10 @@ void SplashScreen::SetScreenBitmap(BitmapEx &rBitmap) // create file name from screen resolution information OUString aResBuf = "_" + OUString::number(nWidth) + "x" + OUString::number(nHeight); if ( !_sAppName.isEmpty() ) - if (Application::LoadBrandBitmap(OUStringConcatenation("intro_" + _sAppName + aResBuf), rBitmap)) + if (Application::LoadBrandBitmap(Concat2View("intro_" + _sAppName + aResBuf), rBitmap)) return; - if (Application::LoadBrandBitmap(OUStringConcatenation("intro" + aResBuf), rBitmap)) + if (Application::LoadBrandBitmap(Concat2View("intro" + aResBuf), rBitmap)) return; (void)Application::LoadBrandBitmap (u"intro", rBitmap); diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx index de345f545497..88c5f0292722 100644 --- a/framework/source/uielement/subtoolbarcontroller.cxx +++ b/framework/source/uielement/subtoolbarcontroller.cxx @@ -168,7 +168,7 @@ void SubToolBarController::statusChanged( const css::frame::FeatureStateEvent& E { // Enum command, such as the current custom shape, // toggle checked state. - if ( m_aLastCommand == OUStringConcatenation( m_aCommandURL + "." + aStrValue ) ) + if ( m_aLastCommand == Concat2View( m_aCommandURL + "." + aStrValue ) ) { eTri = TRISTATE_TRUE; nItemBits |= ToolBoxItemBits::CHECKABLE; diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 7071f2dcb116..92b9b5807e99 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -1532,7 +1532,7 @@ void LanguageTag::convertFromRtlLocale() if (maLocale.Variant.isEmpty()) return; - OString aStr = OUStringToOString(maLocale.Language, RTL_TEXTENCODING_UTF8) + "_" + OUStringToOString(OUStringConcatenation(maLocale.Country + maLocale.Variant), + OString aStr = OUStringToOString(maLocale.Language, RTL_TEXTENCODING_UTF8) + "_" + OUStringToOString(Concat2View(maLocale.Country + maLocale.Variant), RTL_TEXTENCODING_UTF8); /* FIXME: let liblangtag parse this entirely with * lt_tag_convert_from_locale() but that needs a patch to pass the diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx index 0b463315e872..8a5bd818e217 100644 --- a/i18npool/source/indexentry/indexentrysupplier.cxx +++ b/i18npool/source/indexentry/indexentrysupplier.cxx @@ -129,7 +129,7 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c // Load service with name <base>_<lang>_<country>_<algorithm> // or <base>_<bcp47>_<algorithm> and fallbacks. bLoaded = createLocaleSpecificIndexEntrySupplier( - OUStringConcatenation( + Concat2View( LocaleDataImpl::getFirstLocaleServiceName( rLocale) + "_" + aSortAlgorithm)); if (!bLoaded) @@ -137,7 +137,7 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c ::std::vector< OUString > aFallbacks( LocaleDataImpl::getFallbackLocaleServiceNames( rLocale)); for (auto const& fallback : aFallbacks) { - bLoaded = createLocaleSpecificIndexEntrySupplier(OUStringConcatenation(fallback + "_" + aSortAlgorithm)); + bLoaded = createLocaleSpecificIndexEntrySupplier(Concat2View(fallback + "_" + aSortAlgorithm)); if (bLoaded) break; } diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index c20edbfb58e9..acc7dd8f927b 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -799,7 +799,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const if (n100s < 0) incErrorInt( "Error: Time100SecSeparator not present in FormatCode formatindex=\"%d\".\n", formatindex); - n100s = aCode.indexOf( OUStringConcatenation(pSep->getValue() + "00")); + n100s = aCode.indexOf( Concat2View(pSep->getValue() + "00")); if (n100s < 0) incErrorInt( "Error: Time100SecSeparator+00 not present in FormatCode formatindex=\"%d\".\n", formatindex); diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index 9ae30586e549..0e0c3c75d5a9 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -2169,13 +2169,13 @@ public: }; #if defined LIBO_INTERNAL_ONLY -inline bool operator ==(OString const & lhs, OStringConcatenation const & rhs) +inline bool operator ==(OString const & lhs, StringConcatenation<char> const & rhs) { return lhs == std::string_view(rhs); } -inline bool operator !=(OString const & lhs, OStringConcatenation const & rhs) +inline bool operator !=(OString const & lhs, StringConcatenation<char> const & rhs) { return lhs != std::string_view(rhs); } -inline bool operator ==(OStringConcatenation const & lhs, OString const & rhs) +inline bool operator ==(StringConcatenation<char> const & lhs, OString const & rhs) { return std::string_view(lhs) == rhs; } -inline bool operator !=(OStringConcatenation const & lhs, OString const & rhs) +inline bool operator !=(StringConcatenation<char> const & lhs, OString const & rhs) { return std::string_view(lhs) != rhs; } #endif @@ -2282,7 +2282,7 @@ typedef rtlunittest::OString OString; #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST using ::rtl::OString; using ::rtl::OStringChar; -using ::rtl::OStringConcatenation; +using ::rtl::Concat2View; using ::rtl::OStringHash; using ::rtl::OStringLiteral; #endif diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx index 51605d0731e9..c2862c5c49ad 100644 --- a/include/rtl/stringconcat.hxx +++ b/include/rtl/stringconcat.hxx @@ -355,45 +355,35 @@ int operator+( const StringConcatInvalid&, const T& ) } #endif -// Lightweight alternative to OString when a (temporary) object is needed to hold an OStringConcat -// result that can then be used as a std::string_view: -class OStringConcatenation { +// Lightweight alternative to O(U)String when a (temporary) object is needed to hold +// an O(U)StringConcat result that can then be used as a std::(u16)string_view: +template <typename C> class StringConcatenation { public: - template<typename T1, typename T2> - explicit OStringConcatenation(OStringConcat<T1, T2> const & c): + template <class Concat> + explicit StringConcatenation(Concat const& c): length_(c.length()), - buffer_(new char[length_]) + buffer_(new C[length_]) { auto const end = c.addData(buffer_.get()); assert(end == buffer_.get() + length_); (void)end; } - operator std::string_view() const { return {buffer_.get(), length_}; } + operator std::basic_string_view<C>() const { return {buffer_.get(), length_}; } private: std::size_t length_; - std::unique_ptr<char[]> buffer_; + std::unique_ptr<C[]> buffer_; }; -// Lightweight alternative to OUString when a (temporary) object is needed to hold an -// OUStringConcat result that can then be used as a std::u16string_view: -class OUStringConcatenation { -public: - template<typename T1, typename T2> - explicit OUStringConcatenation(OUStringConcat<T1, T2> const & c): - length_(c.length()), - buffer_(new char16_t[length_]) - { - auto const end = c.addData(buffer_.get()); - assert(end == buffer_.get() + length_); (void)end; - } - - operator std::u16string_view() const { return {buffer_.get(), length_}; } +template <typename T1, typename T2> auto Concat2View(OStringConcat<T1, T2> const& c) +{ + return StringConcatenation<char>(c); +} -private: - std::size_t length_; - std::unique_ptr<char16_t[]> buffer_; -}; +template <typename T1, typename T2> auto Concat2View(OUStringConcat<T1, T2> const& c) +{ + return StringConcatenation<char16_t>(c); +} /** @internal diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index c9067905a0a0..cddba5dfadd5 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -3347,13 +3347,13 @@ void operator !=(std::nullptr_t, OUString const &) = delete; #endif #if defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST -inline bool operator ==(OUString const & lhs, OUStringConcatenation const & rhs) +inline bool operator ==(OUString const & lhs, StringConcatenation<char16_t> const & rhs) { return lhs == std::u16string_view(rhs); } -inline bool operator !=(OUString const & lhs, OUStringConcatenation const & rhs) +inline bool operator !=(OUString const & lhs, StringConcatenation<char16_t> const & rhs) { return lhs != std::u16string_view(rhs); } -inline bool operator ==(OUStringConcatenation const & lhs, OUString const & rhs) +inline bool operator ==(StringConcatenation<char16_t> const & lhs, OUString const & rhs) { return std::u16string_view(lhs) == rhs; } -inline bool operator !=(OUStringConcatenation const & lhs, OUString const & rhs) +inline bool operator !=(StringConcatenation<char16_t> const & lhs, OUString const & rhs) { return std::u16string_view(lhs) != rhs; } #endif @@ -3525,7 +3525,7 @@ using ::rtl::OStringToOUString; using ::rtl::OUStringToOString; using ::rtl::OUStringLiteral; using ::rtl::OUStringChar; -using ::rtl::OUStringConcatenation; +using ::rtl::Concat2View; #endif /// @cond INTERNAL diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 62d09e1e7407..b053067ea163 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -223,7 +223,7 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) { sReference = m_sReferences.front(); } - if (pLastMsg != &m_sMsgCtxt || sLine != OStringConcatenation("\"" + sReference + "\\n\"")) + if (pLastMsg != &m_sMsgCtxt || sLine != Concat2View("\"" + sReference + "\\n\"")) { *pLastMsg += lcl_GenNormString(sLine); } @@ -279,7 +279,7 @@ PoEntry::PoEntry( } m_pGenPo->setMsgCtxt(sMsgCtxt); m_pGenPo->setMsgId(rText); - m_pGenPo->setExtractCom(OStringConcatenation( + m_pGenPo->setExtractCom(Concat2View( ( !rHelpText.empty() ? OString::Concat(rHelpText) + "\n" : OString()) + genKeyId( m_pGenPo->getReference().front() + rGroupId + rLocalId + rResType + rText ) )); m_bIsInitialized = true; @@ -446,7 +446,7 @@ PoHeader::PoHeader( std::string_view rExtSrc, const OString& rPoHeaderMsgStr ) : m_pGenPo( new GenPoEntry() ) , m_bIsInitialized( false ) { - m_pGenPo->setExtractCom(OStringConcatenation(OString::Concat("extracted from ") + rExtSrc)); + m_pGenPo->setExtractCom(Concat2View(OString::Concat("extracted from ") + rExtSrc)); m_pGenPo->setMsgStr(rPoHeaderMsgStr); m_bIsInitialized = true; } @@ -455,7 +455,7 @@ PoHeader::PoHeader( std::string_view rExtSrc ) : m_pGenPo( new GenPoEntry() ) , m_bIsInitialized( false ) { - m_pGenPo->setExtractCom(OStringConcatenation(OString::Concat("extracted from ") + rExtSrc)); + m_pGenPo->setExtractCom(Concat2View(OString::Concat("extracted from ") + rExtSrc)); m_pGenPo->setMsgStr( "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?" diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx index ef56578c9825..a2ad3efdf863 100644 --- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx +++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx @@ -224,8 +224,8 @@ ProofreadingResult SAL_CALL LanguageToolGrammarChecker::doProofreading( tools::Long http_code = 0; OUString langTag(aLocale.Language + "-" + aLocale.Country); - OString postData(OUStringToOString( - OUStringConcatenation("text=" + aText + "&language=" + langTag), RTL_TEXTENCODING_UTF8)); + OString postData(OUStringToOString(Concat2View("text=" + aText + "&language=" + langTag), + RTL_TEXTENCODING_UTF8)); const std::string response_body = makeHttpRequest(checkerURL, HTTP_METHOD::HTTP_POST, postData, http_code); diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index af83c96ff71d..ec49682b0cf9 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -449,7 +449,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL) pStream->WriteLine("type: negative"); if (aDicName.endsWith(EXTENSION_FOR_TITLE_TEXT)) { - pStream->WriteLine(OStringConcatenation("title: " + OUStringToOString( + pStream->WriteLine(Concat2View("title: " + OUStringToOString( // strip EXTENSION_FOR_TITLE_TEXT aDicName.subView(0, aDicName.lastIndexOf(EXTENSION_FOR_TITLE_TEXT)), eEnc))); } diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index fe6ce6dc24fb..e0e8b099ea5e 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -1179,7 +1179,7 @@ void XmlFilterBase::exportCustomFragments() const OUString fragmentPath = "customXml/item" + OUString::number(j+1) + ".xml"; if (customXmlDom.is()) { - addRelation(oox::getRelationship(Relationship::CUSTOMXML), OUStringConcatenation("../" + fragmentPath)); + addRelation(oox::getRelationship(Relationship::CUSTOMXML), Concat2View("../" + fragmentPath)); uno::Reference<xml::sax::XSAXSerializable> serializer(customXmlDom, uno::UNO_QUERY); uno::Reference<xml::sax::XWriter> writer = xml::sax::Writer::create(comphelper::getProcessComponentContext()); @@ -1200,7 +1200,7 @@ void XmlFilterBase::exportCustomFragments() // Adding itemprops's relationship entry to item.xml.rels file addRelation(openFragmentStream(fragmentPath, "application/xml"), oox::getRelationship(Relationship::CUSTOMXMLPROPS), - OUStringConcatenation("itemProps"+OUString::number(j+1)+".xml")); + Concat2View("itemProps"+OUString::number(j+1)+".xml")); } } diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 387bbf5c8d6d..e0766d0e7a7a 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -5855,25 +5855,25 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX OUString dataFileName = "diagrams/data" + OUString::number(nDiagramId) + ".xml"; OUString dataRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDATA), - OUStringConcatenation(sRelationCompPrefix + dataFileName)); + Concat2View(sRelationCompPrefix + dataFileName)); // add layout relation OUString layoutFileName = "diagrams/layout" + OUString::number(nDiagramId) + ".xml"; OUString layoutRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMLAYOUT), - OUStringConcatenation(sRelationCompPrefix + layoutFileName)); + Concat2View(sRelationCompPrefix + layoutFileName)); // add style relation OUString styleFileName = "diagrams/quickStyle" + OUString::number(nDiagramId) + ".xml"; OUString styleRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMQUICKSTYLE), - OUStringConcatenation(sRelationCompPrefix + styleFileName)); + Concat2View(sRelationCompPrefix + styleFileName)); // add color relation OUString colorFileName = "diagrams/colors" + OUString::number(nDiagramId) + ".xml"; OUString colorRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMCOLORS), - OUStringConcatenation(sRelationCompPrefix + colorFileName)); + Concat2View(sRelationCompPrefix + colorFileName)); OUString drawingFileName; if (drawingDom.is()) @@ -5882,7 +5882,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX drawingFileName = "diagrams/drawing" + OUString::number(nDiagramId) + ".xml"; OUString drawingRelId = mpFB->addRelation( mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDRAWING), - OUStringConcatenation(sRelationCompPrefix + drawingFileName)); + Concat2View(sRelationCompPrefix + drawingFileName)); // the data dom contains a reference to the drawing relation. We need to update it with the new generated // relation value before writing the dom to a file @@ -6013,7 +6013,7 @@ void DrawingML::writeDiagramRels(const uno::Sequence<uno::Sequence<uno::Any>>& x PropertySet aProps(xOutStream); aProps.setAnyProperty(PROP_RelId, uno::Any(sRelId.toInt32())); - mpFB->addRelation(xOutStream, sType, OUStringConcatenation("../" + sFragment)); + mpFB->addRelation(xOutStream, sType, Concat2View("../" + sFragment)); OUString sDir = OUString::createFromAscii(GetComponentDir()); uno::Reference<io::XOutputStream> xBinOutStream diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 74dadd5da473..c7b5699993f4 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2594,7 +2594,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) OUString const sRelId = mpFB->addRelation( mpFS->getOutputStream(), sRelationType, - OUStringConcatenation(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName)); + Concat2View(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName)); mpFS->startElementNS(mnXmlNamespace, XML_graphicFrame); diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx index 6d8f47e88c52..5e0fc8ae2a71 100644 --- a/oox/source/ole/vbaexport.cxx +++ b/oox/source/ole/vbaexport.cxx @@ -789,7 +789,7 @@ void exportModuleStream(SvStream& rStrm, const OUString& rSourceCode, const OUSt { SvMemoryStream aModuleStream(4096, 4096); - exportString(aModuleStream, OUStringConcatenation("Attribute VB_Name = \"" + aElementName + "\"\r\n"), eTextEncoding); + exportString(aModuleStream, Concat2View("Attribute VB_Name = \"" + aElementName + "\"\r\n"), eTextEncoding); if (rInfo.ModuleType == 4) { if (isWorkbook(rInfo.ModuleObject)) @@ -859,19 +859,19 @@ void exportPROJECTStream(SvStream& rStrm, css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(rModuleName); if(aModuleInfo.ModuleType == 1) { - exportString(rStrm, OUStringConcatenation("Module=" + rModuleName + "\r\n"), + exportString(rStrm, Concat2View("Module=" + rModuleName + "\r\n"), eTextEncoding); } else if(aModuleInfo.ModuleType == 4) { exportString(rStrm, - OUStringConcatenation("Document=" + rModuleName + "/&H00000000\r\n"), + Concat2View("Document=" + rModuleName + "/&H00000000\r\n"), eTextEncoding); } } // section 2.3.1.11 ProjectName - exportString(rStrm, OUStringConcatenation("Name=\"" + projectName + "\"\r\n"), eTextEncoding); + exportString(rStrm, Concat2View("Name=\"" + projectName + "\"\r\n"), eTextEncoding); // section 2.3.1.12 ProjectHelpId exportString(rStrm, u"HelpContextID=\"0\"\r\n", eTextEncoding); @@ -933,12 +933,12 @@ void exportPROJECTStream(SvStream& rStrm, css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(rModuleName); if(aModuleInfo.ModuleType == 1) { - exportString(rStrm, OUStringConcatenation(rModuleName + "=25, 25, 1439, 639, \r\n"), + exportString(rStrm, Concat2View(rModuleName + "=25, 25, 1439, 639, \r\n"), eTextEncoding); } else { - exportString(rStrm, OUStringConcatenation(rModuleName + "=0, 0, 0, 0, C\r\n"), + exportString(rStrm, Concat2View(rModuleName + "=0, 0, 0, 0, C\r\n"), eTextEncoding); } } diff --git a/sal/qa/rtl/strings/test_oustring_compare.cxx b/sal/qa/rtl/strings/test_oustring_compare.cxx index e55d4d3d93b1..1eaf9dd5eba4 100644 --- a/sal/qa/rtl/strings/test_oustring_compare.cxx +++ b/sal/qa/rtl/strings/test_oustring_compare.cxx @@ -88,8 +88,8 @@ void test::oustring::Compare::compareTo() CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), s2.compareTo(s2)); CPPUNIT_ASSERT(s1.compareTo(s2) < 0); CPPUNIT_ASSERT(s2.compareTo(s1) > 0); - CPPUNIT_ASSERT(s1.compareTo(OUStringConcatenation(s2 + "y")) < 0); - CPPUNIT_ASSERT(s2.compareTo(OUStringConcatenation(s1 + "x")) > 0); + CPPUNIT_ASSERT(s1.compareTo(Concat2View(s2 + "y")) < 0); + CPPUNIT_ASSERT(s2.compareTo(Concat2View(s1 + "x")) > 0); CPPUNIT_ASSERT(OUString(s1 + "x").compareTo(s2) < 0); CPPUNIT_ASSERT(OUString(s2 + "y").compareTo(s1) > 0); } diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx index a31603d90ae9..05aab30a063a 100644 --- a/sal/qa/rtl/textenc/rtl_textcvt.cxx +++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx @@ -56,7 +56,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { { rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter(rSet.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::number(rSet.m_nEncoding) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::number(rSet.m_nEncoding) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); rtl_TextToUnicodeContext aContext @@ -81,11 +81,11 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { int j = 0; for (int i = 0; i < 256; ++i) { if (rSet.m_aMap[i] != 0xFFFF && aUnicode[j] != rSet.m_aMap[i]) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("rSet.m_aMap[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("rSet.m_aMap[" + OUString::number(i) + "] == " + OUString::number(rSet.m_aMap[i], 16)), RTL_TEXTENCODING_UTF8).getStr(), u'\xFFFF', rSet.m_aMap[i]); - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aUnicode[" + OUString::number(j) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(j) + "] == " + OUString::number(aUnicode[j], 16) + ", rSet.m_aMap[" + OUString::number(i) + "] == " + OUString::number(rSet.m_aMap[i], 16)), @@ -102,7 +102,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { { rtl_UnicodeToTextConverter aConverter = rtl_createUnicodeToTextConverter(rSet.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); rtl_UnicodeToTextContext aContext @@ -128,11 +128,11 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { if (rSet.m_aMap[i] != 0xFFFF && aText[j] != static_cast< char >(i)) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("rSet.m_aMap[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("rSet.m_aMap[" + OUString::number(i) + "] == " + OUString::number(rSet.m_aMap[i], 16)), RTL_TEXTENCODING_UTF8).getStr(), u'\xFFFF', rSet.m_aMap[i]); - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aText[" + OUString::number(j) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aText[" + OUString::number(j) + "] == " + OUString::number(i, 16)), RTL_TEXTENCODING_UTF8).getStr(), static_cast< char >(i), aText[j]); @@ -146,7 +146,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { aText[0] = static_cast< char >(i); rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter(rSet.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rSet.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); rtl_TextToUnicodeContext aContext @@ -194,7 +194,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { sal_Unicode aUnicode[TEST_STRING_SIZE]; rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter(rTest.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); rtl_TextToUnicodeContext aContext @@ -222,7 +222,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { rtl_destroyTextToUnicodeConverter(aConverter); for (sal_Size i = 0; i < rTest.m_nUnicodeSize; ++i) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aUnicode[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " + OUString::number(aUnicode[i], 16) + ", rTest.m_aUnicode[" + OUString::number(i) + "] == " + OUString::number(rTest.m_aUnicode[i], 16)), @@ -234,7 +234,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { sal_Unicode aUnicode[TEST_STRING_SIZE]; rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter(rTest.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); rtl_TextToUnicodeContext aContext @@ -272,7 +272,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { CPPUNIT_ASSERT_EQUAL(rTest.m_nTextSize, nInput); for (sal_Size i = 0; i < rTest.m_nUnicodeSize; ++i) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aUnicode[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " + OUString::number(aUnicode[i], 16) + ", rTest.m_aUnicode[" + OUString::number(i) + "] == " + OUString::number(rTest.m_aUnicode[i], 16)), @@ -288,7 +288,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { int nSize = 0; rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter(rTest.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); for (sal_Size i = 0;;) { @@ -357,7 +357,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { done: rtl_destroyTextToUnicodeConverter(aConverter); for (sal_Size i = 0; i < rTest.m_nUnicodeSize; ++i) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aUnicode[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " + OUString::number(aUnicode[i], 16) + ", rTest.m_aUnicode[" + OUString::number(i) + "] == " + OUString::number(rTest.m_aUnicode[i], 16)), @@ -369,7 +369,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { char aText[TEST_STRING_SIZE]; rtl_UnicodeToTextConverter aConverter = rtl_createUnicodeToTextConverter(rTest.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); rtl_UnicodeToTextContext aContext @@ -397,7 +397,7 @@ void doComplexCharSetTest(ComplexCharSetTest const & rTest) { rtl_destroyUnicodeToTextContext(aConverter, aContext); rtl_destroyUnicodeToTextConverter(aConverter); for (sal_Size i = 0; i < rTest.m_nTextSize; ++i) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aText[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aText[" + OUString::number(i) + "] == " + OUString::number(aText[i], 16) + ", rTest.m_pText[" + OUString::number(i) + "] == " + OUString::number(rTest.m_pText[i], 16)), @@ -412,7 +412,7 @@ void doComplexCharSetCutTest(ComplexCharSetTest const & rTest) { sal_Unicode aUnicode[TEST_STRING_SIZE]; rtl_TextToUnicodeConverter aConverter = rtl_createTextToUnicodeConverter(rTest.m_nEncoding); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(OUStringConcatenation("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(Concat2View("rtl_createTextToUnicodeConverter(" + OUString::createFromAscii(rtl_getMimeCharsetFromTextEncoding(rTest.m_nEncoding)) + ") failed"), RTL_TEXTENCODING_UTF8).getStr(), aConverter != nullptr); sal_Size nSize; @@ -436,7 +436,7 @@ void doComplexCharSetCutTest(ComplexCharSetTest const & rTest) { rtl_destroyTextToUnicodeConverter(aConverter); for (sal_Size i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUStringConcatenation("aUnicode[" + OUString::number(i) + "] == " + + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(Concat2View("aUnicode[" + OUString::number(i) + "] == " + OUString::number(aUnicode[i], 16) + ", rTest.m_aUnicode[" + OUString::number(i) + "] == " + OUString::number(rTest.m_aUnicode[i], 16)), diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx index 53228328f88e..561a4ee6c15e 100644 --- a/sc/qa/extras/vba-macro-test.cxx +++ b/sc/qa/extras/vba-macro-test.cxx @@ -573,7 +573,7 @@ void VBAMacroTest::testVba() for (const auto& rTestInfo : testInfo) { OUString aFileName; - createFileURL(OUStringConcatenation(rTestInfo.sFileBaseName + "xls"), aFileName); + createFileURL(Concat2View(rTestInfo.sFileBaseName + "xls"), aFileName); mxComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument"); // process all events such as OnLoad events etc. otherwise they tend diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index c5954bc06bef..c9820285c9f1 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -462,7 +462,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU mnFlags |= EXC_HLINK_MARK; OUString location = XclXmlUtils::ToOUString(*mxTextMark); - if (!location.isEmpty() && msTarget.endsWith(OUStringConcatenation("#" + location))) + if (!location.isEmpty() && msTarget.endsWith(Concat2View("#" + location))) msTarget = msTarget.copy(0, msTarget.getLength() - location.getLength() - 1); } diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index d39022794bc5..528286ea49e9 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1480,7 +1480,7 @@ XclExpExternSheet::XclExpExternSheet( const XclExpRoot& rRoot, std::u16string_vi XclExpExternSheetBase( rRoot, EXC_ID_EXTERNSHEET ) { // reference to own sheet: \03<sheetname> - Init(OUStringConcatenation(OUStringChar(EXC_EXTSH_TABNAME) + rTabName)); + Init(Concat2View(OUStringChar(EXC_EXTSH_TABNAME) + rTabName)); } void XclExpExternSheet::Save( XclExpStream& rStrm ) diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index aa6811a33c91..e5bc57a70944 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -300,7 +300,7 @@ void SdImportTest::testDocumentLayout() if( aFilesToCompare[i].nExportType >= 0 ) xDocShRef = saveAndReload( xDocShRef.get(), aFilesToCompare[i].nExportType ); compareWithShapesDump( xDocShRef, - OUStringConcatenation(m_directories.getPathFromSrc( u"/sd/qa/unit/data/" ) + aFilesToCompare[i].sDump), + Concat2View(m_directories.getPathFromSrc( u"/sd/qa/unit/data/" ) + aFilesToCompare[i].sDump), i == nUpdateMe ); } } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 137e8b57415a..810969940bae 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -915,7 +915,7 @@ bool SdDrawDocument::InsertBookmarkAsPage( if(pPg->GetObj(i)->GetStyleSheet()) { OUString aStyleName = pPg->GetObj(i)->GetStyleSheet()->GetName(); - SfxStyleSheet *pSheet = lcl_findStyle(aNewGraphicStyles, OUStringConcatenation(aStyleName + aRenameStr)); + SfxStyleSheet *pSheet = lcl_findStyle(aNewGraphicStyles, Concat2View(aStyleName + aRenameStr)); if(pSheet != nullptr) pPg->GetObj(i)->SetStyleSheet(pSheet, true); } diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index d6ece36a5380..7679fc2fa1ec 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1343,7 +1343,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum // add explicit relation of presentation to this slide OUString sRelId = addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::SLIDE), - OUStringConcatenation("slides/slide" + OUString::number(nPageNum + 1) +".xml")); + Concat2View("slides/slide" + OUString::number(nPageNum + 1) +".xml")); mPresentationFS->singleElementNS(XML_p, XML_sldId, XML_id, OString::number(GetNewSlideId()), @@ -1401,7 +1401,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum // add implicit relation to slide layout addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::SLIDELAYOUT), - OUStringConcatenation("../slideLayouts/slideLayout" + + Concat2View("../slideLayouts/slideLayout" + OUString::number(GetLayoutFileId(GetPPTXLayoutId(GetLayoutOffset(mXPagePropSet)), nMasterNum)) + ".xml")); @@ -1409,7 +1409,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum // add implicit relation to slide comments addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::COMMENTS), - OUStringConcatenation("../comments/comment" + OUString::number(nPageNum + 1) + ".xml")); + Concat2View("../comments/comment" + OUString::number(nPageNum + 1) + ".xml")); SAL_INFO("sd.eppt", "----------------"); } @@ -1440,13 +1440,13 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) // add implicit relation to slide addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::SLIDE), - OUStringConcatenation("../slides/slide" + OUString::number(nPageNum + 1) + ".xml")); + Concat2View("../slides/slide" + OUString::number(nPageNum + 1) + ".xml")); // add slide implicit relation to notes if (nPageNum < mpSlidesFSArray.size()) addRelation(mpSlidesFSArray[ nPageNum ]->getOutputStream(), oox::getRelationship(Relationship::NOTESSLIDE), - OUStringConcatenation("../notesSlides/notesSlide" + OUString::number(nPageNum + 1) + ".xml")); + Concat2View("../notesSlides/notesSlide" + OUString::number(nPageNum + 1) + ".xml")); // add implicit relation to notes master addRelation(pFS->getOutputStream(), @@ -1461,7 +1461,7 @@ void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32 // add implicit relation of slide master to slide layout OUString sRelId = addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::SLIDELAYOUT), - OUStringConcatenation("../slideLayouts/slideLayout" + OUString::number(nLayoutFileId) + ".xml")); + Concat2View("../slideLayouts/slideLayout" + OUString::number(nLayoutFileId) + ".xml")); pFS->singleElementNS(XML_p, XML_sldLayoutId, XML_id, OString::number(GetNewSlideMasterId()), @@ -1478,7 +1478,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro OUString sRelId = addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::SLIDEMASTER), - OUStringConcatenation("slideMasters/slideMaster" + OUString::number(nPageNum + 1) + ".xml")); + Concat2View("slideMasters/slideMaster" + OUString::number(nPageNum + 1) + ".xml")); mPresentationFS->singleElementNS(XML_p, XML_sldMasterId, XML_id, OString::number(GetNewSlideMasterId()), @@ -1505,7 +1505,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro // add implicit relation to the presentation theme addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::THEME), - OUStringConcatenation("../theme/theme" + OUString::number(nPageNum + 1) + ".xml")); + Concat2View("../theme/theme" + OUString::number(nPageNum + 1) + ".xml")); pFS->startElementNS(XML_p, XML_sldMaster, PNMSS); @@ -1602,7 +1602,7 @@ void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMaster // add implicit relation of slide layout to slide master addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::SLIDEMASTER), - OUStringConcatenation("../slideMasters/slideMaster" + OUString::number(nMasterNum + 1) + ".xml")); + Concat2View("../slideMasters/slideMaster" + OUString::number(nMasterNum + 1) + ".xml")); pFS->startElementNS(XML_p, XML_sldLayout, PNMSS, @@ -2348,7 +2348,7 @@ void PowerPointExport::WriteNotesMaster() // add implicit relation to the presentation theme addRelation(pFS->getOutputStream(), oox::getRelationship(Relationship::THEME), - OUStringConcatenation("../theme/theme" + OUString::number(mnMasterPages + 1) + ".xml")); + Concat2View("../theme/theme" + OUString::number(mnMasterPages + 1) + ".xml")); pFS->startElementNS(XML_p, XML_notesMaster, PNMSS); diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index da14c6edc98f..adeae7080e1b 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -2500,7 +2500,7 @@ bool HtmlExport::CreateNavBarFrames() bOk = WriteHtml( "navbar3", true, - OUStringConcatenation( + Concat2View( gaHTMLHeader + CreateMetaCharset() + " <title>" + StringToHTMLString(maPageNames[0]) + "</title>\r\n</head>\r\n" + CreateBodyTag() + CreateLink(u"JavaScript:parent.ExpandOutline()", aButton) @@ -2519,7 +2519,7 @@ bool HtmlExport::CreateNavBarFrames() bOk = WriteHtml( "navbar4", true, - OUStringConcatenation( + Concat2View( gaHTMLHeader + CreateMetaCharset() + " <title>" + StringToHTMLString(maPageNames[0]) + "</title>\r\n</head>\r\n" + CreateBodyTag() + CreateLink(u"JavaScript:parent.CollapseOutline()", aButton) diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index 39ec508ba4c8..cbce18d17d22 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -707,7 +707,7 @@ void LineDescriptorList::FormatText ( } else { - aLineDescriptor.AddPart(OUStringConcatenation(", "+*iPart), rxFont); + aLineDescriptor.AddPart(Concat2View(", "+*iPart), rxFont); } ++iPart; } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index b977b15fe2ad..98b20b05d2f0 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1111,7 +1111,7 @@ void BookmarksTabPage_Impl::DoAction(std::string_view rAction) OUString sURL = m_xBookmarksBox->get_id(nPos); m_xBookmarksBox->remove(nPos); m_xBookmarksBox->append(sURL, aDlg.GetTitle(), - SvFileInformationManager::GetImageId(INetURLObject(rtl::OUStringConcatenation(IMAGE_URL+INetURLObject(sURL).GetHost())))); + SvFileInformationManager::GetImageId(INetURLObject(rtl::Concat2View(IMAGE_URL+INetURLObject(sURL).GetHost())))); m_xBookmarksBox->select(m_xBookmarksBox->n_children() - 1); } } @@ -2343,7 +2343,7 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl, LinkParamNone*, void) else aId = aEntry; - sHelpURL = SfxHelpWindow_Impl::buildHelpURL(xIndexWin->GetFactory(), OUStringConcatenation(OUString::Concat("/") + aId), aAnchor); + sHelpURL = SfxHelpWindow_Impl::buildHelpURL(xIndexWin->GetFactory(), Concat2View(OUString::Concat("/") + aId), aAnchor); } loadHelpContent(sHelpURL); diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index f2046acaecfe..58626bd6d988 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -528,7 +528,7 @@ void collectUIInformation(const util::URL& rURL, const css::uno::Sequence< css:: return; UITestLogger::getInstance().logCommand( - OUStringConcatenation("Send UNO Command (\"" + rURL.Complete + "\") "), rArgs); + Concat2View("Send UNO Command (\"" + rURL.Complete + "\") "), rArgs); } } diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index d761281529c7..7cce6b515db4 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1249,7 +1249,7 @@ OUString ModelData_Impl::GetRecommendedName( const OUString& aSuggestedName, con uno::UNO_QUERY ); if ( xTypeDetection.is() ) { - INetURLObject aObj( rtl::OUStringConcatenation("c:/" + aRecommendedName), INetProtocol::File, + INetURLObject aObj( rtl::Concat2View("c:/" + aRecommendedName), INetProtocol::File, INetURLObject::EncodeMechanism::All, RTL_TEXTENCODING_UTF8, FSysStyle::Dos ); const OUString aExtension = GetRecommendedExtension( aTypeName ); diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index a240e0b9e1f0..967360e341e7 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -581,7 +581,7 @@ SfxClassificationHelper::SfxClassificationHelper(const uno::Reference<document:: continue; //TODO: Support abbreviated names(?) - if (rProperty.Name == OUStringConcatenation(aPrefix + PROP_BACNAME())) + if (rProperty.Name == Concat2View(aPrefix + PROP_BACNAME())) m_pImpl->m_aCategory[eType].m_aName = aValue; else m_pImpl->m_aCategory[eType].m_aLabels[rProperty.Name] = aValue; diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index c14c679a608a..b6f49e37ed24 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -201,7 +201,7 @@ OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir) { aDocumentsDirURL = aUserDirBuf.makeStringAndClear(); if ( bAllowHomeDir || - (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != OUStringConcatenation(aHomeDirURL + "/")) ) + (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != Concat2View(aHomeDirURL + "/")) ) { osl::Directory aDocumentsDir( aDocumentsDirURL ); if( osl::FileBase::E_None == aDocumentsDir.open() ) diff --git a/shell/source/win32/jumplist/JumpList.cxx b/shell/source/win32/jumplist/JumpList.cxx index 06a62a11038d..114c6f4e95b5 100644 --- a/shell/source/win32/jumplist/JumpList.cxx +++ b/shell/source/win32/jumplist/JumpList.cxx @@ -201,21 +201,20 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, PropVariantClear(&propvar); } - ThrowIfFailed(pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), - OStringConcatenation("Setting description '" - + item.description.toUtf8() + "' failed.")); - ThrowIfFailed( - pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), - OStringConcatenation("Setting path '" + sofficePath.toUtf8() + "' failed.")); + pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), + Concat2View("Setting description '" + item.description.toUtf8() + "' failed.")); + + ThrowIfFailed(pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), + Concat2View("Setting path '" + sofficePath.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), - OStringConcatenation("Setting arguments '" + item.arguments.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), + Concat2View("Setting arguments '" + item.arguments.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), - OStringConcatenation("Setting icon path '" + item.iconPath.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), + Concat2View("Setting icon path '" + item.iconPath.toUtf8() + "' failed.")); if (lcl_isItemInArray(pShellLinkItem, m_aRemoved)) { @@ -300,21 +299,20 @@ void SAL_CALL JumpListImpl::addTasks(const Sequence<JumpListItem>& aJumpListItem PropVariantClear(&propvar); } - ThrowIfFailed(pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), - OStringConcatenation("Setting description '" - + item.description.toUtf8() + "' failed.")); - ThrowIfFailed( - pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), - OStringConcatenation("Setting path '" + sofficePath.toUtf8() + "' failed.")); + pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), + Concat2View("Setting description '" + item.description.toUtf8() + "' failed.")); + + ThrowIfFailed(pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), + Concat2View("Setting path '" + sofficePath.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), - OStringConcatenation("Setting arguments '" + item.arguments.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), + Concat2View("Setting arguments '" + item.arguments.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), - OStringConcatenation("Setting icon path '" + item.iconPath.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), + Concat2View("Setting icon path '" + item.iconPath.toUtf8() + "' failed.")); aCollection->AddObject(pShellLinkItem); } diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 7d697e41f372..9efdc32850dd 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -613,11 +613,11 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg, for (const Reference < XRegistryKey > & rSubKey2 : subKeys2) { - if (rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_SERVICES ) && - rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_REGISTRY_LINKS ) && - rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_ACTIVATOR ) && - rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_SINGLETONS ) && - rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_LOCATION) ) + if (rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_SERVICES ) && + rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_REGISTRY_LINKS ) && + rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_ACTIVATOR ) && + rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_SINGLETONS ) && + rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_LOCATION) ) { prepareUserKeys(xReg, xKey, rSubKey2, implName, false); } @@ -949,9 +949,9 @@ void prepareRegistry( for (const Reference < XRegistryKey >& rSubKey2 : subKeys2) { - if (rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_SERVICES) && - rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_REGISTRY_LINKS ) && - rSubKey2->getKeyName() != OUStringConcatenation(xImplKey->getKeyName() + slash_UNO_slash_SINGLETONS )) + if (rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_SERVICES) && + rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_REGISTRY_LINKS ) && + rSubKey2->getKeyName() != Concat2View(xImplKey->getKeyName() + slash_UNO_slash_SINGLETONS )) { prepareUserKeys(xDest, xKey, rSubKey2, implName, true); } diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx index dc8b26d455f1..0a867c5dd261 100644 --- a/svl/source/misc/lockfilecommon.cxx +++ b/svl/source/misc/lockfilecommon.cxx @@ -74,7 +74,7 @@ OUString LockFileCommon::GenerateOwnLockFileURL( std::u16string_view aOrigURL, std::u16string_view aPrefix) { INetURLObject aURL = ResolveLinks(INetURLObject(aOrigURL)); - aURL.setName(OUStringConcatenation(aPrefix + aURL.GetLastName() + "%23" /*'#'*/)); + aURL.setName(Concat2View(aPrefix + aURL.GetLastName() + "%23" /*'#'*/)); return aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } diff --git a/svl/source/misc/msodocumentlockfile.cxx b/svl/source/misc/msodocumentlockfile.cxx index ce1bf287a90c..26192c220371 100644 --- a/svl/source/misc/msodocumentlockfile.cxx +++ b/svl/source/misc/msodocumentlockfile.cxx @@ -58,7 +58,7 @@ OUString GenerateMSOLockFileURL(std::u16string_view aOrigURL) else if (nFileNameLength == 7) sFileName = sFileName.copy(1); } - aURL.setName(OUStringConcatenation("~$" + sFileName)); + aURL.setName(Concat2View("~$" + sFileName)); return aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 59c94be3a305..cfbce503941a 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -2480,7 +2480,7 @@ void SvNumberFormatter::ImpAdjustFormatCodeDefault( OUString aUMsg(OStringToOUString(aMsg, RTL_TEXTENCODING_ASCII_US)); aMsg.setLength(0); LocaleDataWrapper::outputCheckMessage( - xLocaleData->appendLocaleInfo(OUStringConcatenation(aUMsg + pFormatArr[0].NameID))); + xLocaleData->appendLocaleInfo(Concat2View(aUMsg + pFormatArr[0].NameID))); } } // find the default (medium preferred, then long) and reset all other defaults diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 80b314bc5208..39883619f4d0 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -707,7 +707,7 @@ OUString SvNumberformat::ImpObtainCalendarAndNumerals( OUStringBuffer& rString, if ( nNumeralID >= 0x02 && nNumeralID <= 0x13 ) nNatNum = 1; if ( nNatNum ) - rString.insert( nPos, OUStringConcatenation("[NatNum"+OUString::number(nNatNum)+"]")); + rString.insert( nPos, Concat2View("[NatNum"+OUString::number(nNatNum)+"]")); return sCalendar; } @@ -5661,7 +5661,7 @@ OUString SvNumberformat::impTransliterateImpl(const OUString& rStr, sal_Int32 nField = -1; do { - nField = rNum.GetParams().indexOf(OUStringConcatenation(rKeywords[nDateKey] + "="), ++nField); + nField = rNum.GetParams().indexOf(Concat2View(rKeywords[nDateKey] + "="), ++nField); } while (nField != -1 && nField != 0 && (rNum.GetParams()[nField - 1] != ',' && diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index b61abd58e9ad..8e66c1b326ed 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -192,7 +192,7 @@ void PlaceEditDialog::InitDetails( ) auto nSize = std::min(aTypesUrlsList.getLength(), aTypesNamesList.getLength()); for ( sal_Int32 i = 0; i < nSize; ++i ) { - OUString sUrl = aTypesUrlsList[i].replaceFirst("<host", OUStringConcatenation("<" + SvtResId(STR_SVT_HOST))).replaceFirst("port>", OUStringConcatenation(SvtResId(STR_SVT_PORT) + ">")); + OUString sUrl = aTypesUrlsList[i].replaceFirst("<host", Concat2View("<" + SvtResId(STR_SVT_HOST))).replaceFirst("port>", Concat2View(SvtResId(STR_SVT_PORT) + ">")); if ((sUrl == GDRIVE_BASE_URL && bSkipGDrive) || (sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL) && bSkipAlfresco) || diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 65d6c41645a9..36ae07533357 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -145,7 +145,7 @@ bool HostDetailsContainer::setUrl( const INetURLObject& rUrl ) bool HostDetailsContainer::verifyScheme( const OUString& sScheme ) { - return sScheme == OUStringConcatenation( m_sScheme + "://" ); + return sScheme == Concat2View( m_sScheme + "://" ); } DavDetailsContainer::DavDetailsContainer(PlaceEditDialog* pBuilder) diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx index b813c7ee50e8..8f99e3b29110 100644 --- a/svtools/source/svhtml/HtmlWriter.cxx +++ b/svtools/source/svhtml/HtmlWriter.cxx @@ -53,7 +53,7 @@ void HtmlWriter::start(const OString& aElement) } mrStream.WriteChar('<'); - mrStream.WriteOString(OStringConcatenation(maNamespace + aElement)); + mrStream.WriteOString(Concat2View(maNamespace + aElement)); mbElementOpen = true; } @@ -108,7 +108,7 @@ void HtmlWriter::end() } } mrStream.WriteCharPtr("</"); - mrStream.WriteOString(OStringConcatenation(maNamespace + maElementStack.back())); + mrStream.WriteOString(Concat2View(maNamespace + maElementStack.back())); mrStream.WriteCharPtr(">"); if (mbPrettyPrint) mrStream.WriteCharPtr("\n"); diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 3d412eacb307..1aef1cc73f9c 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -303,7 +303,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO { const char *appBundle = [[[NSBundle mainBundle] bundlePath] UTF8String]; OUString path = rBaseURL.GetURLPath(); - if( path.startsWith( OUStringConcatenation(OUString( appBundle, strlen( appBundle ), RTL_TEXTENCODING_UTF8 ) + "/") ) ) + if( path.startsWith( Concat2View(OUString( appBundle, strlen( appBundle ), RTL_TEXTENCODING_UTF8 ) + "/") ) ) rbDirIsReadOnly = true; } #else diff --git a/svx/source/gallery2/gallerybinaryengineentry.cxx b/svx/source/gallery2/gallerybinaryengineentry.cxx index f892788ae208..98df8a5c0a29 100644 --- a/svx/source/gallery2/gallerybinaryengineentry.cxx +++ b/svx/source/gallery2/gallerybinaryengineentry.cxx @@ -60,7 +60,7 @@ void GalleryBinaryEngineEntry::CreateUniqueURL(const INetURLObject& rBaseURL, IN { // create new URLs nIdx++; aURL = aBaseNoCase; - aURL.setName(OUStringConcatenation(aURL.getName() + OUString::number(nIdx))); + aURL.setName(Concat2View(aURL.getName() + OUString::number(nIdx))); } } diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 520790a1d7c3..8f642e779b58 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -226,7 +226,7 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) std::set<Color> aColors = pDocSh->GetDocColors(); mnColorCount = aColors.size(); rColorSet.Clear(); - rColorSet.addEntriesForColorSet(aColors, OUStringConcatenation(SvxResId( RID_SVXSTR_DOC_COLOR_PREFIX ) + " ") ); + rColorSet.addEntriesForColorSet(aColors, Concat2View(SvxResId( RID_SVXSTR_DOC_COLOR_PREFIX ) + " ") ); } } else diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 228c5dc0a234..5ae88b2f5f14 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -1054,7 +1054,7 @@ void Test::testNestedFieldmark() } mxComponent = loadFromDesktop(m_directories.getURLFromSrc( - OUStringConcatenation("/sw/qa/extras/globalfilter/data/" + rFilterName.second)), + Concat2View("/sw/qa/extras/globalfilter/data/" + rFilterName.second)), "com.sun.star.text.TextDocument"); verifyNestedFieldmark(rFilterName.first + ", load", mxComponent); diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 5c64d09ea667..52e1eb6aa1de 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -2060,7 +2060,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testEmbeddedDataSource) // Load: should have a component and a data source, too. // Path with "#" must not cause issues - createSwDoc(OUStringConcatenation(DATA_DIRECTORY + OUString::Concat(u"hash%23path/")), + createSwDoc(Concat2View(DATA_DIRECTORY + OUString::Concat(u"hash%23path/")), "embedded-data-source.odt"); CPPUNIT_ASSERT(xDatabaseContext->hasByName("calc-data-source")); diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx index 61da186d39b9..75e63b811680 100644 --- a/sw/source/core/crsr/crossrefbookmark.cxx +++ b/sw/source/core/crsr/crossrefbookmark.cxx @@ -71,7 +71,7 @@ namespace sw::mark CrossRefHeadingBookmark::CrossRefHeadingBookmark(const SwPaM& rPaM, const vcl::KeyCode& rCode, const OUString& rName) - : CrossRefBookmark(rPaM, rCode, rName, OUStringConcatenation(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc")) + : CrossRefBookmark(rPaM, rCode, rName, Concat2View(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()+"_Toc")) { } bool CrossRefHeadingBookmark::IsLegalName(std::u16string_view rName) diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 02efb6b4433e..6b7852997d60 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1116,7 +1116,7 @@ void SwEditShell::SetClassification(const OUString& rName, SfxClassificationPoli if (bHeaderIsNeeded) { - if (!lcl_hasField(xHeaderText, DocInfoServiceName, OUStringConcatenation(SfxClassificationHelper::PROP_PREFIX_INTELLECTUALPROPERTY() + SfxClassificationHelper::PROP_DOCHEADER()))) + if (!lcl_hasField(xHeaderText, DocInfoServiceName, Concat2View(SfxClassificationHelper::PROP_PREFIX_INTELLECTUALPROPERTY() + SfxClassificationHelper::PROP_DOCHEADER()))) { // Append a field to the end of the header text. uno::Reference<beans::XPropertySet> xField(xMultiServiceFactory->createInstance(DocInfoServiceName), uno::UNO_QUERY); diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 0a152b678476..c4f4d1249070 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -285,7 +285,7 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) } if (!level.isEmpty() || !numString.isEmpty()) - rWrt.Strm().WriteUnicodeOrByteText(OUStringConcatenation(level + numString + " ")); + rWrt.Strm().WriteUnicodeOrByteText(Concat2View(level + numString + " ")); } OUString aStr( rNd.GetText() ); diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 6c489783aca0..f9ee4adf5005 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -333,7 +333,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp, } else { - HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); return; } break; @@ -583,7 +583,7 @@ void SwHTMLWriter::OutStyleSheet( const SwPageDesc& rPageDesc ) DecIndentLevel(); OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_style), false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + OOO_STRING_SVTOOLS_HTML_style), false ); } else { @@ -2816,7 +2816,7 @@ static Writer& OutCSS1_SwFormatDrop( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); } return rWrt; @@ -3331,7 +3331,7 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt ) } else { - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false ); return rWrt; } } diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index b3011ee78f0e..1bf0a45e82e3 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -135,7 +135,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl ) { if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist) ); + HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist) ); IncIndentLevel(); m_bLFPossible = true; } @@ -147,7 +147,7 @@ void SwHTMLWriter::OutAndSetDefList( sal_uInt16 nNewLvl ) DecIndentLevel(); if( m_bLFPossible ) OutNewLine(); - HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist), false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + OOO_STRING_SVTOOLS_HTML_deflist), false ); m_bLFPossible = true; } } @@ -159,7 +159,7 @@ void SwHTMLWriter::ChangeParaToken( HtmlTokenId nNew ) { if( nNew != m_nLastParaToken && HtmlTokenId::PREFORMTXT_ON == m_nLastParaToken ) { - HTMLOutFuncs::Out_AsciiTag( Strm(), OStringConcatenation(GetNamespace() + OOO_STRING_SVTOOLS_HTML_preformtxt), false ); + HTMLOutFuncs::Out_AsciiTag( Strm(), Concat2View(GetNamespace() + OOO_STRING_SVTOOLS_HTML_preformtxt), false ); m_bLFPossible = true; } m_nLastParaToken = nNew; @@ -775,7 +775,7 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, if( rHWrt.m_nDefListLvl > 0 && !bForceDL ) { OString aTag = bDT ? OOO_STRING_SVTOOLS_HTML_dt : OOO_STRING_SVTOOLS_HTML_dd; - HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OStringConcatenation(rHWrt.GetNamespace() + aTag) ); + HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHWrt.GetNamespace() + aTag) ); } if( pAdjItem && @@ -808,7 +808,7 @@ static void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, ... etc. - the rest is truncated