test/source/screenshot_test.cxx          |    2 +-
 test/source/sheet/cellarealink.cxx       |   10 +++++-----
 test/source/sheet/databaserange.cxx      |   22 +++++++++++-----------
 test/source/sheet/datapilotitem.cxx      |    4 ++--
 test/source/sheet/xarrayformularange.cxx |    2 +-
 test/source/sheet/xsheetoutline.cxx      |   18 +++++++++---------
 test/source/sheet/xspreadsheets2.cxx     |    6 +++---
 test/source/text/textsettings.cxx        |    6 +++---
 8 files changed, 35 insertions(+), 35 deletions(-)

New commits:
commit bcbc1051c72dc16dd16dbb86b21ca4d731be34b8
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Oct 19 10:30:33 2023 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Oct 20 15:28:54 2023 +0200

    Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: test
    
    Change-Id: I883d34c9562b48d987a16a0254272f3aeeb4bf5a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158242
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index 8246db7f8492..b4c188fdbc34 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -40,7 +40,7 @@ using namespace css;
 using namespace css::uno;
 
     /// the target directory for screenshots
-constexpr OUStringLiteral g_aScreenshotDirectory(u"screenshots");
+constexpr OUString g_aScreenshotDirectory(u"screenshots"_ustr);
 
 ScreenshotTest::ScreenshotTest()
     : maParent(nullptr, "vcl/ui/screenshotparent.ui", "ScreenShot")
diff --git a/test/source/sheet/cellarealink.cxx 
b/test/source/sheet/cellarealink.cxx
index 412d1b6260e3..93319542cb9b 100644
--- a/test/source/sheet/cellarealink.cxx
+++ b/test/source/sheet/cellarealink.cxx
@@ -22,7 +22,7 @@ void CellAreaLink::testUrl()
 {
     uno::Reference<beans::XPropertySet> xCellAreaLink(init(), 
uno::UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"Url");
+    static constexpr OUString propName(u"Url"_ustr);
 
     OUString aUrl;
     CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aUrl);
@@ -39,7 +39,7 @@ void CellAreaLink::testFilter()
 {
     uno::Reference<beans::XPropertySet> xCellAreaLink(init(), 
uno::UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"Filter");
+    static constexpr OUString propName(u"Filter"_ustr);
 
     OUString aFilter;
     CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilter);
@@ -56,7 +56,7 @@ void CellAreaLink::testFilterOptions()
 {
     uno::Reference<beans::XPropertySet> xCellAreaLink(init(), 
uno::UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"FilterOptions");
+    static constexpr OUString propName(u"FilterOptions"_ustr);
 
     OUString aFilterOptions;
     CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= 
aFilterOptions);
@@ -75,7 +75,7 @@ void CellAreaLink::testRefreshDelay()
 {
     uno::Reference<beans::XPropertySet> xCellAreaLink(init(), 
uno::UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"RefreshDelay");
+    static constexpr OUString propName(u"RefreshDelay"_ustr);
 
     sal_Int32 aRefreshDelay = 0;
     CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= 
aRefreshDelay);
@@ -94,7 +94,7 @@ void CellAreaLink::testRefreshPeriod()
 {
     uno::Reference<beans::XPropertySet> xCellAreaLink(init(), 
uno::UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"RefreshPeriod");
+    static constexpr OUString propName(u"RefreshPeriod"_ustr);
 
     sal_Int32 aRefreshPeriod = 0;
     CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= 
aRefreshPeriod);
diff --git a/test/source/sheet/databaserange.cxx 
b/test/source/sheet/databaserange.cxx
index a9e316be7ce3..5bae62ce434e 100644
--- a/test/source/sheet/databaserange.cxx
+++ b/test/source/sheet/databaserange.cxx
@@ -26,7 +26,7 @@ void DatabaseRange::testMoveCells()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"MoveCells");
+    static constexpr OUString propName(u"MoveCells"_ustr);
 
     bool bMoveCells = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bMoveCells);
@@ -43,7 +43,7 @@ void DatabaseRange::testKeepFormats()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"KeepFormats");
+    static constexpr OUString propName(u"KeepFormats"_ustr);
 
     bool bKeepFormats = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= 
bKeepFormats);
@@ -60,7 +60,7 @@ void DatabaseRange::testStripData()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"StripData");
+    static constexpr OUString propName(u"StripData"_ustr);
 
     bool bStripData = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bStripData);
@@ -77,7 +77,7 @@ void DatabaseRange::testAutoFilter()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"AutoFilter");
+    static constexpr OUString propName(u"AutoFilter"_ustr);
 
     bool bAutoFilter = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bAutoFilter);
@@ -94,7 +94,7 @@ void DatabaseRange::testUseFilterCriteriaSource()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"UseFilterCriteriaSource");
+    static constexpr OUString propName(u"UseFilterCriteriaSource"_ustr);
 
     bool bUseFilterCriteriaSource = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= 
bUseFilterCriteriaSource);
@@ -113,7 +113,7 @@ void DatabaseRange::testFilterCriteriaSource()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"FilterCriteriaSource");
+    static constexpr OUString propName(u"FilterCriteriaSource"_ustr);
 
     table::CellRangeAddress cellRangeAddress;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= 
cellRangeAddress);
@@ -132,7 +132,7 @@ void DatabaseRange::testRefreshPeriod()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"RefreshPeriod");
+    static constexpr OUString propName(u"RefreshPeriod"_ustr);
 
     sal_Int32 aRefreshPeriod = 1;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= 
aRefreshPeriod);
@@ -151,7 +151,7 @@ void DatabaseRange::testFromSelection()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"FromSelection");
+    static constexpr OUString propName(u"FromSelection"_ustr);
 
     bool bFromSelection = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= 
bFromSelection);
@@ -168,7 +168,7 @@ void DatabaseRange::testTokenIndex()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"TokenIndex");
+    static constexpr OUString propName(u"TokenIndex"_ustr);
 
     sal_Int32 aTokenIndex = 0;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= aTokenIndex);
@@ -185,7 +185,7 @@ void DatabaseRange::testTotalsRow()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"TotalsRow");
+    static constexpr OUString propName(u"TotalsRow"_ustr);
 
     bool bTotalsRow = true;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bTotalsRow);
@@ -202,7 +202,7 @@ void DatabaseRange::testContainsHeader()
 {
     uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), 
UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propName(u"ContainsHeader");
+    static constexpr OUString propName(u"ContainsHeader"_ustr);
 
     bool bContainsHeader = false;
     CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= 
bContainsHeader);
diff --git a/test/source/sheet/datapilotitem.cxx 
b/test/source/sheet/datapilotitem.cxx
index 625b1e634807..7433097035d7 100644
--- a/test/source/sheet/datapilotitem.cxx
+++ b/test/source/sheet/datapilotitem.cxx
@@ -24,7 +24,7 @@ void DataPilotItem::testProperties()
 {
     uno::Reference<beans::XPropertySet> xItem(init(), UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral propNameIS(u"IsHidden");
+    static constexpr OUString propNameIS(u"IsHidden"_ustr);
 
     bool bIsHidden = true;
     CPPUNIT_ASSERT(xItem->getPropertyValue(propNameIS) >>= bIsHidden);
@@ -36,7 +36,7 @@ void DataPilotItem::testProperties()
     CPPUNIT_ASSERT(xItem->getPropertyValue(propNameIS) >>= bIsHidden);
     CPPUNIT_ASSERT_MESSAGE("Value of IsHidden wasn't changed", !bIsHidden);
 
-    static constexpr OUStringLiteral propNameSD(u"ShowDetail");
+    static constexpr OUString propNameSD(u"ShowDetail"_ustr);
 
     bool bShowDetail = false;
     CPPUNIT_ASSERT(xItem->getPropertyValue(propNameSD) >>= bShowDetail);
diff --git a/test/source/sheet/xarrayformularange.cxx 
b/test/source/sheet/xarrayformularange.cxx
index 55372e18589c..fb924a78bf2e 100644
--- a/test/source/sheet/xarrayformularange.cxx
+++ b/test/source/sheet/xarrayformularange.cxx
@@ -27,7 +27,7 @@ void XArrayFormulaRange::testGetSetArrayFormula()
 {
     uno::Reference<sheet::XArrayFormulaRange> xAFR(init(), UNO_QUERY_THROW);
 
-    static constexpr OUStringLiteral sFormula(u"=1 + 2 * 5");
+    static constexpr OUString sFormula(u"=1 + 2 * 5"_ustr);
 
     xAFR->setArrayFormula(sFormula);
     uno::Reference<sheet::XCellRangeAddressable> xCRA(xAFR, UNO_QUERY_THROW);
diff --git a/test/source/sheet/xsheetoutline.cxx 
b/test/source/sheet/xsheetoutline.cxx
index e5b99c86a369..ff3e519d301d 100644
--- a/test/source/sheet/xsheetoutline.cxx
+++ b/test/source/sheet/xsheetoutline.cxx
@@ -28,13 +28,13 @@ using namespace css::uno;
 
 namespace apitest {
 
-constexpr OUStringLiteral colLevel1 = u"OutlineSheet.A1:Z1";
-constexpr OUStringLiteral colLevel2 = u"OutlineSheet.C1:W1";
-constexpr OUStringLiteral colLevel3 = u"OutlineSheet.E1:U1";
+constexpr OUString colLevel1 = u"OutlineSheet.A1:Z1"_ustr;
+constexpr OUString colLevel2 = u"OutlineSheet.C1:W1"_ustr;
+constexpr OUString colLevel3 = u"OutlineSheet.E1:U1"_ustr;
 constexpr OUStringLiteral colLevel4 = u"OutlineSheet.G1:S1";
 
-constexpr OUStringLiteral rowLevel1 = u"OutlineSheet.A1:A30";
-constexpr OUStringLiteral rowLevel2 = u"OutlineSheet.A3:A27";
+constexpr OUString rowLevel1 = u"OutlineSheet.A1:A30"_ustr;
+constexpr OUString rowLevel2 = u"OutlineSheet.A3:A27"_ustr;
 
 static OUString getVisibleAddress(
     uno::Reference<sheet::XSpreadsheet> const& xSheet,
@@ -102,14 +102,14 @@ void XSheetOutline::testShowDetail()
     aSheetOutline->showDetail(aLevelRangeAddress);
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Row level 2 still hidden",
-            OUString(rowLevel2), getVisibleAddress(aSheet, rowLevel2));
+            rowLevel2, getVisibleAddress(aSheet, rowLevel2));
 
     // Column Level 2
     aLevelRangeAddress = getAddressFromRangeString(aSheet, colLevel2);
     aSheetOutline->showDetail(aLevelRangeAddress);
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Column level 2 still hidden",
-            OUString(colLevel2), getVisibleAddress(aSheet, colLevel2));
+            colLevel2, getVisibleAddress(aSheet, colLevel2));
 
 }
 
@@ -254,8 +254,8 @@ void XSheetOutline::testClearOutline()
     aLevelRangeAddress = getAddressFromRangeString(aSheet, rowLevel1);
     aSheetOutline->hideDetail(aLevelRangeAddress);
 
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Columns are hidden after 
clear", OUString(colLevel1), getVisibleAddress(aSheet, colLevel1));
-    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Rows are hidden after 
clear", OUString(rowLevel1), getVisibleAddress(aSheet, rowLevel1));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Columns are hidden after 
clear", colLevel1, getVisibleAddress(aSheet, colLevel1));
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("testClearOutline Rows are hidden after 
clear", rowLevel1, getVisibleAddress(aSheet, rowLevel1));
 
 }
 
diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index c783d7f6b565..dd0fbbace5ac 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -33,9 +33,9 @@ using namespace css::uno;
 
 namespace apitest {
 
-constexpr OUStringLiteral gaSrcSheetName(u"SheetToCopy");
+constexpr OUString gaSrcSheetName(u"SheetToCopy"_ustr);
 constexpr OUStringLiteral gaSrcFileName(u"rangenamessrc.ods");
-constexpr OUStringLiteral gaDestFileBase(u"ScNamedRangeObj.ods");
+constexpr OUString gaDestFileBase(u"ScNamedRangeObj.ods"_ustr);
 
 static sal_Int32 nInsertedSheets(0);
 
@@ -243,7 +243,7 @@ void XSpreadsheets2::testImportCellStyle()
 
     //new style created in dest
     uno::Reference< beans::XPropertySet > xSrcCellPropSet (xSrcCell, 
UNO_QUERY_THROW);
-    static constexpr OUStringLiteral aCellProperty(u"CellStyle");
+    static constexpr OUString aCellProperty(u"CellStyle"_ustr);
     OUString aSrcStyleName;
     CPPUNIT_ASSERT(xSrcCellPropSet->getPropertyValue(aCellProperty) >>= 
aSrcStyleName);
 
diff --git a/test/source/text/textsettings.cxx 
b/test/source/text/textsettings.cxx
index 2003156074b3..039210390765 100644
--- a/test/source/text/textsettings.cxx
+++ b/test/source/text/textsettings.cxx
@@ -44,7 +44,7 @@ bool 
isPropertyReadOnly(css::uno::Reference<css::beans::XPropertySet> const& rxP
 // [property] string PrinterName;
 void testPrinterName(css::uno::Reference<css::beans::XPropertySet> const& 
rxSettings)
 {
-    static constexpr OUStringLiteral rPropertyName(u"PrinterName");
+    static constexpr OUString rPropertyName(u"PrinterName"_ustr);
 
     if (!extstsProperty(rxSettings, rPropertyName))
         return; // Property is sometimes not set - bug? it is not defined as 
optional
@@ -67,7 +67,7 @@ void 
testPrinterName(css::uno::Reference<css::beans::XPropertySet> const& rxSett
 // [optional, property] short PrinterIndependentLayout;
 void 
testPrinterIndependentLayout(css::uno::Reference<css::beans::XPropertySet> 
const& rxSettings)
 {
-    static constexpr OUStringLiteral 
rPropertyName(u"PrinterIndependentLayout");
+    static constexpr OUString rPropertyName(u"PrinterIndependentLayout"_ustr);
 
     if (!extstsProperty(rxSettings, rPropertyName))
         return; // Property is optional
@@ -91,7 +91,7 @@ void 
testPrinterIndependentLayout(css::uno::Reference<css::beans::XPropertySet>
 // [optional, property] com::sun::star::i18n::XForbiddenCharacters 
ForbiddenCharacters;
 void testForbiddenCharacters(css::uno::Reference<css::beans::XPropertySet> 
const& rxSettings)
 {
-    static constexpr OUStringLiteral rPropertyName(u"ForbiddenCharacters");
+    static constexpr OUString rPropertyName(u"ForbiddenCharacters"_ustr);
 
     if (!extstsProperty(rxSettings, rPropertyName))
         return; // Property is optional

Reply via email to