diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-05 08:48:07 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-05 10:16:16 +0200 |
commit | c288a97e8983e7b98046fc3a742dda8bc1bc633e (patch) | |
tree | 8701ee18814c7e9518fdfa154015f2e0f8a08119 /svl | |
parent | 3ace835e16883f8f651437f905c6a65f6e2a2263 (diff) |
Upcoming loplugin:elidestringvar: svl
Change-Id: I124dd9be0ca8ede61323dd77b737253c5af99ceb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95570
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/qa/unit/items/test_IndexedStyleSheets.cxx | 3 | ||||
-rw-r--r-- | svl/qa/unit/svl.cxx | 5 | ||||
-rw-r--r-- | svl/qa/unit/test_lngmisc.cxx | 23 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 3 |
4 files changed, 12 insertions, 22 deletions
diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx index 88af521d3aef..50fd4d1ed42c 100644 --- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx +++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx @@ -147,10 +147,9 @@ void IndexedStyleSheetsTest::StyleSheetsCanBeRetrievedByTheirName() void IndexedStyleSheetsTest::KnowsThatItStoresAStyleSheet() { OUString const name1("name1"); - OUString const name2("name2"); rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1)); rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name1)); - rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name2)); + rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet("name2")); rtl::Reference<SfxStyleSheetBase> sheet4(new MockedStyleSheet(name1)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 2c266e4d9d31..8362c9fbc88b 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -343,13 +343,12 @@ void Test::testSharedStringPool() CPPUNIT_ASSERT_EQUAL(p1.getData(), p2.getData()); // Test case insensitive string ID's. - OUString const aAndyLower("andy"), aAndyUpper("ANDY"); p1 = aPool.intern(aAndy); - p2 = aPool.intern(aAndyLower); + p2 = aPool.intern("andy"); CPPUNIT_ASSERT_MESSAGE("Failed to intern strings.", p1.getData() && p2.getData()); CPPUNIT_ASSERT_MESSAGE("These two ID's should differ.", p1.getData() != p2.getData()); CPPUNIT_ASSERT_EQUAL_MESSAGE("These two ID's should be equal.", p2.getDataIgnoreCase(), p1.getDataIgnoreCase()); - p2 = aPool.intern(aAndyUpper); + p2 = aPool.intern("ANDY"); CPPUNIT_ASSERT_MESSAGE("Failed to intern string.", p2.getData()); CPPUNIT_ASSERT_MESSAGE("These two ID's should differ.", p1.getData() != p2.getData()); CPPUNIT_ASSERT_EQUAL_MESSAGE("These two ID's should be equal.", p2.getDataIgnoreCase(), p1.getDataIgnoreCase()); diff --git a/svl/qa/unit/test_lngmisc.cxx b/svl/qa/unit/test_lngmisc.cxx index 5193eb33e159..9287c72365da 100644 --- a/svl/qa/unit/test_lngmisc.cxx +++ b/svl/qa/unit/test_lngmisc.cxx @@ -133,37 +133,30 @@ namespace void LngMiscTest::testGetThesaurusReplaceText() { - const OUString str1(""); const OUString str2("asdf"); - const OUString str3("asdf (abc)"); - const OUString str4("asdf*"); - const OUString str5("asdf * "); - const OUString str6("asdf (abc) *"); - const OUString str7("asdf asdf * (abc)"); - const OUString str8(" * (abc) asdf *"); - - OUString r = linguistic::GetThesaurusReplaceText(str1); + + OUString r = linguistic::GetThesaurusReplaceText(""); CPPUNIT_ASSERT(r.isEmpty()); r = linguistic::GetThesaurusReplaceText(str2); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText(str3); + r = linguistic::GetThesaurusReplaceText("asdf (abc)"); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText(str4); + r = linguistic::GetThesaurusReplaceText("asdf*"); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText(str5); + r = linguistic::GetThesaurusReplaceText("asdf * "); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText(str6); + r = linguistic::GetThesaurusReplaceText("asdf (abc) *"); CPPUNIT_ASSERT_EQUAL(str2, r); - r = linguistic::GetThesaurusReplaceText(str7); + r = linguistic::GetThesaurusReplaceText("asdf asdf * (abc)"); CPPUNIT_ASSERT_EQUAL(OUString("asdf asdf"), r); - r = linguistic::GetThesaurusReplaceText(str8); + r = linguistic::GetThesaurusReplaceText(" * (abc) asdf *"); CPPUNIT_ASSERT(r.isEmpty()); } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index f8652a0c1284..fa501943c341 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1016,8 +1016,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge ) const LanguageTag& rLoadedLocale = xLocaleData->getLoadedLanguageTag(); if ( !rLoadedLocale.equals( maLanguageTag ) ) { - OUString const aMsg("SvNumberFormatter::ImpGenerateCL: locales don't match:"); - LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg )); + LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( "SvNumberFormatter::ImpGenerateCL: locales don't match:" )); } // test XML locale data FormatElement entries { |