mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-13 13:11:41 +00:00
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
This commit is contained in:
parent
52a666f073
commit
769a70956f
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue