diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-06 09:42:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-07 00:47:20 +0200 |
commit | e0c33ec15f53a01fa3ee07489871bbe09bb5c9c3 (patch) | |
tree | 1afe391a2b4bf9eda13de043658941060cb401c2 /sc/qa | |
parent | 9e3da252c361b3e2b04a2df7a3ae2a5177b37713 (diff) |
loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/accessibility/basics.cxx | 4 | ||||
-rw-r--r-- | sc/qa/extras/macros-test.cxx | 6 | ||||
-rw-r--r-- | sc/qa/extras/vba-macro-test.cxx | 3 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_export_test2.cxx | 4 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters_test3.cxx | 28 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters_test4.cxx | 12 | ||||
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 4 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 4 | ||||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc2.cxx | 8 |
9 files changed, 37 insertions, 36 deletions
diff --git a/sc/qa/extras/accessibility/basics.cxx b/sc/qa/extras/accessibility/basics.cxx index f07a24d1a353..8e04c87dacda 100644 --- a/sc/qa/extras/accessibility/basics.cxx +++ b/sc/qa/extras/accessibility/basics.cxx @@ -27,7 +27,7 @@ using namespace css; CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, TestCalcMenu) { - load(u"private:factory/scalc"); + load(u"private:factory/scalc"_ustr); const Date beforeDate(Date::SYSTEM); const double beforeTime = tools::Time(tools::Time::SYSTEM).GetTimeInDays(); @@ -89,7 +89,7 @@ CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, TestCalcMenu) // for the case where 32-bit a11y child indices don't suffice (tdf#150683) CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, Test64BitChildIndices) { - load(u"private:factory/scalc"); + load(u"private:factory/scalc"_ustr); const sal_Int32 nRow = 1048575; const sal_Int32 nCol = 16383; diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 5adf672a7915..d8590804a165 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -268,7 +268,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf89920) CPPUNIT_TEST_FIXTURE(ScMacrosTest, testPasswordProtectedUnicodeString) { - const OUString sCorrectString(u"English Русский 中文"); + const OUString sCorrectString(u"English Русский 中文"_ustr); static constexpr OUStringLiteral sMacroURL( u"vnd.sun.Star.script:Protected.Module1.TestUnicodeString?language=Basic&location=document"); static constexpr OUStringLiteral sLibName(u"Protected"); @@ -499,7 +499,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf75263) pDoc->CalcAll(); // A1 contains formula with user-defined function, and the function is defined in VBA. - CPPUNIT_ASSERT_EQUAL(OUString(u"проба"), pDoc->GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); } saveAndReload("Calc MS Excel 2007 VBA XML"); @@ -511,7 +511,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf75263) // Without the accompanying fix in place, this test would have failed with: // - Expected: проба (sample) // - Actual : ????? - CPPUNIT_ASSERT_EQUAL(OUString(u"проба"), pDoc->GetString(ScAddress(0, 0, 0))); + CPPUNIT_ASSERT_EQUAL(u"проба"_ustr, pDoc->GetString(ScAddress(0, 0, 0))); } } diff --git a/sc/qa/extras/vba-macro-test.cxx b/sc/qa/extras/vba-macro-test.cxx index 7e92dd681110..570d6520a92c 100644 --- a/sc/qa/extras/vba-macro-test.cxx +++ b/sc/qa/extras/vba-macro-test.cxx @@ -868,7 +868,8 @@ CPPUNIT_TEST_FIXTURE(VBAMacroTest, testNonAsciiMacroIRI) CPPUNIT_ASSERT_EQUAL(OUString("bar"), rDoc.GetString(ScAddress(0, 1, 0))); CPPUNIT_ASSERT_EQUAL(OUString("baz"), rDoc.GetString(ScAddress(0, 2, 0))); - auto ret = dispatchCommand(mxComponent, u"macro://./Standard.Module1.NonAsciiName_αβγ", {}); + auto ret + = dispatchCommand(mxComponent, u"macro://./Standard.Module1.NonAsciiName_αβγ"_ustr, {}); css::frame::DispatchResultEvent retEvent; CPPUNIT_ASSERT(ret >>= retEvent); // tdf#153752: without the fix, this would fail with diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 91309d9e5491..49ef48e80e37 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -563,10 +563,10 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testEscapeCharInNumberFormatXLSX) assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[3]", "formatCode", "00\\.00\\.00\\.000\\.0"); // tdf#81939 // "_-* #,##0\ _€_-;\-* #,##0\ _€_-;_-* "- "_€_-;_-@_-" // tdf#81222 - OUString rFormatStrExpected(u"_-* #,##0\\ _€_-;\\-* #,##0\\ _€_-;_-* \"- \"_€_-;_-@_-"); + OUString rFormatStrExpected(u"_-* #,##0\\ _€_-;\\-* #,##0\\ _€_-;_-* \"- \"_€_-;_-@_-"_ustr); assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[4]", "formatCode", rFormatStrExpected); // "_-* #,##0" €"_-;\-* #,##0" €"_-;_-* "- €"_-;_-@_-"); - rFormatStrExpected = u"_-* #,##0\" €\"_-;\\-* #,##0\" €\"_-;_-* \"- €\"_-;_-@_-"; + rFormatStrExpected = u"_-* #,##0\" €\"_-;\\-* #,##0\" €\"_-;_-* \"- €\"_-;_-@_-"_ustr; 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", diff --git a/sc/qa/unit/subsequent_filters_test3.cxx b/sc/qa/unit/subsequent_filters_test3.cxx index 3a46b9926bf6..cd9acf90bece 100644 --- a/sc/qa/unit/subsequent_filters_test3.cxx +++ b/sc/qa/unit/subsequent_filters_test3.cxx @@ -361,7 +361,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf60673) // Without the fix in place, this test would have failed with // - Expected: PL: ĄŚŻŹĆŃŁÓĘ // - Actual : PL: - CPPUNIT_ASSERT_EQUAL(OUString(u"PL: ĄŚŻŹĆŃŁÓĘ"), sLabel); + CPPUNIT_ASSERT_EQUAL(u"PL: ĄŚŻŹĆŃŁÓĘ"_ustr, sLabel); } CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testtdf120301_xmlSpaceParsingXLSX) @@ -519,7 +519,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf70455) // Without the fix in place, this test would have failed with // - Expected: €780.00 // - Actual : Err:509 - CPPUNIT_ASSERT_EQUAL(OUString(u"€780.00"), pDoc->GetString(ScAddress(7, 7, 0))); + CPPUNIT_ASSERT_EQUAL(u"€780.00"_ustr, pDoc->GetString(ScAddress(7, 7, 0))); } CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf62268) @@ -571,7 +571,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf72470) ScDocument* pDoc = getScDoc(); CPPUNIT_ASSERT_EQUAL(OUString("name"), pDoc->GetString(ScAddress(0, 0, 0))); - CPPUNIT_ASSERT_EQUAL(OUString(u"أسمي walid"), pDoc->GetString(ScAddress(0, 1, 0))); + CPPUNIT_ASSERT_EQUAL(u"أسمي walid"_ustr, pDoc->GetString(ScAddress(0, 1, 0))); } CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf35636) @@ -995,13 +995,13 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf129940) ScDocument* pDoc = getScDoc(); // Pure text within text:ruby-base OUString aStr = pDoc->GetString(ScAddress(0, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"小笠原"), aStr); + CPPUNIT_ASSERT_EQUAL(u"小笠原"_ustr, aStr); aStr = pDoc->GetString(ScAddress(1, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"徳彦"), aStr); + CPPUNIT_ASSERT_EQUAL(u"徳彦"_ustr, aStr); // Multiple text:span within text:ruby-base aStr = pDoc->GetString(ScAddress(2, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"注音符號"), aStr); + CPPUNIT_ASSERT_EQUAL(u"注音符號"_ustr, aStr); } CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf119190) @@ -1149,32 +1149,32 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testInvalidBareBiff5) CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"sheetjs"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"sheetjs"_ustr, pDoc->GetString(aPos)); // Row 3 aPos = ScAddress(0, 2, 0); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"foo bar"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"foo bar"_ustr, pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"baz"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, pDoc->GetCellType(aPos)); CPPUNIT_ASSERT_EQUAL(41689.4375, pDoc->GetValue(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"0.3"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"0.3"_ustr, pDoc->GetString(aPos)); // Row 4 aPos = ScAddress(0, 3, 0); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"baz"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"baz"_ustr, pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, pDoc->GetCellType(aPos)); CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"_"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"_"_ustr, pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, pDoc->GetCellType(aPos)); CPPUNIT_ASSERT_EQUAL(3.14159, pDoc->GetValue(aPos)); @@ -1182,7 +1182,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testInvalidBareBiff5) // Row 5 aPos = ScAddress(0, 4, 0); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"hidden"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"hidden"_ustr, pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, pDoc->GetCellType(aPos)); CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(aPos)); @@ -1196,7 +1196,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testInvalidBareBiff5) // Row 6 aPos = ScAddress(0, 5, 0); CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, pDoc->GetCellType(aPos)); - CPPUNIT_ASSERT_EQUAL(OUString(u"visible"), pDoc->GetString(aPos)); + CPPUNIT_ASSERT_EQUAL(u"visible"_ustr, pDoc->GetString(aPos)); aPos.IncCol(); CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, pDoc->GetCellType(aPos)); CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(aPos)); diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx index 4439b3d9ba97..4a7401e84337 100644 --- a/sc/qa/unit/subsequent_filters_test4.cxx +++ b/sc/qa/unit/subsequent_filters_test4.cxx @@ -1329,16 +1329,16 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf153444) ScDocument* pDoc = getScDoc(); - CPPUNIT_ASSERT_EQUAL(OUString(u"time, sec"), pDoc->GetString(0, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"Body_Right_Z, g"), pDoc->GetString(1, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"Body_Left_Z, g"), pDoc->GetString(2, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"time, sec"_ustr, pDoc->GetString(0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"Body_Right_Z, g"_ustr, pDoc->GetString(1, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"Body_Left_Z, g"_ustr, pDoc->GetString(2, 0, 0)); // Without the fix in place, this test would have failed with // - Expected: ÄÖÜ, µm/m // - Actual : ���, �m/m - CPPUNIT_ASSERT_EQUAL(OUString(u"ÄÖÜ, µm/m"), pDoc->GetString(3, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"äöü, µm/m"), pDoc->GetString(4, 0, 0)); - CPPUNIT_ASSERT_EQUAL(OUString(u"ß, µm/m"), pDoc->GetString(5, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"ÄÖÜ, µm/m"_ustr, pDoc->GetString(3, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"äöü, µm/m"_ustr, pDoc->GetString(4, 0, 0)); + CPPUNIT_ASSERT_EQUAL(u"ß, µm/m"_ustr, pDoc->GetString(5, 0, 0)); } CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf151958) diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 76286912a698..ab25340e8c3e 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -3064,8 +3064,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testGetViewRenderState) { // Add a pair of schemes, last added is the default svtools::EditableColorConfig aColorConfig; - aColorConfig.AddScheme(u"Dark"); - aColorConfig.AddScheme(u"Light"); + aColorConfig.AddScheme(u"Dark"_ustr); + aColorConfig.AddScheme(u"Light"_ustr); ScModelObj* pModelObj = createDoc("empty.ods"); int nFirstViewId = SfxLokHelper::getView(); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index afbe5b8432a0..83ec9c63986e 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -514,14 +514,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf114406) CPPUNIT_TEST_FIXTURE(Test, testTdf93951) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); - m_pDoc->SetString(ScAddress(0,0,0), u"=2*§*2"); + m_pDoc->SetString(ScAddress(0,0,0), u"=2*§*2"_ustr); OUString aFormula = m_pDoc->GetFormula(0,0,0); // Without the fix in place, this test would have failed with // - Expected: =2*§*2 // - Actual : =2* - CPPUNIT_ASSERT_EQUAL(OUString(u"=2*§*2"), aFormula); + CPPUNIT_ASSERT_EQUAL(u"=2*§*2"_ustr, aFormula); m_pDoc->DeleteTab(0); } diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx index c5207a03c3d8..d90e3bb3d3e2 100644 --- a/sc/qa/unit/uicalc/uicalc2.cxx +++ b/sc/qa/unit/uicalc/uicalc2.cxx @@ -881,10 +881,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf123202) createScDoc(); ScDocument* pDoc = getScDoc(); - insertStringToCell(u"A1", u"1"); - insertStringToCell(u"A2", u"2"); - insertStringToCell(u"A3", u"3"); - insertStringToCell(u"A4", u"4"); + insertStringToCell(u"A1"_ustr, u"1"); + insertStringToCell(u"A2"_ustr, u"2"); + insertStringToCell(u"A3"_ustr, u"3"); + insertStringToCell(u"A4"_ustr, u"4"); goToCell("A3"); |