Commit 769a7095 authored by Pino Toscano's avatar Pino Toscano

add more checks against invalid viewports

fix crash when activating some of the toc items in the testcase of #176513 (still it would be nice to know why they are "void" items"...)

svn path=/trunk/KDE/kdegraphics/okular/; revision=890803
parent 52a666f0
......@@ -2370,6 +2370,12 @@ void Document::setViewportPage( int page, int excludeId, bool smoothMove )
void Document::setViewport( const DocumentViewport & viewport, int excludeId, bool smoothMove )
{
if ( !viewport.isValid() )
{
kDebug(OkularDebug) << "invalid viewport:" << viewport.toString();
return;
}
// if already broadcasted, don't redo it
DocumentViewport & oldViewport = *d->m_viewportIterator;
// disabled by enrico on 2005-03-18 (less debug output)
......
......@@ -112,7 +112,7 @@ void TOC::slotExecuted( const QModelIndex &index )
Okular::GotoAction action( externalFileName, viewport );
m_document->processAction( &action );
}
else
else if ( viewport.isValid() )
{
m_document->setViewport( viewport );
}
......
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