From 776a3f14f2d987312b926ebc1ad09321a3a87f0d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 11 Jun 2015 10:06:49 +0200 Subject: convert expressions like 'size() == 0' to 'empty()' Change-Id: Ia5c8c0f38a347f398d587970a22e03f29ffd37af --- package/source/xstor/ohierarchyholder.cxx | 10 +++++----- package/source/xstor/owriteablestream.cxx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'package/source/xstor') diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx index fd2b39f02159..cb827a137aa9 100644 --- a/package/source/xstor/ohierarchyholder.cxx +++ b/package/source/xstor/ohierarchyholder.cxx @@ -79,7 +79,7 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea if ( !( nStorageMode & embed::ElementModes::WRITE ) && ( nStreamMode & embed::ElementModes::WRITE ) ) throw io::IOException(); - if ( !aListPath.size() ) + if ( aListPath.empty() ) throw uno::RuntimeException(); OUString aNextName = *(aListPath.begin()); @@ -94,9 +94,9 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea if ( !xOwnStor.is() ) throw uno::RuntimeException(); - if ( !aListPath.size() ) + if ( aListPath.empty() ) { - if ( !aEncryptionData.size() ) + if ( aEncryptionData.empty() ) { uno::Reference< embed::XHierarchicalStorageAccess > xHStorage( xOwnStor, uno::UNO_QUERY_THROW ); xResult = xHStorage->openStreamElementByHierarchicalName( aNextName, nStreamMode ); @@ -162,7 +162,7 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( OStringList_Impl& aList { ::osl::MutexGuard aGuard( m_aMutex ); - if ( !aListPath.size() ) + if ( aListPath.empty() ) throw uno::RuntimeException(); OUString aNextName = *(aListPath.begin()); @@ -177,7 +177,7 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( OStringList_Impl& aList if ( !xOwnStor.is() ) throw uno::RuntimeException(); - if ( !aListPath.size() ) + if ( aListPath.empty() ) { xOwnStor->removeElement( aNextName ); } diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index e3cdbf20f9dd..59d8de64974a 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -76,7 +76,7 @@ namespace package bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 ) { - bool bResult = ( aHash1.size() && aHash1.size() == aHash2.size() ); + bool bResult = !aHash1.empty() && aHash1.size() == aHash2.size(); for ( ::comphelper::SequenceAsHashMap::const_iterator aIter = aHash1.begin(); bResult && aIter != aHash1.end(); ++aIter ) @@ -455,7 +455,7 @@ void OWriteStream_Impl::SetEncrypted( const ::comphelper::SequenceAsHashMap& aEn if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); - if ( !aEncryptionData.size() ) + if ( aEncryptionData.empty() ) throw uno::RuntimeException(); GetStreamProperties(); -- cgit