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 /desktop/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 'desktop/source')
-rw-r--r-- | desktop/source/app/app.cxx | 4 | ||||
-rw-r--r-- | desktop/source/app/check_ext_deps.cxx | 2 | ||||
-rw-r--r-- | desktop/source/app/cmdlinehelp.cxx | 8 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_dependencies.cxx | 8 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 112be4caf94d..596e83b14ebf 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -560,7 +560,7 @@ bool Desktop::QueryExit() { } - const char SUSPEND_QUICKSTARTVETO[] = "SuspendQuickstartVeto"; + static const OUStringLiteral SUSPEND_QUICKSTARTVETO = u"SuspendQuickstartVeto"; Reference< XDesktop2 > xDesktop = css::frame::Desktop::create( ::comphelper::getProcessComponentContext() ); Reference< XPropertySet > xPropertySet(xDesktop, UNO_QUERY_THROW); @@ -872,7 +872,7 @@ namespace { #if HAVE_FEATURE_BREAKPAD void handleCrashReport() { - static const char SERVICENAME_CRASHREPORT[] = "com.sun.star.comp.svx.CrashReportUI"; + static const OUStringLiteral SERVICENAME_CRASHREPORT = u"com.sun.star.comp.svx.CrashReportUI"; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index 8af149f1f93b..2e667e0ad64c 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -207,7 +207,7 @@ void SilentCommandEnv::pop() } // end namespace -const char aAccessSrvc[] = "com.sun.star.configuration.ConfigurationUpdateAccess"; +const OUStringLiteral aAccessSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess"; static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > const &xContext ) { diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 1d7fe7613be7..03e45b7278c0 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -35,11 +35,11 @@ namespace desktop { - const char aCmdLineHelp_version[] = - "%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION %BUILDID\n" + const OUStringLiteral aCmdLineHelp_version = + u"%PRODUCTNAME %PRODUCTVERSION%PRODUCTEXTENSION %BUILDID\n" "\n"; - const char aCmdLineHelp[] = - "Usage: %CMDNAME [argument...]\n" + const OUStringLiteral aCmdLineHelp = + u"Usage: %CMDNAME [argument...]\n" " argument - switches, switch parameters and document URIs (filenames). \n\n" "Using without special arguments: \n" "Opens the start center, if it is used without any arguments. \n" diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx index eae5ca5cb7d8..732778e2bbd1 100644 --- a/desktop/source/deployment/misc/dp_dependencies.cxx +++ b/desktop/source/deployment/misc/dp_dependencies.cxx @@ -43,14 +43,14 @@ namespace { char const namespaceLibreOffice[] = "http://libreoffice.org/extensions/description/2011"; -char const namespaceOpenOfficeOrg[] = - "http://openoffice.org/extensions/description/2006"; +OUStringLiteral const namespaceOpenOfficeOrg = + u"http://openoffice.org/extensions/description/2006"; char const minimalVersionLibreOffice[] = "LibreOffice-minimal-version"; char const maximalVersionLibreOffice[] = "LibreOffice-maximal-version"; -char const minimalVersionOpenOfficeOrg[] = - "OpenOffice.org-minimal-version"; +OUStringLiteral const minimalVersionOpenOfficeOrg = + u"OpenOffice.org-minimal-version"; char const maximalVersionOpenOfficeOrg[] = "OpenOffice.org-maximal-version"; diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 1637a9d63ade..4955c279ec32 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -69,9 +69,9 @@ using namespace com::sun::star; namespace desktop { -const char ITEM_DESCRIPTOR_COMMANDURL[] = "CommandURL"; -const char ITEM_DESCRIPTOR_CONTAINER[] = "ItemDescriptorContainer"; -const char ITEM_DESCRIPTOR_LABEL[] = "Label"; +const OUStringLiteral ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"; +const OUStringLiteral ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"; +const OUStringLiteral ITEM_DESCRIPTOR_LABEL = u"Label"; static OUString mapModuleShortNameToIdentifier(std::u16string_view sShortName) { |