summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-19 10:30:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-20 07:06:58 +0200
commit6e4d3c3476fb60116fc7100a30a30ae15f60ce62 (patch)
treee2cd56a8579d3d703f8f131993035eb4d99a83dc /package
parent3bbed358b617eb407184edac9a11aed62e36a2d7 (diff)
Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: package
Change-Id: I5d70d9291a64139bc2dc60c63173fef862a00f2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158207 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'package')
-rw-r--r--package/source/manifest/ManifestExport.cxx8
-rw-r--r--package/source/manifest/ManifestImport.cxx6
-rw-r--r--package/source/xstor/owriteablestream.cxx8
-rw-r--r--package/source/zippackage/ZipPackage.cxx16
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx10
5 files changed, 24 insertions, 24 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 79948c9ff068..feeb63353698 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -49,9 +49,9 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
static constexpr OUStringLiteral sPgpKeyIDProperty ( u"KeyId" );
static constexpr OUStringLiteral sPgpKeyPacketProperty ( u"KeyPacket" );
static constexpr OUStringLiteral sCipherValueProperty ( u"CipherValue" );
- static constexpr OUStringLiteral sFullPathProperty ( u"FullPath" );
- static constexpr OUStringLiteral sVersionProperty ( u"Version" );
- static constexpr OUStringLiteral sMediaTypeProperty ( u"MediaType" );
+ static constexpr OUString sFullPathProperty ( u"FullPath"_ustr );
+ static constexpr OUString sVersionProperty ( u"Version"_ustr );
+ static constexpr OUString sMediaTypeProperty ( u"MediaType"_ustr );
static constexpr OUStringLiteral sIterationCountProperty ( u"IterationCount" );
static constexpr OUStringLiteral sDerivedKeySizeProperty ( u"DerivedKeySize" );
static constexpr OUStringLiteral sSaltProperty ( u"Salt" );
@@ -62,7 +62,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
static constexpr OUStringLiteral sStartKeyAlgProperty ( u"StartKeyAlgorithm" );
static constexpr OUStringLiteral sDigestAlgProperty ( u"DigestAlgorithm" );
- static constexpr OUStringLiteral sWhiteSpace ( u" " );
+ static constexpr OUString sWhiteSpace ( u" "_ustr );
const OUString sSHA256_URL_ODF12 ( SHA256_URL_ODF12 );
const OUString sSHA1_Name ( SHA1_NAME );
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index d2b3177e34cf..2c55bcf87fe9 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -41,9 +41,9 @@ 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 OUString gsEncryptionAlgProperty ( u"EncryptionAlgorithm"_ustr );
+constexpr OUString gsStartKeyAlgProperty ( u"StartKeyAlgorithm"_ustr );
+constexpr OUString gsDigestAlgProperty ( u"DigestAlgorithm"_ustr );
ManifestImport::ManifestImport( std::vector < Sequence < PropertyValue > > & rNewManVector )
: bIgnoreEncryptData ( false )
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 1ed64c60e204..bd58f579a326 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -974,8 +974,8 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper
// The "Compressed" property must be set after "MediaType" property,
// since the setting of the last one can change the value of the first one
static constexpr OUStringLiteral sMediaType = u"MediaType";
- static constexpr OUStringLiteral sCompressed = u"Compressed";
- static constexpr OUStringLiteral sSize = u"Size";
+ static constexpr OUString sCompressed = u"Compressed"_ustr;
+ static constexpr OUString sSize = u"Size"_ustr;
static constexpr OUStringLiteral sEncrypted = u"Encrypted";
if ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE )
{
@@ -2770,8 +2770,8 @@ void SAL_CALL OWriteStream::setPropertyValue( const OUString& aPropertyName, con
}
m_pImpl->GetStreamProperties();
- static constexpr OUStringLiteral aCompressedString( u"Compressed" );
- static constexpr OUStringLiteral aMediaTypeString( u"MediaType" );
+ static constexpr OUString aCompressedString( u"Compressed"_ustr );
+ static constexpr OUString aMediaTypeString( u"MediaType"_ustr );
if ( m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName == aMediaTypeString )
{
// if the "Compressed" property is not set explicitly, the MediaType can change the default value
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 1ba45654b73c..39a8e17fbdd7 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -168,11 +168,11 @@ void ZipPackage::parseManifest()
return;
bool bManifestParsed = false;
- static constexpr OUStringLiteral sMeta (u"META-INF");
+ static constexpr OUString sMeta (u"META-INF"_ustr);
if ( m_xRootFolder->hasByName( sMeta ) )
{
try {
- static constexpr OUStringLiteral sManifest (u"manifest.xml");
+ static constexpr OUString sManifest (u"manifest.xml"_ustr);
Any aAny = m_xRootFolder->getByName( sMeta );
uno::Reference< XNameContainer > xMetaInfFolder;
aAny >>= xMetaInfFolder;
@@ -370,7 +370,7 @@ void ZipPackage::parseManifest()
throw ZipIOException(
THROW_WHERE "Could not parse manifest.xml" );
- static constexpr OUStringLiteral sMimetype (u"mimetype");
+ static constexpr OUString sMimetype (u"mimetype"_ustr);
if ( m_xRootFolder->hasByName( sMimetype ) )
{
// get mediatype from the "mimetype" stream
@@ -447,7 +447,7 @@ void ZipPackage::parseContentType()
return;
try {
- static constexpr OUStringLiteral aContentTypes(u"[Content_Types].xml");
+ static constexpr OUString aContentTypes(u"[Content_Types].xml"_ustr);
// the content type must exist in OFOPXML format!
if ( !m_xRootFolder->hasByName( aContentTypes ) )
throw io::IOException(THROW_WHERE "Wrong format!" );
@@ -1001,7 +1001,7 @@ uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( c
void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
{
- static constexpr OUStringLiteral sMime (u"mimetype");
+ static constexpr OUString sMime (u"mimetype"_ustr);
if ( m_xRootFolder->hasByName( sMime ) )
m_xRootFolder->removeByName( sMime );
@@ -1210,11 +1210,11 @@ 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 constexpr OUStringLiteral sMeta (u"META-INF");
+ static constexpr OUString sMeta (u"META-INF"_ustr);
if ( m_xRootFolder->hasByName( sMeta ) )
{
- static constexpr OUStringLiteral sManifest (u"manifest.xml");
+ static constexpr OUString sManifest (u"manifest.xml"_ustr);
uno::Reference< XNameContainer > xMetaInfFolder;
Any aAny = m_xRootFolder->getByName( sMeta );
@@ -1231,7 +1231,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
// Remove the old [Content_Types].xml file as the
// file will be re-generated
- static constexpr OUStringLiteral aContentTypes(u"[Content_Types].xml");
+ static constexpr OUString aContentTypes(u"[Content_Types].xml"_ustr);
if ( m_xRootFolder->hasByName( aContentTypes ) )
m_xRootFolder->removeByName( aContentTypes );
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 6af3480d9e02..a183e63869b1 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -435,11 +435,11 @@ bool ZipPackageStream::saveChild(
{
bool bSuccess = true;
- static constexpr OUStringLiteral sDigestProperty (u"Digest");
- static constexpr OUStringLiteral sEncryptionAlgProperty (u"EncryptionAlgorithm");
- static constexpr OUStringLiteral sStartKeyAlgProperty (u"StartKeyAlgorithm");
- static constexpr OUStringLiteral sDigestAlgProperty (u"DigestAlgorithm");
- static constexpr OUStringLiteral sDerivedKeySizeProperty (u"DerivedKeySize");
+ static constexpr OUString sDigestProperty (u"Digest"_ustr);
+ static constexpr OUString sEncryptionAlgProperty (u"EncryptionAlgorithm"_ustr);
+ static constexpr OUString sStartKeyAlgProperty (u"StartKeyAlgorithm"_ustr);
+ static constexpr OUString sDigestAlgProperty (u"DigestAlgorithm"_ustr);
+ static constexpr OUString sDerivedKeySizeProperty (u"DerivedKeySize"_ustr);
uno::Sequence < beans::PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST);