summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2016-10-17 11:02:49 (GMT)
committerAlbert Astals Cid <aacid@kde.org>2016-10-17 11:02:49 (GMT)
commitf943f9ee8b5cc5c2e2b049cf223040608891aa64 (patch)
tree753bdda6baabdb23c3cf33fa86a7511a8e453144
parent75c387c62c8a1132f4101a1964c05dc8b034433c (diff)
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
-rw-r--r--core/area.h26
-rw-r--r--ui/pageviewannotator.cpp2
2 files changed, 2 insertions, 26 deletions
diff --git a/core/area.h b/core/area.h
index 1f7b10d..936c266 100644
--- a/core/area.h
+++ b/core/area.h
@@ -655,9 +655,6 @@ void RegularArea<NormalizedShape, Shape>::simplify()
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::isNull() const
{
- if ( !this )
- return false;
-
if ( this->isEmpty() )
return false;
@@ -672,9 +669,6 @@ bool RegularArea<NormalizedShape, Shape>::isNull() const
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::intersects( const NormalizedShape& rect ) const
{
- if ( !this )
- return false;
-
if ( this->isEmpty() )
return false;
@@ -689,9 +683,6 @@ bool RegularArea<NormalizedShape, Shape>::intersects( const NormalizedShape& rec
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::intersects( const RegularArea<NormalizedShape,Shape> *area ) const
{
- if ( !this )
- return false;
-
if ( this->isEmpty() )
return false;
@@ -712,9 +703,6 @@ bool RegularArea<NormalizedShape, Shape>::intersects( const RegularArea<Normaliz
template <class NormalizedShape, class Shape>
void RegularArea<NormalizedShape, Shape>::appendArea( const RegularArea<NormalizedShape, Shape> *area )
{
- if ( !this )
- return;
-
typename QList<NormalizedShape>::const_iterator areaIt = area->begin(), areaItEnd = area->end();
for ( ; areaIt != areaItEnd; ++areaIt )
this->append( *areaIt );
@@ -724,9 +712,6 @@ void RegularArea<NormalizedShape, Shape>::appendArea( const RegularArea<Normaliz
template <class NormalizedShape, class Shape>
void RegularArea<NormalizedShape, Shape>::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<NormalizedShape, Shape>::appendShape( const NormalizedShape& sh
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::contains( double x, double y ) const
{
- if ( !this )
- return false;
-
if ( this->isEmpty() )
return false;
@@ -816,9 +798,6 @@ bool RegularArea<NormalizedShape, Shape>::contains( double x, double y ) const
template <class NormalizedShape, class Shape>
bool RegularArea<NormalizedShape, Shape>::contains( const NormalizedShape& shape ) const
{
- if ( !this )
- return false;
-
if ( this->isEmpty() )
return false;
@@ -828,7 +807,7 @@ bool RegularArea<NormalizedShape, Shape>::contains( const NormalizedShape& shape
template <class NormalizedShape, class Shape>
QList<Shape> RegularArea<NormalizedShape, Shape>::geometry( int xScale, int yScale, int dx, int dy ) const
{
- if ( !this || this->isEmpty() )
+ if ( this->isEmpty() )
return QList<Shape>();
QList<Shape> ret;
@@ -847,9 +826,6 @@ QList<Shape> RegularArea<NormalizedShape, Shape>::geometry( int xScale, int ySca
template <class NormalizedShape, class Shape>
void RegularArea<NormalizedShape, Shape>::transform( const QTransform &matrix )
{
- if ( !this )
- return;
-
if ( this->isEmpty() )
return;
diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp
index 699f068..3a3cd18 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<QRect> geom = newselection->geometry( (int)xScale, (int)yScale );
QRect newrect;