diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-18 08:27:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-18 09:46:28 +0200 |
commit | 5fb66ae5595b7435e8954df31473fad15a74b8c2 (patch) | |
tree | 3b3f0ce3eafa10557a7e78b10851c97ee16c7ebf /tools | |
parent | 181a1b36ac728e3a43e054496ceb53fd3315abdb (diff) |
clang-tidy readability-simplify-boolean-expr
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64
Reviewed-on: https://gerrit.libreoffice.org/61902
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/datetime/datetime.cxx | 33 | ||||
-rw-r--r-- | tools/source/fsys/wldcrd.cxx | 5 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 5 |
3 files changed, 11 insertions, 32 deletions
diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx index 6f41e0523c56..00790ff78dd4 100644 --- a/tools/source/datetime/datetime.cxx +++ b/tools/source/datetime/datetime.cxx @@ -52,46 +52,31 @@ DateTime& DateTime::operator =( const css::util::DateTime& rUDateTime ) bool DateTime::IsBetween( const DateTime& rFrom, const DateTime& rTo ) const { - if ( (*this >= rFrom) && (*this <= rTo) ) - return true; - else - return false; + return (*this >= rFrom) && (*this <= rTo); } bool DateTime::operator >( const DateTime& rDateTime ) const { - if ( (Date::operator>( rDateTime )) || - (Date::operator==( rDateTime ) && tools::Time::operator>( rDateTime )) ) - return true; - else - return false; + return (Date::operator>( rDateTime )) || + (Date::operator==( rDateTime ) && tools::Time::operator>( rDateTime )); } bool DateTime::operator <( const DateTime& rDateTime ) const { - if ( (Date::operator<( rDateTime )) || - (Date::operator==( rDateTime ) && tools::Time::operator<( rDateTime )) ) - return true; - else - return false; + return (Date::operator<( rDateTime )) || + (Date::operator==( rDateTime ) && tools::Time::operator<( rDateTime )); } bool DateTime::operator >=( const DateTime& rDateTime ) const { - if ( (Date::operator>( rDateTime )) || - (Date::operator==( rDateTime ) && tools::Time::operator>=( rDateTime )) ) - return true; - else - return false; + return (Date::operator>( rDateTime )) || + (Date::operator==( rDateTime ) && tools::Time::operator>=( rDateTime )); } bool DateTime::operator <=( const DateTime& rDateTime ) const { - if ( (Date::operator<( rDateTime )) || - (Date::operator==( rDateTime ) && tools::Time::operator<=( rDateTime )) ) - return true; - else - return false; + return (Date::operator<( rDateTime )) || + (Date::operator==( rDateTime ) && tools::Time::operator<=( rDateTime )); } sal_Int64 DateTime::GetSecFromDateTime( const Date& rDate ) const diff --git a/tools/source/fsys/wldcrd.cxx b/tools/source/fsys/wldcrd.cxx index c0750b7098b1..2ea29eedddeb 100644 --- a/tools/source/fsys/wldcrd.cxx +++ b/tools/source/fsys/wldcrd.cxx @@ -104,10 +104,7 @@ bool WildCard::Matches( const OUString& rString ) const } } - if ( ImpMatch( aTmpWild.getStr(), aString.getStr() ) ) - return true; - else - return false; + return ImpMatch( aTmpWild.getStr(), aString.getStr() ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index ea855f98e9f0..61a16a5400e7 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -192,10 +192,7 @@ bool tools::Rectangle::IsInside( const Point& rPoint ) const bool tools::Rectangle::IsInside( const tools::Rectangle& rRect ) const { - if ( IsInside( rRect.TopLeft() ) && IsInside( rRect.BottomRight() ) ) - return true; - else - return false; + return IsInside( rRect.TopLeft() ) && IsInside( rRect.BottomRight() ); } bool tools::Rectangle::IsOver( const tools::Rectangle& rRect ) const |