summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-01-27 16:45:22 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-01-27 23:24:42 +0100
commitaa2064c5c5f23f6f4b7bc44e12345b37f66995bc (patch)
treea5073b6d0b0c5846575671975341f0e0b393d98d /sw/qa/extras/rtfimport
parent686582b4890f458b6b8ee0e1ab19d9ad64793c85 (diff)
Improve loplugin:stringliteralvar
...to also consider O[U]String ctors taking pointer and length Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4749fa3acf6f..ae99eab0d49a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1093,10 +1093,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext1)
load(mpTestDocumentPath, "cp950listleveltext1.rtf");
// suffix with Chinese only ( most common case generated by MSO2010 TC)
// This is a dot that is generally used as suffix of Chinese list number
- const sal_Unicode aExpectedNumbering[] = { 0x4e00, 0x3001 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u4e00\u3001";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
@@ -1105,10 +1105,10 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext2)
{
load(mpTestDocumentPath, "cp950listleveltext2.rtf");
// Prefix and suffix with Chinese only ( tweaked from default in MSO2010 TC)
- const sal_Unicode aExpectedNumbering[] = { 0x524d, 0x7f6e, 0x7532, 0x3001, 0x5f8c, 0x7f6e };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u524d\u7f6e\u7532\u3001\u5f8c\u7f6e";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
@@ -1117,11 +1117,11 @@ CPPUNIT_TEST_FIXTURE(Test, testCp950listleveltext3)
{
load(mpTestDocumentPath, "cp950listleveltext3.rtf");
// Numbering is a mix Chinese and English ( tweaked from default in MSO2010 TC)
- const sal_Unicode aExpectedNumbering[] = { 0x524d, 0x0061, 0x7f6e, 0x0062, 0x7532, 0x3001,
- 0x0063, 0x5f8c, 0x0064, 0x7f6e, 0x0065 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u524da\u7f6eb\u7532\u3001"
+ "c\u5f8cd\u7f6ee";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}
@@ -1129,10 +1129,10 @@ CPPUNIT_TEST_FIXTURE(Test, testChtOutlineNumberingRtf)
{
load(mpTestDocumentPath, "chtoutline.rtf");
- const sal_Unicode aExpectedNumbering[] = { 0x7b2c, ' ', '1', ' ', 0x7ae0 };
+ static constexpr OUStringLiteral aExpectedNumbering = u"\u7b2c 1 \u7ae0";
uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering, SAL_N_ELEMENTS(aExpectedNumbering)),
+ CPPUNIT_ASSERT_EQUAL(OUString(aExpectedNumbering),
getProperty<OUString>(xPara, "ListLabelString"));
}