summaryrefslogtreecommitdiff
path: root/package
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 /package
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 'package')
-rw-r--r--package/source/manifest/ManifestImport.cxx142
-rw-r--r--package/source/zippackage/ZipPackage.cxx10
2 files changed, 76 insertions, 76 deletions
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index 81acb9e403cf..76c0be4ea36f 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -34,77 +34,77 @@ using namespace com::sun::star;
using namespace std;
-const OUStringLiteral gsFileEntryElement ( u"" ELEMENT_FILE_ENTRY );
-const OUStringLiteral gsEncryptionDataElement( u"" ELEMENT_ENCRYPTION_DATA );
-const OUStringLiteral gsAlgorithmElement ( u"" ELEMENT_ALGORITHM );
-const OUStringLiteral gsStartKeyAlgElement ( u"" ELEMENT_START_KEY_GENERATION );
-const OUStringLiteral gsKeyDerivationElement( u"" ELEMENT_KEY_DERIVATION );
-
-const OUStringLiteral gsMediaTypeAttribute ( u"" ATTRIBUTE_MEDIA_TYPE );
-const OUStringLiteral gsVersionAttribute ( u"" ATTRIBUTE_VERSION );
-const OUStringLiteral gsFullPathAttribute ( u"" ATTRIBUTE_FULL_PATH );
-const OUStringLiteral gsSizeAttribute ( u"" ATTRIBUTE_SIZE );
-const OUStringLiteral gsSaltAttribute ( u"" ATTRIBUTE_SALT );
-const OUStringLiteral gsInitialisationVectorAttribute ( u"" ATTRIBUTE_INITIALISATION_VECTOR );
-const OUStringLiteral gsIterationCountAttribute ( u"" ATTRIBUTE_ITERATION_COUNT );
-const OUStringLiteral gsKeySizeAttribute ( u"" ATTRIBUTE_KEY_SIZE );
-const OUStringLiteral gsAlgorithmNameAttribute ( u"" ATTRIBUTE_ALGORITHM_NAME );
-const OUStringLiteral gsStartKeyAlgNameAttribute ( u"" ATTRIBUTE_START_KEY_GENERATION_NAME );
-const OUStringLiteral gsKeyDerivationNameAttribute ( u"" ATTRIBUTE_KEY_DERIVATION_NAME );
-const OUStringLiteral gsChecksumAttribute ( u"" ATTRIBUTE_CHECKSUM );
-const OUStringLiteral gsChecksumTypeAttribute ( u"" ATTRIBUTE_CHECKSUM_TYPE );
-
-const OUStringLiteral gsKeyInfoElement ( u"" ELEMENT_ENCRYPTED_KEYINFO );
-const OUStringLiteral gsManifestKeyInfoElement ( u"" ELEMENT_MANIFEST_KEYINFO );
-const OUStringLiteral gsEncryptedKeyElement ( u"" ELEMENT_ENCRYPTEDKEY );
-const OUStringLiteral gsEncryptionMethodElement ( u"" ELEMENT_ENCRYPTIONMETHOD );
-const OUStringLiteral gsPgpDataElement ( u"" ELEMENT_PGPDATA );
-const OUStringLiteral gsPgpKeyIDElement ( u"" ELEMENT_PGPKEYID );
-const OUStringLiteral gsPGPKeyPacketElement ( u"" ELEMENT_PGPKEYPACKET );
-const OUStringLiteral gsAlgorithmAttribute ( u"" ATTRIBUTE_ALGORITHM );
-const OUStringLiteral gsCipherDataElement ( u"" ELEMENT_CIPHERDATA );
-const OUStringLiteral gsCipherValueElement ( u"" ELEMENT_CIPHERVALUE );
-
-const OUStringLiteral gsManifestKeyInfoElement13 ( u"" ELEMENT_MANIFEST13_KEYINFO );
-const OUStringLiteral gsEncryptedKeyElement13 ( u"" ELEMENT_ENCRYPTEDKEY13 );
-const OUStringLiteral gsEncryptionMethodElement13 ( u"" ELEMENT_ENCRYPTIONMETHOD13 );
-const OUStringLiteral gsPgpDataElement13 ( u"" ELEMENT_PGPDATA13 );
-const OUStringLiteral gsPgpKeyIDElement13 ( u"" ELEMENT_PGPKEYID13 );
-const OUStringLiteral gsPGPKeyPacketElement13 ( u"" ELEMENT_PGPKEYPACKET13 );
-const OUStringLiteral gsAlgorithmAttribute13 ( u"" ATTRIBUTE_ALGORITHM13 );
-const OUStringLiteral gsCipherDataElement13 ( u"" ELEMENT_CIPHERDATA13 );
-const OUStringLiteral gsCipherValueElement13 ( u"" ELEMENT_CIPHERVALUE13 );
-
-const OUStringLiteral gsFullPathProperty ( u"FullPath" );
-const OUStringLiteral gsMediaTypeProperty ( u"MediaType" );
-const OUStringLiteral gsVersionProperty ( u"Version" );
-const OUStringLiteral gsIterationCountProperty ( u"IterationCount" );
-const OUStringLiteral gsDerivedKeySizeProperty ( u"DerivedKeySize" );
-const OUStringLiteral gsSaltProperty ( u"Salt" );
-const OUStringLiteral gsInitialisationVectorProperty ( u"InitialisationVector" );
-const OUStringLiteral gsSizeProperty ( u"Size" );
-const OUStringLiteral gsDigestProperty ( u"Digest" );
-const OUStringLiteral gsEncryptionAlgProperty ( u"EncryptionAlgorithm" );
-const OUStringLiteral gsStartKeyAlgProperty ( u"StartKeyAlgorithm" );
-const OUStringLiteral gsDigestAlgProperty ( u"DigestAlgorithm" );
-
-const OUStringLiteral gsSHA256_URL_ODF12 ( u"" SHA256_URL_ODF12 );
-const OUStringLiteral gsSHA256_URL ( u"" SHA256_URL );
-const OUStringLiteral gsSHA1_Name ( u"" SHA1_NAME );
-const OUStringLiteral gsSHA1_URL ( u"" SHA1_URL );
-
-const OUStringLiteral gsSHA256_1k_URL ( u"" SHA256_1K_URL );
-const OUStringLiteral gsSHA1_1k_Name ( u"" SHA1_1K_NAME );
-const OUStringLiteral gsSHA1_1k_URL ( u"" SHA1_1K_URL );
-
-const OUStringLiteral gsBlowfish_Name ( u"" BLOWFISH_NAME );
-const OUStringLiteral gsBlowfish_URL ( u"" BLOWFISH_URL );
-const OUStringLiteral gsAES128_URL ( u"" AES128_URL );
-const OUStringLiteral gsAES192_URL ( u"" AES192_URL );
-const OUStringLiteral gsAES256_URL ( u"" AES256_URL );
-
-const OUStringLiteral gsPBKDF2_Name ( u"" PBKDF2_NAME );
-const OUStringLiteral gsPBKDF2_URL ( u"" PBKDF2_URL );
+constexpr OUStringLiteral gsFileEntryElement ( u"" ELEMENT_FILE_ENTRY );
+constexpr OUStringLiteral gsEncryptionDataElement( u"" ELEMENT_ENCRYPTION_DATA );
+constexpr OUStringLiteral gsAlgorithmElement ( u"" ELEMENT_ALGORITHM );
+constexpr OUStringLiteral gsStartKeyAlgElement ( u"" ELEMENT_START_KEY_GENERATION );
+constexpr OUStringLiteral gsKeyDerivationElement( u"" ELEMENT_KEY_DERIVATION );
+
+constexpr OUStringLiteral gsMediaTypeAttribute ( u"" ATTRIBUTE_MEDIA_TYPE );
+constexpr OUStringLiteral gsVersionAttribute ( u"" ATTRIBUTE_VERSION );
+constexpr OUStringLiteral gsFullPathAttribute ( u"" ATTRIBUTE_FULL_PATH );
+constexpr OUStringLiteral gsSizeAttribute ( u"" ATTRIBUTE_SIZE );
+constexpr OUStringLiteral gsSaltAttribute ( u"" ATTRIBUTE_SALT );
+constexpr OUStringLiteral gsInitialisationVectorAttribute ( u"" ATTRIBUTE_INITIALISATION_VECTOR );
+constexpr OUStringLiteral gsIterationCountAttribute ( u"" ATTRIBUTE_ITERATION_COUNT );
+constexpr OUStringLiteral gsKeySizeAttribute ( u"" ATTRIBUTE_KEY_SIZE );
+constexpr OUStringLiteral gsAlgorithmNameAttribute ( u"" ATTRIBUTE_ALGORITHM_NAME );
+constexpr OUStringLiteral gsStartKeyAlgNameAttribute ( u"" ATTRIBUTE_START_KEY_GENERATION_NAME );
+constexpr OUStringLiteral gsKeyDerivationNameAttribute ( u"" ATTRIBUTE_KEY_DERIVATION_NAME );
+constexpr OUStringLiteral gsChecksumAttribute ( u"" ATTRIBUTE_CHECKSUM );
+constexpr OUStringLiteral gsChecksumTypeAttribute ( u"" ATTRIBUTE_CHECKSUM_TYPE );
+
+constexpr OUStringLiteral gsKeyInfoElement ( u"" ELEMENT_ENCRYPTED_KEYINFO );
+constexpr OUStringLiteral gsManifestKeyInfoElement ( u"" ELEMENT_MANIFEST_KEYINFO );
+constexpr OUStringLiteral gsEncryptedKeyElement ( u"" ELEMENT_ENCRYPTEDKEY );
+constexpr OUStringLiteral gsEncryptionMethodElement ( u"" ELEMENT_ENCRYPTIONMETHOD );
+constexpr OUStringLiteral gsPgpDataElement ( u"" ELEMENT_PGPDATA );
+constexpr OUStringLiteral gsPgpKeyIDElement ( u"" ELEMENT_PGPKEYID );
+constexpr OUStringLiteral gsPGPKeyPacketElement ( u"" ELEMENT_PGPKEYPACKET );
+constexpr OUStringLiteral gsAlgorithmAttribute ( u"" ATTRIBUTE_ALGORITHM );
+constexpr OUStringLiteral gsCipherDataElement ( u"" ELEMENT_CIPHERDATA );
+constexpr OUStringLiteral gsCipherValueElement ( u"" ELEMENT_CIPHERVALUE );
+
+constexpr OUStringLiteral gsManifestKeyInfoElement13 ( u"" ELEMENT_MANIFEST13_KEYINFO );
+constexpr OUStringLiteral gsEncryptedKeyElement13 ( u"" ELEMENT_ENCRYPTEDKEY13 );
+constexpr OUStringLiteral gsEncryptionMethodElement13 ( u"" ELEMENT_ENCRYPTIONMETHOD13 );
+constexpr OUStringLiteral gsPgpDataElement13 ( u"" ELEMENT_PGPDATA13 );
+constexpr OUStringLiteral gsPgpKeyIDElement13 ( u"" ELEMENT_PGPKEYID13 );
+constexpr OUStringLiteral gsPGPKeyPacketElement13 ( u"" ELEMENT_PGPKEYPACKET13 );
+constexpr OUStringLiteral gsAlgorithmAttribute13 ( u"" ATTRIBUTE_ALGORITHM13 );
+constexpr OUStringLiteral gsCipherDataElement13 ( u"" ELEMENT_CIPHERDATA13 );
+constexpr OUStringLiteral gsCipherValueElement13 ( u"" ELEMENT_CIPHERVALUE13 );
+
+constexpr OUStringLiteral gsFullPathProperty ( u"FullPath" );
+constexpr OUStringLiteral gsMediaTypeProperty ( u"MediaType" );
+constexpr OUStringLiteral gsVersionProperty ( u"Version" );
+constexpr OUStringLiteral gsIterationCountProperty ( u"IterationCount" );
+constexpr OUStringLiteral gsDerivedKeySizeProperty ( u"DerivedKeySize" );
+constexpr OUStringLiteral gsSaltProperty ( u"Salt" );
+constexpr OUStringLiteral gsInitialisationVectorProperty ( u"InitialisationVector" );
+constexpr OUStringLiteral gsSizeProperty ( u"Size" );
+constexpr OUStringLiteral gsDigestProperty ( u"Digest" );
+constexpr OUStringLiteral gsEncryptionAlgProperty ( u"EncryptionAlgorithm" );
+constexpr OUStringLiteral gsStartKeyAlgProperty ( u"StartKeyAlgorithm" );
+constexpr OUStringLiteral gsDigestAlgProperty ( u"DigestAlgorithm" );
+
+constexpr OUStringLiteral gsSHA256_URL_ODF12 ( u"" SHA256_URL_ODF12 );
+constexpr OUStringLiteral gsSHA256_URL ( u"" SHA256_URL );
+constexpr OUStringLiteral gsSHA1_Name ( u"" SHA1_NAME );
+constexpr OUStringLiteral gsSHA1_URL ( u"" SHA1_URL );
+
+constexpr OUStringLiteral gsSHA256_1k_URL ( u"" SHA256_1K_URL );
+constexpr OUStringLiteral gsSHA1_1k_Name ( u"" SHA1_1K_NAME );
+constexpr OUStringLiteral gsSHA1_1k_URL ( u"" SHA1_1K_URL );
+
+constexpr OUStringLiteral gsBlowfish_Name ( u"" BLOWFISH_NAME );
+constexpr OUStringLiteral gsBlowfish_URL ( u"" BLOWFISH_URL );
+constexpr OUStringLiteral gsAES128_URL ( u"" AES128_URL );
+constexpr OUStringLiteral gsAES192_URL ( u"" AES192_URL );
+constexpr OUStringLiteral gsAES256_URL ( u"" AES256_URL );
+
+constexpr OUStringLiteral gsPBKDF2_Name ( u"" PBKDF2_NAME );
+constexpr OUStringLiteral gsPBKDF2_URL ( u"" PBKDF2_URL );
ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManVector )
: bIgnoreEncryptData ( false )
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index a9d71cdb1623..bdb5c25a8bf0 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1225,7 +1225,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
// Remove the old manifest.xml file as the
// manifest will be re-generated and the
// META-INF directory implicitly created if does not exist
- static const OUStringLiteral sMeta (u"META-INF");
+ static constexpr OUStringLiteral sMeta (u"META-INF");
if ( m_xRootFolder->hasByName( sMeta ) )
{
@@ -1247,7 +1247,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
// Remove the old [Content_Types].xml file as the
// file will be re-generated
- static const OUStringLiteral aContentTypes(u"[Content_Types].xml");
+ static constexpr OUStringLiteral aContentTypes(u"[Content_Types].xml");
if ( m_xRootFolder->hasByName( aContentTypes ) )
m_xRootFolder->removeByName( aContentTypes );
@@ -1256,9 +1256,9 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
// Create a vector to store data for the manifest.xml file
vector < uno::Sequence < PropertyValue > > aManList;
- static const OUStringLiteral sMediaType(u"MediaType");
- static const OUStringLiteral sVersion(u"Version");
- static const OUStringLiteral sFullPath(u"FullPath");
+ static constexpr OUStringLiteral sMediaType(u"MediaType");
+ static constexpr OUStringLiteral sVersion(u"Version");
+ static constexpr OUStringLiteral sFullPath(u"FullPath");
const bool bIsGpgEncrypt = m_aGpgProps.hasElements();
if ( m_nFormat == embed::StorageFormats::PACKAGE )