Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit f36d1de1 authored by Fabio D'Urso's avatar Fabio D'Urso

pageview: React to Document::isAllowed(AllowFillForms) changes in notifySetup

parent 8e70c16f
......@@ -879,13 +879,26 @@ void PageView::selectAll()
void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setupFlags )
{
bool documentChanged = setupFlags & Okular::DocumentObserver::DocumentChanged;
const bool allowfillforms = d->document->isAllowed( Okular::AllowFillForms );
// reuse current pages if nothing new
if ( ( pageSet.count() == d->items.count() ) && !documentChanged && !( setupFlags & Okular::DocumentObserver::NewLayoutForPages ) )
{
int count = pageSet.count();
for ( int i = 0; (i < count) && !documentChanged; i++ )
{
if ( (int)pageSet[i]->number() != d->items[i]->pageNumber() )
{
documentChanged = true;
}
else
{
// even if the document has not changed, allowfillforms may have
// changed, so update all fields' "canBeFilled" flag
foreach ( FormWidgetIface * w, d->items[i]->formWidgets() )
w->setCanBeFilled( allowfillforms );
}
}
if ( !documentChanged )
return;
}
......@@ -923,7 +936,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
w->setPageItem( item );
w->setFormWidgetsController( d->formWidgetsController() );
w->setVisibility( false );
w->setCanBeFilled( d->document->isAllowed( Okular::AllowFillForms ) );
w->setCanBeFilled( allowfillforms );
item->formWidgets().insert( ff->id(), w );
hasformwidgets = true;
}
......
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