diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-13 12:43:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-13 15:20:58 +0200 |
commit | 3697b87b70c69e17e1d0398e0192a11dab179fe3 (patch) | |
tree | a498cce1f1351e6f92385aa9245c66c0724b6430 /package | |
parent | 9bc95521aaa35b533894b3934519acdbd7a47815 (diff) |
use more OUString::operator== in forms..sal
Change-Id: I70d7e50f8c1e019524ccad915f0cca912c5035dc
Reviewed-on: https://gerrit.libreoffice.org/39899
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/manifest/ManifestExport.cxx | 30 | ||||
-rw-r--r-- | package/source/manifest/ManifestImport.cxx | 30 | ||||
-rw-r--r-- | package/source/xstor/ocompinstream.cxx | 8 | ||||
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 50 | ||||
-rw-r--r-- | package/source/xstor/register.cxx | 2 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 22 | ||||
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 2 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 28 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 2 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 2 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 6 |
11 files changed, 91 insertions, 91 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index 60bcb8b3ff2a..915c8f243bd7 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -109,15 +109,15 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con const beans::PropertyValue *pValue = pSequence[nInd].getConstArray(); for (sal_uInt32 j = 0, nNum = pSequence[nInd].getLength(); j < nNum; j++, pValue++) { - if (pValue->Name.equals (sMediaTypeProperty) ) + if (pValue->Name == sMediaTypeProperty ) { pValue->Value >>= aMediaType; } - else if (pValue->Name.equals (sFullPathProperty) ) + else if (pValue->Name == sFullPathProperty ) { pValue->Value >>= aPath; } - else if (pValue->Name.equals (sVersionProperty) ) + else if (pValue->Name == sVersionProperty ) { pValue->Value >>= aVersion; } @@ -201,24 +201,24 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con const uno::Any *pVector = nullptr, *pSalt = nullptr, *pIterationCount = nullptr, *pDigest = nullptr, *pDigestAlg = nullptr, *pEncryptAlg = nullptr, *pStartKeyAlg = nullptr, *pDerivedKeySize = nullptr; for (sal_uInt32 j = 0, nNum = pSequence[i].getLength(); j < nNum; j++, pValue++) { - if (pValue->Name.equals (sMediaTypeProperty) ) + if (pValue->Name == sMediaTypeProperty ) { pValue->Value >>= aString; pAttrList->AddAttribute ( sMediaTypeAttribute, sCdataAttribute, aString ); } - else if (pValue->Name.equals (sVersionProperty) ) + else if (pValue->Name == sVersionProperty ) { pValue->Value >>= aString; // the version is stored only if it is not empty if ( bAcceptNonemptyVersion && !aString.isEmpty() ) pAttrList->AddAttribute ( sVersionAttribute, sCdataAttribute, aString ); } - else if (pValue->Name.equals (sFullPathProperty) ) + else if (pValue->Name == sFullPathProperty ) { pValue->Value >>= aString; pAttrList->AddAttribute ( sFullPathAttribute, sCdataAttribute, aString ); } - else if (pValue->Name.equals (sSizeProperty) ) + else if (pValue->Name == sSizeProperty ) { sal_Int64 nSize = 0; pValue->Value >>= nSize; @@ -226,21 +226,21 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con aBuffer.append ( nSize ); pAttrList->AddAttribute ( sSizeAttribute, sCdataAttribute, aBuffer.makeStringAndClear() ); } - else if (pValue->Name.equals (sInitialisationVectorProperty) ) + else if (pValue->Name == sInitialisationVectorProperty ) pVector = &pValue->Value; - else if (pValue->Name.equals (sSaltProperty) ) + else if (pValue->Name == sSaltProperty ) pSalt = &pValue->Value; - else if (pValue->Name.equals (sIterationCountProperty) ) + else if (pValue->Name == sIterationCountProperty ) pIterationCount = &pValue->Value; - else if (pValue->Name.equals ( sDigestProperty ) ) + else if (pValue->Name == sDigestProperty ) pDigest = &pValue->Value; - else if (pValue->Name.equals ( sDigestAlgProperty ) ) + else if (pValue->Name == sDigestAlgProperty ) pDigestAlg = &pValue->Value; - else if (pValue->Name.equals ( sEncryptionAlgProperty ) ) + else if (pValue->Name == sEncryptionAlgProperty ) pEncryptAlg = &pValue->Value; - else if (pValue->Name.equals ( sStartKeyAlgProperty ) ) + else if (pValue->Name == sStartKeyAlgProperty ) pStartKeyAlg = &pValue->Value; - else if (pValue->Name.equals ( sDerivedKeySizeProperty ) ) + else if (pValue->Name == sDerivedKeySizeProperty ) pDerivedKeySize = &pValue->Value; } diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index ec34c750858f..bfde6aa3cb2c 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -133,10 +133,10 @@ void ManifestImport::doEncryptionData(StringHashMap &rConvertedAttribs) nDerivedKeySize = 0; OUString aString = rConvertedAttribs[sChecksumTypeAttribute]; if ( !bIgnoreEncryptData ) { - if ( aString.equals( sSHA1_1k_Name ) || aString.equals( sSHA1_1k_URL ) ) { + if ( aString == sSHA1_1k_Name || aString == sSHA1_1k_URL ) { aSequence[PKG_MNFST_DIGESTALG].Name = sDigestAlgProperty; aSequence[PKG_MNFST_DIGESTALG].Value <<= xml::crypto::DigestID::SHA1_1K; - } else if ( aString.equals( sSHA256_1k_URL ) ) { + } else if ( aString == sSHA256_1k_URL ) { aSequence[PKG_MNFST_DIGESTALG].Name = sDigestAlgProperty; aSequence[PKG_MNFST_DIGESTALG].Value <<= xml::crypto::DigestID::SHA256_1K; } else @@ -156,20 +156,20 @@ void ManifestImport::doAlgorithm(StringHashMap &rConvertedAttribs) { if ( !bIgnoreEncryptData ) { OUString aString = rConvertedAttribs[sAlgorithmNameAttribute]; - if ( aString.equals( sBlowfish_Name ) || aString.equals( sBlowfish_URL ) ) { + if ( aString == sBlowfish_Name || aString == sBlowfish_URL ) { aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty; aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8; - } else if ( aString.equals( sAES256_URL ) ) { + } else if ( aString == sAES256_URL ) { aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty; aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING; OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 32, "Unexpected derived key length!" ); nDerivedKeySize = 32; - } else if ( aString.equals( sAES192_URL ) ) { + } else if ( aString == sAES192_URL ) { aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty; aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING; OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 24, "Unexpected derived key length!" ); nDerivedKeySize = 24; - } else if ( aString.equals( sAES128_URL ) ) { + } else if ( aString == sAES128_URL ) { aSequence[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty; aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING; OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 16, "Unexpected derived key length!" ); @@ -191,7 +191,7 @@ void ManifestImport::doKeyDerivation(StringHashMap &rConvertedAttribs) { if ( !bIgnoreEncryptData ) { OUString aString = rConvertedAttribs[sKeyDerivationNameAttribute]; - if ( aString.equals( sPBKDF2_Name ) || aString.equals( sPBKDF2_URL ) ) { + if ( aString == sPBKDF2_Name || aString == sPBKDF2_URL ) { aString = rConvertedAttribs[sSaltAttribute]; uno::Sequence < sal_Int8 > aDecodeBuffer; ::sax::Converter::decodeBase64(aDecodeBuffer, aString); @@ -222,10 +222,10 @@ void ManifestImport::doKeyDerivation(StringHashMap &rConvertedAttribs) void ManifestImport::doStartKeyAlg(StringHashMap &rConvertedAttribs) { OUString aString = rConvertedAttribs[sStartKeyAlgNameAttribute]; - if (aString.equals(sSHA256_URL) || aString.equals(sSHA256_URL_ODF12)) { + if (aString == sSHA256_URL || aString == sSHA256_URL_ODF12) { aSequence[PKG_MNFST_STARTALG].Name = sStartKeyAlgProperty; aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA256; - } else if ( aString.equals( sSHA1_Name ) || aString.equals( sSHA1_URL ) ) { + } else if ( aString == sSHA1_Name || aString == sSHA1_URL ) { aSequence[PKG_MNFST_STARTALG].Name = sStartKeyAlgProperty; aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA1; } else @@ -260,7 +260,7 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re if (!aIter->m_bValid) aStack.back().m_bValid = false; - else if (aConvertedName.equals(sEncryptionDataElement)) //manifest:encryption-data + else if (aConvertedName == sEncryptionDataElement) //manifest:encryption-data doEncryptionData(aConvertedAttribs); else aStack.back().m_bValid = false; @@ -272,11 +272,11 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re if (!aIter->m_bValid) aStack.back().m_bValid = false; - else if (aConvertedName.equals(sAlgorithmElement)) //manifest:algorithm, + else if (aConvertedName == sAlgorithmElement) //manifest:algorithm, doAlgorithm(aConvertedAttribs); - else if (aConvertedName.equals(sKeyDerivationElement)) //manifest:key-derivation, + else if (aConvertedName == sKeyDerivationElement) //manifest:key-derivation, doKeyDerivation(aConvertedAttribs); - else if (aConvertedName.equals(sStartKeyAlgElement)) //manifest:start-key-generation + else if (aConvertedName == sStartKeyAlgElement) //manifest:start-key-generation doStartKeyAlg(aConvertedAttribs); else aStack.back().m_bValid = false; @@ -299,8 +299,8 @@ bool isEmpty(const css::beans::PropertyValue &rProp) void SAL_CALL ManifestImport::endElement( const OUString& aName ) { OUString aConvertedName = ConvertName( aName ); - if ( !aStack.empty() && aStack.rbegin()->m_aConvertedName.equals( aConvertedName ) ) { - if ( aConvertedName.equals( sFileEntryElement ) && aStack.back().m_bValid ) { + if ( !aStack.empty() && aStack.rbegin()->m_aConvertedName == aConvertedName ) { + if ( aConvertedName == sFileEntryElement && aStack.back().m_bValid ) { css::beans::PropertyValue aEmpty; aSequence.erase(std::remove_if(aSequence.begin(), aSequence.end(), isEmpty), aSequence.end()); diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 2fc6927e4f04..06076370ea92 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -351,7 +351,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Id" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) return aSeq[nInd1]; break; } @@ -381,7 +381,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Type" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sType ) ) + if ( aSeq[nInd1][nInd2].Second == sType ) { aResult.realloc( nEntriesNum ); aResult[nEntriesNum-1] = aSeq[nInd1]; @@ -510,7 +510,7 @@ void SAL_CALL OInputCompStream::setPropertyValue( const OUString& aPropertyName, // all the provided properties are accessible for ( sal_Int32 aInd = 0; aInd < m_aProperties.getLength(); aInd++ ) { - if ( m_aProperties[aInd].Name.equals( aPropertyName ) ) + if ( m_aProperties[aInd].Name == aPropertyName ) { throw beans::PropertyVetoException(); // TODO } @@ -541,7 +541,7 @@ uno::Any SAL_CALL OInputCompStream::getPropertyValue( const OUString& aProp ) // all the provided properties are accessible for ( sal_Int32 aInd = 0; aInd < m_aProperties.getLength(); aInd++ ) { - if ( m_aProperties[aInd].Name.equals( aPropertyName ) ) + if ( m_aProperties[aInd].Name == aPropertyName ) { return m_aProperties[aInd].Value; } diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 6bee879b5a75..af0dc07fbb29 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -169,7 +169,7 @@ bool SequencesEqual( const uno::Sequence< beans::NamedValue >& aSequence1, const { for ( sal_Int32 nInd2 = 0; nInd2 < aSequence2.getLength(); nInd2++ ) { - if ( aSequence1[nInd].Name.equals( aSequence2[nInd2].Name ) ) + if ( aSequence1[nInd].Name == aSequence2[nInd2].Name ) { bHasMember = true; @@ -183,7 +183,7 @@ bool SequencesEqual( const uno::Sequence< beans::NamedValue >& aSequence1, const { for ( sal_Int32 nInd2 = 0; nInd2 < aSequence2.getLength(); nInd2++ ) { - if ( aSequence1[nInd].Name.equals( aSequence2[nInd2].Name ) ) + if ( aSequence1[nInd].Name == aSequence2[nInd2].Name ) { bHasMember = true; @@ -727,13 +727,13 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt OUString aMedTypePropName( "MediaType" ); for ( sal_Int32 nInd = 0; nInd < aProps.getLength(); nInd++ ) { - if ( aProps[nInd].Name.equals( aComprPropName ) ) + if ( aProps[nInd].Name == aComprPropName ) { bCompressedIsSet = true; aProps[nInd].Value >>= bCompressed; } else if ( ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) - && aProps[nInd].Name.equals( aMedTypePropName ) ) + && aProps[nInd].Name == aMedTypePropName ) { xPropertySet->setPropertyValue( aProps[nInd].Name, aProps[nInd].Value ); } @@ -743,10 +743,10 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt throw lang::IllegalArgumentException(); // if there are cached properties update them - if ( aProps[nInd].Name.equals( aMedTypePropName ) || aProps[nInd].Name.equals( aComprPropName ) ) + if ( aProps[nInd].Name == aMedTypePropName || aProps[nInd].Name == aComprPropName ) for ( sal_Int32 nMemInd = 0; nMemInd < m_aProps.getLength(); nMemInd++ ) { - if ( aProps[nInd].Name.equals( m_aProps[nMemInd].Name ) ) + if ( aProps[nInd].Name == m_aProps[nMemInd].Name ) m_aProps[nMemInd].Value = aProps[nInd].Value; } } @@ -1547,7 +1547,7 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora OUString aNewRelStreamName = aNewStreamName; aNewRelStreamName += ".rels"; - bool bRenamed = !aOrigRelStreamName.equals( aNewRelStreamName ); + bool bRenamed = aOrigRelStreamName != aNewRelStreamName; if ( m_nRelInfoStatus == RELINFO_CHANGED || m_nRelInfoStatus == RELINFO_CHANGED_STREAM_READ || m_nRelInfoStatus == RELINFO_CHANGED_STREAM ) @@ -2593,7 +2593,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Id" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) return aSeq[nInd1]; break; } @@ -2623,7 +2623,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRe for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Type" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sType ) ) + if ( aSeq[nInd1][nInd2].Second == sType ) { aResult.realloc( nEntriesNum ); aResult[nEntriesNum-1] = aSeq[nInd1]; @@ -2671,9 +2671,9 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const OUString& sID, const 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.equals( aIDTag ) ) + if ( aSeq[nInd1][nInd2].First == aIDTag ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) nIDInd = nInd1; break; @@ -2696,7 +2696,7 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const OUString& sID, const nIndOrig < aEntry.getLength(); nIndOrig++ ) { - if ( !aEntry[nIndOrig].First.equals( aIDTag ) ) + if ( aEntry[nIndOrig].First != aIDTag ) aSeq[nIDInd][nIndTarget++] = aEntry[nIndOrig]; } @@ -2728,7 +2728,7 @@ void SAL_CALL OWriteStream::removeRelationshipByID( const OUString& sID ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Id" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) { sal_Int32 nLength = aSeq.getLength(); aSeq[nInd1] = aSeq[nLength-1]; @@ -2768,16 +2768,16 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ for ( sal_Int32 nIndTarget1 = 0; nIndTarget1 < aSeq.getLength(); nIndTarget1++ ) for ( sal_Int32 nIndTarget2 = 0; nIndTarget2 < aSeq[nIndTarget1].getLength(); nIndTarget2++ ) - if ( aSeq[nIndTarget1][nIndTarget2].First.equals( aIDTag ) ) + if ( aSeq[nIndTarget1][nIndTarget2].First == aIDTag ) { sal_Int32 nIndSourceSame = -1; for ( sal_Int32 nIndSource1 = 0; nIndSource1 < aEntries.getLength(); nIndSource1++ ) for ( sal_Int32 nIndSource2 = 0; nIndSource2 < aEntries[nIndSource1].getLength(); nIndSource2++ ) { - if ( aEntries[nIndSource1][nIndSource2].First.equals( aIDTag ) ) + if ( aEntries[nIndSource1][nIndSource2].First == aIDTag ) { - if ( aEntries[nIndSource1][nIndSource2].Second.equals( aSeq[nIndTarget1][nIndTarget2].Second ) ) + if ( aEntries[nIndSource1][nIndSource2].Second == aSeq[nIndTarget1][nIndTarget2].Second ) { if ( !bReplace ) throw container::ElementExistException(); @@ -2805,7 +2805,7 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ sal_Int32 nResInd2 = 1; for ( sal_Int32 nIndSource2 = 0; nIndSource2 < aEntries[nIndSource1].getLength(); nIndSource2++ ) - if ( aEntries[nIndSource1][nIndSource2].First.equals( aIDTag ) ) + if ( aEntries[nIndSource1][nIndSource2].First == aIDTag ) { aResultSeq[nResultInd][0] = aEntries[nIndSource1][nIndSource2]; bHasID = true; @@ -2866,7 +2866,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const OUString& aPropertyName, con m_pImpl->GetStreamProperties(); OUString aCompressedString( "Compressed" ); OUString aMediaTypeString( "MediaType" ); - if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equals( aMediaTypeString ) ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName == aMediaTypeString ) { // if the "Compressed" property is not set explicitly, the MediaType can change the default value bool bCompressedValueFromType = true; @@ -2881,19 +2881,19 @@ void SAL_CALL OWriteStream::setPropertyValue( const OUString& aPropertyName, con for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { - if ( aPropertyName.equals( m_pImpl->m_aProps[nInd].Name ) ) + if ( aPropertyName == m_pImpl->m_aProps[nInd].Name ) m_pImpl->m_aProps[nInd].Value = aValue; - else if ( !m_pImpl->m_bCompressedSetExplicit && aCompressedString.equals( m_pImpl->m_aProps[nInd].Name ) ) + else if ( !m_pImpl->m_bCompressedSetExplicit && aCompressedString == m_pImpl->m_aProps[nInd].Name ) m_pImpl->m_aProps[nInd].Value <<= bCompressedValueFromType; } } - else if ( aPropertyName.equals( aCompressedString ) ) + else if ( aPropertyName == aCompressedString ) { // if the "Compressed" property is not set explicitly, the MediaType can change the default value m_pImpl->m_bCompressedSetExplicit = true; for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { - if ( aPropertyName.equals( m_pImpl->m_aProps[nInd].Name ) ) + if ( aPropertyName == m_pImpl->m_aProps[nInd].Name ) m_pImpl->m_aProps[nInd].Value = aValue; } } @@ -2922,11 +2922,11 @@ void SAL_CALL OWriteStream::setPropertyValue( const OUString& aPropertyName, con else throw lang::IllegalArgumentException(); //TODO } - else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equals( aMediaTypeString ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName == aMediaTypeString ) { for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { - if ( aPropertyName.equals( m_pImpl->m_aProps[nInd].Name ) ) + if ( aPropertyName == m_pImpl->m_aProps[nInd].Name ) m_pImpl->m_aProps[nInd].Value = aValue; } } @@ -3005,7 +3005,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const OUString& aProp ) for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { - if ( aPropertyName.equals( m_pImpl->m_aProps[nInd].Name ) ) + if ( aPropertyName == m_pImpl->m_aProps[nInd].Name ) return m_pImpl->m_aProps[nInd].Value; } } diff --git a/package/source/xstor/register.cxx b/package/source/xstor/register.cxx index e32f64e1ea7e..7f4e75ab1d9b 100644 --- a/package/source/xstor/register.cxx +++ b/package/source/xstor/register.cxx @@ -34,7 +34,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL xstor_component_getFactory( const sal_Char OUString aImplName( OUString::createFromAscii( pImplName ) ); uno::Reference< lang::XSingleServiceFactory > xFactory; - if ( pServiceManager && aImplName.equals( OStorageFactory::impl_staticGetImplementationName() ) ) + if ( pServiceManager && aImplName == OStorageFactory::impl_staticGetImplementationName() ) { xFactory= ::cppu::createOneInstanceFactory( static_cast< lang::XMultiServiceFactory*>( pServiceManager ), OStorageFactory::impl_staticGetImplementationName(), diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 569bd30f86c0..aa47f3d45726 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -339,7 +339,7 @@ OStorage_Impl::~OStorage_Impl() OUString aPropertyName = "URL"; for ( sal_Int32 aInd = 0; aInd < m_xProperties.getLength(); ++aInd ) { - if ( m_xProperties[aInd].Name.equals( aPropertyName ) ) + if ( m_xProperties[aInd].Name == aPropertyName ) { // the storage is URL based so all the streams are opened by factory and should be closed try @@ -4448,7 +4448,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) { for ( sal_Int32 aInd = 0; aInd < m_pImpl->m_xProperties.getLength(); aInd++ ) { - if ( m_pImpl->m_xProperties[aInd].Name.equals( aPropertyName ) ) + if ( m_pImpl->m_xProperties[aInd].Name == aPropertyName ) return m_pImpl->m_xProperties[aInd].Value; } @@ -4638,7 +4638,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Id" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) return aSeq[nInd1]; break; } @@ -4738,9 +4738,9 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: 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.equals( aIDTag ) ) + if ( aSeq[nInd1][nInd2].First == aIDTag ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) nIDInd = nInd1; break; @@ -4763,7 +4763,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: nIndOrig < aEntry.getLength(); nIndOrig++ ) { - if ( !aEntry[nIndOrig].First.equals( aIDTag ) ) + if ( aEntry[nIndOrig].First != aIDTag ) aSeq[nIDInd][nIndTarget++] = aEntry[nIndOrig]; } @@ -4795,7 +4795,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ ) if ( aSeq[nInd1][nInd2].First == "Id" ) { - if ( aSeq[nInd1][nInd2].Second.equals( sID ) ) + if ( aSeq[nInd1][nInd2].Second == sID ) { sal_Int32 nLength = aSeq.getLength(); aSeq[nInd1] = aSeq[nLength-1]; @@ -4835,16 +4835,16 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence for ( sal_Int32 nIndTarget1 = 0; nIndTarget1 < aSeq.getLength(); nIndTarget1++ ) for ( sal_Int32 nIndTarget2 = 0; nIndTarget2 < aSeq[nIndTarget1].getLength(); nIndTarget2++ ) - if ( aSeq[nIndTarget1][nIndTarget2].First.equals( aIDTag ) ) + if ( aSeq[nIndTarget1][nIndTarget2].First == aIDTag ) { sal_Int32 nIndSourceSame = -1; for ( sal_Int32 nIndSource1 = 0; nIndSource1 < aEntries.getLength(); nIndSource1++ ) for ( sal_Int32 nIndSource2 = 0; nIndSource2 < aEntries[nIndSource1].getLength(); nIndSource2++ ) { - if ( aEntries[nIndSource1][nIndSource2].First.equals( aIDTag ) ) + if ( aEntries[nIndSource1][nIndSource2].First == aIDTag ) { - if ( aEntries[nIndSource1][nIndSource2].Second.equals( aSeq[nIndTarget1][nIndTarget2].Second ) ) + if ( aEntries[nIndSource1][nIndSource2].Second == aSeq[nIndTarget1][nIndTarget2].Second ) { if ( !bReplace ) throw container::ElementExistException( THROW_WHERE ); @@ -4872,7 +4872,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence sal_Int32 nResInd2 = 1; for ( sal_Int32 nIndSource2 = 0; nIndSource2 < aEntries[nIndSource1].getLength(); nIndSource2++ ) - if ( aEntries[nIndSource1][nIndSource2].First.equals( aIDTag ) ) + if ( aEntries[nIndSource1][nIndSource2].First == aIDTag ) { aResultSeq[nResultInd][0] = aEntries[nIndSource1][nIndSource2]; bHasID = true; diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index c331282f9c76..efad81b5fdf2 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -782,7 +782,7 @@ bool ZipFile::readLOC( ZipEntry &rEntry ) } bBroken = rEntry.nPathLen != nPathLen - || !rEntry.sPath.equals( sLOCPath ); + || rEntry.sPath != sLOCPath; } catch(...) { diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 7f998ccf01ec..66e40cb9d410 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -212,29 +212,29 @@ void ZipPackage::parseManifest() const Any *pSalt = nullptr, *pVector = nullptr, *pCount = nullptr, *pSize = nullptr, *pDigest = nullptr, *pDigestAlg = nullptr, *pEncryptionAlg = nullptr, *pStartKeyAlg = nullptr, *pDerivedKeySize = nullptr; for ( sal_Int32 j = 0, nNum = pSequence->getLength(); j < nNum; j++ ) { - if ( pValue[j].Name.equals( sPropFullPath ) ) + if ( pValue[j].Name == sPropFullPath ) pValue[j].Value >>= sPath; - else if ( pValue[j].Name.equals( sPropVersion ) ) + else if ( pValue[j].Name == sPropVersion ) pValue[j].Value >>= sVersion; - else if ( pValue[j].Name.equals( sPropMediaType ) ) + else if ( pValue[j].Name == sPropMediaType ) pValue[j].Value >>= sMediaType; - else if ( pValue[j].Name.equals( sPropSalt ) ) + else if ( pValue[j].Name == sPropSalt ) pSalt = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropInitialisationVector ) ) + else if ( pValue[j].Name == sPropInitialisationVector ) pVector = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropIterationCount ) ) + else if ( pValue[j].Name == sPropIterationCount ) pCount = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropSize ) ) + else if ( pValue[j].Name == sPropSize ) pSize = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropDigest ) ) + else if ( pValue[j].Name == sPropDigest ) pDigest = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropDigestAlgorithm ) ) + else if ( pValue[j].Name == sPropDigestAlgorithm ) pDigestAlg = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropEncryptionAlgorithm ) ) + else if ( pValue[j].Name == sPropEncryptionAlgorithm ) pEncryptionAlg = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropStartKeyAlgorithm ) ) + else if ( pValue[j].Name == sPropStartKeyAlgorithm ) pStartKeyAlg = &( pValue[j].Value ); - else if ( pValue[j].Name.equals( sPropDerivedKeySize ) ) + else if ( pValue[j].Name == sPropDerivedKeySize ) pDerivedKeySize = &( pValue[j].Value ); } @@ -366,7 +366,7 @@ void ZipPackage::parseManifest() else if ( !m_bForceRecovery ) { // the mimetype stream should contain the information from manifest.xml - if ( !m_xRootFolder->GetMediaType().equals( aPackageMediatype ) ) + if ( m_xRootFolder->GetMediaType() != aPackageMediatype ) throw ZipIOException( THROW_WHERE "mimetype conflicts with manifest.xml, \"" @@ -1556,7 +1556,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey() throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) - if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) + if ( m_aStorageEncryptionKeys[nInd].Name == aNameToFind ) m_aStorageEncryptionKeys[nInd].Value >>= aResult; // empty keys are not allowed here diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index af4b1c9d56dc..5d110278c674 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -345,7 +345,7 @@ void ZipPackageFolder::saveContents( const OUString &rShortName = (*aCI).first; const ZipContentInfo &rInfo = *(*aCI).second; - if ( !bMimeTypeStreamStored || !rShortName.equals( aMimeTypeStreamName ) ) + if ( !bMimeTypeStreamStored || rShortName != aMimeTypeStreamName ) { if (rInfo.bFolder) { diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index fcec2f09d982..dc3129c67ce7 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -232,7 +232,7 @@ uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncodi throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" ); for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ ) - if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) ) + if ( m_aStorageEncryptionKeys[nInd].Name == aNameToFind ) m_aStorageEncryptionKeys[nInd].Value >>= aResult; // empty keys are not allowed here diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 8f0979f5f748..03e2451efbf8 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -127,14 +127,14 @@ bool OZipFileAccess::StringGoodForPattern_Impl( const OUString& aString, if ( aPattern[0].isEmpty() ) return true; - return aString.equals( aPattern[0] ); + return aString == aPattern[0]; } sal_Int32 nBeginInd = aPattern[0].getLength(); sal_Int32 nEndInd = aString.getLength() - aPattern[nInd].getLength(); if ( nEndInd >= nBeginInd - && ( nEndInd == aString.getLength() || aString.copy( nEndInd ).equals( aPattern[nInd] ) ) - && ( nBeginInd == 0 || aString.copy( 0, nBeginInd ).equals( aPattern[0] ) ) ) + && ( nEndInd == aString.getLength() || aString.copy( nEndInd ) == aPattern[nInd] ) + && ( nBeginInd == 0 || aString.copy( 0, nBeginInd ) == aPattern[0] ) ) { for ( sal_Int32 nCurInd = aPattern.getLength() - 2; nCurInd > 0; nCurInd-- ) { |