summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-06-04 14:35:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-06-04 23:29:52 +0200
commit214077401a736d49e9c9c6e8f1dd348725455fd7 (patch)
tree14d2a2dff9b8c061f88ad89d1abfb2b14ce0cdd2 /package
parentdbcfb91c259e8397b3de20f9b3e481b4abadf996 (diff)
Upcoming loplugin:elidestringvar: package
Change-Id: I10f55bff4619fe7c1cab378aa00d96cf31d0fcd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95511 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/xstorage.cxx9
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx10
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx21
3 files changed, 13 insertions, 27 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 017ee528e616..8a13fd82b32d 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -661,18 +661,15 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes
// move storage properties to the destination one ( means changeable properties )
if ( m_nStorageType == embed::StorageFormats::PACKAGE )
{
- OUString aMediaTypeString = "MediaType";
- OUString aVersionString = "Version";
- xPropSet->setPropertyValue( aMediaTypeString, uno::makeAny( m_aMediaType ) );
- xPropSet->setPropertyValue( aVersionString, uno::makeAny( m_aVersion ) );
+ xPropSet->setPropertyValue( "MediaType", uno::makeAny( m_aMediaType ) );
+ xPropSet->setPropertyValue( "Version", uno::makeAny( m_aVersion ) );
}
if ( m_nStorageType == embed::StorageFormats::PACKAGE )
{
// if this is a root storage, the common key from current one should be moved there
bool bIsRoot = false;
- OUString aRootString = "IsRoot";
- if ( ( xPropSet->getPropertyValue( aRootString ) >>= bIsRoot ) && bIsRoot )
+ if ( ( xPropSet->getPropertyValue( "IsRoot" ) >>= bIsRoot ) && bIsRoot )
{
try
{
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 3a6b7ee19bbd..c95849df91a0 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -252,20 +252,16 @@ bool ZipPackageFolder::saveChild(
sal_Int32 nPBKDF2IterationCount,
const rtlRandomPool &rRandomPool)
{
- const OUString sMediaTypeProperty ("MediaType");
- const OUString sVersionProperty ("Version");
- const OUString sFullPathProperty ("FullPath");
-
uno::Sequence < PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST);
OUString sTempName = rPath + "/";
if ( !GetMediaType().isEmpty() )
{
- aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
+ aPropSet[PKG_MNFST_MEDIATYPE].Name = "MediaType";
aPropSet[PKG_MNFST_MEDIATYPE].Value <<= GetMediaType();
- aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty;
+ aPropSet[PKG_MNFST_VERSION].Name = "Version";
aPropSet[PKG_MNFST_VERSION].Value <<= GetVersion();
- aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
+ aPropSet[PKG_MNFST_FULLPATH].Name = "FullPath";
aPropSet[PKG_MNFST_FULLPATH].Value <<= sTempName;
}
else
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index ab237a15f5e4..71f9ad9f2ba1 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -455,13 +455,6 @@ bool ZipPackageStream::saveChild(
{
bool bSuccess = true;
- const OUString sMediaTypeProperty ("MediaType");
- const OUString sVersionProperty ("Version");
- const OUString sFullPathProperty ("FullPath");
- const OUString sInitialisationVectorProperty ("InitialisationVector");
- const OUString sSaltProperty ("Salt");
- const OUString sIterationCountProperty ("IterationCount");
- const OUString sSizeProperty ("Size");
const OUString sDigestProperty ("Digest");
const OUString sEncryptionAlgProperty ("EncryptionAlgorithm");
const OUString sStartKeyAlgProperty ("StartKeyAlgorithm");
@@ -484,11 +477,11 @@ bool ZipPackageStream::saveChild(
const bool bToBeEncrypted = m_bToBeEncrypted && (rEncryptionKey.hasElements() || m_bHaveOwnKey);
const bool bToBeCompressed = bToBeEncrypted || m_bToBeCompressed;
- aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
+ aPropSet[PKG_MNFST_MEDIATYPE].Name = "MediaType";
aPropSet[PKG_MNFST_MEDIATYPE].Value <<= GetMediaType( );
- aPropSet[PKG_MNFST_VERSION].Name = sVersionProperty;
+ aPropSet[PKG_MNFST_VERSION].Name = "Version";
aPropSet[PKG_MNFST_VERSION].Value <<= OUString(); // no version is stored for streams currently
- aPropSet[PKG_MNFST_FULLPATH].Name = sFullPathProperty;
+ aPropSet[PKG_MNFST_FULLPATH].Name = "FullPath";
aPropSet[PKG_MNFST_FULLPATH].Value <<= pTempEntry->sPath;
OSL_ENSURE( m_nStreamMode != PACKAGE_STREAM_NOTSET, "Unacceptable ZipPackageStream mode!" );
@@ -611,16 +604,16 @@ bool ZipPackageStream::saveChild(
// a magic header
aPropSet.realloc(PKG_SIZE_ENCR_MNFST);
- aPropSet[PKG_MNFST_INIVECTOR].Name = sInitialisationVectorProperty;
+ aPropSet[PKG_MNFST_INIVECTOR].Name = "InitialisationVector";
aPropSet[PKG_MNFST_INIVECTOR].Value <<= m_xBaseEncryptionData->m_aInitVector;
- aPropSet[PKG_MNFST_SALT].Name = sSaltProperty;
+ aPropSet[PKG_MNFST_SALT].Name = "Salt";
aPropSet[PKG_MNFST_SALT].Value <<= m_xBaseEncryptionData->m_aSalt;
- aPropSet[PKG_MNFST_ITERATION].Name = sIterationCountProperty;
+ aPropSet[PKG_MNFST_ITERATION].Name = "IterationCount";
aPropSet[PKG_MNFST_ITERATION].Value <<= m_xBaseEncryptionData->m_nIterationCount;
// Need to store the uncompressed size in the manifest
OSL_ENSURE( m_nOwnStreamOrigSize >= 0, "The stream size was not correctly initialized!" );
- aPropSet[PKG_MNFST_UCOMPSIZE].Name = sSizeProperty;
+ aPropSet[PKG_MNFST_UCOMPSIZE].Name = "Size";
aPropSet[PKG_MNFST_UCOMPSIZE].Value <<= m_nOwnStreamOrigSize;
if ( m_bRawStream || bTransportOwnEncrStreamAsRaw )