[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/kpdf
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2005-09-16 20:30:19
Message-ID: 1126902619.176326.32012.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 461203 by aacid:

add guards to check the document is opened because that slots can not be called from \
the ui when there's no document, but they can be called by dcop


 M  +6 -4      part.cpp  


--- trunk/KDE/kdegraphics/kpdf/part.cpp #461202:461203
@@ -615,24 +615,26 @@
 
 void Part::slotPreviousPage()
 {
-    if ( !m_document->currentPage() < 1 )
+    if ( m_document->isOpened() && !m_document->currentPage() < 1 )
         m_document->setViewportPage( m_document->currentPage() - 1 );
 }
 
 void Part::slotNextPage()
 {
-    if ( m_document->currentPage() < (m_document->pages() - 1) )
+    if ( m_document->isOpened() && m_document->currentPage() < (m_document->pages() \
- 1) )  m_document->setViewportPage( m_document->currentPage() + 1 );
 }
 
 void Part::slotGotoFirst()
 {
-    m_document->setViewportPage( 0 );
+    if ( m_document->isOpened() )
+        m_document->setViewportPage( 0 );
 }
 
 void Part::slotGotoLast()
 {
-    m_document->setViewportPage( m_document->pages() - 1 );
+    if ( m_document->isOpened() )
+        m_document->setViewportPage( m_document->pages() - 1 );
 }
 
 void Part::slotHistoryBack()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic