Commit 2a041d48 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix crash when adding stamps to the quick annotations

BUGS: 447409
parent 84d977dd
Pipeline #114520 passed with stage
in 27 minutes and 37 seconds
......@@ -439,16 +439,20 @@ void StampAnnotationWidget::createStyleWidget(QFormLayout *formlayout)
{
QWidget *widget = qobject_cast<QWidget *>(formlayout->parent());
Okular::Document *doc = Okular::AnnotationPrivate::get(m_stampAnn)->m_page->m_doc->m_parent;
if (doc->metaData(QStringLiteral("ShowStampsWarning")).toString() == QLatin1String("yes")) {
KMessageWidget *brokenStampSupportWarning = new KMessageWidget(widget);
brokenStampSupportWarning->setText(xi18nc("@info",
"<warning>experimental feature.<nl/>"
"Stamps inserted in PDF documents are not visible in PDF readers other than Okular.</warning>"));
brokenStampSupportWarning->setMessageType(KMessageWidget::Warning);
brokenStampSupportWarning->setWordWrap(true);
brokenStampSupportWarning->setCloseButtonVisible(false);
formlayout->insertRow(0, brokenStampSupportWarning);
const Okular::PagePrivate *const pagePrivate = Okular::AnnotationPrivate::get(m_stampAnn)->m_page;
if (pagePrivate) {
// Not all stamps are associated with pages, e.g. when we're creating a quick annotation tool
Okular::Document *doc = pagePrivate->m_doc->m_parent;
if (doc->metaData(QStringLiteral("ShowStampsWarning")).toString() == QLatin1String("yes")) {
KMessageWidget *brokenStampSupportWarning = new KMessageWidget(widget);
brokenStampSupportWarning->setText(xi18nc("@info",
"<warning>experimental feature.<nl/>"
"Stamps inserted in PDF documents are not visible in PDF readers other than Okular.</warning>"));
brokenStampSupportWarning->setMessageType(KMessageWidget::Warning);
brokenStampSupportWarning->setWordWrap(true);
brokenStampSupportWarning->setCloseButtonVisible(false);
formlayout->insertRow(0, brokenStampSupportWarning);
}
}
addOpacitySpinBox(widget, formlayout);
......
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