summaryrefslogtreecommitdiffstats
path: root/kpdf/core/page.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-14 08:57:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-14 08:57:48 +0000
commit9116c29739aa3e15eb5e052d335b1f76700f6b32 (patch)
treec7301ec627341f5207fba729b3e2ad4e6cb9dfb0 /kpdf/core/page.cpp
parent47d455dd55be855e4cc691c32f687f723d9247ee (diff)
downloadtdegraphics-9116c29739aa3e15eb5e052d335b1f76700f6b32.tar.gz
tdegraphics-9116c29739aa3e15eb5e052d335b1f76700f6b32.zip
* kpdf page rotate options
* kdvi options dialog enhancements * djvu plugin for kviewshell git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1062216 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpdf/core/page.cpp')
-rw-r--r--kpdf/core/page.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/kpdf/core/page.cpp b/kpdf/core/page.cpp
index e6a847a8..70bc71bc 100644
--- a/kpdf/core/page.cpp
+++ b/kpdf/core/page.cpp
@@ -27,10 +27,40 @@ KPDFPage::KPDFPage( uint page, float w, float h, int r )
: m_number( page ), m_rotation( r ), m_width( w ), m_height( h ),
m_bookmarked( false ), m_text( 0 ), m_transition( 0 )
{
+ setRotation( r );
+}
+
+KPDFPage::~KPDFPage()
+{
+ deletePixmapsAndRects();
+ deleteHighlights();
+ delete m_text;
+ delete m_transition;
+}
+
+void KPDFPage::rotate90degrees()
+ {
+ float w = m_width;
+ m_width = m_height;
+ m_height = w;
+
+ // avoid Division-By-Zero problems in the program
+
+ if ( m_width <= 0 )
+ m_width = 1;
+ if ( m_height <= 0 )
+ m_height = 1;
+
+ deletePixmapsAndRects();
+ }
+
+void KPDFPage::setRotation( int r )
+{
// if landscape swap width <-> height (rotate 90deg CCW)
if ( r == 90 || r == 270 )
{
- m_width = h;
+ float w = m_width;
+ m_width = m_height;
m_height = w;
}
// avoid Division-By-Zero problems in the program
@@ -38,17 +68,10 @@ KPDFPage::KPDFPage( uint page, float w, float h, int r )
m_width = 1;
if ( m_height <= 0 )
m_height = 1;
-}
-KPDFPage::~KPDFPage()
-{
deletePixmapsAndRects();
- deleteHighlights();
- delete m_text;
- delete m_transition;
}
-
bool KPDFPage::hasPixmap( int id, int width, int height ) const
{
if ( !m_pixmaps.contains( id ) )