From ac396f2f6b058ddff8c394443669b8c5d8b97b71 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 8 Jan 2021 19:54:55 +0000 Subject: fix coverity parse errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svtools/source/config/fontsubstconfig.cxx | 12 ++++++------ svtools/source/misc/sampletext.cxx | 4 ++-- svtools/source/uno/toolboxcontroller.cxx | 2 +- svtools/source/uno/unoevent.cxx | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'svtools') diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx index e3c156fbfb36..a77f2e59b775 100644 --- a/svtools/source/config/fontsubstconfig.cxx +++ b/svtools/source/config/fontsubstconfig.cxx @@ -32,13 +32,13 @@ using namespace com::sun::star::uno; using namespace com::sun::star::beans; -const OUStringLiteral cReplacement = u"Replacement"; -const OUStringLiteral cFontPairs = u"FontPairs"; +constexpr OUStringLiteral cReplacement = u"Replacement"; +constexpr OUStringLiteral cFontPairs = u"FontPairs"; -const OUStringLiteral cReplaceFont = u"ReplaceFont"; -const OUStringLiteral cSubstituteFont= u"SubstituteFont"; -const OUStringLiteral cOnScreenOnly = u"OnScreenOnly"; -const OUStringLiteral cAlways = u"Always"; +constexpr OUStringLiteral cReplaceFont = u"ReplaceFont"; +constexpr OUStringLiteral cSubstituteFont= u"SubstituteFont"; +constexpr OUStringLiteral cOnScreenOnly = u"OnScreenOnly"; +constexpr OUStringLiteral cAlways = u"Always"; typedef std::vector SubstitutionStructArr; diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index e96962254521..950193cce994 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -150,14 +150,14 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice const &rD { if (rDevice.GetFont().GetFamilyName() == "Symbol") { - static const OUStringLiteral aImplAppleSymbolText = + static constexpr OUStringLiteral aImplAppleSymbolText = u"\u03BC\u2202\u2211\u220F\u03C0\u222B\u03A9\u221A"; bool bHasSampleTextGlyphs = (-1 == rDevice.HasGlyphs(rDevice.GetFont(), aImplAppleSymbolText)); //It's the Apple version if (bHasSampleTextGlyphs) return aImplAppleSymbolText; - static const OUStringLiteral aImplAdobeSymbolText = + static constexpr OUStringLiteral aImplAdobeSymbolText = u"\uF06D\uF0B6\uF0E5\uF0D5\uF070\uF0F2\uF057\uF0D6"; return aImplAdobeSymbolText; } diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index e3da167c21bb..86476da1903c 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -33,7 +33,7 @@ #include const int TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIBLE = 1; -const OUStringLiteral TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE = u"SupportsVisible"; +constexpr OUStringLiteral TOOLBARCONTROLLER_PROPNAME_SUPPORTSVISIBLE = u"SupportsVisible"; using namespace ::cppu; diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 3094d9a297ee..3ec1408ebfe5 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -33,13 +33,13 @@ using css::lang::IllegalArgumentException; using css::beans::PropertyValue; -const OUStringLiteral sAPI_ServiceName = u"com.sun.star.container.XNameReplace"; +constexpr OUStringLiteral sAPI_ServiceName = u"com.sun.star.container.XNameReplace"; const char sEventType[] = "EventType"; const char sMacroName[] = "MacroName"; const char sLibrary[] = "Library"; -const OUStringLiteral sStarBasic = u"StarBasic"; -const OUStringLiteral sScript = u"Script"; -const OUStringLiteral sNone = u"None"; +constexpr OUStringLiteral sStarBasic = u"StarBasic"; +constexpr OUStringLiteral sScript = u"Script"; +constexpr OUStringLiteral sNone = u"None"; namespace { -- cgit