diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-12 11:21:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-28 11:23:34 +0200 |
commit | 9348b322a5c230dfcc2231661b73e480b130fcd9 (patch) | |
tree | 2c81a97d6f54229c87c5e2a37c73935ffc2527ac /ucb | |
parent | 5bcd18461b8cb63b477dbb74025374b4c963161a (diff) |
clang-tidy readability-simplify-boolean-expr
Change-Id: Iea7ab64683f0b29794d50d774cc482b54a00e70a
Reviewed-on: https://gerrit.libreoffice.org/36450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.cxx | 7 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpdirp.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpresultsetbase.cxx | 8 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_docmgr.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/ContentProperties.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/NeonSession.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx | 31 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 19 |
9 files changed, 26 insertions, 64 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 353de0253519..dbe645cf2e04 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -179,12 +179,9 @@ bool SAL_CALL CachedContentResultSet::CCRS_Cache if( !m_pResult ) return false; - if( ( m_pResult->FetchError & FetchError::ENDOFDATA ) + return ( m_pResult->FetchError & FetchError::ENDOFDATA ) && m_pResult->Orientation - && m_pResult->Rows.getLength() ) - return true; - - return false; + && m_pResult->Rows.getLength(); } bool SAL_CALL CachedContentResultSet::CCRS_Cache diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx index 032f96927f2b..915f1921443b 100644 --- a/ucb/source/ucp/ftp/ftpdirp.cxx +++ b/ucb/source/ucp/ftp/ftpdirp.cxx @@ -835,10 +835,7 @@ bool FTPDirectoryParser::parseVMS ( rEntry.m_aDate.SetNanoSec(0); // Skip <rest> part: - if (*p && (*p != '\t' && *p != ' ')) - return false; - - return true; + return !*p || *p == '\t' || *p == ' '; } } diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx index afb599be75eb..b95b18ad5df3 100644 --- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx @@ -143,12 +143,8 @@ ResultSetBase::dispose() sal_Bool SAL_CALL ResultSetBase::next() { - bool test; - if( ++m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) ) - test = true; - else - test = false; - return test; + ++m_nRow; + return m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()); } diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index d03b789821ca..1fd8247a9b14 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -583,10 +583,7 @@ bool OfficeDocumentsManager::isHelpDocument( return false; OUString sURL( xModel->getURL() ); - if ( sURL.match( "vnd.sun.star.help://" ) ) - return true; - - return false; + return sURL.match( "vnd.sun.star.help://" ); } diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index e90021b0ee8e..ef82213e7937 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -171,10 +171,7 @@ ContentProperties::ContentProperties( const ContentProperties & rOther ) bool ContentProperties::contains( const OUString & rName ) const { - if ( get( rName ) ) - return true; - else - return false; + return get( rName ) != nullptr; } diff --git a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx index c29c9b56e2d4..a17377734f12 100644 --- a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx @@ -1193,10 +1193,7 @@ bool DAVResourceAccess::handleException( const DAVException & e, int errorCount case SC_SERVICE_UNAVAILABLE: // retry, the service may become available case SC_INSUFFICIENT_STORAGE: // space may be freed, retry { - if ( errorCount < 3 ) - return true; - else - return false; + return errorCount < 3; } break; // all the other HTTP server response status codes are NOT retry diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx index 8f6a625ccfee..6e808ebe07d2 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.cxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx @@ -150,10 +150,7 @@ static bool noKeepAlive( const uno::Sequence< beans::NamedValue >& rFlags ) const beans::NamedValue* pValue( std::find_if(pAry,pAry+nLen, [] (beans::NamedValue const& rNV) { return rNV.Name == "KeepAlive"; } )); - if ( pValue != pAry+nLen && !pValue->Value.get<bool>() ) - return true; - - return false; + return pValue != pAry+nLen && !pValue->Value.get<bool>(); } struct NeonRequestContext diff --git a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx index a1a2c7a1c2cb..d2ce9673d375 100644 --- a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx @@ -307,28 +307,15 @@ static OUString decodeValue( const OUString & rValue ) // static bool UCBDeadPropertyValue::supportsType( const uno::Type & rType ) { - if ( ( rType != cppu::UnoType<OUString>::get() ) - && - ( rType != cppu::UnoType<sal_Int32>::get() ) - && - ( rType != cppu::UnoType<sal_Int16>::get() ) - && - ( rType != cppu::UnoType<bool>::get() ) - && - ( rType != cppu::UnoType<cppu::UnoCharType>::get() ) - && - ( rType != cppu::UnoType<sal_Int8>::get() ) - && - ( rType != cppu::UnoType<sal_Int64>::get() ) - && - ( rType != cppu::UnoType<float>::get() ) - && - ( rType != cppu::UnoType<double>::get() ) ) - { - return false; - } - - return true; + return rType == cppu::UnoType<OUString>::get() + || rType == cppu::UnoType<sal_Int32>::get() + || rType == cppu::UnoType<sal_Int16>::get() + || rType == cppu::UnoType<bool>::get() + || rType == cppu::UnoType<cppu::UnoCharType>::get() + || rType == cppu::UnoType<sal_Int8>::get() + || rType == cppu::UnoType<sal_Int64>::get() + || rType == cppu::UnoType<float>::get() + || rType == cppu::UnoType<double>::get(); } diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 1f4845d543d2..5e401027ace8 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -3774,16 +3774,13 @@ uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) // static bool Content::shouldAccessNetworkAfterException( const DAVException & e ) { - if ( ( e.getStatus() == SC_NOT_FOUND ) || - ( e.getStatus() == SC_GONE ) || - ( e.getError() == DAVException::DAV_HTTP_TIMEOUT ) || - ( e.getError() == DAVException::DAV_HTTP_LOOKUP ) || - ( e.getError() == DAVException::DAV_HTTP_CONNECT ) || - ( e.getError() == DAVException::DAV_HTTP_AUTH ) || - ( e.getError() == DAVException::DAV_HTTP_AUTHPROXY ) ) - return false; - - return true; + return !(( e.getStatus() == SC_NOT_FOUND ) || + ( e.getStatus() == SC_GONE ) || + ( e.getError() == DAVException::DAV_HTTP_TIMEOUT ) || + ( e.getError() == DAVException::DAV_HTTP_LOOKUP ) || + ( e.getError() == DAVException::DAV_HTTP_CONNECT ) || + ( e.getError() == DAVException::DAV_HTTP_AUTH ) || + ( e.getError() == DAVException::DAV_HTTP_AUTHPROXY )); } @@ -4275,7 +4272,7 @@ void Content::getResourceOptions( ) ) { - *networkAccessAllowed = *networkAccessAllowed && false; + *networkAccessAllowed = false; } } rDAVOptions = aDAVOptions; |