diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-21 14:23:23 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-08-16 06:30:09 +0000 |
commit | 127f70d66ac32b7a4ec818adaf1bdccb71865ee5 (patch) | |
tree | a020d2002c2eea81484297421f0fbe3ee84c2db0 /vcl | |
parent | ce95e39f8e952159844e9dc04a1df402bb103634 (diff) |
new loplugin to check for static OUStrings
that are better declared as OUStringLiteral
Change-Id: Ifb5d9a12bb31a68641940bec16971a8181a46567
Reviewed-on: https://gerrit.libreoffice.org/27377
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/app/test_IconThemeSelector.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/IconThemeInfo.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/IconThemeSelector.cxx | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx index e32ccd209c8e..8863f10eaff1 100644 --- a/vcl/qa/cppunit/app/test_IconThemeSelector.cxx +++ b/vcl/qa/cppunit/app/test_IconThemeSelector.cxx @@ -163,7 +163,7 @@ IconThemeSelectorTest::FallbackThemeIsReturnedForEmptyInput() vcl::IconThemeSelector s; OUString selected = s.SelectIconTheme(std::vector<vcl::IconThemeInfo>(), "oxygen"); CPPUNIT_ASSERT_EQUAL_MESSAGE("fallback is returned for empty input", - vcl::IconThemeSelector::FALLBACK_ICON_THEME_ID, selected); + OUString(vcl::IconThemeSelector::FALLBACK_ICON_THEME_ID), selected); } void diff --git a/vcl/source/app/IconThemeInfo.cxx b/vcl/source/app/IconThemeInfo.cxx index 37d35dd0c513..a354b0dbb9a0 100644 --- a/vcl/source/app/IconThemeInfo.cxx +++ b/vcl/source/app/IconThemeInfo.cxx @@ -16,13 +16,13 @@ // constants for theme ids and display names. Only the theme id for hicontrast is used // outside of this class and hence made public. -const OUString vcl::IconThemeInfo::HIGH_CONTRAST_ID = "hicontrast"; +const OUStringLiteral vcl::IconThemeInfo::HIGH_CONTRAST_ID("hicontrast"); namespace { -static const OUString HIGH_CONTRAST_DISPLAY_NAME = "High Contrast"; -static const OUString TANGO_TESTING_ID = "tango_testing"; -static const OUString TANGO_TESTING_DISPLAY_NAME = "Tango Testing"; +static const OUStringLiteral HIGH_CONTRAST_DISPLAY_NAME("High Contrast"); +static const OUStringLiteral TANGO_TESTING_ID("tango_testing"); +static const OUStringLiteral TANGO_TESTING_DISPLAY_NAME("Tango Testing"); OUString filename_from_url(const OUString& url) diff --git a/vcl/source/app/IconThemeSelector.cxx b/vcl/source/app/IconThemeSelector.cxx index 5948856f0ea8..ce91d5b2eca2 100644 --- a/vcl/source/app/IconThemeSelector.cxx +++ b/vcl/source/app/IconThemeSelector.cxx @@ -16,8 +16,7 @@ namespace vcl { -/*static*/ const OUString -IconThemeSelector::FALLBACK_ICON_THEME_ID("tango"); +/*static*/ const OUStringLiteral IconThemeSelector::FALLBACK_ICON_THEME_ID("tango"); namespace { |