summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-13 08:44:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-15 21:15:49 +0200
commitb4844c310bd9897fef59e8a4da0513100ea86096 (patch)
tree379a43d012894ff06d29d79c7d4d8009b7853501 /sw/qa
parent8797ba5e5d63151837ba443e1aea9d0997b6b7ab (diff)
Repurpose loplugin:stringstatic for O[U]String vars that can be constexpr
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/test_ToxWhitespaceStripper.cxx2
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx2
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx2
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx6
-rw-r--r--sw/qa/extras/uiwriter/uiwriter4.cxx12
-rw-r--r--sw/qa/extras/uiwriter/uiwriter6.cxx2
7 files changed, 14 insertions, 14 deletions
diff --git a/sw/qa/core/test_ToxWhitespaceStripper.cxx b/sw/qa/core/test_ToxWhitespaceStripper.cxx
index 14ebc6ac2e14..f3c2de946773 100644
--- a/sw/qa/core/test_ToxWhitespaceStripper.cxx
+++ b/sw/qa/core/test_ToxWhitespaceStripper.cxx
@@ -113,7 +113,7 @@ void ToxWhitespaceStripperTest::StrippingWhitespacesFromVariousStringsWorks()
void ToxWhitespaceStripperTest::PositionAfterStringCanBeRequested()
{
- OUString const test("abc");
+ OUString constexpr test(u"abc"_ustr);
ToxWhitespaceStripper sut(test);
sal_Int32 expected = test.getLength();
CPPUNIT_ASSERT_EQUAL(expected, sut.GetPositionInStrippedString(test.getLength()));
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 6810baa1efe3..be3c67fb0bba 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -1115,7 +1115,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFieldShadeReqIf)
DECLARE_HTMLEXPORT_TEST(testTdf126879, "tdf126879.odt")
{
- const OString aExpected("<!DOCTYPE html>");
+ constexpr OString aExpected("<!DOCTYPE html>"_ostr);
SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
CPPUNIT_ASSERT(pStream);
const OString aActual(read_uInt8s_ToOString(*pStream, aExpected.getLength()));
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index f2ce8f149306..3bb0e585f6fc 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1196,7 +1196,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt")
CPPUNIT_TEST_FIXTURE(Test, testProtectionKey)
{
loadAndReload("protection-key.fodt");
- OUString const password("1012345678901234567890123456789012345678901234567890");
+ OUString constexpr password(u"1012345678901234567890123456789012345678901234567890"_ustr);
// check 1 invalid OOo legacy password and 3 valid ODF 1.2 passwords
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 402c2ddcc04a..c0dea13f2075 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -1490,7 +1490,7 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXOptionButtonGroup, "activex_option_button_gr
{
// Optionbutton groups were not handled
// The two optionbutton should have the same group name
- const OUString sGroupName = "GroupX";
+ constexpr OUString sGroupName = u"GroupX"_ustr;
uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
CPPUNIT_ASSERT(xControlShape.is());
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index d3877d94c0cc..d62a46aa3671 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -1568,7 +1568,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
// click on the links...
{
- OUString const tmp("Table of Contents");
+ OUString constexpr tmp(u"Table of Contents"_ustr);
pWrtShell->GotoNextTOXBase(&tmp);
}
@@ -1603,7 +1603,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
}
{
- OUString const tmp("User-Defined1");
+ OUString constexpr tmp(u"User-Defined1"_ustr);
pWrtShell->GotoNextTOXBase(&tmp);
}
@@ -1653,7 +1653,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testToxmarkLinks)
}
{
- OUString const tmp("NewUD!|1");
+ OUString constexpr tmp(u"NewUD!|1"_ustr);
pWrtShell->GotoNextTOXBase(&tmp);
}
diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx
index d5acadd55569..2865378fa998 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -663,7 +663,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testBookmarkCollapsed)
// load only content.xml from the resaved document
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- const OString aPath("/office:document-content/office:body/office:text/text:p");
+ constexpr OString aPath("/office:document-content/office:body/office:text/text:p"_ostr);
const int pos1 = getXPathPosition(pXmlDoc, aPath, "bookmark");
CPPUNIT_ASSERT_EQUAL(0, pos1); // found, and it is first
@@ -736,7 +736,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkText)
// load only content.xml from the resaved document
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- const OString aPath("/office:document-content/office:body/office:text/text:p");
+ constexpr OString aPath("/office:document-content/office:body/office:text/text:p"_ostr);
CPPUNIT_ASSERT_ASSERTION_FAIL(getXPathPosition(pXmlDoc, aPath, "bookmark")); // not found
const int pos2 = getXPathPosition(pXmlDoc, aPath, "bookmark-start");
@@ -838,7 +838,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNew)
// load only content.xml from the resaved document
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- const OString aPath("/office:document-content/office:body/office:text/text:p");
+ constexpr OString aPath("/office:document-content/office:body/office:text/text:p"_ostr);
CPPUNIT_ASSERT_ASSERTION_FAIL(getXPathPosition(pXmlDoc, aPath, "bookmark")); // not found
const int pos2 = getXPathPosition(pXmlDoc, aPath, "bookmark-start");
@@ -902,7 +902,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNewAfterReload
// load only content.xml from the resaved document
xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
- const OString aPath("/office:document-content/office:body/office:text/text:p");
+ constexpr OString aPath("/office:document-content/office:body/office:text/text:p"_ostr);
const int pos1 = getXPathPosition(pXmlDoc, aPath, "bookmark");
const int pos2 = getXPathPosition(pXmlDoc, aPath, "text");
@@ -1319,7 +1319,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRedlineViewAuthor)
SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
pWrtShell->Insert("middle");
SwView* pView = pDocShell->GetView();
- const OUString aAuthor("A U. Thor");
+ constexpr OUString aAuthor(u"A U. Thor"_ustr);
pView->SetRedlineAuthor(aAuthor);
pDocShell->SetView(pView);
@@ -2141,7 +2141,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testCreateDocxAnnotation)
createSwDoc();
// insert an annotation with a text
- const OUString aSomeText("some text");
+ constexpr OUString aSomeText(u"some text"_ustr);
uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence({
{ "Text", uno::Any(aSomeText) },
{ "Author", uno::Any(OUString("me")) },
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx
index 74221022bd6d..ac5155f429a9 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -715,7 +715,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113481)
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf115013)
{
- const OUString sColumnName("Name with spaces, \"quotes\" and \\backslashes");
+ constexpr OUString sColumnName(u"Name with spaces, \"quotes\" and \\backslashes"_ustr);
utl::TempFileNamed aTempDir(nullptr, true);
aTempDir.EnableKillingFile();