diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp index a01434226..0e4ca05c7 100644 --- a/generators/poppler/generator_pdf.cpp +++ b/generators/poppler/generator_pdf.cpp @@ -513,8 +513,13 @@ Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLink, bool break; #endif +#ifdef HAVE_POPPLER_0_50 case Poppler::Link::OCGState: - Q_UNREACHABLE(); + link = new Okular::BackendOpaqueAction(); + link->setNativeId( QVariant::fromValue( static_cast( popplerLink ) ) ); + deletePopplerLink = false; + break; +#endif } #ifdef HAVE_POPPLER_0_64 diff --git a/ui/pageview.cpp b/ui/pageview.cpp index f22b2e15b..d96a0906b 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -4401,8 +4401,13 @@ QMenu* PageView::createProcessLinkMenu(PageViewItem *item, const QPoint &eventPo const Okular::ObjectRect * rect = item->page()->objectRect( Okular::ObjectRect::Action, nX, nY, item->uncroppedWidth(), item->uncroppedHeight() ); if ( rect ) { - QMenu *menu = new QMenu(this); const Okular::Action * link = static_cast< const Okular::Action * >( rect->object() ); + + if (!link) + return nullptr; + + QMenu *menu = new QMenu(this); + // creating the menu and its actions QAction * processLink = menu->addAction( i18n( "Follow This Link" ) ); processLink->setObjectName(QStringLiteral("ProcessLinkAction"));