From fbe8dbf1082b75e96014645706bd6bd31c8f2aa6 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 10 Jul 2007 23:15:14 +0000 Subject: [PATCH] promote RegularAreaRect from a typedef to a class, a bit more easy to eventually expand in the future svn path=/trunk/KDE/kdegraphics/okular/; revision=686281 --- core/area.cpp | 21 +++++++++++++++++++++ core/area.h | 14 +++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/core/area.cpp b/core/area.cpp index b06f2464a..1ad04a973 100644 --- a/core/area.cpp +++ b/core/area.cpp @@ -173,6 +173,27 @@ kdbgstream& operator<<( kdbgstream& str, const Okular::NormalizedRect& r ) return str; } +RegularAreaRect::RegularAreaRect() + : RegularArea< NormalizedRect, QRect >(), d( 0 ) +{ +} + +RegularAreaRect::RegularAreaRect( const RegularAreaRect& rar ) + : RegularArea< NormalizedRect, QRect >( rar ), d( 0 ) +{ +} + +RegularAreaRect::~RegularAreaRect() +{ +} + +RegularAreaRect& RegularAreaRect::operator=( const RegularAreaRect& rar ) +{ + RegularArea< NormalizedRect, QRect >::operator=( rar ); + return *this; +} + + HighlightAreaRect::HighlightAreaRect( const RegularAreaRect *area ) : RegularAreaRect(), s_id( -1 ) { diff --git a/core/area.h b/core/area.h index dba746064..30ef6aa27 100644 --- a/core/area.h +++ b/core/area.h @@ -676,7 +676,19 @@ void RegularArea::transform( const QMatrix &matrix ) givePtr( (*this)[i] )->transform( matrix ); } -typedef RegularArea RegularAreaRect; +class RegularAreaRect : public RegularArea< NormalizedRect, QRect > +{ + public: + RegularAreaRect(); + RegularAreaRect( const RegularAreaRect& rar ); + ~RegularAreaRect(); + + RegularAreaRect& operator=( const RegularAreaRect& rar ); + + private: + class Private; + Private * const d; +}; /** * This class stores the coordinates of a highlighting area