Bugfixing: optional content changed

This commit is contained in:
Jakub Melka
2020-01-02 12:06:09 +01:00
parent e9481fc446
commit 78b56ab007
4 changed files with 23 additions and 12 deletions

View File

@ -54,16 +54,10 @@ void PDFDrawSpaceController::setDocument(const PDFDocument* document, const PDFO
m_document = document;
m_fontCache.setDocument(document);
m_optionalContentActivity = optionalContentActivity;
connect(m_optionalContentActivity, &PDFOptionalContentActivity::optionalContentGroupStateChanged, this, &PDFDrawSpaceController::onOptionalContentGroupStateChanged);
recalculate();
}
}
void PDFDrawSpaceController::onOptionalContentGroupStateChanged()
{
emit pageImageChanged(true, { });
}
void PDFDrawSpaceController::setPageLayout(PageLayout pageLayout)
{
if (m_pageLayoutMode != pageLayout)
@ -423,6 +417,7 @@ void PDFDrawWidgetProxy::setDocument(const PDFDocument* document, const PDFOptio
m_compiler->stop();
m_textLayoutCompiler->stop();
m_controller->setDocument(document, optionalContentActivity);
connect(optionalContentActivity, &PDFOptionalContentActivity::optionalContentGroupStateChanged, this, &PDFDrawWidgetProxy::onOptionalContentGroupStateChanged);
m_compiler->start();
m_textLayoutCompiler->start();
}
@ -1196,4 +1191,11 @@ void PDFDrawWidgetProxy::onColorManagementSystemChanged()
emit pageImageChanged(true, { });
}
void PDFDrawWidgetProxy::onOptionalContentGroupStateChanged()
{
m_compiler->reset();
m_textLayoutCompiler->reset();
emit pageImageChanged(true, { });
}
} // namespace pdf