From 1f7b66104dcb8ccad3efd2bd116c42e090ee9981 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 31 Jul 2011 00:02:18 +0200 Subject: Some cppcheck cleaning --- ucb/source/cacher/cachedcontentresultset.cxx | 2 +- ucb/source/cacher/contentresultsetwrapper.cxx | 4 ++-- ucb/source/ucp/ftp/ftpurl.cxx | 6 +++--- ucb/source/ucp/webdav/DAVResourceAccess.cxx | 2 +- ucb/source/ucp/webdav/NeonLockStore.cxx | 2 +- ucb/source/ucp/webdav/NeonSession.cxx | 2 +- ucb/source/ucp/webdav/webdavcontent.cxx | 6 +++--- vbahelper/source/msforms/vbacontrols.cxx | 2 +- vbahelper/source/vbahelper/vbadocumentsbase.cxx | 2 +- xmlhelp/source/cxxhelp/provider/databases.cxx | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index c6005bb3b32c..6a296c4e3f98 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -809,7 +809,7 @@ sal_Bool SAL_CALL CachedContentResultSet m_bAfterLastApplied = nRow != m_nLastAppliedPos; } else - throw rEx; + throw; } return nRow == m_nLastAppliedPos; diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx b/ucb/source/cacher/contentresultsetwrapper.cxx index a66c288276e2..fbed827ad89f 100644 --- a/ucb/source/cacher/contentresultsetwrapper.cxx +++ b/ucb/source/cacher/contentresultsetwrapper.cxx @@ -616,7 +616,7 @@ void SAL_CALL ContentResultSetWrapper catch( Exception& rEx ) { m_pPropertyChangeListeners->removeInterface( aPropertyName, xListener ); - throw rEx; + throw; } } } @@ -667,7 +667,7 @@ void SAL_CALL ContentResultSetWrapper catch( Exception& rEx ) { m_pVetoableChangeListeners->removeInterface( rPropertyName, xListener ); - throw rEx; + throw; } } } diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 7ef4db27dca5..c022e584ac4a 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -420,7 +420,7 @@ namespace ftp { FILE* FTPURL::open() throw(curl_exception) { - if(!m_aPathSegmentVec.size()) + if(m_aPathSegmentVec.empty()) throw curl_exception(CURLE_FTP_COULDNT_RETR_FILE); CURL *curl = m_pFCP->handle(); @@ -597,7 +597,7 @@ rtl::OUString FTPURL::net_title() const // We were either denied access when trying to login to // an FTP server or when trying to change working directory // to the one given in the URL. - if(m_aPathSegmentVec.size()) + if(!m_aPathSegmentVec.empty()) // determine title form url aNetTitle = decodePathSegment(m_aPathSegmentVec.back()); else @@ -701,7 +701,7 @@ void FTPURL::mkdir(bool ReplaceExisting) const throw(curl_exception) { rtl::OString title; - if(m_aPathSegmentVec.size()) { + if(!m_aPathSegmentVec.empty()) { rtl::OUString titleOU = m_aPathSegmentVec.back(); titleOU = decodePathSegment(titleOU); title = rtl::OString(titleOU.getStr(), diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 9b02e5c562d6..4edc50831826 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -1172,7 +1172,7 @@ sal_Bool DAVResourceAccess::detectRedirectCycle( void DAVResourceAccess::resetUri() { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - if ( m_aRedirectURIs.size() > 0 ) + if ( !m_aRedirectURIs.empty() ) { std::vector< NeonUri >::const_iterator it = m_aRedirectURIs.begin(); diff --git a/ucb/source/ucp/webdav/NeonLockStore.cxx b/ucb/source/ucp/webdav/NeonLockStore.cxx index a57a4d124c95..9cb3ec9adabb 100644 --- a/ucb/source/ucp/webdav/NeonLockStore.cxx +++ b/ucb/source/ucp/webdav/NeonLockStore.cxx @@ -203,7 +203,7 @@ void NeonLockStore::removeLock( NeonLock * pLock ) m_aLockInfoMap.erase( pLock ); ne_lockstore_remove( m_pNeonLockStore, pLock ); - if ( m_aLockInfoMap.size() == 0 ) + if ( m_aLockInfoMap.empty() ) stopTicker(); } diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index ae54ff4386b7..de7f69c29358 100755 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -1702,7 +1702,7 @@ bool NeonSession::removeExpiredLocktoken( const rtl::OUString & inURL, PROPFIND( rEnv.m_aRequestURI, DAVZERO, aPropNames, aResources, rEnv ); - if ( aResources.size() == 0 ) + if ( aResources.empty() ) return false; std::vector< DAVPropertyValue >::const_iterator it diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index d4c32fc239d8..3d03500f02cd 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -1229,7 +1229,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( uno::Sequence< beans::Property > aProperties( rProperties.getLength() ); - if ( m_aFailedPropNames.size() > 0 ) + if ( !m_aFailedPropNames.empty() ) { sal_Int32 nProps = 0; sal_Int32 nCount = rProperties.getLength(); @@ -1268,7 +1268,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( ContentProperties::UCBNamesToDAVNames( aProperties, aPropNames ); - if ( aPropNames.size() > 0 ) + if ( !aPropNames.empty() ) { std::vector< DAVResource > resources; try @@ -1320,7 +1320,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( aHeaderNames, true /* bIncludeUnmatched */ ); - if ( aHeaderNames.size() > 0 ) + if ( !aHeaderNames.empty() ) { try { diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx index 309ff71e929f..543a4bfcd56f 100644 --- a/vbahelper/source/msforms/vbacontrols.cxx +++ b/vbahelper/source/msforms/vbacontrols.cxx @@ -128,7 +128,7 @@ public: virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { - return ( mControls.size() > 0 ); + return ( !mControls.empty() ); } // XNameAcess diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index d4d9ce700e66..261599da630b 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -189,7 +189,7 @@ public: virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { - return (m_documents.size() > 0); + return (!m_documents.empty()); } //XNameAccess diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 5b8979bb7b8d..0c3e8fd1b8a3 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -429,7 +429,7 @@ rtl::OUString Databases::getInstallPathAsURL() const std::vector< rtl::OUString >& Databases::getModuleList( const rtl::OUString& Language ) { - if( m_avModules.size() == 0 ) + if( m_avModules.empty() ) { rtl::OUString fileName,dirName = getInstallPathAsURL() + processLang( Language ); osl::Directory dirFile( dirName ); -- cgit