diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-23 13:16:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-26 14:51:15 +0100 |
commit | a3d0091d185f39eddabf4d372ebe0ac3061dbb89 (patch) | |
tree | 4d70cedc274972ccc21b6b8e7105f042090cf5d6 /cui/source | |
parent | af791fb775e35c11ad01c42a7085dd121ab9c7a6 (diff) |
New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.
(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)
Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/customize/acccfg.cxx | 4 | ||||
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/cuigaldlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/hlinettp.cxx | 2 | ||||
-rw-r--r-- | cui/source/inc/cfg.hxx | 8 | ||||
-rw-r--r-- | cui/source/options/optasian.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 10 | ||||
-rw-r--r-- | cui/source/options/optinet2.cxx | 16 |
8 files changed, 24 insertions, 24 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 014c8b09f328..e7aa9c83f29d 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -65,9 +65,9 @@ using namespace css; -const char FOLDERNAME_UICONFIG[] = "Configurations2"; +const OUStringLiteral FOLDERNAME_UICONFIG = u"Configurations2"; -const char MEDIATYPE_PROPNAME[] = "MediaType"; +const OUStringLiteral MEDIATYPE_PROPNAME = u"MediaType"; const sal_uInt16 KEYCODE_ARRAY[] = { KEY_F1, KEY_F2, diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index f694f26fd6bc..e538bc25bcee 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -74,7 +74,7 @@ const char CMDURL_STYLEPROT_ONLY[] = ".uno:StyleApply?"; const char CMDURL_SPART_ONLY [] = "Style:string="; const char CMDURL_FPART_ONLY [] = "FamilyName:string="; -const char STYLEPROP_UINAME[] = "DisplayName"; +const OUStringLiteral STYLEPROP_UINAME = u"DisplayName"; OUString SfxStylesInfo_Impl::generateCommand(const OUString& sFamily, const OUString& sStyle) { diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 116dac39f0a6..76abb324b583 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -709,7 +709,7 @@ void TPGalleryThemeProperties::FillFilterList() #if HAVE_FEATURE_AVMEDIA // media filters - static const char aWildcard[] = "*."; + static const OUStringLiteral aWildcard = u"*."; ::avmedia::FilterNameVector aFilters= ::avmedia::MediaWindow::getMediaFilters(); for(const std::pair<OUString,OUString> & aFilter : aFilters) diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx index 140d2a59da3b..9c938e40ae66 100644 --- a/cui/source/dialogs/hlinettp.cxx +++ b/cui/source/dialogs/hlinettp.cxx @@ -23,7 +23,7 @@ #include <hlinettp.hxx> #include <hlmarkwn_def.hxx> -char const sAnonymous[] = "anonymous"; +OUStringLiteral const sAnonymous = u"anonymous"; char const sFTPScheme[] = INET_FTP_SCHEME; /************************************************************************* diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index 0bc2085178d2..4fd7fb801ebc 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -42,18 +42,18 @@ #define notebookbarTabScope "notebookbarTabScope" const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; -const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer"; +inline const OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; const char ITEM_DESCRIPTOR_LABEL[] = "Label"; const char ITEM_DESCRIPTOR_TYPE[] = "Type"; const char ITEM_DESCRIPTOR_STYLE[] = "Style"; const char ITEM_DESCRIPTOR_ISVISIBLE[] = "IsVisible"; const char ITEM_DESCRIPTOR_RESOURCEURL[] = "ResourceURL"; -const char ITEM_DESCRIPTOR_UINAME[] = "UIName"; +inline const OUStringLiteral ITEM_DESCRIPTOR_UINAME = u"UIName"; -const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar"; +inline const OUStringLiteral ITEM_MENUBAR_URL = u"private:resource/menubar/menubar"; constexpr char16_t ITEM_TOOLBAR_URL[] = u"private:resource/toolbar/"; -const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_"; +inline const OUStringLiteral CUSTOM_TOOLBAR_STR = u"custom_toolbar_"; const char aMenuSeparatorStr[] = " | "; diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 1daf56dbb64b..c16a533bbf9e 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -43,8 +43,8 @@ using namespace com::sun::star::i18n; using namespace com::sun::star::frame; using namespace com::sun::star::beans; -const char cIsKernAsianPunctuation[] = "IsKernAsianPunctuation"; -const char cCharacterCompressionType[] = "CharacterCompressionType"; +const OUStringLiteral cIsKernAsianPunctuation = u"IsKernAsianPunctuation"; +const OUStringLiteral cCharacterCompressionType = u"CharacterCompressionType"; namespace { diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index a1b820b93585..21d46a879e36 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1019,11 +1019,11 @@ struct LanguageConfig_Impl static bool bLanguageCurrentDoc_Impl = false; // some things we'll need... -const char sAccessSrvc[] = "com.sun.star.configuration.ConfigurationAccess"; -const char sAccessUpdSrvc[] = "com.sun.star.configuration.ConfigurationUpdateAccess"; -const char sInstalledLocalesPath[] = "org.openoffice.Setup/Office/InstalledLocales"; -const char sUserLocalePath[] = "org.openoffice.Office.Linguistic/General"; -const char sUserLocaleKey[] = "UILocale"; +const OUStringLiteral sAccessSrvc = u"com.sun.star.configuration.ConfigurationAccess"; +const OUStringLiteral sAccessUpdSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess"; +const OUStringLiteral sInstalledLocalesPath = u"org.openoffice.Setup/Office/InstalledLocales"; +const OUStringLiteral sUserLocalePath = u"org.openoffice.Office.Linguistic/General"; +const OUStringLiteral sUserLocaleKey = u"UILocale"; static Sequence< OUString > seqInstalledLanguages; static OUString lcl_getDatePatternsConfigString( const LocaleDataWrapper& rLocaleWrapper ) diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 3f7bad1d804a..5e2df9189d7a 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -93,14 +93,14 @@ IMPL_LINK(SvxProxyTabPage, PortChangedHdl, weld::Entry&, rEdit, void) } } -const char g_aProxyModePN[] = "ooInetProxyType"; -const char g_aHttpProxyPN[] = "ooInetHTTPProxyName"; -const char g_aHttpPortPN[] = "ooInetHTTPProxyPort"; -const char g_aHttpsProxyPN[] = "ooInetHTTPSProxyName"; -const char g_aHttpsPortPN[] = "ooInetHTTPSProxyPort"; -const char g_aFtpProxyPN[] = "ooInetFTPProxyName"; -const char g_aFtpPortPN[] = "ooInetFTPProxyPort"; -const char g_aNoProxyDescPN[] = "ooInetNoProxy"; +const OUStringLiteral g_aProxyModePN = u"ooInetProxyType"; +const OUStringLiteral g_aHttpProxyPN = u"ooInetHTTPProxyName"; +const OUStringLiteral g_aHttpPortPN = u"ooInetHTTPProxyPort"; +const OUStringLiteral g_aHttpsProxyPN = u"ooInetHTTPSProxyName"; +const OUStringLiteral g_aHttpsPortPN = u"ooInetHTTPSProxyPort"; +const OUStringLiteral g_aFtpProxyPN = u"ooInetFTPProxyName"; +const OUStringLiteral g_aFtpPortPN = u"ooInetFTPProxyPort"; +const OUStringLiteral g_aNoProxyDescPN = u"ooInetNoProxy"; IMPL_STATIC_LINK(SvxProxyTabPage, NumberOnlyTextFilterHdl, OUString&, rTest, bool) { |