Commit e1ba221c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix crash when page doesn't exist

svn path=/trunk/kdegraphics/kpdf/; revision=251001
parent 36c336d2
......@@ -93,6 +93,9 @@ Part::~Part()
void Part::slotNextPage()
{
m_currentPage = pdfpartview->pagesListBox->currentItem() + 1;
if ( m_doc && m_currentPage >= m_doc->getNumPages())
return;
pdfpartview->pagesListBox->setCurrentItem(m_currentPage);
m_outputDev->nextPage();
}
......@@ -100,6 +103,9 @@ void Part::slotNextPage()
void Part::slotPreviousPage()
{
m_currentPage = pdfpartview->pagesListBox->currentItem() - 1;
if ( m_currentPage < 0)
return;
pdfpartview->pagesListBox->setCurrentItem(m_currentPage );
m_outputDev->previousPage();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment