From f943f9ee8b5cc5c2e2b049cf223040608891aa64 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 17 Oct 2016 13:02:49 +0200 Subject: [PATCH] Remove the !this checks It's not part of the standard and GCC recently removed support for it Looking at the code it seems we only need one external check, let's hope i'm right :D --- core/area.h | 26 +------------------------- ui/pageviewannotator.cpp | 2 +- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/core/area.h b/core/area.h index 1f7b10d2a..936c266b5 100644 --- a/core/area.h +++ b/core/area.h @@ -655,9 +655,6 @@ void RegularArea::simplify() template bool RegularArea::isNull() const { - if ( !this ) - return false; - if ( this->isEmpty() ) return false; @@ -672,9 +669,6 @@ bool RegularArea::isNull() const template bool RegularArea::intersects( const NormalizedShape& rect ) const { - if ( !this ) - return false; - if ( this->isEmpty() ) return false; @@ -689,9 +683,6 @@ bool RegularArea::intersects( const NormalizedShape& rec template bool RegularArea::intersects( const RegularArea *area ) const { - if ( !this ) - return false; - if ( this->isEmpty() ) return false; @@ -712,9 +703,6 @@ bool RegularArea::intersects( const RegularArea void RegularArea::appendArea( const RegularArea *area ) { - if ( !this ) - return; - typename QList::const_iterator areaIt = area->begin(), areaItEnd = area->end(); for ( ; areaIt != areaItEnd; ++areaIt ) this->append( *areaIt ); @@ -724,9 +712,6 @@ void RegularArea::appendArea( const RegularArea void RegularArea::appendShape( const NormalizedShape& shape, MergeSide side ) { - if ( !this ) - return; - int size = this->count(); // if the list is empty, adds the shape normally if ( size == 0 ) @@ -799,9 +784,6 @@ void RegularArea::appendShape( const NormalizedShape& sh template bool RegularArea::contains( double x, double y ) const { - if ( !this ) - return false; - if ( this->isEmpty() ) return false; @@ -816,9 +798,6 @@ bool RegularArea::contains( double x, double y ) const template bool RegularArea::contains( const NormalizedShape& shape ) const { - if ( !this ) - return false; - if ( this->isEmpty() ) return false; @@ -828,7 +807,7 @@ bool RegularArea::contains( const NormalizedShape& shape template QList RegularArea::geometry( int xScale, int yScale, int dx, int dy ) const { - if ( !this || this->isEmpty() ) + if ( this->isEmpty() ) return QList(); QList ret; @@ -847,9 +826,6 @@ QList RegularArea::geometry( int xScale, int ySca template void RegularArea::transform( const QTransform &matrix ) { - if ( !this ) - return; - if ( this->isEmpty() ) return; diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp index 699f068c0..3a3cd182b 100644 --- a/ui/pageviewannotator.cpp +++ b/ui/pageviewannotator.cpp @@ -521,7 +521,7 @@ class TextSelectorEngine : public AnnotatorEngine delete selection; selection = 0; Okular::RegularAreaRect * newselection = m_pageView->textSelectionForItem( item(), start, end ); - if ( !newselection->isEmpty() ) + if ( newselection && !newselection->isEmpty() ) { const QList geom = newselection->geometry( (int)xScale, (int)yScale ); QRect newrect;