Commit 6e170312 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix crash when closing print preview dialog

BUGS: 415340
parent feb72a01
......@@ -1584,10 +1584,11 @@ QVariant PageView::capability( ViewCapability capability ) const
case ZoomModality:
return d->zoomMode;
case Continuous:
return d->aViewContinuous->isChecked();
return d->aViewContinuous ? d->aViewContinuous->isChecked() : true;
case ViewModeModality:
{
for (int i=0; i < d->aViewMode->menu()->actions().size(); ++i)
const int nActions = d->aViewMode ? d->aViewMode->menu()->actions().size() : 0;
for (int i=0; i < nActions; ++i)
{
const QAction* action = d->aViewMode->menu()->actions().at(i);
if ( action->isChecked() )
......@@ -1596,7 +1597,7 @@ QVariant PageView::capability( ViewCapability capability ) const
return QVariant();
}
case TrimMargins:
return d->aTrimMargins->isChecked();
return d->aTrimMargins ? d->aTrimMargins->isChecked() : false;
}
return QVariant();
}
......
Supports Markdown
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