summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-27 11:40:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-28 08:07:09 +0200
commit33ecd0d5c4fff9511a8436513936a3f7044a775a (patch)
treec25809adda140ff89d9f2a2b6dfadba17e188fb0 /package
parent554834484a3323f73b5aeace246bcd9635368967 (diff)
Change OUStringLiteral from char[] to char16_t[]
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@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 e6c7598a2901..81acb9e403cf 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 ( ELEMENT_FILE_ENTRY );
-const OUStringLiteral gsEncryptionDataElement( ELEMENT_ENCRYPTION_DATA );
-const OUStringLiteral gsAlgorithmElement ( ELEMENT_ALGORITHM );
-const OUStringLiteral gsStartKeyAlgElement ( ELEMENT_START_KEY_GENERATION );
-const OUStringLiteral gsKeyDerivationElement( ELEMENT_KEY_DERIVATION );
-
-const OUStringLiteral gsMediaTypeAttribute ( ATTRIBUTE_MEDIA_TYPE );
-const OUStringLiteral gsVersionAttribute ( ATTRIBUTE_VERSION );
-const OUStringLiteral gsFullPathAttribute ( ATTRIBUTE_FULL_PATH );
-const OUStringLiteral gsSizeAttribute ( ATTRIBUTE_SIZE );
-const OUStringLiteral gsSaltAttribute ( ATTRIBUTE_SALT );
-const OUStringLiteral gsInitialisationVectorAttribute ( ATTRIBUTE_INITIALISATION_VECTOR );
-const OUStringLiteral gsIterationCountAttribute ( ATTRIBUTE_ITERATION_COUNT );
-const OUStringLiteral gsKeySizeAttribute ( ATTRIBUTE_KEY_SIZE );
-const OUStringLiteral gsAlgorithmNameAttribute ( ATTRIBUTE_ALGORITHM_NAME );
-const OUStringLiteral gsStartKeyAlgNameAttribute ( ATTRIBUTE_START_KEY_GENERATION_NAME );
-const OUStringLiteral gsKeyDerivationNameAttribute ( ATTRIBUTE_KEY_DERIVATION_NAME );
-const OUStringLiteral gsChecksumAttribute ( ATTRIBUTE_CHECKSUM );
-const OUStringLiteral gsChecksumTypeAttribute ( ATTRIBUTE_CHECKSUM_TYPE );
-
-const OUStringLiteral gsKeyInfoElement ( ELEMENT_ENCRYPTED_KEYINFO );
-const OUStringLiteral gsManifestKeyInfoElement ( ELEMENT_MANIFEST_KEYINFO );
-const OUStringLiteral gsEncryptedKeyElement ( ELEMENT_ENCRYPTEDKEY );
-const OUStringLiteral gsEncryptionMethodElement ( ELEMENT_ENCRYPTIONMETHOD );
-const OUStringLiteral gsPgpDataElement ( ELEMENT_PGPDATA );
-const OUStringLiteral gsPgpKeyIDElement ( ELEMENT_PGPKEYID );
-const OUStringLiteral gsPGPKeyPacketElement ( ELEMENT_PGPKEYPACKET );
-const OUStringLiteral gsAlgorithmAttribute ( ATTRIBUTE_ALGORITHM );
-const OUStringLiteral gsCipherDataElement ( ELEMENT_CIPHERDATA );
-const OUStringLiteral gsCipherValueElement ( ELEMENT_CIPHERVALUE );
-
-const OUStringLiteral gsManifestKeyInfoElement13 ( ELEMENT_MANIFEST13_KEYINFO );
-const OUStringLiteral gsEncryptedKeyElement13 ( ELEMENT_ENCRYPTEDKEY13 );
-const OUStringLiteral gsEncryptionMethodElement13 ( ELEMENT_ENCRYPTIONMETHOD13 );
-const OUStringLiteral gsPgpDataElement13 ( ELEMENT_PGPDATA13 );
-const OUStringLiteral gsPgpKeyIDElement13 ( ELEMENT_PGPKEYID13 );
-const OUStringLiteral gsPGPKeyPacketElement13 ( ELEMENT_PGPKEYPACKET13 );
-const OUStringLiteral gsAlgorithmAttribute13 ( ATTRIBUTE_ALGORITHM13 );
-const OUStringLiteral gsCipherDataElement13 ( ELEMENT_CIPHERDATA13 );
-const OUStringLiteral gsCipherValueElement13 ( ELEMENT_CIPHERVALUE13 );
-
-const OUStringLiteral gsFullPathProperty ( "FullPath" );
-const OUStringLiteral gsMediaTypeProperty ( "MediaType" );
-const OUStringLiteral gsVersionProperty ( "Version" );
-const OUStringLiteral gsIterationCountProperty ( "IterationCount" );
-const OUStringLiteral gsDerivedKeySizeProperty ( "DerivedKeySize" );
-const OUStringLiteral gsSaltProperty ( "Salt" );
-const OUStringLiteral gsInitialisationVectorProperty ( "InitialisationVector" );
-const OUStringLiteral gsSizeProperty ( "Size" );
-const OUStringLiteral gsDigestProperty ( "Digest" );
-const OUStringLiteral gsEncryptionAlgProperty ( "EncryptionAlgorithm" );
-const OUStringLiteral gsStartKeyAlgProperty ( "StartKeyAlgorithm" );
-const OUStringLiteral gsDigestAlgProperty ( "DigestAlgorithm" );
-
-const OUStringLiteral gsSHA256_URL_ODF12 ( SHA256_URL_ODF12 );
-const OUStringLiteral gsSHA256_URL ( SHA256_URL );
-const OUStringLiteral gsSHA1_Name ( SHA1_NAME );
-const OUStringLiteral gsSHA1_URL ( SHA1_URL );
-
-const OUStringLiteral gsSHA256_1k_URL ( SHA256_1K_URL );
-const OUStringLiteral gsSHA1_1k_Name ( SHA1_1K_NAME );
-const OUStringLiteral gsSHA1_1k_URL ( SHA1_1K_URL );
-
-const OUStringLiteral gsBlowfish_Name ( BLOWFISH_NAME );
-const OUStringLiteral gsBlowfish_URL ( BLOWFISH_URL );
-const OUStringLiteral gsAES128_URL ( AES128_URL );
-const OUStringLiteral gsAES192_URL ( AES192_URL );
-const OUStringLiteral gsAES256_URL ( AES256_URL );
-
-const OUStringLiteral gsPBKDF2_Name ( PBKDF2_NAME );
-const OUStringLiteral gsPBKDF2_URL ( PBKDF2_URL );
+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 );
ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManVector )
: bIgnoreEncryptData ( false )
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 08de1692a3a7..a9d71cdb1623 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 ("META-INF");
+ static const 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("[Content_Types].xml");
+ static const 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("MediaType");
- static const OUStringLiteral sVersion("Version");
- static const OUStringLiteral sFullPath("FullPath");
+ static const OUStringLiteral sMediaType(u"MediaType");
+ static const OUStringLiteral sVersion(u"Version");
+ static const OUStringLiteral sFullPath(u"FullPath");
const bool bIsGpgEncrypt = m_aGpgProps.hasElements();
if ( m_nFormat == embed::StorageFormats::PACKAGE )