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 /svl | |
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 'svl')
-rw-r--r-- | svl/qa/unit/svl.cxx | 26 | ||||
-rw-r--r-- | svl/qa/unit/test_URIHelper.cxx | 38 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 6 |
3 files changed, 35 insertions, 35 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 05b5155054d9..f43cfb9e437e 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -565,10 +565,10 @@ void Test::testTdf103060() sExpected = "H"; // Heisei era checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); sCode = "GG"; - sExpected = u"\u5E73"; + sExpected = u"\u5E73"_ustr; checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); sCode = "GGG"; - sExpected = u"\u5E73\u6210"; + sExpected = u"\u5E73\u6210"_ustr; checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); } @@ -1522,7 +1522,7 @@ void Test::testUserDefinedNumberFormats() { // tdf#79399 tdf#101462 Native Number Formats sCode = "[NatNum5][$-0404]General\\ "; // Chinese upper case number characters for 120 - sExpected = u"\u58F9\u4F70\u8CB3\u62FE "; + sExpected = u"\u58F9\u4F70\u8CB3\u62FE "_ustr; checkPreviewString(aFormatter, sCode, 120, eLang, sExpected); sCode = "[DBNum2][$-0404]General\\ "; checkPreviewString(aFormatter, sCode, 120, eLang, sExpected); @@ -1582,7 +1582,7 @@ void Test::testUserDefinedNumberFormats() // DBNum1 -> NatNum4: Chinese lower case text for 123456789 // 一億二千三百四十五萬六千七百八十九 sExpected = u"\u4e00\u5104\u4e8c\u5343\u4e09\u767e\u56db\u5341\u4e94\u842c\u516d\u5343" - u"\u4e03\u767e\u516b\u5341\u4e5d "; + u"\u4e03\u767e\u516b\u5341\u4e5d "_ustr; sCode = "[NatNum4][$-0404]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum1][$-0404]General\\ "; @@ -1591,7 +1591,7 @@ void Test::testUserDefinedNumberFormats() // DBNum2 -> NatNum5: Chinese upper case text // 壹億貳仟參佰肆拾伍萬陸仟柒佰捌拾玖 sExpected = u"\u58f9\u5104\u8cb3\u4edf\u53c3\u4f70\u8086\u62fe\u4f0d\u842c\u9678\u4edf" - u"\u67d2\u4f70\u634c\u62fe\u7396 "; + u"\u67d2\u4f70\u634c\u62fe\u7396 "_ustr; sCode = "[NatNum5][$-0404]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum2][$-0404]General\\ "; @@ -1599,7 +1599,7 @@ void Test::testUserDefinedNumberFormats() // DBNum3 -> NatNum3: fullwidth text // 123456789 - sExpected = u"\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19 "; + sExpected = u"\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19 "_ustr; sCode = "[NatNum3][$-0404]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum3][$-0404]General\\ "; @@ -1610,7 +1610,7 @@ void Test::testUserDefinedNumberFormats() // DBNum1 -> NatNum4: Japanese modern long Kanji text for 123456789 // 一億二千三百四十五万六千七百八十九 sExpected = u"\u4e00\u5104\u4e8c\u5343\u4e09\u767e\u56db\u5341\u4e94\u4e07\u516d\u5343" - u"\u4e03\u767e\u516b\u5341\u4e5d "; + u"\u4e03\u767e\u516b\u5341\u4e5d "_ustr; sCode = "[NatNum4][$-0411]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum1][$-0411]General\\ "; @@ -1619,7 +1619,7 @@ void Test::testUserDefinedNumberFormats() // DBNum2 -> NatNum5: traditional long Kanji text // 壱億弐阡参百四拾伍萬六阡七百八拾九 sExpected = u"\u58f1\u5104\u5f10\u9621\u53c2\u767e\u56db\u62fe\u4f0d\u842c\u516d\u9621" - u"\u4e03\u767e\u516b\u62fe\u4e5d "; + u"\u4e03\u767e\u516b\u62fe\u4e5d "_ustr; sCode = "[NatNum5][$-0411]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum2][$-0411]General\\ "; @@ -1627,7 +1627,7 @@ void Test::testUserDefinedNumberFormats() // DBNum3 -> NatNum3: fullwidth Arabic digits // 123456789 - sExpected = u"\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19 "; + sExpected = u"\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19 "_ustr; sCode = "[NatNum3][$-0411]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum3][$-0411]General\\ "; @@ -1637,7 +1637,7 @@ void Test::testUserDefinedNumberFormats() // DBNum1 -> NatNum4: Korean lower case characters // 一億二千三百四十五万六千七百八十九 - sExpected = u"\u4e00\u5104\u4e8c\u5343\u4e09\u767e\u56db\u5341\u4e94\u4e07\u516d\u5343\u4e03\u767e\u516b\u5341\u4e5d "; + sExpected = u"\u4e00\u5104\u4e8c\u5343\u4e09\u767e\u56db\u5341\u4e94\u4e07\u516d\u5343\u4e03\u767e\u516b\u5341\u4e5d "_ustr; sCode = "[NatNum4][$-0412]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum1][$-0412]General\\ "; @@ -1645,7 +1645,7 @@ void Test::testUserDefinedNumberFormats() // DBNum2 -> NatNum5: Korean upper case characters // 壹億貳阡參佰四拾伍萬六阡七佰八拾九 - sExpected = u"\u58f9\u5104\u8cb3\u9621\u53c3\u4f70\u56db\u62fe\u4f0d\u842c\u516d\u9621\u4e03\u4f70\u516b\u62fe\u4e5d "; + sExpected = u"\u58f9\u5104\u8cb3\u9621\u53c3\u4f70\u56db\u62fe\u4f0d\u842c\u516d\u9621\u4e03\u4f70\u516b\u62fe\u4e5d "_ustr; sCode = "[NatNum5][$-0412]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum2][$-0412]General\\ "; @@ -1653,7 +1653,7 @@ void Test::testUserDefinedNumberFormats() // DBNum3 -> NatNum6: fullwidth Arabic digits // 1억2천3백4십5만6천7백8십9 - sExpected = u"\uff11\uc5b5\uff12\ucc9c\uff13\ubc31\uff14\uc2ed\uff15\ub9cc\uff16\ucc9c\uff17\ubc31\uff18\uc2ed\uff19 "; + sExpected = u"\uff11\uc5b5\uff12\ucc9c\uff13\ubc31\uff14\uc2ed\uff15\ub9cc\uff16\ucc9c\uff17\ubc31\uff18\uc2ed\uff19 "_ustr; sCode = "[NatNum6][$-0412]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum3][$-0412]General\\ "; @@ -1661,7 +1661,7 @@ void Test::testUserDefinedNumberFormats() // DBNum4 -> NatNum10: Hangul characters // 일억이천삼백사십오만육천칠백팔십구 - sExpected = u"\uc77c\uc5b5\uc774\ucc9c\uc0bc\ubc31\uc0ac\uc2ed\uc624\ub9cc\uc721\ucc9c\uce60\ubc31\ud314\uc2ed\uad6c "; + sExpected = u"\uc77c\uc5b5\uc774\ucc9c\uc0bc\ubc31\uc0ac\uc2ed\uc624\ub9cc\uc721\ucc9c\uce60\ubc31\ud314\uc2ed\uad6c "_ustr; sCode = "[NatNum10][$-0412]General\\ "; checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected); sCode = "[DBNum4][$-0412]General\\ "; diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx index 3f2624785f24..516f4eb4fd04 100644 --- a/svl/qa/unit/test_URIHelper.cxx +++ b/svl/qa/unit/test_URIHelper.cxx @@ -454,67 +454,67 @@ void Test::testResolveIdnaHost() { input.clear(); CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"Foo.M\u00FCnchen.de"; + input = u"Foo.M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); input = "foo://Muenchen.de"; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://-M\u00FCnchen.de"; + input = u"foo://-M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://M\u00FCnchen-.de"; + input = u"foo://M\u00FCnchen-.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://xn--M\u00FCnchen.de"; + input = u"foo://xn--M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://xy--M\u00FCnchen.de"; + input = u"foo://xy--M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://.M\u00FCnchen.de"; + input = u"foo://.M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://-bar.M\u00FCnchen.de"; + input = u"foo://-bar.M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://bar-.M\u00FCnchen.de"; + input = u"foo://bar-.M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://xn--bar.M\u00FCnchen.de"; + input = u"foo://xn--bar.M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); - input = u"foo://xy--bar.M\u00FCnchen.de"; + input = u"foo://xy--bar.M\u00FCnchen.de"_ustr; CPPUNIT_ASSERT_EQUAL(input, URIHelper::resolveIdnaHost(input)); CPPUNIT_ASSERT_EQUAL( - OUString(u"foo://M\u00FCnchen@xn--mnchen-3ya.de"), - URIHelper::resolveIdnaHost(u"foo://M\u00FCnchen@M\u00FCnchen.de")); + u"foo://M\u00FCnchen@xn--mnchen-3ya.de"_ustr, + URIHelper::resolveIdnaHost(u"foo://M\u00FCnchen@M\u00FCnchen.de"_ustr)); CPPUNIT_ASSERT_EQUAL( OUString("foo://xn--mnchen-3ya.de."), - URIHelper::resolveIdnaHost(u"foo://M\u00FCnchen.de.")); + URIHelper::resolveIdnaHost(u"foo://M\u00FCnchen.de."_ustr)); CPPUNIT_ASSERT_EQUAL( OUString("Foo://bar@xn--mnchen-3ya.de:123/?bar#baz"), - URIHelper::resolveIdnaHost(u"Foo://bar@M\u00FCnchen.de:123/?bar#baz")); + URIHelper::resolveIdnaHost(u"Foo://bar@M\u00FCnchen.de:123/?bar#baz"_ustr)); CPPUNIT_ASSERT_EQUAL( OUString("foo://xn--mnchen-3ya.de"), - URIHelper::resolveIdnaHost(u"foo://Mu\u0308nchen.de")); + URIHelper::resolveIdnaHost(u"foo://Mu\u0308nchen.de"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://example.xn--m-eha"), URIHelper::resolveIdnaHost(u"foo://example.mü")); + OUString("foo://example.xn--m-eha"), URIHelper::resolveIdnaHost(u"foo://example.mü"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://example.xn--m-eha:0"), URIHelper::resolveIdnaHost(u"foo://example.mü:0")); + OUString("foo://example.xn--m-eha:0"), URIHelper::resolveIdnaHost(u"foo://example.mü:0"_ustr)); CPPUNIT_ASSERT_EQUAL( - OUString("foo://xn--e1afmkfd.xn--p1ai"), URIHelper::resolveIdnaHost(u"foo://пример.рф")); + OUString("foo://xn--e1afmkfd.xn--p1ai"), URIHelper::resolveIdnaHost(u"foo://пример.рф"_ustr)); CPPUNIT_ASSERT_EQUAL( OUString("foo://xn--e1afmkfd.xn--p1ai:0"), - URIHelper::resolveIdnaHost(u"foo://пример.рф:0")); + URIHelper::resolveIdnaHost(u"foo://пример.рф:0"_ustr)); } css::uno::Reference< css::uno::XComponentContext > Test::m_context; diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index b99f32c1e5b2..d29a6a025cd8 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -658,7 +658,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) res = sal::static_int_cast< short >(-(i+1)); // negative break; // for } - else if (pUpperAbbrevMonthText[i] == "MRZ" && StringContainsWord( u"M\u00C4R", rString, nPos)) + else if (pUpperAbbrevMonthText[i] == "MRZ" && StringContainsWord( u"M\u00C4R"_ustr, rString, nPos)) { // And vice versa, accept MÄR for MRZ nPos = nPos + 3; res = sal::static_int_cast< short >(-(i+1)); // negative @@ -711,12 +711,12 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos ) { // Locale data has Januar/Jan assert(pUpperMonthText[0] == "JANUAR"); - if (StringContainsWord( u"J\u00C4NNER", rString, nPos)) + if (StringContainsWord( u"J\u00C4NNER"_ustr, rString, nPos)) { nPos += 6; res = 1; } - else if (StringContainsWord( u"J\u00C4N", rString, nPos)) + else if (StringContainsWord( u"J\u00C4N"_ustr, rString, nPos)) { nPos += 3; res = -1; |