diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-03 08:39:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-04 12:39:40 +0200 |
commit | 58a32075ca4f457f570af75aef368dd6c389aca7 (patch) | |
tree | e437dcbdeb248b4316cb8a9281d1543419853f6d /package | |
parent | Underline should be a split button (diff) | |
download | core-58a32075ca4f457f570af75aef368dd6c389aca7.tar.gz core-58a32075ca4f457f570af75aef368dd6c389aca7.zip |
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 26 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 22 |
2 files changed, 15 insertions, 33 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 84cf1f757246..0f58bc48602a 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1518,10 +1518,8 @@ void SAL_CALL ZipPackage::commitChanges() aInfo.NewTitle = rtl::Uri::decode ( m_aURL.copy ( 1 + m_aURL.lastIndexOf ( static_cast < sal_Unicode > ( '/' ) ) ), rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - aAny <<= aInfo; - // if the file is still not corrupted, it can become after the next step - aContent.executeCommand ("transfer", aAny ); + aContent.executeCommand ("transfer", Any(aInfo) ); } catch ( const css::uno::Exception& r ) { @@ -1782,11 +1780,9 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException(THROW_WHERE ); - Any aAny; if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) { - aAny <<= m_aEncryptionKey; - return aAny; + return Any(m_aEncryptionKey); } else if ( PropertyName == ENCRYPTION_ALGORITHMS_PROPERTY ) { @@ -1794,33 +1790,27 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) aAlgorithms["StartKeyGenerationAlgorithm"] <<= m_nStartKeyGenerationID; aAlgorithms["EncryptionAlgorithm"] <<= m_nCommonEncryptionID; aAlgorithms["ChecksumAlgorithm"] <<= m_nChecksumDigestID; - aAny <<= aAlgorithms.getAsConstNamedValueList(); - return aAny; + return Any(aAlgorithms.getAsConstNamedValueList()); } if ( PropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { - aAny <<= m_aStorageEncryptionKeys; - return aAny; + return Any(m_aStorageEncryptionKeys); } else if ( PropertyName == HAS_ENCRYPTED_ENTRIES_PROPERTY ) { - aAny <<= m_bHasEncryptedEntries; - return aAny; + return Any(m_bHasEncryptedEntries); } else if ( PropertyName == HAS_NONENCRYPTED_ENTRIES_PROPERTY ) { - aAny <<= m_bHasNonEncryptedEntries; - return aAny; + return Any(m_bHasNonEncryptedEntries); } else if ( PropertyName == IS_INCONSISTENT_PROPERTY ) { - aAny <<= m_bInconsistent; - return aAny; + return Any(m_bInconsistent); } else if ( PropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY ) { - aAny <<= m_bMediaTypeFallbackUsed; - return aAny; + return Any(m_bMediaTypeFallbackUsed); } throw UnknownPropertyException(THROW_WHERE ); } diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 8ecb31fbc551..79c42b11be43 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -1339,41 +1339,33 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) throw( beans::UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception ) { - Any aAny; if ( PropertyName == "MediaType" ) { - aAny <<= msMediaType; - return aAny; + return Any(msMediaType); } else if ( PropertyName == "Size" ) { - aAny <<= aEntry.nSize; - return aAny; + return Any(aEntry.nSize); } else if ( PropertyName == "Encrypted" ) { - aAny <<= ((m_nStreamMode == PACKAGE_STREAM_RAW) || m_bToBeEncrypted); - return aAny; + return Any((m_nStreamMode == PACKAGE_STREAM_RAW) || m_bToBeEncrypted); } else if ( PropertyName == "WasEncrypted" ) { - aAny <<= m_bIsEncrypted; - return aAny; + return Any(m_bIsEncrypted); } else if ( PropertyName == "Compressed" ) { - aAny <<= m_bToBeCompressed; - return aAny; + return Any(m_bToBeCompressed); } else if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) { - aAny <<= m_aEncryptionKey; - return aAny; + return Any(m_aEncryptionKey); } else if ( PropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { - aAny <<= m_aStorageEncryptionKeys; - return aAny; + return Any(m_aStorageEncryptionKeys); } else throw beans::UnknownPropertyException(THROW_WHERE ); |