summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-20 12:53:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-22 12:58:14 +0200
commitde74d98c58db604aafc0ee623c252f3aa25ac4b7 (patch)
tree1ff996e3f5bc27c10c7c64313a357a5a9c2bfa86 /comphelper
parentbe8a33c0f03b83357d2ae37dda6bf65313267cea (diff)
OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaround
do more like commit 121771e37f7e2de41cd5643475861062bf25627b Date: Mon Sep 21 09:17:54 2020 +0200 Make some OUStringLiteral vars constexpr cause coverity can live with that Change-Id: I9efd7f848289c4865997a44c6780373068422227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx2
-rw-r--r--comphelper/source/misc/backupfilehelper.cxx2
-rw-r--r--comphelper/source/officeinstdir/officeinstallationdirectories.cxx4
-rw-r--r--comphelper/source/xml/ofopxmlhelper.cxx36
4 files changed, 22 insertions, 22 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 6adb91987455..92b93a1ff704 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -914,7 +914,7 @@ bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed
// the media type will be provided with object insertion
OUString aOrigStorMediaType;
uno::Reference< beans::XPropertySet > xStorProps( pImpl->mxStorage, uno::UNO_QUERY_THROW );
- static const OUStringLiteral s_sMediaType(u"MediaType");
+ static constexpr OUStringLiteral s_sMediaType(u"MediaType");
xStorProps->getPropertyValue( s_sMediaType ) >>= aOrigStorMediaType;
SAL_WARN_IF( aOrigStorMediaType.isEmpty(), "comphelper.container", "No valuable media type in the storage!" );
diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx
index 02e279623971..dc9e0ab9143d 100644
--- a/comphelper/source/misc/backupfilehelper.cxx
+++ b/comphelper/source/misc/backupfilehelper.cxx
@@ -353,7 +353,7 @@ namespace
typedef std::vector< ExtensionInfoEntry > ExtensionInfoEntryVector;
- const OUStringLiteral gaRegPath { u"/registry/com.sun.star.comp.deployment.bundle.PackageRegistryBackend/backenddb.xml" };
+ constexpr OUStringLiteral gaRegPath { u"/registry/com.sun.star.comp.deployment.bundle.PackageRegistryBackend/backenddb.xml" };
class ExtensionInfo
{
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index 79dfcd9ebb48..1bee23622d42 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -75,8 +75,8 @@ static bool makeCanonicalFileURL( OUString & rURL )
namespace comphelper {
-OUStringLiteral const g_aOfficeBrandDirMacro(u"$(brandbaseurl)");
-OUStringLiteral const g_aUserDirMacro(u"$(userdataurl)");
+constexpr OUStringLiteral g_aOfficeBrandDirMacro(u"$(brandbaseurl)");
+constexpr OUStringLiteral g_aUserDirMacro(u"$(userdataurl)");
OfficeInstallationDirectories::OfficeInstallationDirectories(
const uno::Reference< uno::XComponentContext > & xCtx )
diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx
index 9e8886b48f24..3bf5984f9d83 100644
--- a/comphelper/source/xml/ofopxmlhelper.cxx
+++ b/comphelper/source/xml/ofopxmlhelper.cxx
@@ -196,12 +196,12 @@ void WriteContentSequence(
xWriter->setOutputStream( xOutStream );
- static const OUStringLiteral aTypesElement(u"Types");
- static const OUStringLiteral aDefaultElement(u"Default");
- static const OUStringLiteral aOverrideElement(u"Override");
- static const OUStringLiteral aContentTypeAttr(u"ContentType");
- static const OUStringLiteral aCDATAString(u"CDATA");
- static const OUStringLiteral aWhiteSpace(u" ");
+ static constexpr OUStringLiteral aTypesElement(u"Types");
+ static constexpr OUStringLiteral aDefaultElement(u"Default");
+ static constexpr OUStringLiteral aOverrideElement(u"Override");
+ static constexpr OUStringLiteral aContentTypeAttr(u"ContentType");
+ static constexpr OUStringLiteral aCDATAString(u"CDATA");
+ static constexpr OUStringLiteral aWhiteSpace(u" ");
// write the namespace
AttributeList* pRootAttrList = new AttributeList;
@@ -269,20 +269,20 @@ uno::Sequence< uno::Sequence< beans::StringPair > > ReadSequence_Impl(
} // namespace OFOPXMLHelper
// Relations info related strings
-OUStringLiteral const g_aRelListElement(u"Relationships");
-OUStringLiteral const g_aRelElement( u"Relationship" );
-OUStringLiteral const g_aIDAttr( u"Id" );
-OUStringLiteral const g_aTypeAttr( u"Type" );
-OUStringLiteral const g_aTargetModeAttr( u"TargetMode" );
-OUStringLiteral const g_aTargetAttr( u"Target" );
+constexpr OUStringLiteral g_aRelListElement(u"Relationships");
+constexpr OUStringLiteral g_aRelElement( u"Relationship" );
+constexpr OUStringLiteral g_aIDAttr( u"Id" );
+constexpr OUStringLiteral g_aTypeAttr( u"Type" );
+constexpr OUStringLiteral g_aTargetModeAttr( u"TargetMode" );
+constexpr OUStringLiteral g_aTargetAttr( u"Target" );
// ContentType related strings
-OUStringLiteral const g_aTypesElement( u"Types" );
-OUStringLiteral const g_aDefaultElement( u"Default" );
-OUStringLiteral const g_aOverrideElement( u"Override" );
-OUStringLiteral const g_aExtensionAttr( u"Extension" );
-OUStringLiteral const g_aPartNameAttr( u"PartName" );
-OUStringLiteral const g_aContentTypeAttr( u"ContentType" );
+constexpr OUStringLiteral g_aTypesElement( u"Types" );
+constexpr OUStringLiteral g_aDefaultElement( u"Default" );
+constexpr OUStringLiteral g_aOverrideElement( u"Override" );
+constexpr OUStringLiteral g_aExtensionAttr( u"Extension" );
+constexpr OUStringLiteral g_aPartNameAttr( u"PartName" );
+constexpr OUStringLiteral g_aContentTypeAttr( u"ContentType" );
OFOPXMLHelper_Impl::OFOPXMLHelper_Impl( sal_uInt16 nFormat )
: m_nFormat( nFormat )