diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-20 21:07:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-21 13:15:32 +0200 |
commit | 7049328fb2d656d8454d4f704ad75d057e766c0b (patch) | |
tree | 0e8f2e1cce68c6a07c82d5e8496a64f716fecfde | |
parent | a003e4ff69263c7feb8e97e3291e5579fbd181ac (diff) |
loplugin:stringadd replace OUStringLiteral temporaries with OUString::Concat
Change-Id: I656f06a74d9f0180ae460264563d6a935c7d2c60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114377
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
53 files changed, 146 insertions, 138 deletions
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx index 90f16fdd3332..43376278b285 100644 --- a/codemaker/source/cppumaker/cppuoptions.cxx +++ b/codemaker/source/cppumaker/cppuoptions.cxx @@ -76,7 +76,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-O', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i+1] + "'"; + tmp += OString::Concat(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -92,7 +92,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) case 'n': if (av[i][2] != 'D' || av[i][3] != '\0') { - OString tmp = OStringLiteral("'-nD', please check your input '") + av[i] + "'"; + OString tmp = OString::Concat("'-nD', please check your input '") + av[i] + "'"; throw IllegalArgument(tmp); } @@ -111,7 +111,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-T', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i+1] + "'"; + tmp += OString::Concat(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -138,7 +138,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-L', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -158,7 +158,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-CS', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -176,7 +176,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-C', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -196,7 +196,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-Gc', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -210,7 +210,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-G', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -232,7 +232,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-X', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i+1] + "'"; + tmp += OString::Concat(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -248,7 +248,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) } default: - throw IllegalArgument(OStringLiteral("the option is unknown") + av[i]); + throw IllegalArgument(OString::Concat("the option is unknown") + av[i]); } } else { diff --git a/codemaker/source/javamaker/javaoptions.cxx b/codemaker/source/javamaker/javaoptions.cxx index c86f35e6cf15..e0e51c9736f8 100644 --- a/codemaker/source/javamaker/javaoptions.cxx +++ b/codemaker/source/javamaker/javaoptions.cxx @@ -71,7 +71,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-O', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i+1] + "'"; + tmp += OString::Concat(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -104,7 +104,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-T', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i+1] + "'"; + tmp += OString::Concat(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -131,7 +131,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-Gc', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -144,7 +144,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-G', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i] + "'"; + tmp += OString::Concat(" your input '") + av[i] + "'"; } throw IllegalArgument(tmp); @@ -165,7 +165,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) OString tmp("'-X', please check"); if (i <= ac - 1) { - tmp += OStringLiteral(" your input '") + av[i+1] + "'"; + tmp += OString::Concat(" your input '") + av[i+1] + "'"; } throw IllegalArgument(tmp); @@ -180,7 +180,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) } default: - throw IllegalArgument(OStringLiteral("the option is unknown") + av[i]); + throw IllegalArgument(OString::Concat("the option is unknown") + av[i]); } } else { diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index b53c4086bf3c..cee15b1cbcb9 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -285,7 +285,7 @@ sal_Int32 OStorageHelper::GetXStorageFormat( { // the mediatype is not known OUString aMsg = __func__ - + OUStringLiteral(u":") + + OUString::Concat(u":") + OUString::number(__LINE__) + ": unknown media type '" + aMediaType diff --git a/compilerplugins/clang/stringadd.cxx b/compilerplugins/clang/stringadd.cxx index b4994ab60ec6..5723b5bb6e3b 100644 --- a/compilerplugins/clang/stringadd.cxx +++ b/compilerplugins/clang/stringadd.cxx @@ -242,10 +242,15 @@ bool StringAdd::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const* operatorCall return; auto tc3 = loplugin::TypeCheck(e->getType()); if (!tc3.Class("OUString").Namespace("rtl").GlobalNamespace() - && !tc3.Class("OString").Namespace("rtl").GlobalNamespace()) + && !tc3.Class("OString").Namespace("rtl").GlobalNamespace() + && !tc3.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace() + && !tc3.Class("OStringLiteral").Namespace("rtl").GlobalNamespace() + && !tc3.Class("OUStringBuffer").Namespace("rtl").GlobalNamespace() + && !tc3.Class("OStringBuffer").Namespace("rtl").GlobalNamespace()) return; report(DiagnosticsEngine::Warning, - ("avoid constructing %0 from %1 on %select{L|R}2HS of + (where %select{R|L}2HS is of" + ("rather use O[U]String::Concat than constructing %0 from %1 on %select{L|R}2HS of " + "+ (where %select{R|L}2HS is of" " type %3)"), compat::getBeginLoc(e)) << e->getType().getLocalUnqualifiedType() << e->getSubExprAsWritten()->getType() << arg @@ -348,7 +353,8 @@ bool StringAdd::isSideEffectFree(Expr const* expr) return true; // Expr::HasSideEffects does not like stuff that passes through OUStringLiteral auto dc2 = loplugin::DeclCheck(constructExpr->getConstructor()->getParent()); - if (dc2.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace()) + if (dc2.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace() + || dc2.Class("OStringLiteral").Namespace("rtl").GlobalNamespace()) return true; } @@ -356,7 +362,8 @@ bool StringAdd::isSideEffectFree(Expr const* expr) if (auto functionalCastExpr = dyn_cast<CXXFunctionalCastExpr>(expr)) { auto tc = loplugin::TypeCheck(functionalCastExpr->getType()); - if (tc.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace()) + if (tc.Class("OUStringLiteral").Namespace("rtl").GlobalNamespace() + || tc.Class("OStringLiteral").Namespace("rtl").GlobalNamespace()) return isSideEffectFree(functionalCastExpr->getSubExpr()); } diff --git a/compilerplugins/clang/test/stringadd.cxx b/compilerplugins/clang/test/stringadd.cxx index e17b207fcb64..a953e44062bb 100644 --- a/compilerplugins/clang/test/stringadd.cxx +++ b/compilerplugins/clang/test/stringadd.cxx @@ -36,6 +36,7 @@ void f1(OUString s1, int i, OString o) s2 += OUString::number(i); // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}} s2 += XXX1; + // expected-error@+2 {{rather use O[U]String::Concat than constructing 'rtl::OUStringLiteral<4>' from 'const char16_t [4]' on LHS of + (where RHS is of type 'const char [4]') [loplugin:stringadd]}} // expected-error@+1 {{simplify by merging with the preceding assignment [loplugin:stringadd]}} s2 += OUStringLiteral(XXX1u) + XXX2; @@ -200,9 +201,9 @@ void f1(OUString s, OUString t, int i, const char* pChar) { // no warning expected t = t + "xxx"; - // expected-error@+1 {{avoid constructing 'rtl::OUString' from 'const char [4]' on RHS of + (where LHS is of type 'rtl::OUString') [loplugin:stringadd]}} + // expected-error@+1 {{rather use O[U]String::Concat than constructing 'rtl::OUString' from 'const char [4]' on RHS of + (where LHS is of type 'rtl::OUString') [loplugin:stringadd]}} s = s + OUString("xxx"); - // expected-error@+1 {{avoid constructing 'rtl::OUString' from 'const rtl::OUString' on RHS of + (where LHS is of type 'rtl::OUString') [loplugin:stringadd]}} + // expected-error@+1 {{rather use O[U]String::Concat than constructing 'rtl::OUString' from 'const rtl::OUString' on RHS of + (where LHS is of type 'rtl::OUString') [loplugin:stringadd]}} s = s + OUString(getByRef()); // no warning expected @@ -220,9 +221,9 @@ void f1(OUString s, OUString t, int i, const char* pChar) void f2(char ch) { OString s; - // expected-error@+1 {{avoid constructing 'rtl::OString' from 'const char [4]' on RHS of + (where LHS is of type 'rtl::OString') [loplugin:stringadd]}} + // expected-error@+1 {{rather use O[U]String::Concat than constructing 'rtl::OString' from 'const char [4]' on RHS of + (where LHS is of type 'rtl::OString') [loplugin:stringadd]}} s = s + OString("xxx"); - // expected-error@+1 {{avoid constructing 'rtl::OString' from 'char' on RHS of + (where LHS is of type 'rtl::OString') [loplugin:stringadd]}} + // expected-error@+1 {{rather use O[U]String::Concat than constructing 'rtl::OString' from 'char' on RHS of + (where LHS is of type 'rtl::OString') [loplugin:stringadd]}} s = s + OString(ch); } } diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index b76284ff759b..65c3e800702a 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -148,7 +148,7 @@ UpdateCheckROModel::getUpdateEntry(UpdateInfo& rInfo) const for(sal_Int32 n=1; n < 6; ++n ) { OUString aUStr = getStringValue( - OString(OStringLiteral(RELEASE_NOTE) + OString::number(n)).getStr()); + OString(OString::Concat(RELEASE_NOTE) + OString::number(n)).getStr()); if( !aUStr.isEmpty() ) rInfo.ReleaseNotes.push_back(ReleaseNote(static_cast<sal_Int8>(n), aUStr)); } diff --git a/filter/source/msfilter/rtfutil.cxx b/filter/source/msfilter/rtfutil.cxx index 4d6c5dda2fea..0e840a59862a 100644 --- a/filter/source/msfilter/rtfutil.cxx +++ b/filter/source/msfilter/rtfutil.cxx @@ -248,7 +248,7 @@ static bool TryOutString(const OUString& rStr, rtl_TextEncoding eDestEnc) OString OutStringUpr(const char* pToken, const OUString& rStr, rtl_TextEncoding eDestEnc) { if (TryOutString(rStr, eDestEnc)) - return OStringLiteral("{") + pToken + " " + OutString(rStr, eDestEnc) + "}"; + return OString::Concat("{") + pToken + " " + OutString(rStr, eDestEnc) + "}"; OStringBuffer aRet; aRet.append("{" OOO_STRING_SVTOOLS_RTF_UPR "{"); diff --git a/idlc/inc/astsequence.hxx b/idlc/inc/astsequence.hxx index d74f8320f627..e8a2850e23f4 100644 --- a/idlc/inc/astsequence.hxx +++ b/idlc/inc/astsequence.hxx @@ -25,7 +25,7 @@ class AstSequence final : public AstType { public: AstSequence(AstType const* pMemberType, AstScope* pScope) - : AstType(NT_sequence, OStringLiteral("[]") + pMemberType->getScopedName(), pScope) + : AstType(NT_sequence, OString::Concat("[]") + pMemberType->getScopedName(), pScope) , m_pMemberType(pMemberType) { } diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index f41670b7343f..530af9d6efe1 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -79,14 +79,14 @@ inline css::uno::Any DbgGetCaughtException() OSL_ENSURE(c, m); \ throw css::lang::IllegalArgumentException( \ __func__ \ - + OUStringLiteral(u",\n" m), \ + + OUString::Concat(u",\n" m), \ css::uno::Reference< css::uno::XInterface >(), \ 0 ); } #define ENSURE_ARG_OR_THROW2(c, m, ifc, arg) if( !(c) ) { \ OSL_ENSURE(c, m); \ throw css::lang::IllegalArgumentException( \ __func__ \ - + OUStringLiteral(u",\n" m), \ + + OUString::Concat(u",\n" m), \ ifc, \ arg ); } @@ -97,14 +97,14 @@ inline css::uno::Any DbgGetCaughtException() if( !(c) ){ \ OSL_ENSURE(c, m); \ throw css::uno::RuntimeException( \ - __func__ + OUStringLiteral(u",\n" m), \ + __func__ + OUString::Concat(u",\n" m), \ css::uno::Reference< css::uno::XInterface >() ); } #define ENSURE_OR_THROW2(c, m, ifc) \ if( !(c) ) { \ OSL_ENSURE(c, m); \ throw css::uno::RuntimeException( \ - __func__ + OUStringLiteral(u",\n" m), \ + __func__ + OUString::Concat(u",\n" m), \ ifc ); } /** This macro asserts the given condition (in debug mode), and diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx index 6864881aad7d..dc7a8a153a5c 100644 --- a/jvmfwk/source/fwkbase.cxx +++ b/jvmfwk/source/fwkbase.cxx @@ -107,7 +107,7 @@ VendorSettings::VendorSettings() if (m_xmlDocVendorSettings == nullptr) throw FrameworkException( JFW_E_ERROR, - OStringLiteral("[Java framework] Error while parsing file: ") + OString::Concat("[Java framework] Error while parsing file: ") + sSettingsPath + "."); m_xmlPathContextVendorSettings = xmlXPathNewContext(m_xmlDocVendorSettings); diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx index 35986b3646ba..f3c6d92669fb 100644 --- a/pyuno/source/module/pyuno_module.cxx +++ b/pyuno/source/module/pyuno_module.cxx @@ -219,7 +219,7 @@ OUString getLibDir() void raisePySystemException( const char * exceptionType, std::u16string_view message ) { - OString buf = OStringLiteral("Error during bootstrapping uno (") + + OString buf = OString::Concat("Error during bootstrapping uno (") + exceptionType + "):" + OUStringToOString( message, osl_getThreadTextEncoding() ); @@ -386,14 +386,14 @@ PyObject * extractOneStringArg( PyObject *args, char const *funcName ) { if( !PyTuple_Check( args ) || PyTuple_Size( args) != 1 ) { - OString buf = funcName + OStringLiteral(": expecting one string argument"); + OString buf = funcName + OString::Concat(": expecting one string argument"); PyErr_SetString( PyExc_RuntimeError, buf.getStr() ); return nullptr; } PyObject *obj = PyTuple_GetItem( args, 0 ); if (!PyUnicode_Check(obj)) { - OString buf = funcName + OStringLiteral(": expecting one string argument"); + OString buf = funcName + OString::Concat(": expecting one string argument"); PyErr_SetString( PyExc_TypeError, buf.getStr()); return nullptr; } @@ -504,7 +504,7 @@ static PyObject *getTypeByName( } else { - OString buf = OStringLiteral("Type ") + name + " is unknown"; + OString buf = OString::Concat("Type ") + name + " is unknown"; PyErr_SetString( PyExc_RuntimeError, buf.getStr() ); } } diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx index 63176c3a2970..a04b4e26d78c 100644 --- a/pyuno/source/module/pyuno_type.cxx +++ b/pyuno/source/module/pyuno_type.cxx @@ -226,7 +226,7 @@ static PyObject* callCtor( const Runtime &r , const char * clazz, const PyRef & PyRef code( PyDict_GetItemString( r.getImpl()->cargo->getUnoModule().get(), clazz ) ); if( ! code.is() ) { - OString buf = OStringLiteral("couldn't access uno.") + clazz; + OString buf = OString::Concat("couldn't access uno.") + clazz; PyErr_SetString( PyExc_RuntimeError, buf.getStr() ); return nullptr; } diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx index c23120898fc5..ea70758ba6f3 100644 --- a/reportdesign/source/core/misc/reportformula.cxx +++ b/reportdesign/source/core/misc/reportformula.cxx @@ -82,7 +82,7 @@ namespace rptui case Field: { - m_sCompleteFormula = sFieldPrefix + OUStringLiteral(u"[") + _rFieldOrExpression + "]"; + m_sCompleteFormula = sFieldPrefix + OUString::Concat(u"[") + _rFieldOrExpression + "]"; } break; default: diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index f9f316d8b5fb..906f5a9e209e 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -841,7 +841,7 @@ static oslFileError oslDoCopy(const char* pszSourceFileName, const char* pszDest { //TODO: better pick a temp file name instead of adding .osl-tmp: // use the destination file to avoid EXDEV /* Cross-device link */ - tmpDestFile = pszDestFileName + OStringLiteral(".osl-tmp"); + tmpDestFile = pszDestFileName + OString::Concat(".osl-tmp"); if (rename(pszDestFileName, tmpDestFile.getStr()) != 0) { int e = errno; diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index 034979ba0e4e..d903bdd2f2de 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -166,11 +166,11 @@ static oslPipe osl_psz_createPipe(const char *pszPipeName, oslPipeOptions Option OSL_VERIFY(osl_psz_getUserIdent(Security, Ident, sizeof(Ident))); - name += OStringLiteral("OSL_PIPE_") + Ident + "_" + pszPipeName; + name += OString::Concat("OSL_PIPE_") + Ident + "_" + pszPipeName; } else { - name += OStringLiteral("OSL_PIPE_") + pszPipeName; + name += OString::Concat("OSL_PIPE_") + pszPipeName; } if (o3tl::make_unsigned(name.getLength()) >= sizeof addr.sun_path) diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 884ff06e917c..b83dbb3b821a 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -380,7 +380,7 @@ static OString outputError(const OString & returnVal, const OString & rightVal, return OString(); OString aString = msg + - OStringLiteral(": the returned value is '") + + OString::Concat(": the returned value is '") + returnVal + "', but the value should be '" + rightVal + diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 138555180f41..689a93a2e498 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -3610,7 +3610,7 @@ void ScExportTest::testSwappedOutImageExport() // Check whether the export code swaps in the image which was swapped out before. ScDocShellRef xDocSh = loadDoc(u"document_with_two_images.", FORMAT_ODS); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + aFilterNames[nFilter]; + const OString sFailedMessage = OString::Concat("Failed on filter: ") + aFilterNames[nFilter]; CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xDocSh.is()); // Export the document and import again for a check @@ -3725,7 +3725,7 @@ void ScExportTest::testLinkedGraphicRT() { // Load the original file with one image ScDocShellRef xDocSh = loadDoc(u"document_with_linked_graphic.", FORMAT_ODS); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + aFilterNames[nFilter]; + const OString sFailedMessage = OString::Concat("Failed on filter: ") + aFilterNames[nFilter]; // Export the document and import again for a check ScDocShellRef xDocSh2 = saveAndReload(xDocSh.get(), nFilter); @@ -3767,7 +3767,7 @@ void ScExportTest::testImageWithSpecialID() { ScDocShellRef xDocSh = loadDoc(u"images_with_special_IDs.", FORMAT_ODS); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + aFilterNames[nFilter]; + const OString sFailedMessage = OString::Concat("Failed on filter: ") + aFilterNames[nFilter]; CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), xDocSh.is()); // Export the document and import again for a check diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index d7b7146a1402..30ece5cd5116 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -155,7 +155,7 @@ void Test::testFormulaCreateStringFromTokens() bool bInserted = pDBs->getNamedDBs().insert(std::move(pData)); CPPUNIT_ASSERT_MESSAGE( OString( - OStringLiteral("Failed to insert \"") + aDBs[i].pName + "\"").getStr(), + OString::Concat("Failed to insert \"") + aDBs[i].pName + "\"").getStr(), bInserted); } @@ -7267,7 +7267,7 @@ void Test::testFuncTableRef() ScAddress(2,4,0), ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE); bool bInserted = pGlobalNames->insert(pName); CPPUNIT_ASSERT_MESSAGE( - OString(OStringLiteral("Failed to insert named expression ") + aNames[i].pName +".").getStr(), bInserted); + OString(OString::Concat("Failed to insert named expression ") + aNames[i].pName +".").getStr(), bInserted); } } @@ -7441,7 +7441,7 @@ void Test::testFuncTableRef() ScAddress(6,12,0), ScRangeData::Type::Name, formula::FormulaGrammar::GRAM_NATIVE); bool bInserted = pGlobalNames->insert(pName); CPPUNIT_ASSERT_MESSAGE( - OString(OStringLiteral("Failed to insert named expression ") + aHlNames[i].pName +".").getStr(), bInserted); + OString(OString::Concat("Failed to insert named expression ") + aHlNames[i].pName +".").getStr(), bInserted); } } diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index 77d1e329a839..60003fb924b3 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -499,7 +499,7 @@ OString ScFlatBoolRowSegments::dumpAsString() while (getRangeData(nRow, aRange)) { if (!nRow) - aSegment = (aRange.mbValue ? OStringLiteral("1") : OStringLiteral("0")) + OStringLiteral(":"); + aSegment = (aRange.mbValue ? OStringLiteral("1") : OStringLiteral("0")) + OString::Concat(":"); else aSegment.clear(); @@ -571,7 +571,7 @@ OString ScFlatBoolColSegments::dumpAsString() while (getRangeData(nCol, aRange)) { if (!nCol) - aSegment = (aRange.mbValue ? OStringLiteral("1") : OStringLiteral("0")) + OStringLiteral(":"); + aSegment = (aRange.mbValue ? OString::Concat("1") : OString::Concat("0")) + OString::Concat(":"); else aSegment.clear(); diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx index 34613ad9ff94..412528b95937 100644 --- a/sc/source/filter/qpro/qproform.cxx +++ b/sc/source/filter/qpro/qproform.cxx @@ -80,7 +80,7 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const char* pExtString bAddIn = true; if( pExtString ) { - OString s = OStringLiteral("QPRO_") + pExtString; + OString s = OString::Concat("QPRO_") + pExtString; nPush = aPool.Store(eOc, OStringToOUString(s, maIn.GetStreamCharSet())); aPool << nPush; } diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 7f70942dadae..4fd2fab73f80 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -530,13 +530,13 @@ ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs ) : // global auto registerAutoEvent = [this](sal_Int32 nID, const char* sName) - { registerEventHandler(nID, script::ModuleType::NORMAL, OString(OStringLiteral("Auto_") + sName).getStr(), -1, uno::Any(false)); }; + { registerEventHandler(nID, script::ModuleType::NORMAL, OString(OString::Concat("Auto_") + sName).getStr(), -1, uno::Any(false)); }; registerAutoEvent(AUTO_OPEN, "Open"); registerAutoEvent(AUTO_CLOSE, "Close"); // Workbook auto registerWorkbookEvent = [this](sal_Int32 nID, const char* sName, sal_Int32 nCancelIndex) - { registerEventHandler(nID, script::ModuleType::DOCUMENT, OString(OStringLiteral("Workbook_") + sName).getStr(), nCancelIndex, uno::Any(false)); }; + { registerEventHandler(nID, script::ModuleType::DOCUMENT, OString(OString::Concat("Workbook_") + sName).getStr(), nCancelIndex, uno::Any(false)); }; registerWorkbookEvent( WORKBOOK_ACTIVATE, "Activate", -1 ); registerWorkbookEvent( WORKBOOK_DEACTIVATE, "Deactivate", -1 ); registerWorkbookEvent( WORKBOOK_OPEN, "Open", -1 ); @@ -552,10 +552,10 @@ ScVbaEventsHelper::ScVbaEventsHelper( const uno::Sequence< uno::Any >& rArgs ) : // Worksheet events. All events have a corresponding workbook event. auto registerWorksheetEvent = [this](sal_Int32 nID, const char* sName, sal_Int32 nCancelIndex) { - registerEventHandler(nID, script::ModuleType::DOCUMENT, OString(OStringLiteral("Worksheet_") + sName).getStr(), + registerEventHandler(nID, script::ModuleType::DOCUMENT, OString(OString::Concat("Worksheet_") + sName).getStr(), nCancelIndex, uno::Any(true)); registerEventHandler(USERDEFINED_START + nID, script::ModuleType::DOCUMENT, - OString(OStringLiteral("Workbook_Worksheet") + sName).getStr(), + OString(OString::Concat("Workbook_Worksheet") + sName).getStr(), ((nCancelIndex >= 0) ? (nCancelIndex + 1) : -1), uno::Any(false)); }; registerWorksheetEvent( WORKSHEET_ACTIVATE, "Activate", -1 ); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 3c95f8290693..8b3614e6b52d 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -426,7 +426,7 @@ void SdExportTest::testSwappedOutImageExport() { // Load the original file with one image ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/document_with_two_images.odp"), ODP); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + aFileFormats[vFormats[nExportFormat]].pFilterName; + const OString sFailedMessage = OString::Concat("Failed on filter: ") + aFileFormats[vFormats[nExportFormat]].pFilterName; // Export the document and import again for a check uno::Reference< lang::XComponent > xComponent = xDocShRef->GetModel(); @@ -645,7 +645,7 @@ void SdExportTest::testLinkedGraphicRT() // Check whether graphic imported well after export { - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + aFileFormats[vFormats[nExportFormat]].pFilterName; + const OString sFailedMessage = OString::Concat("Failed on filter: ") + aFileFormats[vFormats[nExportFormat]].pFilterName; SdDrawDocument *pDoc = xDocShRef->GetDoc(); CPPUNIT_ASSERT_MESSAGE( sFailedMessage.getStr(), pDoc != nullptr ); @@ -723,7 +723,7 @@ void SdExportTest::testImageWithSpecialID() { // Load the original file ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/images_with_special_IDs.odp"), ODP); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + aFileFormats[vFormats[nExportFormat]].pFilterName; + const OString sFailedMessage = OString::Concat("Failed on filter: ") + aFileFormats[vFormats[nExportFormat]].pFilterName; // Export the document and import again for a check uno::Reference< lang::XComponent > xComponent = xDocShRef->GetModel(); @@ -1068,7 +1068,7 @@ void SdExportTest::testBulletsAsImage() for (sal_Int32 nExportFormat : {ODP, PPTX, PPT}) { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/BulletsAsImage.odp"), ODP); - const OString sFailedMessageBase = OStringLiteral("Failed on filter '") + aFileFormats[nExportFormat].pFilterName + "': "; + const OString sFailedMessageBase = OString::Concat("Failed on filter '") + aFileFormats[nExportFormat].pFilterName + "': "; uno::Reference< lang::XComponent > xComponent = xDocShRef->GetModel(); uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY); diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx index a4d93c611d7d..d206c981f356 100644 --- a/sdext/source/pdfimport/test/pdfunzip.cxx +++ b/sdext/source/pdfimport/test/pdfunzip.cxx @@ -270,7 +270,7 @@ static int write_addStreamArray( const char* pOutFile, PDFArray* pStreams, PDFFi if( pObject ) { OString aOutStream = pOutFile + - OStringLiteral("_stream_") + + OString::Concat("_stream_") + OString::number( sal_Int32(pStreamRef->m_nNumber) ) + "_" + OString::number( sal_Int32(pStreamRef->m_nGeneration) ); @@ -413,7 +413,7 @@ static int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile } OString aOutStream = i_pOutFile + - OStringLiteral("_stream_") + + OString::Concat("_stream_") + OString::number( nObject ) + "_" + OString::number( nGeneration ); diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 852501c34af5..c6ed821c1874 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -45,7 +45,7 @@ sal_uInt16 SfxSlot::GetWhich( const SfxItemPool &rPool ) const OString SfxSlot::GetCommand() const { - return OStringLiteral(".uno:") + pUnoName; + return OString::Concat(".uno:") + pUnoName; } OUString SfxSlot::GetCommandString() const diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 5f77b3de952a..10807c70a26d 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -104,7 +104,7 @@ rtl::Reference<svt::StatusbarController> SfxStatusBarControllerFactory( sal_uInt16 nSlotId = pSlot->GetSlotId(); if ( nSlotId > 0 ) { - OString aCmd = OStringLiteral(".uno:") + pSlot->GetUnoName(); + OString aCmd = OString::Concat(".uno:") + pSlot->GetUnoName(); pStatusBar->SetHelpId( nSlotId, aCmd ); return SfxStatusBarControl::CreateControl( nSlotId, nID, pStatusBar, pModule ); } diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 3ef17c92452b..ec1046617253 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -346,7 +346,7 @@ static inline OString lcl_generateJSON(const SfxViewShell* pView, std::string_vi const OString& rPayload) { assert(pView != nullptr && "pView must be valid"); - return OStringLiteral("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pView)) + return OString::Concat("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pView)) + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", \"" + rKey + "\": \"" + lcl_sanitizeJSONAsValue(rPayload) + "\" }"; } @@ -557,7 +557,7 @@ void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisVie if (comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation()) { OString sHyperlink = rHyperlink.isEmpty() ? "{}" : rHyperlink; - sPayload = OStringLiteral("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView()) + + sPayload = OString::Concat("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView()) + "\", \"rectangle\": \"" + rRectangle + "\", \"mispelledWord\": \"" + OString::number(bMispelledWord ? 1 : 0) + "\", \"hyperlink\": " + sHyperlink + " }"; diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 9ec32a35f630..014782e62d27 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -180,7 +180,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar if ( pDesktopLaunch && *pDesktopLaunch ) { - aLaunchBuffer.append( pDesktopLaunch + OStringLiteral(" ")); + aLaunchBuffer.append( pDesktopLaunch + OString::Concat(" ")); escapeForShell(aLaunchBuffer, OUStringToOString(aURL, osl_getThreadTextEncoding())); } } else if ((nFlags & css::system::SystemShellExecuteFlags::URIS_ONLY) != 0) diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 2bb32137bd0b..47854129a6be 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -1106,7 +1106,7 @@ void Test::checkDateInput( SvNumberFormatter& rFormatter, const char* pTimezone, sal_uInt32 nIndex = 0; double fVal = 0.0; bool bVal = rFormatter.IsNumberFormat( aDate, nIndex, fVal); - CPPUNIT_ASSERT_MESSAGE( OString(OStringLiteral("Date not recognized: ") + + CPPUNIT_ASSERT_MESSAGE( OString(OString::Concat("Date not recognized: ") + pTimezone + " " + pIsoDate).getStr(), bVal); CPPUNIT_ASSERT_MESSAGE("Format parsed is not date.", (rFormatter.GetType(nIndex) & SvNumFormatType::DATE)); @@ -1177,7 +1177,7 @@ void checkSpecificNumberFormats( SvNumberFormatter& rFormatter, double fNumber = 0; OUString aString( OUString::fromUtf8( rVec[i].mpInput)); const bool bIsNumber = rFormatter.IsNumberFormat( aString, nIndex, fNumber); - CPPUNIT_ASSERT_EQUAL_MESSAGE( OString( pName + OStringLiteral(" ") + OString::number(i) + + CPPUNIT_ASSERT_EQUAL_MESSAGE( OString( pName + OString::Concat(" ") + OString::number(i) + (rVec[i].mbNumber ? " not recognized: " : " should not be recognized: ") + OUStringToOString( aString, RTL_TEXTENCODING_UTF8)).getStr(), rVec[i].mbNumber, bIsNumber); if (bIsNumber) @@ -1186,7 +1186,7 @@ void checkSpecificNumberFormats( SvNumberFormatter& rFormatter, nIndex = rVec[i].mnOutputIndex; const Color* pColor; rFormatter.GetOutputString( fNumber, nIndex, aString, &pColor); - CPPUNIT_ASSERT_EQUAL_MESSAGE( OString( pName + OStringLiteral(" ") + OString::number(i) + " mismatch").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE( OString( pName + OString::Concat(" ") + OString::number(i) + " mismatch").getStr(), OUString::fromUtf8( rVec[i].mpOutput), aString); } } diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index f84bc2ffc9bd..f51a1132b60a 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -122,7 +122,7 @@ void Test::testEmbeddedGraphicRoundtrip() mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument"); // Check whether graphic exported well after it was swapped out - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 2, getShapes()); // First image @@ -174,7 +174,7 @@ void Test::testLinkedGraphicRT() mxComponent->dispose(); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/document_with_linked_graphic.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -256,7 +256,7 @@ void Test::testImageWithSpecialID() mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument"); // Check whether graphic exported well - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 2, getShapes()); uno::Reference<drawing::XShape> xImage = getShape(1); @@ -351,7 +351,7 @@ void Test::testGraphicShape() mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument"); // Check whether graphic exported well - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), 2, getShapes()); uno::Reference<drawing::XShape> xImage = lcl_getShape(mxComponent, true); @@ -376,7 +376,7 @@ void Test::testGraphicShape() // Second image is a linked one xImage = lcl_getShape(mxComponent, false); XPropSet.set(xImage, uno::UNO_QUERY); - const OString sFailedImageLoad = OStringLiteral("Couldn't load the shape/image for ") + rFilterName.toUtf8(); + const OString sFailedImageLoad = OString::Concat("Couldn't load the shape/image for ") + rFilterName.toUtf8(); CPPUNIT_ASSERT_MESSAGE(sFailedImageLoad.getStr(), xImage.is()); // Check size @@ -457,7 +457,7 @@ void Test::testMultipleIdenticalGraphics() mxComponent = loadFromDesktop(aTempFile.GetURL(), "com.sun.star.text.TextDocument"); // Check whether graphic exported well - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); auto aGraphics = lcl_getGraphics(mxComponent); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), size_t(5), aGraphics.size()); @@ -473,7 +473,8 @@ void Test::testMultipleIdenticalGraphics() // Check all addresses are the same bool bResult = std::equal(aGfxLinkAddresses.begin() + 1, aGfxLinkAddresses.end(), aGfxLinkAddresses.begin()); - const OString sGraphicNotTheSameFailedMessage = OStringLiteral("Graphics not the same for filter: '") + rFilterName.toUtf8() + OStringLiteral("'"); + const OString sGraphicNotTheSameFailedMessage = OString::Concat("Graphics not the same for filter: '") + + rFilterName.toUtf8() + OString::Concat("'"); CPPUNIT_ASSERT_EQUAL_MESSAGE(sGraphicNotTheSameFailedMessage.getStr(), true, bResult); } } @@ -497,7 +498,7 @@ void Test::testCharHighlightBody() mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/char_highlight.docx"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -593,7 +594,7 @@ void Test::testCharStyleHighlight() mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/tdf138345_charstyle_highlight.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -730,7 +731,7 @@ void Test::testMSCharBackgroundEditing() mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/char_background_editing.docx"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Check whether import was done on the right way uno::Reference< text::XTextRange > xPara = getParagraph(1); @@ -842,7 +843,7 @@ void Test::testCharBackgroundToHighlighting() mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/char_background.odt"), "com.sun.star.text.TextDocument"); - OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); SvtFilterOptions& rOpt = SvtFilterOptions::Get(); @@ -911,7 +912,7 @@ void Test::testSkipImages() for (auto const & rFilterNamePair : aFilterNames) { bool bSkipImages = !rFilterNamePair.second.isEmpty(); - OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterNamePair.first.toUtf8(); + OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterNamePair.first.toUtf8(); if (mxComponent.is()) mxComponent->dispose(); @@ -1274,7 +1275,7 @@ void Test::testRedlineFlags() // tdf#97103 check that redline mode is properly restored CPPUNIT_ASSERT_EQUAL_MESSAGE( - OString(OStringLiteral("redline mode not restored in ") + rFilterName.toUtf8()).getStr(), + OString(OString::Concat("redline mode not restored in ") + rFilterName.toUtf8()).getStr(), static_cast<int>(nRedlineFlags), static_cast<int>(rIDRA.GetRedlineFlags())); } } @@ -1290,7 +1291,7 @@ void Test::testBulletAsImage() for (OUString const & rFilterName : aFilterNames) { - OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); if (mxComponent.is()) mxComponent->dispose(); @@ -1433,7 +1434,7 @@ void Test::testTextFormField() mxComponent->dispose(); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/text_form_field.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -1488,7 +1489,7 @@ void Test::testCheckBoxFormField() mxComponent->dispose(); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/checkbox_form_field.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -1551,7 +1552,7 @@ void Test::testDropDownFormField() mxComponent->dispose(); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/dropdown_form_field.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -1636,7 +1637,7 @@ void Test::testDateFormField() mxComponent->dispose(); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/date_form_field.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -1752,7 +1753,7 @@ void Test::testDateFormFieldCharacterFormatting() mxComponent->dispose(); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"/sw/qa/extras/globalfilter/data/date_form_field_char_formatting.odt"), "com.sun.star.text.TextDocument"); - const OString sFailedMessage = OStringLiteral("Failed on filter: ") + rFilterName.toUtf8(); + const OString sFailedMessage = OString::Concat("Failed on filter: ") + rFilterName.toUtf8(); // Export the document and import again for a check uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 280d29f3d596..3e34dd10946f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -649,7 +649,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112118_DOCX, "tdf112118.docx") for (const auto& side : style.sideParams) { const OUString sSide = OUString::createFromAscii(side.sideName); - const OString sStage = style.styleName + OStringLiteral(" ") + side.sideName; + const OString sStage = style.styleName + OString::Concat(" ") + side.sideName; sal_Int32 nMargin = getProperty<sal_Int32>(xStyle, sSide + "Margin"); CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(sStage + " margin width").getStr(), diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index f56cf50d328d..e7d9e38153ab 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -4473,7 +4473,7 @@ void SwUiWriterTest::testEmbeddedDataSource() // Load: should have a component and a data source, too. // Path with "#" must not cause issues - load(OUString(DATA_DIRECTORY + OUStringLiteral(u"hash%23path/")), "embedded-data-source.odt"); + load(OUString(DATA_DIRECTORY + OUString::Concat(u"hash%23path/")), "embedded-data-source.odt"); CPPUNIT_ASSERT(xDatabaseContext->hasByName("calc-data-source")); // Data source has a table named Sheet1. diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index e017bc2c7077..02811994e525 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1641,7 +1641,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloatButton) for (const OUString& aTestFile : aTestFiles) { OString sTestFileName = OUStringToOString(aTestFile, RTL_TEXTENCODING_UTF8); - OString sFailureMessage = OStringLiteral("Failure in the test file: ") + sTestFileName; + OString sFailureMessage = OString::Concat("Failure in the test file: ") + sTestFileName; load(FLOATING_TABLE_DATA_DIRECTORY, sTestFileName.getStr()); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); @@ -1715,7 +1715,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testUnfloating) for (const OUString& aTestFile : aTestFiles) { OString sTestFileName = OUStringToOString(aTestFile, RTL_TEXTENCODING_UTF8); - OString sFailureMessage = OStringLiteral("Failure in the test file: ") + sTestFileName; + OString sFailureMessage = OString::Concat("Failure in the test file: ") + sTestFileName; // Test what happens when pushing the unfloat button load(FLOATING_TABLE_DATA_DIRECTORY, "unfloatable_floating_table.docx"); diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 5b60fb1b87be..a1f8fe239d7a 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -983,7 +983,7 @@ DECLARE_WW8EXPORT_TEST(testTdf112118_DOC, "tdf112118.doc") for (const auto& side : style.sideParams) { const OUString sSide = OUString::createFromAscii(side.sideName); - const OString sStage = style.styleName + OStringLiteral(" ") + side.sideName; + const OString sStage = style.styleName + OString::Concat(" ") + side.sideName; sal_Int32 nMargin = getProperty<sal_Int32>(xStyle, sSide + "Margin"); CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(sStage + " margin width").getStr(), diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 632441524eb3..7a158abf7e3b 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -604,8 +604,8 @@ void SwModelTestBase::reload(const char* pFilter, const char* filename, const ch else { OString aMessage - = OStringLiteral("validation requested, but don't know how to validate ") + filename - + " (" + OUStringToOString(aFilterName, RTL_TEXTENCODING_UTF8) + ")"; + = OString::Concat("validation requested, but don't know how to validate ") + + filename + " (" + OUStringToOString(aFilterName, RTL_TEXTENCODING_UTF8) + ")"; CPPUNIT_FAIL(aMessage.getStr()); } } diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index ee03e6bc28b7..3a22f54180c5 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -701,7 +701,7 @@ namespace sw::mark return; OStringBuffer sPayload; - sPayload = OStringLiteral("{\"action\": \"show\"," + sPayload = OString::Concat("{\"action\": \"show\"," " \"type\": \"drop-down\", \"textArea\": \"") + m_aPortionPaintArea.SVRect().toString() + "\","; // Add field params to the message diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 25b980b6dc19..3b5854308810 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -292,7 +292,7 @@ static void lcl_formatReferenceLanguage( OUString& rRefText, 0x00E1, 0x00C1, 0x00E9, 0x00C9, 0x00ED, 0x00CD, 0x00F3, 0x00D3, 0x00F6, 0x00D6, 0x0151, 0x0150, 0x00FA, 0x00DA, 0x00FC, 0x00DC, 0x0171, 0x0170, 0 }; - static OUString sVowels = OUString::Concat(u"aAeEiIoOuU") + sVowelsWithDiacritic; + static const OUString sVowels = OUString::Concat(u"aAeEiIoOuU") + sVowelsWithDiacritic; // handle more than 1-letter long Roman numbers and // their possible combinations with letters: diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index b9179b601bf5..c88cc4c77f45 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -344,7 +344,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp, sOut.append("; "); } - sOut.append(pProp + OStringLiteral(": ")); + sOut.append(pProp + OString::Concat(": ")); if( m_nCSS1OutMode & CSS1_OUTMODE_ENCODE ) { // for STYLE-Option encode string diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index cdbfae284ff8..ba1111d37054 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2992,7 +2992,7 @@ Writer& OutHTML_INetFormat( Writer& rWrt, const SwFormatINetFormat& rINetFormat, pStr = "ctl"; break; } - sOut += pStr + OStringLiteral("\""); + sOut += pStr + OString::Concat("\""); } rWrt.Strm().WriteOString( sOut ); @@ -3189,7 +3189,7 @@ static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) } if( pStr ) { - OString sOut = OStringLiteral(" " OOO_STRING_SVTOOLS_HTML_O_align "=\"") + + OString sOut = OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_align "=\"") + pStr + "\""; rWrt.Strm().WriteOString( sOut ); } diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index b3f84f896f89..b02875822482 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -504,7 +504,7 @@ void SwHTMLWriter::OutForm( bool bOn, if( pStr ) { - sOut += OStringLiteral(" " OOO_STRING_SVTOOLS_HTML_O_enctype "=\"") + + sOut += OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_enctype "=\"") + pStr + "\""; } } @@ -847,7 +847,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, auto b = o3tl::tryAccess<bool>(aTmp2); pWrapStr = (b && *b) ? OOO_STRING_SVTOOLS_HTML_WW_hard : OOO_STRING_SVTOOLS_HTML_WW_soft; - sOptions += OStringLiteral(" " OOO_STRING_SVTOOLS_HTML_O_wrap "=\"") + + sOptions += OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_wrap "=\"") + pWrapStr + "\""; } } @@ -925,10 +925,10 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, if( eTag == TAG_NONE ) return rWrt; - OString sOut = OStringLiteral("<") + TagNames[eTag]; + OString sOut = OString::Concat("<") + TagNames[eTag]; if( eType != TYPE_NONE ) { - sOut += OStringLiteral(" " OOO_STRING_SVTOOLS_HTML_O_type "=\"") + + sOut += OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_type "=\"") + TypeNames[eType] + "\""; } diff --git a/sw/source/filter/html/htmlnumwriter.cxx b/sw/source/filter/html/htmlnumwriter.cxx index ea3c949c3801..87f273ab7bb0 100644 --- a/sw/source/filter/html/htmlnumwriter.cxx +++ b/sw/source/filter/html/htmlnumwriter.cxx @@ -199,7 +199,7 @@ Writer& OutHTML_NumberBulletListStart( SwHTMLWriter& rWrt, if( pStr ) { - sOut += OStringLiteral(" " OOO_STRING_SVTOOLS_HTML_O_type "=\"") + pStr + "\""; + sOut += OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_type "=\"") + pStr + "\""; } } else if( SVX_NUM_BITMAP == eType ) diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index c01c6bdc9966..1908bd732fa6 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -923,9 +923,8 @@ static void OutBodyColor( const char* pTag, const SwFormat *pFormat, if( pColorItem ) { - OStringBuffer sOut; - sOut.append(OStringLiteral(" ") + pTag + "="); - rHWrt.Strm().WriteOString( sOut.makeStringAndClear() ); + OString sOut = OString::Concat(" ") + pTag + "="; + rHWrt.Strm().WriteOString( sOut ); Color aColor( pColorItem->GetValue() ); if( COL_AUTO == aColor ) aColor = COL_BLACK; diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 66686a8e9808..b8c36c76eda4 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -396,7 +396,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName { SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool(); const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId); - OString aCmd = OStringLiteral(".uno:") + pSlot->GetUnoName(); + OString aCmd = OString::Concat(".uno:") + pSlot->GetUnoName(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(pFact->CreateInsertObjectDialog(GetFrameWeld(mxDoc->GetDocShell()), OUString::fromUtf8( aCmd ), xStor, &aServerList)); diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index fcd6ca5815ac..7d01690aee82 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -86,7 +86,7 @@ OUString XmlTestTools::getXPath(const xmlDocUniquePtr& pXmlDoc, const OString& r xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); CPPUNIT_ASSERT(pXmlObj); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), 1, xmlXPathNodeSetGetLength(pXmlNodes)); if (rAttribute.isEmpty()) { @@ -95,7 +95,7 @@ OUString XmlTestTools::getXPath(const xmlDocUniquePtr& pXmlDoc, const OString& r } xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; xmlChar * prop = xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr())); - OString sAttAbsent = OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + OString sAttAbsent = OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' no attribute '" + rAttribute + "' exist"; CPPUNIT_ASSERT_MESSAGE(sAttAbsent.getStr(), prop); OUString s(convert(prop)); @@ -116,7 +116,7 @@ OUString XmlTestTools::getXPathContent(const xmlDocUniquePtr& pXmlDoc, const OSt xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_MESSAGE( - OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' not found") + OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' not found") .getStr(), xmlXPathNodeSetGetLength(pXmlNodes) > 0); @@ -168,7 +168,7 @@ void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rX void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rAttribute, const OUString& rExpectedValue) { OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute); - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, attribute '" + rAttribute + "' of '" + rXPath + "' incorrect value.").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, attribute '" + rAttribute + "' of '" + rXPath + "' incorrect value.").getStr(), rExpectedValue, aValue); } @@ -185,14 +185,14 @@ void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rX { xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), nNumberOfNodes, xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); } void XmlTestTools::assertXPathContent(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OUString& rContent) { - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath contents of child does not match").getStr(), rContent, getXPathContent(pXmlDoc, rXPath)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath contents of child does not match").getStr(), rContent, getXPathContent(pXmlDoc, rXPath)); } void XmlTestTools::assertXPathNSDef(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, @@ -201,7 +201,7 @@ void XmlTestTools::assertXPathNSDef(const xmlDocUniquePtr& pXmlDoc, const OStrin xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_MESSAGE( - OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' not found").getStr(), + OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' not found").getStr(), xmlXPathNodeSetGetLength(pXmlNodes) > 0); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; @@ -227,10 +227,10 @@ void XmlTestTools::assertXPathChildren(const xmlDocUniquePtr& pXmlDoc, const OSt #if LIBXML_VERSION >= 20703 /* xmlChildElementCount is only available in libxml2 >= 2.7.3 */ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), 1, xmlXPathNodeSetGetLength(pXmlNodes)); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of child-nodes is incorrect").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of child-nodes is incorrect").getStr(), nNumberOfChildNodes, static_cast<int>(xmlChildElementCount(pXmlNode))); xmlXPathFreeObject(pXmlObj); #else @@ -244,10 +244,10 @@ void XmlTestTools::assertXPathNoAttribute(const xmlDocUniquePtr& pXmlDoc, const { xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), 1, xmlXPathNodeSetGetLength(pXmlNodes)); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' unexpected '" + rAttribute + "' attribute").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' unexpected '" + rAttribute + "' attribute").getStr(), static_cast<xmlChar*>(nullptr), xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr()))); xmlXPathFreeObject(pXmlObj); } @@ -256,7 +256,7 @@ int XmlTestTools::getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString { xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(), 1, xmlXPathNodeSetGetLength(pXmlNodes)); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; @@ -272,7 +272,7 @@ int XmlTestTools::getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString ++nRet; } xmlXPathFreeObject(pXmlObj); - CPPUNIT_ASSERT_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + CPPUNIT_ASSERT_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' child '" + rChildName + "' not found") .getStr(), bFound); diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx index 35788df70d2b..f94f0704c243 100644 --- a/unotest/source/cpp/macros_test.cxx +++ b/unotest/source/cpp/macros_test.cxx @@ -114,7 +114,7 @@ void MacrosTest::setUpNssGpg(const test::Directories& rDirectories, const OUStri #if HAVE_GPGCONF_SOCKETDIR auto const ldPath = std::getenv("LIBO_LD_PATH"); m_gpgconfCommandPrefix - = ldPath == nullptr ? OString() : OStringLiteral("LD_LIBRARY_PATH=") + ldPath + " "; + = ldPath == nullptr ? OString() : OString::Concat("LD_LIBRARY_PATH=") + ldPath + " "; OString path; bool ok = aTargetPath.convertToString(&path, osl_getThreadTextEncoding(), RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index 6d2c08676a29..01de54cd8244 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -235,7 +235,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css OUString VbaCommandBarHelper::generateCustomURL() { - return OUStringLiteral(ITEM_TOOLBAR_URL) + CUSTOM_TOOLBAR_STR + + return OUString::Concat(ITEM_TOOLBAR_URL) + CUSTOM_TOOLBAR_STR + // use a random number to minimize possible clash with existing custom toolbars OUString::number(comphelper::rng::uniform_int_distribution(0, std::numeric_limits<int>::max()), 16); } diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index fda8aea30245..f37324ab05e4 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -182,7 +182,7 @@ static void testCachedGlyphs( const OUString& aText, const OUString& aFontName = for( int level = 0; level < MAX_FALLBACK; ++level ) { const std::string messageLevel = OString(message.c_str() - + OStringLiteral(", level: ") + OString::number(level)).getStr(); + + OString::Concat(", level: ") + OString::number(level)).getStr(); if( aGlyphs1.Impl(level) == nullptr) { CPPUNIT_ASSERT_MESSAGE(messageLevel, aGlyphs2.Impl(level) == nullptr); diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 95332b442530..765ed602704e 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -198,12 +198,12 @@ void Qt5Instance::RunInMainThread(std::function<void()> func) OUString Qt5Instance::constructToolkitID(std::u16string_view sTKname) { - OUString sID(sTKname + OUStringLiteral(u" (")); + OUString sID(sTKname + OUString::Concat(u" (")); if (m_bUseCairo) sID += "cairo+"; else sID += "qfont+"; - sID += toOUString(QGuiApplication::platformName()) + OUStringLiteral(u")"); + sID += toOUString(QGuiApplication::platformName()) + OUString::Concat(u")"); return sID; } diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index b7909691d758..fa2cf67ed5d9 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -1315,9 +1315,9 @@ OString SkiaSalBitmap::GetImageKey() const ss << std::hex << std::setfill('0') << std::setw(6) << static_cast<sal_uInt32>(mEraseColor.GetRGBColor()) << std::setw(2) << static_cast<int>(mEraseColor.GetAlpha()); - return OStringLiteral("E") + ss.str().c_str(); + return OString::Concat("E") + ss.str().c_str(); } - return OStringLiteral("I") + OString::number(GetSkImage()->uniqueID()); + return OString::Concat("I") + OString::number(GetSkImage()->uniqueID()); } OString SkiaSalBitmap::GetAlphaImageKey() const @@ -1327,9 +1327,9 @@ OString SkiaSalBitmap::GetAlphaImageKey() const std::stringstream ss; ss << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(255 - SkColorGetA(fromEraseColorToAlphaImageColor(mEraseColor))); - return OStringLiteral("E") + ss.str().c_str(); + return OString::Concat("E") + ss.str().c_str(); } - return OStringLiteral("I") + OString::number(GetAlphaSkImage()->uniqueID()); + return OString::Concat("I") + OString::number(GetAlphaSkImage()->uniqueID()); } #ifdef DBG_UTIL diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 689c4816e174..bf9ad4f9293d 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -1144,7 +1144,7 @@ void PrintFontManager::Substitute(FontSelectPattern &rPattern, OUString& rMissin sTag = mapToFontConfigLangTag(aOurTag); if (!sTag.isEmpty() && m_aPreviousLangSupportRequests.find(sTag) == m_aPreviousLangSupportRequests.end()) { - OString sReq = OStringLiteral(":lang=") + sTag; + OString sReq = OString::Concat(":lang=") + sTag; m_aCurrentRequests.push_back(OUString::fromUtf8(sReq)); m_aPreviousLangSupportRequests.insert(sTag); } diff --git a/vcl/unx/generic/fontmanager/helper.cxx b/vcl/unx/generic/fontmanager/helper.cxx index 79b772c39d6e..6cea0998e771 100644 --- a/vcl/unx/generic/fontmanager/helper.cxx +++ b/vcl/unx/generic/fontmanager/helper.cxx @@ -137,7 +137,7 @@ void psp::getPrinterPathList( std::vector< OUString >& rPathList, const char* pS if( pSubDir ) { - aDir += OStringLiteral("/") + pSubDir; + aDir += OString::Concat("/") + pSubDir; } struct stat aStat; if( stat( aDir.getStr(), &aStat ) || ! S_ISDIR( aStat.st_mode ) ) diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index c6780b491f34..227b185f904e 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -871,7 +871,7 @@ void SystemQueueInfo::run() << rParm.pQueueCommand << "\" ..."); #endif - OString aCmdLine = rParm.pQueueCommand + OStringLiteral(" 2>/dev/null"); + OString aCmdLine = rParm.pQueueCommand + OString::Concat(" 2>/dev/null"); FILE *pPipe; if( (pPipe = popen( aCmdLine.getStr(), "r" )) ) { diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 4269f2e7f67d..93cd88152a35 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -2695,7 +2695,7 @@ void XMLDdeFieldDeclImportContext::startFastElement( try { Reference<XInterface> xIfc = - xFactory->createInstance(OUStringLiteral(sAPI_fieldmaster_prefix) + sAPI_dde); + xFactory->createInstance(OUString::Concat(sAPI_fieldmaster_prefix) + sAPI_dde); if( xIfc.is() ) { Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY ); diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index e43039e8202a..bc99e1cc3750 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -798,13 +798,13 @@ bool XMLVariableDeclImportContext::FindFieldMaster( xTextFieldsSupp->getTextFieldMasters(); OUString sVarServiceName = - OUStringLiteral(sAPI_fieldmaster_prefix) + + OUString::Concat(sAPI_fieldmaster_prefix) + sAPI_set_expression + "." + sName; OUString sUserServiceName = - OUStringLiteral(sAPI_fieldmaster_prefix) + + OUString::Concat(sAPI_fieldmaster_prefix) + sAPI_user + "." + sName; |