From 8a01ee624318ac08800af89d988971114637a04e Mon Sep 17 00:00:00 2001 From: Szabolcs Dezsi Date: Fri, 6 Apr 2012 14:28:18 +0200 Subject: Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator Pattern used: find . -name "*.cxx" -exec sed -i 's/\( *\)\(else if\|if\) *( *\([^!()|&]*\)\.equalsAsciiL( *RTL_CONSTASCII_STRINGPARAM *( *\([^)]*\) ) *) *)$/\1\2 ( \3 == \4 )/' \{\} \; --- package/source/xstor/ocompinstream.cxx | 14 +++++------ package/source/xstor/owriteablestream.cxx | 32 ++++++++++++------------ package/source/xstor/xfactory.cxx | 2 +- package/source/xstor/xstorage.cxx | 30 +++++++++++------------ package/source/zippackage/ZipPackage.cxx | 34 +++++++++++++------------- package/source/zippackage/ZipPackageFolder.cxx | 6 ++--- package/source/zippackage/ZipPackageStream.cxx | 24 +++++++++--------- 7 files changed, 71 insertions(+), 71 deletions(-) (limited to 'package') diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 7ebe2df0f358..1002637ae538 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -389,7 +389,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( aSeq[nInd].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) ) + if ( aSeq[nInd].First == "Target" ) return aSeq[nInd].Second; return ::rtl::OUString(); @@ -414,7 +414,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( aSeq[nInd].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aSeq[nInd].First == "Type" ) return aSeq[nInd].Second; return ::rtl::OUString(); @@ -441,7 +441,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Id" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Id" ) { if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) return aSeq[nInd1]; @@ -474,7 +474,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Type" ) { if ( aSeq[nInd1][nInd2].Second.equals( sType ) ) { @@ -505,7 +505,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g // TODO/LATER: in future the information could be taken directly from m_pImpl when possible uno::Sequence< uno::Sequence< beans::StringPair > > aResult; for ( sal_Int32 aInd = 0; aInd < m_aProperties.getLength(); aInd++ ) - if ( m_aProperties[aInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) + if ( m_aProperties[aInd].Name == "RelationsInfo" ) { if ( m_aProperties[aInd].Value >>= aResult ) return aResult; @@ -655,12 +655,12 @@ uno::Any SAL_CALL OInputCompStream::getPropertyValue( const ::rtl::OUString& aPr } ::rtl::OUString aPropertyName; - if ( aProp.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsEncrypted" ) ) ) + if ( aProp == "IsEncrypted" ) aPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) ); else aPropertyName = aProp; - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) + if ( aPropertyName == "RelationsInfo" ) throw beans::UnknownPropertyException(); // TODO // all the provided properties are accessible diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index dd0229341aca..697b988a0144 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -431,7 +431,7 @@ sal_Bool OWriteStream_Impl::IsEncrypted() sal_Bool bToBeEncr = sal_False; for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + if ( m_aProps[nInd].Name == "Encrypted" ) { if ( !( m_aProps[nInd].Value >>= bToBeEncr ) ) { @@ -482,7 +482,7 @@ void OWriteStream_Impl::SetDecrypted() for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + if ( m_aProps[nInd].Name == "Encrypted" ) m_aProps[nInd].Value <<= sal_False; } } @@ -506,7 +506,7 @@ void OWriteStream_Impl::SetEncrypted( const ::comphelper::SequenceAsHashMap& aEn // introduce encryption info for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + if ( m_aProps[nInd].Name == "Encrypted" ) m_aProps[nInd].Value <<= sal_True; } @@ -950,7 +950,7 @@ void OWriteStream_Impl::Commit() for ( sal_Int32 nInd = 0; nInd < m_aProps.getLength(); nInd++ ) { - if ( m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + if ( m_aProps[nInd].Name == "Size" ) { if ( m_pAntiImpl && !m_bHasInsertedStreamOptimization && m_pAntiImpl->m_xSeekable.is() ) { @@ -1063,7 +1063,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aResult[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) ) ) + if ( aResult[nInd].Name == "UseCommonStoragePasswordEncryption" ) { aResult[nInd].Value <<= bUseCommonEncryption; return aResult; @@ -1087,7 +1087,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( uno::Reference< uno::XInterface >() ); for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) - if ( aResult[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) + if ( aResult[nInd].Name == "RelationsInfo" ) { aResult[nInd].Value = aValue; return aResult; @@ -2453,7 +2453,7 @@ void OWriteStream::CloseOutput_Impl() for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { - if ( m_pImpl->m_aProps[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + if ( m_pImpl->m_aProps[nInd].Name == "Size" ) m_pImpl->m_aProps[nInd].Value <<= ((sal_Int32)m_xSeekable->getLength()); } } @@ -2813,7 +2813,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( aSeq[nInd].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) ) + if ( aSeq[nInd].First == "Target" ) return aSeq[nInd].Second; return ::rtl::OUString(); @@ -2838,7 +2838,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( aSeq[nInd].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aSeq[nInd].First == "Type" ) return aSeq[nInd].Second; return ::rtl::OUString(); @@ -2865,7 +2865,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Id" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Id" ) { if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) return aSeq[nInd1]; @@ -2898,7 +2898,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRe uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Type" ) { if ( aSeq[nInd1][nInd2].Second.equals( sType ) ) { @@ -3014,7 +3014,7 @@ void SAL_CALL OWriteStream::removeRelationshipByID( const ::rtl::OUString& sID uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Id" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Id" ) { if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) { @@ -3264,7 +3264,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); // TODO } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( aPropertyName == "Size" ) throw beans::PropertyVetoException(); // TODO else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsEncrypted" ) ) || aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) ) @@ -3291,13 +3291,13 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) throw lang::DisposedException(); } - if ( aProp.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelId" ) ) ) + if ( aProp == "RelId" ) { return uno::makeAny( m_pImpl->GetNewRelId() ); } ::rtl::OUString aPropertyName; - if ( aProp.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsEncrypted" ) ) ) + if ( aProp == "IsEncrypted" ) aPropertyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) ); else aPropertyName = aProp; @@ -3318,7 +3318,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) ) ) return uno::makeAny( m_pImpl->m_bUseCommonEncryption ); - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( aPropertyName == "Size" ) { CheckInitOnDemand(); diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index 7037e61fb3f0..3a0011c3fb4c 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -210,7 +210,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr aPropsToSet[nNumArgs-1].Name = aDescr[nInd].Name; aPropsToSet[nNumArgs-1].Value = aDescr[nInd].Value; } - else if ( aDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StorageFormat" ) ) ) + else if ( aDescr[nInd].Name == "StorageFormat" ) { ::rtl::OUString aFormatName; sal_Int32 nFormatID = 0; diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 3845d9c61820..7792a46374d4 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -495,7 +495,7 @@ void OStorage_Impl::OpenOwnPackage() aArguments.realloc( ++nArgNum ); aArguments[nArgNum-1] <<= aNamedValue; } - else if ( m_xProperties[aInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Password" ) ) ) + else if ( m_xProperties[aInd].Name == "Password" ) { // TODO: implement password setting for documents // the password entry must be removed after setting @@ -5007,7 +5007,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + if ( aPropertyName == "MediaType" ) { aValue >>= m_pImpl->m_aMediaType; m_pImpl->m_bControlMediaType = sal_True; @@ -5015,7 +5015,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, m_pImpl->m_bBroadcastModified = sal_True; m_pImpl->m_bIsModified = sal_True; } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Version" ) ) ) + else if ( aPropertyName == "Version" ) { aValue >>= m_pImpl->m_aVersion; m_pImpl->m_bControlVersion = sal_True; @@ -5040,7 +5040,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, } else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfoStream" ) ) ) + if ( aPropertyName == "RelationsInfoStream" ) { uno::Reference< io::XInputStream > xInRelStream; if ( ( aValue >>= xInRelStream ) && xInRelStream.is() ) @@ -5063,7 +5063,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, else throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RelationsInfo" ) ) ) + else if ( aPropertyName == "RelationsInfo" ) { if ( aValue >>= m_pImpl->m_aRelInfo ) { @@ -5132,18 +5132,18 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa aCaught ); } - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + if ( aPropertyName == "MediaType" ) return uno::makeAny( m_pImpl->m_aMediaType ); - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Version" ) ) ) + else if ( aPropertyName == "Version" ) return uno::makeAny( m_pImpl->m_aVersion ); else return uno::makeAny( m_pImpl->m_bMTFallbackUsed ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsRoot" ) ) ) + else if ( aPropertyName == "IsRoot" ) { return uno::makeAny( m_pData->m_bIsRoot ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OpenMode" ) ) ) + else if ( aPropertyName == "OpenMode" ) { return uno::makeAny( m_pImpl->m_nStorageMode ); } @@ -5158,7 +5158,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa return m_pImpl->m_xProperties[aInd].Value; } - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) ) + if ( aPropertyName == "URL" ) return uno::makeAny( ::rtl::OUString() ); return uno::makeAny( sal_False ); // RepairPackage @@ -5334,7 +5334,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( aSeq[nInd].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Target" ) ) ) + if ( aSeq[nInd].First == "Target" ) return aSeq[nInd].Second; return ::rtl::OUString(); @@ -5359,7 +5359,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( aSeq[nInd].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aSeq[nInd].First == "Type" ) return aSeq[nInd].Second; return ::rtl::OUString(); @@ -5386,7 +5386,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Id" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Id" ) { if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) return aSeq[nInd1]; @@ -5419,7 +5419,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Type" ) { // the type is usually an URL, so the check should be case insensitive if ( aSeq[nInd1][nInd2].Second.equalsIgnoreAsciiCase( sType ) ) @@ -5536,7 +5536,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const ::rtl::OUString& sID ) uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) - if ( aSeq[nInd1][nInd2].First.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Id" ) ) ) + if ( aSeq[nInd1][nInd2].First == "Id" ) { if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) { diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 776ccbccdfb9..c6bbff940b29 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -691,9 +691,9 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) } else if ( ( aArguments[ind] >>= aNamedValue ) ) { - if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "RepairPackage" ) ) ) + if ( aNamedValue.Name == "RepairPackage" ) aNamedValue.Value >>= m_bForceRecovery; - else if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PackageFormat" ) ) ) + else if ( aNamedValue.Name == "PackageFormat" ) { // setting this argument to true means Package format // setting it to false means plain Zip format @@ -705,7 +705,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } - else if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StorageFormat" ) ) ) + else if ( aNamedValue.Name == "StorageFormat" ) { ::rtl::OUString aFormatName; sal_Int32 nFormatID = 0; @@ -734,7 +734,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } - else if ( aNamedValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AllowRemoveOnInsert" ) ) ) + else if ( aNamedValue.Name == "AllowRemoveOnInsert" ) { aNamedValue.Value >>= m_bAllowRemoveOnInsert; m_pRootFolder->setRemoveOnInsertMode_Impl( m_bAllowRemoveOnInsert ); @@ -1730,14 +1730,14 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const ||aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( IS_INCONSISTENT_PROPERTY ) ) ||aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( MEDIATYPE_FALLBACK_USED_PROPERTY ) ) ) throw PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ENCRYPTION_KEY_PROPERTY ) ) ) + else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( !( aValue >>= m_aEncryptionKey ) ) throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); m_aStorageEncryptionKeys.realloc( 0 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( STORAGE_ENCRYPTION_KEYS_PROPERTY ) ) ) + else if ( aPropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { // this property is only necessary to support raw passwords in storage API; // because of this support the storage has to operate with more than one key dependent on storage generation algorithm; @@ -1766,7 +1766,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const m_aStorageEncryptionKeys = aKeys; m_aEncryptionKey.realloc( 0 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ENCRYPTION_ALGORITHMS_PROPERTY ) ) ) + else if ( aPropertyName == ENCRYPTION_ALGORITHMS_PROPERTY ) { uno::Sequence< beans::NamedValue > aAlgorithms; if ( m_pZipFile || !( aValue >>= aAlgorithms ) || aAlgorithms.getLength() == 0 ) @@ -1777,7 +1777,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const for ( sal_Int32 nInd = 0; nInd < aAlgorithms.getLength(); nInd++ ) { - if ( aAlgorithms[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StartKeyGenerationAlgorithm" ) ) ) + if ( aAlgorithms[nInd].Name == "StartKeyGenerationAlgorithm" ) { sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) @@ -1786,7 +1786,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const m_nStartKeyGenerationID = nID; } - else if ( aAlgorithms[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EncryptionAlgorithm" ) ) ) + else if ( aAlgorithms[nInd].Name == "EncryptionAlgorithm" ) { sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) @@ -1795,7 +1795,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const m_nCommonEncryptionID = nID; } - else if ( aAlgorithms[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ChecksumAlgorithm" ) ) ) + else if ( aAlgorithms[nInd].Name == "ChecksumAlgorithm" ) { sal_Int32 nID = 0; if ( !( aAlgorithms[nInd].Value >>= nID ) @@ -1824,12 +1824,12 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); Any aAny; - if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( ENCRYPTION_KEY_PROPERTY ) ) ) + if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) { aAny <<= m_aEncryptionKey; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ENCRYPTION_ALGORITHMS_PROPERTY ) ) ) + else if ( PropertyName == ENCRYPTION_ALGORITHMS_PROPERTY ) { ::comphelper::SequenceAsHashMap aAlgorithms; aAlgorithms[ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StartKeyGenerationAlgorithm" ) ) ] <<= m_nStartKeyGenerationID; @@ -1838,27 +1838,27 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) aAny <<= aAlgorithms.getAsConstNamedValueList(); return aAny; } - if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( STORAGE_ENCRYPTION_KEYS_PROPERTY ) ) ) + if ( PropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { aAny <<= m_aStorageEncryptionKeys; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( HAS_ENCRYPTED_ENTRIES_PROPERTY ) ) ) + else if ( PropertyName == HAS_ENCRYPTED_ENTRIES_PROPERTY ) { aAny <<= m_bHasEncryptedEntries; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( HAS_NONENCRYPTED_ENTRIES_PROPERTY ) ) ) + else if ( PropertyName == HAS_NONENCRYPTED_ENTRIES_PROPERTY ) { aAny <<= m_bHasNonEncryptedEntries; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( IS_INCONSISTENT_PROPERTY ) ) ) + else if ( PropertyName == IS_INCONSISTENT_PROPERTY ) { aAny <<= m_bInconsistent; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( MEDIATYPE_FALLBACK_USED_PROPERTY ) ) ) + else if ( PropertyName == MEDIATYPE_FALLBACK_USED_PROPERTY ) { aAny <<= m_bMediaTypeFallbackUsed; return aAny; diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 48c51b42d364..5fabbab1e973 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -798,7 +798,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const ::rtl::OUString& aProper uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const ::rtl::OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, uno::RuntimeException) { - if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + if ( PropertyName == "MediaType" ) { // TODO/LATER: activate when zip ucp is ready // if ( m_nFormat != embed::StorageFormats::PACKAGE ) @@ -806,9 +806,9 @@ uno::Any SAL_CALL ZipPackageFolder::getPropertyValue( const ::rtl::OUString& Pro return uno::makeAny ( sMediaType ); } - else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "Version" ) ) ) + else if ( PropertyName == "Version" ) return uno::makeAny( m_sVersion ); - else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "Size" ) ) ) + else if ( PropertyName == "Size" ) return uno::makeAny ( aEntry.nSize ); else throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 483759e7e16d..d49c0b3a0029 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -710,7 +710,7 @@ sal_Int64 SAL_CALL ZipPackageStream::getSomething( const Sequence< sal_Int8 >& a void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw( beans::UnknownPropertyException, beans::PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException ) { - if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" )) ) + if ( aPropertyName == "MediaType" ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE && rZipPackage.getFormat() != embed::StorageFormats::OFOPXML ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -732,14 +732,14 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, 2 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + else if ( aPropertyName == "Size" ) { if ( !( aValue >>= aEntry.nSize ) ) throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Wrong type for Size property!\n" ) ), uno::Reference< XInterface >(), 2 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Encrypted" ) ) ) + else if ( aPropertyName == "Encrypted" ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -763,7 +763,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, 2 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ENCRYPTION_KEY_PROPERTY ) ) ) + else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -808,7 +808,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, m_aStorageEncryptionKeys.realloc( 0 ); } - else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( STORAGE_ENCRYPTION_KEYS_PROPERTY ) ) ) + else if ( aPropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -870,37 +870,37 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName ) throw( beans::UnknownPropertyException, WrappedTargetException, RuntimeException ) { Any aAny; - if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) + if ( PropertyName == "MediaType" ) { aAny <<= sMediaType; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "Size" ) ) ) + else if ( PropertyName == "Size" ) { aAny <<= aEntry.nSize; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "Encrypted" ) ) ) + else if ( PropertyName == "Encrypted" ) { aAny <<= ((m_nStreamMode == PACKAGE_STREAM_RAW) ? sal_True : bToBeEncrypted); return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "WasEncrypted" ) ) ) + else if ( PropertyName == "WasEncrypted" ) { aAny <<= bIsEncrypted; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "Compressed" ) ) ) + else if ( PropertyName == "Compressed" ) { aAny <<= bToBeCompressed; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ENCRYPTION_KEY_PROPERTY ) ) ) + else if ( PropertyName == ENCRYPTION_KEY_PROPERTY ) { aAny <<= m_aEncryptionKey; return aAny; } - else if ( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( STORAGE_ENCRYPTION_KEYS_PROPERTY ) ) ) + else if ( PropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY ) { aAny <<= m_aStorageEncryptionKeys; return aAny; -- cgit