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 /sfx2/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 'sfx2/source')
-rw-r--r-- | sfx2/source/control/emojicontrol.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/DocumentMetadataAccess.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 2 |
8 files changed, 28 insertions, 27 deletions
diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx index 850c87897974..67d097584645 100644 --- a/sfx2/source/control/emojicontrol.cxx +++ b/sfx2/source/control/emojicontrol.cxx @@ -26,15 +26,15 @@ #include <comphelper/dispatchcommand.hxx> #include <officecfg/Office/Common.hxx> -const char FILTER_PEOPLE[] = "people"; -const char FILTER_NATURE[] = "nature"; -const char FILTER_FOOD[] = "food"; -const char FILTER_ACTIVITY[] = "activity"; -const char FILTER_TRAVEL[] = "travel"; -const char FILTER_OBJECTS[] = "objects"; -const char FILTER_SYMBOLS[] = "symbols"; -const char FILTER_FLAGS[] = "flags"; -const char FILTER_UNICODE9[] = "unicode9"; +const OStringLiteral FILTER_PEOPLE = "people"; +const OStringLiteral FILTER_NATURE = "nature"; +const OStringLiteral FILTER_FOOD = "food"; +const OStringLiteral FILTER_ACTIVITY = "activity"; +const OStringLiteral FILTER_TRAVEL = "travel"; +const OStringLiteral FILTER_OBJECTS = "objects"; +const OStringLiteral FILTER_SYMBOLS = "symbols"; +const OStringLiteral FILTER_FLAGS = "flags"; +const OStringLiteral FILTER_UNICODE9 = "unicode9"; using namespace com::sun::star; diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index cab0ebd4be6a..e1ed8755103f 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -57,7 +57,7 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::document; -const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess"; +const OUStringLiteral SERVICENAME_CFGREADACCESS = u"com.sun.star.configuration.ConfigurationAccess"; // increase size of the text in the buttons on the left fMultiplier-times float const g_fMultiplier = 1.4f; diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 0a931f4088ef..39664cc1d3b4 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -84,9 +84,9 @@ bool isValidNCName(std::u16string_view i_rIdref) } -const char s_content [] = "content.xml"; -const char s_styles [] = "styles.xml"; -const char s_manifest[] = "manifest.rdf"; +const OUStringLiteral s_content = u"content.xml"; +const OUStringLiteral s_styles = u"styles.xml"; +const OUStringLiteral s_manifest = u"manifest.rdf"; const char s_odfmime [] = "application/vnd.oasis.opendocument."; diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 962918897301..f26eae3b3add 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -403,13 +403,13 @@ const char* s_stdMetaList[] = { nullptr }; -const char s_nsXLink[] = "http://www.w3.org/1999/xlink"; -const char s_nsDC[] = "http://purl.org/dc/elements/1.1/"; -const char s_nsODF[] = "urn:oasis:names:tc:opendocument:xmlns:office:1.0"; -const char s_nsODFMeta[] = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; +const OUStringLiteral s_nsXLink = u"http://www.w3.org/1999/xlink"; +const OUStringLiteral s_nsDC = u"http://purl.org/dc/elements/1.1/"; +const OUStringLiteral s_nsODF = u"urn:oasis:names:tc:opendocument:xmlns:office:1.0"; +const OUStringLiteral s_nsODFMeta = u"urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; // const char* s_nsOOo = "http://openoffice.org/2004/office"; // not used (yet?) -const char s_meta [] = "meta.xml"; +const OUStringLiteral s_meta = u"meta.xml"; bool isValidDate(const css::util::Date & i_rDate) { diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 27d5134075ed..3bc794343f8c 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -133,7 +133,8 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU static const int nMaxPathSize = 16000; const OUString sConfPath = "Office/Factories/" + rServiceName; - static const char PROP_DEF_TEMPL_CHANGED[] = "ooSetupFactorySystemDefaultTemplateChanged"; + static const OUStringLiteral PROP_DEF_TEMPL_CHANGED + = u"ooSetupFactorySystemDefaultTemplateChanged"; static const char DEF_TPL_STR[] = "/soffice."; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 42ad906e07d7..ad94a17e4231 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -110,9 +110,9 @@ #define STATUS_SAVEAS 2 #define STATUS_SAVEAS_STANDARDNAME 3 -const char aFilterNameString[] = "FilterName"; -const char aFilterOptionsString[] = "FilterOptions"; -const char aFilterDataString[] = "FilterData"; +const OUStringLiteral aFilterNameString = u"FilterName"; +const OUStringLiteral aFilterOptionsString = u"FilterOptions"; +const OUStringLiteral aFilterDataString = u"FilterData"; using namespace ::com::sun::star; using namespace css::system; diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 13444e6b4280..1f4bd0dccfb4 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -54,10 +54,10 @@ #include <sfx2/strings.hrc> -const char TM_SETTING_MANAGER[] = "TemplateManager"; -const char TM_SETTING_LASTFOLDER[] = "LastFolder"; -const char TM_SETTING_LASTAPPLICATION[] = "LastApplication"; -const char TM_SETTING_VIEWMODE[] = "ViewMode"; +const OUStringLiteral TM_SETTING_MANAGER = u"TemplateManager"; +const OUStringLiteral TM_SETTING_LASTFOLDER = u"LastFolder"; +const OUStringLiteral TM_SETTING_LASTAPPLICATION = u"LastApplication"; +const OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode"; #define MNI_ACTION_NEW_FOLDER "new" #define MNI_ACTION_RENAME_FOLDER "rename" diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 83dbd0e561f4..e6cf00fe376f 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -65,7 +65,7 @@ using namespace css::uno; namespace { - const char gsReadOnlyCommandName[] = ".uno:EditDoc"; + const OUStringLiteral gsReadOnlyCommandName = u".uno:EditDoc"; const sal_Int32 gnWidthCloseThreshold (70); const sal_Int32 gnWidthOpenThreshold (40); |