diff options
51 files changed, 234 insertions, 222 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 94349ba904c5..b9650a3a199f 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -62,7 +62,7 @@ void TestString::testDecimalStringToNumber() { OUString s1("1234"); CPPUNIT_ASSERT_EQUAL((sal_uInt32)1234, comphelper::string::decimalStringToNumber(s1)); - s1 += OUString(static_cast<sal_Unicode>(0x07C6)); + s1 += OUStringLiteral1<0x07C6>(); CPPUNIT_ASSERT_EQUAL((sal_uInt32)12346, comphelper::string::decimalStringToNumber(s1)); // Codepoints on 2 16bits words sal_uInt32 utf16String[] = { 0x1D7FE /* 8 */, 0x1D7F7 /* 1 */}; diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index fde3119075a8..d49920798508 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -99,7 +99,7 @@ public: private: enum class TreatEmpty { DefaultCtor, CheckEmpty, Error }; - enum class ChangeKind { Char, CharLen, SingleChar }; + enum class ChangeKind { Char, CharLen, SingleChar, OUStringLiteral1 }; enum class PassThrough { No, EmptyConstantString, NonEmptyConstantString }; @@ -666,7 +666,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { { return true; } - if (v == 0 || v.uge(0x80)) { + if (v.ugt(0xFFFF)) { return true; } kind = ChangeKind::SingleChar; @@ -675,36 +675,44 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { } case 2: { - unsigned n; - bool non; - bool emb; - bool trm; - if (!isStringConstant( - expr->getArg(0)->IgnoreParenImpCasts(), &n, &non, &emb, - &trm)) + auto arg = expr->getArg(0); + if (loplugin::TypeCheck(arg->getType()) + .Class("OUStringLiteral1_").Namespace("rtl") + .GlobalNamespace()) { - return true; - } - if (non) { - report( - DiagnosticsEngine::Warning, - ("construction of %0 with string constant argument" - " containging non-ASCII characters"), - expr->getExprLoc()) - << cdecl << expr->getSourceRange(); - } - if (emb) { - report( - DiagnosticsEngine::Warning, - ("construction of %0 with string constant argument" - " containging embedded NULs"), - expr->getExprLoc()) - << cdecl << expr->getSourceRange(); + kind = ChangeKind::OUStringLiteral1; + pass = PassThrough::NonEmptyConstantString; + } else { + unsigned n; + bool non; + bool emb; + bool trm; + if (!isStringConstant( + arg->IgnoreParenImpCasts(), &n, &non, &emb, &trm)) + { + return true; + } + if (non) { + report( + DiagnosticsEngine::Warning, + ("construction of %0 with string constant argument" + " containging non-ASCII characters"), + expr->getExprLoc()) + << cdecl << expr->getSourceRange(); + } + if (emb) { + report( + DiagnosticsEngine::Warning, + ("construction of %0 with string constant argument" + " containging embedded NULs"), + expr->getExprLoc()) + << cdecl << expr->getSourceRange(); + } + kind = ChangeKind::Char; + pass = n == 0 + ? PassThrough::EmptyConstantString + : PassThrough::NonEmptyConstantString; } - kind = ChangeKind::Char; - pass = n == 0 - ? PassThrough::EmptyConstantString - : PassThrough::NonEmptyConstantString; break; } default: @@ -860,15 +868,28 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { { return true; } - report( - DiagnosticsEngine::Warning, - ("elide construction of %0 with " - + describeChangeKind(kind) - + " in call of %1"), - getMemberLocation(expr)) - << cdecl - << fdecl->getQualifiedNameAsString() - << expr->getSourceRange(); + if (kind == ChangeKind::SingleChar) { + report( + DiagnosticsEngine::Warning, + ("rewrite construction of %0 with " + + describeChangeKind(kind) + + (" in call of %1 as construction of" + " OUStringLiteral1")), + getMemberLocation(expr)) + << cdecl + << fdecl->getQualifiedNameAsString() + << expr->getSourceRange(); + } else { + report( + DiagnosticsEngine::Warning, + ("elide construction of %0 with " + + describeChangeKind(kind) + + " in call of %1"), + getMemberLocation(expr)) + << cdecl + << fdecl->getQualifiedNameAsString() + << expr->getSourceRange(); + } return true; } } @@ -892,7 +913,9 @@ std::string StringConstant::describeChangeKind(ChangeKind kind) { case ChangeKind::CharLen: return "string constant and matching length arguments"; case ChangeKind::SingleChar: - return "ASCII sal_Unicode argument"; + return "sal_Unicode argument"; + case ChangeKind::OUStringLiteral1: + return "OUStringLiteral1 argument"; default: std::abort(); } @@ -1422,11 +1445,11 @@ void StringConstant::handleOUStringCtor( // OUString ctor taking an OUStringLiteral1 arg, so don't warn there: if (!explicitFunctionalCastNotation) { uint64_t n = res.getZExtValue(); - if (n != 0 && n <= 127) { + if (n <= 0xFFFF) { report( DiagnosticsEngine::Warning, - ("in call of %0, replace OUString constructed from an ASCII" - " char constant with a string literal"), + ("in call of %0, replace OUString constructed from a" + " sal_Unicode constant with an OUStringLiteral1"), e3->getExprLoc()) << callee->getQualifiedNameAsString() << expr->getSourceRange(); diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 6eefbcefbdf8..b692be407304 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -699,7 +699,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound ) OUString sTemp = aFld->GetText(); aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit ); // multiplication sign (U+00D7) - sTemp += OUString( sal_Unicode (0x00D7) ) + aFld->GetText(); + sTemp += OUStringLiteral1<0x00D7>() + aFld->GetText(); if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) { sal_Int32 ax = sal_Int32(floor((float)aOrigPixelSize.Width() / @@ -710,7 +710,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound ) sTemp += CUI_RESSTR( RID_SVXSTR_PPI ); OUString sPPI = OUString::number(ax); if (abs(ax - ay) > 1) { - sPPI += OUString( sal_Unicode (0x00D7) ) + OUString::number(ay); + sPPI += OUStringLiteral1<0x00D7>() + OUString::number(ay); } sTemp = sTemp.replaceAll("%1", sPPI); } diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx b/filter/source/graphicfilter/idxf/dxfreprd.cxx index f33fdef6164a..ff66914fa2e9 100644 --- a/filter/source/graphicfilter/idxf/dxfreprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfreprd.cxx @@ -405,9 +405,9 @@ OUString DXFRepresentation::ToOUString(const OString& s) const OUString result = OStringToOUString(s, getTextEncoding()); result = result.replaceAll("%%o", "") // Overscore - simply remove .replaceAll("%%u", "") // Underscore - simply remove - .replaceAll("%%d", OUString(sal_Unicode(L'\u00B0'))) // Degrees symbol (°) - .replaceAll("%%p", OUString(sal_Unicode(L'\u00B1'))) // Tolerance symbol (±) - .replaceAll("%%c", OUString(sal_Unicode(L'\u2205'))) // Diameter symbol + .replaceAll("%%d", OUStringLiteral1<0x00B0>()) // Degrees symbol (°) + .replaceAll("%%p", OUStringLiteral1<0x00B1>()) // Tolerance symbol (±) + .replaceAll("%%c", OUStringLiteral1<0x2205>()) // Diameter symbol .replaceAll("%%%", "%"); // Percent symbol sal_Int32 pos = result.indexOf("%%"); // %%nnn, where nnn - 3-digit decimal ASCII code diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index ab17fa4d3ee8..539d071f88ff 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -3627,12 +3627,12 @@ void ScExportTest::testEscapeCharInNumberFormatXLSX() assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]", "formatCode", "00\\ 00\\ 00\\ 00\\ 00"); assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[3]", "formatCode", "00\\.00\\.00\\.000\\.0"); // tdf#81939 // "_-* #,##0\ _€_-;\-* #,##0\ _€_-;_-* "- "_€_-;_-@_-" // tdf#81222 - OUString rFormatStrExpected ( "_-* #,##0\\ _" + OUString(cEuro) + "_-;\\-* #,##0\\ _" + - OUString(cEuro) + "_-;_-* \"- \"_" + OUString(cEuro) + "_-;_-@_-" ); + OUString rFormatStrExpected ( "_-* #,##0\\ _" + OUStringLiteral1<cEuro>() + "_-;\\-* #,##0\\ _" + + OUStringLiteral1<cEuro>() + "_-;_-* \"- \"_" + OUStringLiteral1<cEuro>() + "_-;_-@_-" ); assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[4]", "formatCode", rFormatStrExpected ); // "_-* #,##0" €"_-;\-* #,##0" €"_-;_-* "- €"_-;_-@_-"); - rFormatStrExpected = "_-* #,##0\" " + OUString(cEuro) + "\"_-;\\-* #,##0\" " + - OUString(cEuro) + "\"_-;_-* \"- " + OUString(cEuro) + "\"_-;_-@_-"; + rFormatStrExpected = "_-* #,##0\" " + OUStringLiteral1<cEuro>() + "\"_-;\\-* #,##0\" " + + OUStringLiteral1<cEuro>() + "\"_-;_-* \"- " + OUStringLiteral1<cEuro>() + "\"_-;_-@_-"; assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[5]", "formatCode", rFormatStrExpected ); // remove escape char in fraction assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[6]", "formatCode", "# ?/?;[RED]\\-# #/#####"); diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 91af50246422..00c9feb3642c 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1056,7 +1056,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1 break; case SVX_NUM_NUMBER_LOWER_ZH : { - if ( sSuffix == OUString( sal_Unicode(0xff0e)) ) + if ( sSuffix == OUStringLiteral1<0xff0e>() ) nMappedNumType = 0x260001; // Japanese with double-byte period. else if ( !sSuffix.isEmpty() ) nMappedNumType = 0x1B0001; // Japanese/Korean with single-byte period. diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index edcc9792568f..2a5464832c9a 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -410,10 +410,10 @@ void SvFileObject::Edit( vcl::Window* /*pParent*/, sfx2::SvBaseLink* pLink, cons if( !aDlg.Execute() ) { - sFile = aDlg.GetPath(); - sFile += OUString(::sfx2::cTokenSeparator); - sFile += OUString(::sfx2::cTokenSeparator); - sFile += aDlg.GetCurrentFilter(); + sFile = aDlg.GetPath() + + OUStringLiteral1<sfx2::cTokenSeparator>() + + OUStringLiteral1<sfx2::cTokenSeparator>() + + aDlg.GetCurrentFilter(); aEndEditLink.Call( sFile ); } @@ -501,10 +501,9 @@ IMPL_LINK_TYPED( SvFileObject, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileD if ( _pFileDlg && _pFileDlg->GetError() == ERRCODE_NONE ) { OUString sURL( _pFileDlg->GetPath() ); - sFile = sURL; - sFile += OUString(::sfx2::cTokenSeparator); - sFile += OUString(::sfx2::cTokenSeparator); - sFile += impl_getFilter( sURL ); + sFile = sURL + OUStringLiteral1<sfx2::cTokenSeparator>() + + OUStringLiteral1<sfx2::cTokenSeparator>() + + impl_getFilter( sURL ); } } else diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index cfac8e848405..bc1c3a856d66 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -377,22 +377,20 @@ void MakeLnkName( OUString& rName, const OUString* pType, const OUString& rFile, { if( pType ) { - rName = comphelper::string::strip(*pType, ' '); - rName += OUString(cTokenSeparator); + rName = comphelper::string::strip(*pType, ' ') + + OUStringLiteral1<cTokenSeparator>(); } - else if( !rName.isEmpty() ) + else rName.clear(); rName += rFile; - rName = comphelper::string::strip(rName, ' '); - rName += OUString(cTokenSeparator); - rName = comphelper::string::strip(rName, ' '); - rName += rLink; + rName = comphelper::string::strip(rName, ' ') + + OUStringLiteral1<cTokenSeparator>(); + rName = comphelper::string::strip(rName, ' ') + rLink; if( pFilter ) { - rName += OUString(cTokenSeparator); - rName += *pFilter; + rName += OUStringLiteral1<cTokenSeparator>() + *pFilter; rName = comphelper::string::strip(rName, ' '); } } diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx index 59083c1a759d..97eaacec6b11 100644 --- a/starmath/source/ooxmlimport.cxx +++ b/starmath/source/ooxmlimport.cxx @@ -312,21 +312,25 @@ OUString SmOoxmlImport::handleD() opening = "left lbrace "; if( closing == "}" ) closing = " right rbrace"; - if( opening == OUString( sal_Unicode( 0x27e6 ))) + if( opening == OUStringLiteral1<0x27e6>() ) opening = "left ldbracket "; - if( closing == OUString( sal_Unicode( 0x27e7 ))) + if( closing == OUStringLiteral1<0x27e7>() ) closing = " right rdbracket"; if( opening == "|" ) opening = "left lline "; if( closing == "|" ) closing = " right rline"; - if (opening == OUString(MS_DLINE) || opening == OUString(MS_DVERTLINE)) + if (opening == OUStringLiteral1<MS_DLINE>() + || opening == OUStringLiteral1<MS_DVERTLINE>()) opening = "left ldline "; - if (closing == OUString(MS_DLINE) || closing == OUString(MS_DVERTLINE)) + if (closing == OUStringLiteral1<MS_DLINE>() + || closing == OUStringLiteral1<MS_DVERTLINE>()) closing = " right rdline"; - if (opening == OUString(MS_LANGLE) || opening == OUString(MS_LMATHANGLE)) + if (opening == OUStringLiteral1<MS_LANGLE>() + || opening == OUStringLiteral1<MS_LMATHANGLE>()) opening = "left langle "; - if (closing == OUString(MS_RANGLE) || closing == OUString(MS_RMATHANGLE)) + if (closing == OUStringLiteral1<MS_RANGLE>() + || closing == OUStringLiteral1<MS_RMATHANGLE>()) closing = " right rangle"; // use scalable brackets (the explicit "left" or "right") if( opening == "(" || opening == "[" ) diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index d23620dc55f7..9a7cb261c441 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -1185,10 +1185,10 @@ void Test::testUserDefinedNumberFormats() } { // tdf#79399 tdf#101462 Native Number Formats sCode = "[NatNum5][$-0404]General\\ "; - sExpected = OUString(sal_Unicode(22777)) + // 壹 - OUString(sal_Unicode(20336)) + // 佰 - OUString(sal_Unicode(36019)) + // 貳 - OUString(sal_Unicode(25342)) + // 拾 + sExpected = OUStringLiteral1<22777>() + // 壹 + OUStringLiteral1<20336>() + // 佰 + OUStringLiteral1<36019>() + // 貳 + OUStringLiteral1<25342>() + // 拾 " "; checkPreviewString(aFormatter, sCode, 120, eLang, sExpected); sCode = "[DBNum2][$-0404]General\\ "; diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index 019cbb556c65..d0fe8b501dfe 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -38,8 +38,8 @@ namespace linguistic bool RemoveHyphens(OUString &rTxt) { sal_Int32 n = rTxt.getLength(); - rTxt = rTxt.replaceAll(OUString(SVT_SOFT_HYPHEN), ""); - rTxt = rTxt.replaceAll(OUString(SVT_HARD_HYPHEN), ""); + rTxt = rTxt.replaceAll(OUStringLiteral1<SVT_SOFT_HYPHEN>(), ""); + rTxt = rTxt.replaceAll(OUStringLiteral1<SVT_HARD_HYPHEN>(), ""); return n != rTxt.getLength(); } diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 6e4ba6cc58d2..de365590843e 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -119,7 +119,8 @@ const OUString ApplyLreOrRleEmbedding( const OUString &rText ) OUString aRes( rText ); if (bFound) { - aRes = OUString(cStart) + aRes + OUString(cPopDirectionalFormat); + aRes = OUString(cStart) + aRes + + OUStringLiteral1<cPopDirectionalFormat>(); } return aRes; diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index 18a139893aa2..e2961a66e46b 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -307,7 +307,7 @@ void TableWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) // #i95350# force RTL output if (IsRTLEnabled()) - aText = OUString(sal_Unicode(0x202D)) + aText; + aText = OUStringLiteral1<0x202D>() + aText; rRenderContext.DrawText(Point(nTextX, nTextY), aText); } diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 2469e981351c..0a971d5a2dee 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -377,7 +377,7 @@ void SwDocTest::testModelToViewHelperExpandFieldsExpandFootnoteReplaceMode() ExpandMode::ExpandFields | ExpandMode::ExpandFootnote | ExpandMode::ReplaceMode); OUString sViewText = aModelToViewHelper.getViewText(); CPPUNIT_ASSERT_EQUAL( - OUString("AAAAA BBBBB " + OUString(CHAR_ZWSP) + " CCCCC " + OUString(CHAR_ZWSP) + " DDDDD"), + OUString("AAAAA BBBBB " + OUStringLiteral1<CHAR_ZWSP>() + " CCCCC " + OUStringLiteral1<CHAR_ZWSP>() + " DDDDD"), sViewText); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aModelToViewHelper.getFootnotePositions().size()); @@ -453,7 +453,7 @@ void SwDocTest::testModelToViewHelperExpandFieldsHideInvisibleExpandFootnoteRepl ExpandMode::ExpandFields | ExpandMode::HideInvisible | ExpandMode::ExpandFootnote | ExpandMode::ReplaceMode); OUString sViewText = aModelToViewHelper.getViewText(); CPPUNIT_ASSERT_EQUAL( - OUString("AAAAA CCCCC " + OUString(CHAR_ZWSP) + " DDDDD"), + OUString("AAAAA CCCCC " + OUStringLiteral1<CHAR_ZWSP>() + " DDDDD"), sViewText); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aModelToViewHelper.getFootnotePositions().size()); @@ -481,7 +481,7 @@ void SwDocTest::testModelToViewHelperExpandFieldsHideHideRedlinedExpandFootnoteR ExpandMode::ExpandFields | ExpandMode::HideDeletions | ExpandMode::ExpandFootnote | ExpandMode::ReplaceMode); OUString sViewText = aModelToViewHelper.getViewText(); CPPUNIT_ASSERT_EQUAL( - OUString("AAAABB " + OUString(CHAR_ZWSP) + " CCCCC " + OUString(CHAR_ZWSP) + " DDDDD"), + OUString("AAAABB " + OUStringLiteral1<CHAR_ZWSP>() + " CCCCC " + OUStringLiteral1<CHAR_ZWSP>() + " DDDDD"), sViewText); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), aModelToViewHelper.getFootnotePositions().size()); @@ -523,7 +523,7 @@ void SwDocTest::testModelToViewHelperExpandFieldsHideInvisibleHideRedlinedExpand ExpandMode::ExpandFields | ExpandMode::HideInvisible | ExpandMode::HideDeletions | ExpandMode::ExpandFootnote | ExpandMode::ReplaceMode); OUString sViewText = aModelToViewHelper.getViewText(); CPPUNIT_ASSERT_EQUAL(sViewText, - OUString("AAAACCCCC " + OUString(CHAR_ZWSP) + " DDDDD")); + OUString("AAAACCCCC " + OUStringLiteral1<CHAR_ZWSP>() + " DDDDD")); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aModelToViewHelper.getFootnotePositions().size()); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10), @@ -549,7 +549,7 @@ void SwDocTest::testModelToViewHelperExpandFieldsExpandFootnoteReplaceMode2() ExpandMode::ExpandFields | ExpandMode::ExpandFootnote | ExpandMode::ReplaceMode); OUString sViewText = aModelToViewHelper.getViewText(); CPPUNIT_ASSERT_EQUAL( - OUString("AAAAA" + OUString(CHAR_ZWSP) + "CCCCC"), + OUString("AAAAA" + OUStringLiteral1<CHAR_ZWSP>() + "CCCCC"), sViewText); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), aModelToViewHelper.getFootnotePositions().size()); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 6e9341ed05fe..471860e60a85 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1984,10 +1984,10 @@ void SwUiWriterTest::testTdf73660() { SwDoc* pDoc = createDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - OUString aData1 = "First" + OUString(CHAR_SOFTHYPHEN) + "Word"; - OUString aData2 = "Seco" + OUString(CHAR_SOFTHYPHEN) + "nd"; - OUString aData3 = OUString(CHAR_SOFTHYPHEN) + "Third"; - OUString aData4 = "Fourth" + OUString(CHAR_SOFTHYPHEN); + OUString aData1 = "First" + OUStringLiteral1<CHAR_SOFTHYPHEN>() + "Word"; + OUString aData2 = "Seco" + OUStringLiteral1<CHAR_SOFTHYPHEN>() + "nd"; + OUString aData3 = OUStringLiteral1<CHAR_SOFTHYPHEN>() + "Third"; + OUString aData4 = "Fourth" + OUStringLiteral1<CHAR_SOFTHYPHEN>(); OUString aData5 = "Fifth"; pWrtShell->Insert("We are inserting some text in the document to check the search feature "); pWrtShell->Insert(aData1 + " "); diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 9fc8190626bf..cba7c3cec371 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -1494,10 +1494,7 @@ OUString SwCalc::GetDBName(const OUString& rName) return rName.copy( 0, nPos ); } SwDBData aData = m_rDoc.GetDBData(); - OUString sRet = aData.sDataSource; - sRet += OUString(DB_DELIM); - sRet += aData.sCommand; - return sRet; + return aData.sDataSource + OUStringLiteral1<DB_DELIM>() + aData.sCommand; } namespace diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 8c638666e873..08631909fd91 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -65,10 +65,8 @@ namespace if( aDBData != aDocData ) { - sDBNumNm = aDBData.sDataSource; - sDBNumNm += OUString(DB_DELIM); - sDBNumNm += aDBData.sCommand; - sDBNumNm += OUString(DB_DELIM); + sDBNumNm = aDBData.sDataSource + OUStringLiteral1<DB_DELIM>() + + aDBData.sCommand + OUStringLiteral1<DB_DELIM>(); } sDBNumNm += SwFieldType::GetTypeStr(TYP_DBSETNUMBERFLD); diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 0e33eb56c561..89acde7df587 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -244,7 +244,7 @@ bool SwAutoCompleteWord::InsertWord( const OUString& rWord, SwDoc& rDoc ) return false; } - OUString aNewWord = rWord.replaceAll(OUString(CH_TXTATR_INWORD), "") + OUString aNewWord = rWord.replaceAll(OUStringLiteral1<CH_TXTATR_INWORD>(), "") .replaceAll(OUStringLiteral1<CH_TXTATR_BREAKWORD>(), ""); pImpl->AddDocument(rDoc); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 56ef91936db3..66b6b01ab9f9 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -418,8 +418,8 @@ void SwDoc::SetInitDBFields( bool b ) /// Get all databases that are used by fields static OUString lcl_DBDataToString(const SwDBData& rData) { - return rData.sDataSource + OUString(DB_DELIM) - + rData.sCommand + OUString(DB_DELIM) + return rData.sDataSource + OUStringLiteral1<DB_DELIM>() + + rData.sCommand + OUStringLiteral1<DB_DELIM>() + OUString::number(rData.nCommandType); } @@ -515,7 +515,7 @@ void SwDoc::GetAllDBNames( std::vector<OUString>& rAllDBNames ) const SwDSParams_t& rArr = pMgr->GetDSParamArray(); for (const auto& pParam : rArr) { - rAllDBNames.push_back(pParam->sDataSource + OUString(DB_DELIM) + pParam->sCommand); + rAllDBNames.push_back(pParam->sDataSource + OUStringLiteral1<DB_DELIM>() + pParam->sCommand); } #endif } @@ -543,7 +543,7 @@ std::vector<OUString>& SwDoc::FindUsedDBs( const std::vector<OUString>& rAllDBNa const sal_Int32 nEndPos = sFormula.indexOf('.', nPos); if( nEndPos>=0 ) { - rUsedDBNames.push_back(sItem + OUString( DB_DELIM ) + sFormula.copy( nPos, nEndPos - nPos )); + rUsedDBNames.push_back(sItem + OUStringLiteral1<DB_DELIM>() + sFormula.copy( nPos, nEndPos - nPos )); } } } @@ -691,7 +691,7 @@ namespace inline OUString lcl_CutOffDBCommandType(const OUString& rName) { - return rName.replaceFirst(OUString(DB_DELIM), ".").getToken(0, DB_DELIM); + return rName.replaceFirst(OUStringLiteral1<DB_DELIM>(), ".").getToken(0, DB_DELIM); } } diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 32e2f0260a4c..36e1e846b5d7 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -682,7 +682,7 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); // The LinkFileName could only consist of separators - OUString sCompareString = OUString(sfx2::cTokenSeparator) + OUString(sfx2::cTokenSeparator); + OUString sCompareString = OUStringLiteral1<sfx2::cTokenSeparator>() + OUStringLiteral1<sfx2::cTokenSeparator>(); const bool bUpdate = (!pSection->IsLinkType() && rNewData.IsLinkType()) || (!rNewData.GetLinkFileName().isEmpty() diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index c1a699190d3c..55f40492d42d 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -562,8 +562,8 @@ OUString SwSection::GetLinkFileName() const sfx2::LinkManager::GetDisplayNames( m_RefLink, nullptr, &sTmp, &sRange, &sFilter )) { - sTmp += OUString(sfx2::cTokenSeparator) + sFilter - + OUString(sfx2::cTokenSeparator) + sRange; + sTmp += OUStringLiteral1<sfx2::cTokenSeparator>() + sFilter + + OUStringLiteral1<sfx2::cTokenSeparator>() + sRange; } else if( GetFormat() && !GetFormat()->GetSectionNode() ) { diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index cea640584c66..6928e48494ad 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -862,7 +862,7 @@ uno::Reference< XSpellAlternatives > { const OUString aText(pNode->GetText().copy(nBegin, nLen)); OUString aWord = aText.replaceAll(OUStringLiteral1<CH_TXTATR_BREAKWORD>(), "") - .replaceAll(OUString(CH_TXTATR_INWORD), ""); + .replaceAll(OUStringLiteral1<CH_TXTATR_INWORD>(), ""); uno::Reference< XSpellChecker1 > xSpell( ::GetSpellChecker() ); if( xSpell.is() ) diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index 16059313c199..35352daad596 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -47,7 +47,7 @@ using namespace ::com::sun::star; /// replace database separator by dots for display static OUString lcl_DBTrennConv(const OUString& aContent) { - return aContent.replaceAll(OUString(DB_DELIM), "."); + return aContent.replaceAll(OUStringLiteral1<DB_DELIM>(), "."); } // database field type @@ -62,9 +62,9 @@ SwDBFieldType::SwDBFieldType(SwDoc* pDocPtr, const OUString& rNam, const SwDBDat if(!aDBData.sDataSource.isEmpty() || !aDBData.sCommand.isEmpty()) { sName = aDBData.sDataSource - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + aDBData.sCommand - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + sName; } } @@ -237,9 +237,9 @@ OUString SwDBField::GetFieldName() const if (sContent.getLength() > 1) { - sContent += OUString(DB_DELIM) + sContent += OUStringLiteral1<DB_DELIM>() + rDBName.getToken(1, DB_DELIM) - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + rDBName.getToken(2, DB_DELIM); } return lcl_DBTrennConv(sContent); @@ -477,7 +477,7 @@ OUString SwDBNameInfField::GetFieldName() const { sStr += ":" + aDBData.sDataSource - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + aDBData.sCommand; } return lcl_DBTrennConv(sStr); diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index 99f34553b561..0e1f08a0f500 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -367,7 +367,7 @@ bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId ) rVal >>= sToken; } sNewCmd += (i < 2) - ? sToken + OUString(sfx2::cTokenSeparator) : sToken; + ? sToken + OUStringLiteral1<sfx2::cTokenSeparator>() : sToken; } SetCmd( sNewCmd ); } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 8872560fa8a6..2e4d8f333f89 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1548,7 +1548,7 @@ OUString SwHiddenTextField::GetDBName(const OUString& rName, SwDoc *pDoc) } SwDBData aData = pDoc->GetDBData(); - return aData.sDataSource + OUString(DB_DELIM) + aData.sCommand; + return aData.sDataSource + OUStringLiteral1<DB_DELIM>() + aData.sCommand; } // field type for line height 0 diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 118d7c17bd1e..f91382656ce5 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -398,7 +398,7 @@ void SwGetRefField::UpdateField( const SwTextField* pFieldTextAttr ) // remove all special characters (replace them with blanks) if( !sText.isEmpty() ) { - sText = sText.replaceAll(OUString(sal_Unicode(0xad)), ""); + sText = sText.replaceAll(OUStringLiteral1<0xad>(), ""); OUStringBuffer aBuf(sText); const sal_Int32 l = aBuf.getLength(); for (sal_Int32 i=0; i<l; ++i) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index ca05aace39d5..7659ef06de30 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -641,8 +641,8 @@ bool SwGrfNode::GetFileFilterNms( OUString* pFileNm, OUString* pFilterNm ) const if( sfx2::LinkManager::GetDisplayNames( refLink, &sApp, &sTopic, &sItem ) ) { - *pFileNm = sApp + OUString(sfx2::cTokenSeparator) - + sTopic + OUString(sfx2::cTokenSeparator) + *pFileNm = sApp + OUStringLiteral1<sfx2::cTokenSeparator>() + + sTopic + OUStringLiteral1<sfx2::cTokenSeparator>() + sItem; *pFilterNm = "DDE"; bRet = true; diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 71e33bb79a29..dcd1a2831552 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -748,8 +748,9 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, { if (m_pImpl->m_sParam1.isEmpty()) { - m_pImpl->m_sParam1 = OUString(sfx2::cTokenSeparator) - + OUString(sfx2::cTokenSeparator); + m_pImpl->m_sParam1 + = OUStringLiteral1<sfx2::cTokenSeparator>() + + OUStringLiteral1<sfx2::cTokenSeparator>(); } OUString sTmp; rValue >>= sTmp; @@ -2780,7 +2781,7 @@ bool SwXTextFieldMasters::getInstanceName( break; case RES_DBFLD: - sField = "DataBase." + rFieldType.GetName().replaceAll(OUString(DB_DELIM), "."); + sField = "DataBase." + rFieldType.GetName().replaceAll(OUStringLiteral1<DB_DELIM>(), "."); break; case RES_AUTHORITY: diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index e5e6f6c8e500..8d1857443d7f 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -340,9 +340,9 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SwSectionData aSect(eType, pDoc->GetUniqueSectionName(&m_pImpl->m_sName)); aSect.SetCondition(m_pImpl->m_pProps->m_sCondition); aSect.SetLinkFileName(m_pImpl->m_pProps->m_sLinkFileName + - OUString(sfx2::cTokenSeparator) + + OUStringLiteral1<sfx2::cTokenSeparator>() + m_pImpl->m_pProps->m_sSectionFilter + - OUString(sfx2::cTokenSeparator) + + OUStringLiteral1<sfx2::cTokenSeparator>() + m_pImpl->m_pProps->m_sSectionRegion); aSect.SetHidden(m_pImpl->m_pProps->m_bHidden); @@ -616,7 +616,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, if (!m_pProps->m_bDDE) { m_pProps->m_sLinkFileName = - OUString(sfx2::cTokenSeparator) + OUString(sfx2::cTokenSeparator); + OUStringLiteral1<sfx2::cTokenSeparator>() + OUStringLiteral1<sfx2::cTokenSeparator>(); m_pProps->m_bDDE = true; } m_pProps->m_sLinkFileName = comphelper::string::setToken( @@ -628,7 +628,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, OUString sLinkFileName(pSectionData->GetLinkFileName()); if (pSectionData->GetType() != DDE_LINK_SECTION) { - sLinkFileName = OUString(sfx2::cTokenSeparator) + OUString(sfx2::cTokenSeparator); + sLinkFileName = OUStringLiteral1<sfx2::cTokenSeparator>() + OUStringLiteral1<sfx2::cTokenSeparator>(); pSectionData->SetType(DDE_LINK_SECTION); } sLinkFileName = comphelper::string::setToken(sLinkFileName, @@ -682,8 +682,8 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, aLink.FileURL, URIHelper::GetMaybeFileHdl()) : OUString()); const OUString sFileName( - sTmp + OUString(sfx2::cTokenSeparator) + - aLink.FilterName + OUString(sfx2::cTokenSeparator) + + sTmp + OUStringLiteral1<sfx2::cTokenSeparator>() + + aLink.FilterName + OUStringLiteral1<sfx2::cTokenSeparator>() + pSectionData->GetLinkFileName().getToken(2, sfx2::cTokenSeparator)); pSectionData->SetLinkFileName(sFileName); if (sFileName.getLength() < 3) @@ -713,7 +713,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, for (sal_Int32 i = comphelper::string::getTokenCount(sSectLink, sfx2::cTokenSeparator); i < 3; ++i) { - sSectLink += OUString(sfx2::cTokenSeparator); + sSectLink += OUStringLiteral1<sfx2::cTokenSeparator>(); } sSectLink = comphelper::string::setToken(sSectLink, 2, sfx2::cTokenSeparator, sLink); pSectionData->SetLinkFileName(sSectLink); diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 7afdedad12f3..b4554fe39b1f 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -204,7 +204,7 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) { OUString aOutStr( aStr.copy( nStrPos, nNextAttr - nStrPos ) ); if ( !bExportSoftHyphens ) - aOutStr = aOutStr.replaceAll(OUString(CHAR_SOFTHYPHEN), ""); + aOutStr = aOutStr.replaceAll(OUStringLiteral1<CHAR_SOFTHYPHEN>(), ""); rWrt.Strm().WriteUnicodeOrByteText( aOutStr ); } diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 8bad71cbc009..bfd284f2e27b 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -287,17 +287,17 @@ void SwHTMLParser::NewDivision( int nToken ) } else { - aURL = URIHelper::SmartRel2Abs(INetURLObject( m_sBaseURL ), aHRef.copy( 0, nPos ), Link<OUString *, bool>(), false ); - aURL += OUString(sfx2::cTokenSeparator); + aURL = URIHelper::SmartRel2Abs(INetURLObject( m_sBaseURL ), aHRef.copy( 0, nPos ), Link<OUString *, bool>(), false ) + + OUStringLiteral1<sfx2::cTokenSeparator>(); if( nPos2 == -1 ) { aURL += aHRef.copy( nPos+1 ); } else { - aURL += aHRef.copy( nPos+1, nPos2 - (nPos+1) ); - aURL += OUString(sfx2::cTokenSeparator); - aURL += rtl::Uri::decode( aHRef.copy( nPos2+1 ), + aURL += aHRef.copy( nPos+1, nPos2 - (nPos+1) ) + + OUStringLiteral1<sfx2::cTokenSeparator>() + + rtl::Uri::decode( aHRef.copy( nPos2+1 ), rtl_UriDecodeWithCharset, RTL_TEXTENCODING_ISO_8859_1 ); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ee0ad84e2a57..1146ea2103d1 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6091,7 +6091,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, aBuffer.append( pPrev, pIt - pPrev ); // If bullet char is empty, set lvlText as empty - if ( rNumberingString.equals ( OUString(sal_Unicode(0)) ) && nNumberingType == SVX_NUM_CHAR_SPECIAL ) + if ( rNumberingString == OUStringLiteral1<0>() && nNumberingType == SVX_NUM_CHAR_SPECIAL ) { m_pSerializer->singleElementNS( XML_w, XML_lvlText, FSNS( XML_w, XML_val ), "", FSEND ); } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index afdc2779ad1d..79123eaded79 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2537,7 +2537,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField ) SwDBData aData = GetExport().m_pDoc->GetDBData(); const OUString sStr = FieldString(ww::eDATABASE) + aData.sDataSource - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + aData.sCommand; GetExport().OutputField(pField, ww::eDATABASE, sStr); } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 574b5641d765..cbb0708d6486 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2427,9 +2427,8 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt { // Bereich aus Quelle ( kein Switch ) ? ConvertUFName(aBook); - aPara += OUString(sfx2::cTokenSeparator); - aPara += OUString(sfx2::cTokenSeparator); - aPara += aBook; + aPara += OUStringLiteral1<sfx2::cTokenSeparator>() + + OUStringLiteral1<sfx2::cTokenSeparator>() + aBook; } /* diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 60c2327505b1..22c677b630dd 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1173,9 +1173,9 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext, { // make command string const OUString sCommand(pContext->GetDDEApplication() - + OUString(sfx2::cTokenSeparator) + + OUStringLiteral1<sfx2::cTokenSeparator>() + pContext->GetDDEItem() - + OUString(sfx2::cTokenSeparator) + + OUStringLiteral1<sfx2::cTokenSeparator>() + pContext->GetDDETopic()); const SfxLinkUpdateMode nType = pContext->GetIsAutomaticUpdate() diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index a8a652d6e2ec..79af0846c5a5 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -318,10 +318,10 @@ SwFrameFormat* SwMailMergeLayoutPage::InsertAddressFrame( SwFieldMgr aFieldMgr(&rShell); //create a database string source.command.commandtype.column const SwDBData& rData = rConfigItem.GetCurrentDBData(); - OUString sDBName(rData.sDataSource + OUString(DB_DELIM) - + rData.sCommand + OUString(DB_DELIM)); + OUString sDBName(rData.sDataSource + OUStringLiteral1<DB_DELIM>() + + rData.sCommand + OUStringLiteral1<DB_DELIM>()); const OUString sDatabaseConditionPrefix(sDBName.replace(DB_DELIM, '.')); - sDBName += OUString::number(rData.nCommandType) + OUString(DB_DELIM); + sDBName += OUString::number(rData.nCommandType) + OUStringLiteral1<DB_DELIM>(); // if only the country is in an address line the // paragraph has to be hidden depending on the @@ -510,9 +510,9 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig const OUString sConditionBase("[" + sCommonBase + sGenderColumn + "]"); const OUString sNameColumnBase("[" + sCommonBase + sNameColumn + "]"); - const OUString sDBName(rData.sDataSource + OUString(DB_DELIM) - + rData.sCommand + OUString(DB_DELIM) - + OUString::number(rData.nCommandType) + OUString(DB_DELIM)); + const OUString sDBName(rData.sDataSource + OUStringLiteral1<DB_DELIM>() + + rData.sCommand + OUStringLiteral1<DB_DELIM>() + + OUString::number(rData.nCommandType) + OUStringLiteral1<DB_DELIM>()); // Female: [database.sGenderColumn] != "rFemaleGenderValue" && [database.NameColumn] // Male: [database.sGenderColumn] == "rFemaleGenderValue" && [database.rGenderColumn] diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index ccdf15ef7f95..e5332fa0fbbb 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -210,11 +210,11 @@ void SectRepr::SetFile( const OUString& rFile ) if( !rFile.isEmpty() || !sSub.isEmpty() ) { - sNewFile += OUString(sfx2::cTokenSeparator); + sNewFile += OUStringLiteral1<sfx2::cTokenSeparator>(); if( !rFile.isEmpty() ) // Filter only with FileName sNewFile += sOldFileName.getToken( 1, sfx2::cTokenSeparator ); - sNewFile += OUString(sfx2::cTokenSeparator) + sSub; + sNewFile += OUStringLiteral1<sfx2::cTokenSeparator>() + sSub; } m_SectionData.SetLinkFileName( sNewFile ); @@ -237,10 +237,10 @@ void SectRepr::SetFilter( const OUString& rFilter ) const OUString sSub( sOldFileName.getToken( 2, sfx2::cTokenSeparator ) ); if( !sFile.isEmpty() ) - sNewFile = sFile + OUString(sfx2::cTokenSeparator) + - rFilter + OUString(sfx2::cTokenSeparator) + sSub; + sNewFile = sFile + OUStringLiteral1<sfx2::cTokenSeparator>() + + rFilter + OUStringLiteral1<sfx2::cTokenSeparator>() + sSub; else if( !sSub.isEmpty() ) - sNewFile = OUString(sfx2::cTokenSeparator) + OUString(sfx2::cTokenSeparator) + sSub; + sNewFile = OUStringLiteral1<sfx2::cTokenSeparator>() + OUStringLiteral1<sfx2::cTokenSeparator>() + sSub; m_SectionData.SetLinkFileName( sNewFile ); @@ -259,8 +259,8 @@ void SectRepr::SetSubRegion(const OUString& rSubRegion) const OUString sFilter( sLinkFileName.getToken( 0, sfx2::cTokenSeparator, n ) ); if( !rSubRegion.isEmpty() || !sOldFileName.isEmpty() ) - sNewFile = sOldFileName + OUString(sfx2::cTokenSeparator) + - sFilter + OUString(sfx2::cTokenSeparator) + rSubRegion; + sNewFile = sOldFileName + OUStringLiteral1<sfx2::cTokenSeparator>() + + sFilter + OUStringLiteral1<sfx2::cTokenSeparator>() + rSubRegion; m_SectionData.SetLinkFileName( sNewFile ); @@ -285,8 +285,8 @@ OUString SectRepr::GetFile() const if (DDE_LINK_SECTION == m_SectionData.GetType()) { sal_Int32 n = 0; - return sLinkFile.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &n ) - .replaceFirst( OUString(sfx2::cTokenSeparator), " ", &n ); + return sLinkFile.replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &n ) + .replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &n ); } return INetURLObject::decode( sLinkFile.getToken( 0, sfx2::cTokenSeparator ), INetURLObject::DECODE_UNAMBIGUOUS ); @@ -1144,10 +1144,10 @@ IMPL_LINK_TYPED( SwEditRegionDlg, FileNameHdl, Edit&, rEdit, void ) { OUString sLink( SwSectionData::CollapseWhiteSpaces(rEdit.GetText()) ); sal_Int32 nPos = 0; - sLink = sLink.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos ); + sLink = sLink.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos ); if (nPos>=0) { - sLink = sLink.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos ); + sLink = sLink.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos ); } pSectRepr->GetSectionData().SetLinkFileName( sLink ); @@ -1619,10 +1619,10 @@ bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* ) { aLinkFile = SwSectionData::CollapseWhiteSpaces(sFileName); sal_Int32 nPos = 0; - aLinkFile = aLinkFile.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos ); + aLinkFile = aLinkFile.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos ); if (nPos>=0) { - aLinkFile = aLinkFile.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos ); + aLinkFile = aLinkFile.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos ); } } else @@ -1638,8 +1638,8 @@ bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* ) aSection.SetLinkFilePassword( m_sFilePasswd ); } - aLinkFile += OUString(sfx2::cTokenSeparator) + m_sFilterName - + OUString(sfx2::cTokenSeparator) + sSubRegion; + aLinkFile += OUStringLiteral1<sfx2::cTokenSeparator>() + m_sFilterName + + OUStringLiteral1<sfx2::cTokenSeparator>() + sSubRegion; } aSection.SetLinkFileName(aLinkFile); diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 398de3dab700..1c9d34d38007 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -226,7 +226,7 @@ SwEnvPage::SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pPreview->SetBorderStyle( WindowBorderStyle::MONO ); SwDBData aData = pSh->GetDBData(); - sActDBName = aData.sDataSource + OUString(DB_DELIM) + aData.sCommand; + sActDBName = aData.sDataSource + OUStringLiteral1<DB_DELIM>() + aData.sCommand; InitDatabaseBox(); } @@ -256,7 +256,7 @@ IMPL_LINK_TYPED( SwEnvPage, DatabaseHdl, ListBox&, rListBox, void ) { sActDBName = rListBox.GetSelectEntry(); pSh->GetDBManager()->GetTableNames(m_pTableLB, sActDBName); - sActDBName += OUString(DB_DELIM); + sActDBName += OUStringLiteral1<DB_DELIM>(); } else { diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index ab3fd3565a5b..32a69db38ebd 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -192,7 +192,7 @@ void SwChangeDBDlg::UpdateFields() if( m_pUsedDBTLB->GetParent( pEntry )) { OUString sTmp(m_pUsedDBTLB->GetEntryText( m_pUsedDBTLB->GetParent( pEntry )) + - OUString(DB_DELIM) + m_pUsedDBTLB->GetEntryText( pEntry ) + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + m_pUsedDBTLB->GetEntryText( pEntry ) + OUStringLiteral1<DB_DELIM>() + OUString::number((int)reinterpret_cast<sal_uLong>(pEntry->GetUserData()))); aDBNames.push_back(sTmp); } @@ -205,9 +205,9 @@ void SwChangeDBDlg::UpdateFields() sal_Bool bIsTable = false; const OUString DBName(m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable)); const OUString sTemp = DBName - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + sTableName - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + OUString::number(bIsTable ? CommandType::TABLE : CommandType::QUERY); diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index bd2f636e6b67..cdd2cd71f839 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -219,14 +219,14 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* ) sal_uInt16 nSubType = 0; OUString sDBName = aData.sDataSource - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + aData.sCommand - + OUString(DB_DELIM) + + OUStringLiteral1<DB_DELIM>() + OUString::number(aData.nCommandType) - + OUString(DB_DELIM); + + OUStringLiteral1<DB_DELIM>(); if (!sColumnName.isEmpty()) { - sDBName += sColumnName + OUString(DB_DELIM); + sDBName += sColumnName + OUStringLiteral1<DB_DELIM>(); } OUString aName = sDBName + m_pConditionED->GetText(); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 5f3a1701f771..5e9713324f39 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -575,7 +575,7 @@ bool SwFieldFuncPage::FillItemSet(SfxItemSet* ) for(sal_Int32 i = 0; i < m_pListItemsLB->GetEntryCount(); i++) { if(i) - aVal += OUString(DB_DELIM); + aVal += OUStringLiteral1<DB_DELIM>(); aVal += m_pListItemsLB->GetEntry(i); } } diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 3d162721e960..2fa1dad31833 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -473,8 +473,8 @@ void SwFieldVarPage::SubTypeHdl(ListBox* pBox) // That's not considered here yet OUString sCmd( pType->GetCmd() ); sal_Int32 nTmpPos = 0; - sCmd = sCmd.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &nTmpPos ); - sCmd = sCmd.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &nTmpPos ); + sCmd = sCmd.replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &nTmpPos ); + sCmd = sCmd.replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &nTmpPos ); m_pValueED->SetText( sCmd ); m_pFormatLB->SelectEntryPos(static_cast<int>(pType->GetType())); @@ -1040,8 +1040,8 @@ IMPL_LINK_TYPED( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void ) // DDE-Topics/-Items can have blanks in their names! // That's not being considered here yet. sal_Int32 nTmpPos = 0; - sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos ); - sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos ); + sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos ); + sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos ); static_cast<SwDDEFieldType*>(pType)->SetCmd(sValue); static_cast<SwDDEFieldType*>(pType)->SetType(static_cast<SfxLinkUpdateMode>(nFormat)); } @@ -1079,8 +1079,8 @@ IMPL_LINK_TYPED( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void ) // DDE-Topics/-Items can have blanks in their names! // That's not being considered here yet. sal_Int32 nTmpPos = 0; - sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos ); - sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos ); + sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos ); + sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos ); SwDDEFieldType aType(sName, sValue, static_cast<SfxLinkUpdateMode>(nFormat)); m_pSelectionLB->InsertEntry(sName); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 9642b265ee1e..9fd1ce6653a6 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -527,11 +527,10 @@ bool SwDBManager::Merge( const SwMergeDescriptor& rMergeDesc ) std::vector<OUString> aDBNames; aDBNames.push_back(OUString()); SwDBData aInsertData = pWorkShell->GetDBData(); - OUString sDBName = aInsertData.sDataSource; - sDBName += OUString(DB_DELIM); - sDBName += aInsertData.sCommand; - sDBName += OUString(DB_DELIM); - sDBName += OUString::number(aInsertData.nCommandType); + OUString sDBName = aInsertData.sDataSource + + OUStringLiteral1<DB_DELIM>() + aInsertData.sCommand + + OUStringLiteral1<DB_DELIM>() + + OUString::number(aInsertData.nCommandType); pWorkShell->ChangeDBFields( aDBNames, sDBName); SetInitDBFields(false); } diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 207fb5192169..8c6ce8279852 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -154,8 +154,8 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) if(!aFile.isEmpty() || !aSub.isEmpty()) { - OUString sLinkFileName = OUString(sfx2::cTokenSeparator); - sLinkFileName += OUString(sfx2::cTokenSeparator); + OUString sLinkFileName = OUStringLiteral1<sfx2::cTokenSeparator>() + + OUStringLiteral1<sfx2::cTokenSeparator>(); sLinkFileName = comphelper::string::setToken(sLinkFileName, 0, sfx2::cTokenSeparator, aFile); if(SfxItemState::SET == diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 0d2517129de4..edf3aab7ca9b 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -202,7 +202,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( !sText.isEmpty() ) { - OUStringBuffer sTmp(sText.replaceAll(OUString(sal_Unicode(0xad)), "")); + OUStringBuffer sTmp(sText.replaceAll(OUStringLiteral1<0xad>(), "")); for (sal_Int32 i = 0; i < sTmp.getLength(); ++i) { if (sTmp[i] < 0x20) diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 29677576858d..e6c9a174ce0f 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -946,10 +946,10 @@ bool SwFieldMgr::InsertField( //JP 28.08.95: DDE-Topics/-Items can have blanks in their names! // That's not yet considered here. sal_Int32 nIndex = 0; - OUString sCmd = rData.m_sPar2.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex); + OUString sCmd = rData.m_sPar2.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex); if (nIndex>=0 && ++nIndex<sCmd.getLength()) { - sCmd = sCmd.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex); + sCmd = sCmd.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex); } SwDDEFieldType aType( rData.m_sPar1, sCmd, static_cast<SfxLinkUpdateMode>(nFormatId) ); @@ -1397,10 +1397,10 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat, // DDE-Topics/-Items can have blanks in their names! // That's not yet considered here! sal_Int32 nIndex = 0; - sPar2 = sPar2.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex ); + sPar2 = sPar2.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex ); if (nIndex>=0 && ++nIndex<sPar2.getLength()) { - sPar2 = sPar2.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex); + sPar2 = sPar2.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex); } break; } diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 84acdb149e58..357c18e3b74f 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -433,10 +433,8 @@ IMPL_LINK_TYPED( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void aEdit->UpdateRange( sBoxNms, sTableNm ); - OUString sNew; - sNew += OUString(CH_LRE); - sNew += aEdit->GetText(); - sNew += OUString(CH_PDF); + OUString sNew = OUStringLiteral1<CH_LRE>() + aEdit->GetText() + + OUStringLiteral1<CH_PDF>(); if( sNew != sOldFormula ) { @@ -483,10 +481,8 @@ IMPL_LINK_NOARG_TYPED(SwInputWindow, ModifyHdl, Edit&, void) { pWrtShell->StartAllAction(); DelBoxContent(); - OUString sNew; - sNew += OUString(CH_LRE); - sNew += aEdit->GetText(); - sNew += OUString(CH_PDF); + OUString sNew = OUStringLiteral1<CH_LRE>() + aEdit->GetText() + + OUStringLiteral1<CH_PDF>(); pWrtShell->SwEditShell::Insert2( sNew ); pWrtShell->EndAllAction(); sOldFormula = sNew; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index e9db87ffe399..04f3ea1dcd93 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -231,7 +231,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) if( SfxItemState::SET == pArgs->GetItemState( FN_PARAM_FIELD_TYPE, false, &pItem )) nType = static_cast<const SfxUInt16Item *>(pItem)->GetValue(); - aPar1 += OUString(DB_DELIM); + aPar1 += OUStringLiteral1<DB_DELIM>(); if( SfxItemState::SET == pArgs->GetItemState( FN_PARAM_1, false, &pItem )) { @@ -240,9 +240,9 @@ void SwTextShell::ExecField(SfxRequest &rReq) if( SfxItemState::SET == pArgs->GetItemState( FN_PARAM_3, false, &pItem )) nCommand = static_cast<const SfxInt32Item*>(pItem)->GetValue(); - aPar1 += OUString(DB_DELIM); - aPar1 += OUString::number(nCommand); - aPar1 += OUString(DB_DELIM); + aPar1 += OUStringLiteral1<DB_DELIM>() + + OUString::number(nCommand) + + OUStringLiteral1<DB_DELIM>(); if( SfxItemState::SET == pArgs->GetItemState( FN_PARAM_2, false, &pItem )) { diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx index 47969fa7b26f..b386e6ac20cc 100644 --- a/sw/source/uibase/shells/textsh2.cxx +++ b/sw/source/uibase/shells/textsh2.cxx @@ -196,13 +196,10 @@ void SwTextShell::ExecDB(SfxRequest &rReq) OUString sColumnName; if(pColumnNameItem) static_cast<const SfxUsrAnyItem*>(pColumnNameItem)->GetValue() >>= sColumnName; - OUString sDBName = sSourceArg; - sDBName += OUString(DB_DELIM); - sDBName += sCommandArg; - sDBName += OUString(DB_DELIM); - sDBName += OUString::number(nCommandTypeArg); - sDBName += OUString(DB_DELIM); - sDBName += sColumnName; + OUString sDBName = sSourceArg + OUStringLiteral1<DB_DELIM>() + + sCommandArg + OUStringLiteral1<DB_DELIM>() + + OUString::number(nCommandTypeArg) + + OUStringLiteral1<DB_DELIM>() + sColumnName; SwFieldMgr aFieldMgr(GetShellPtr()); SwInsertField_Data aData(TYP_DBFLD, 0, sDBName, OUString(), 0); diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 1030003ba4a0..8fc22cb2e39e 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -1369,10 +1369,10 @@ IMPL_LINK_TYPED( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileD sal_Int32 nPos = 0; for (SfxMedium* pMed : *pMedList) { - OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - sFileName += OUString(sfx2::cTokenSeparator); - sFileName += pMed->GetFilter()->GetFilterName(); - sFileName += OUString(sfx2::cTokenSeparator); + OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) + + OUStringLiteral1<sfx2::cTokenSeparator>() + + pMed->GetFilter()->GetFilterName() + + OUStringLiteral1<sfx2::cTokenSeparator>(); pFileNames[nPos++] = sFileName; } pMedList.reset(); diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index aba44d2265bc..5b65e86a5ecd 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -553,10 +553,10 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk, else { SwSectionData aSection( FILE_LINK_SECTION, GetUniqueSectionName() ); - OUString aLinkFile( rBkmk.GetURL().getToken(0, '#') ); - aLinkFile += OUString(sfx2::cTokenSeparator); - aLinkFile += OUString(sfx2::cTokenSeparator); - aLinkFile += rBkmk.GetURL().getToken(1, '#'); + OUString aLinkFile = rBkmk.GetURL().getToken(0, '#') + + OUStringLiteral1<sfx2::cTokenSeparator>() + + OUStringLiteral1<sfx2::cTokenSeparator>() + + rBkmk.GetURL().getToken(1, '#'); aSection.SetLinkFileName( aLinkFile ); aSection.SetProtectFlag( true ); const SwSection* pIns = InsertSection( aSection ); |