From 3c6a4fcbedf4fbb86e0a705ea18e1666606b7836 Mon Sep 17 00:00:00 2001 From: Christoph Feck Date: Fri, 31 May 2019 12:28:33 +0200 Subject: [PATCH 1/4] GIT_SILENT Upgrade KDE Applications version to 19.04.2. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87c77fbd0..503dc96da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0) # KDE Application Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "19") set (KDE_APPLICATIONS_VERSION_MINOR "04") -set (KDE_APPLICATIONS_VERSION_MICRO "1") +set (KDE_APPLICATIONS_VERSION_MICRO "2") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") project(okular VERSION 1.7.${KDE_APPLICATIONS_VERSION_MICRO}) From f3f7ca79fcf1ae3521ed9b7d8b586f3d45b8a487 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 22 Jun 2019 12:35:17 +0200 Subject: [PATCH 2/4] Fix crash for rects that don't have an action It shouldn't really happen, but in some cases it does, so be protective BUGS: 408849 --- ui/pageview.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 18a2bf9ff..72ce80969 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -4429,8 +4429,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("ProcessLinkAction"); From ea2a7b264f3135b9ea5f82a877c725f0b7491365 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 22 Jun 2019 12:36:33 +0200 Subject: [PATCH 3/4] PDF: Finish support for Optional Content state change links I implemented this 3 years ago, but for some reason forgot to commit this part ^_^ CCBUGS: 408849 --- generators/poppler/generator_pdf.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp index 6bce88c8c..259e07b70 100644 --- a/generators/poppler/generator_pdf.cpp +++ b/generators/poppler/generator_pdf.cpp @@ -525,7 +525,12 @@ Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLink, bool #endif case Poppler::Link::OCGState: - Q_UNREACHABLE(); +#ifdef HAVE_POPPLER_0_50 + link = new Okular::BackendOpaqueAction(); + link->setNativeId( QVariant::fromValue( static_cast( popplerLink ) ) ); + deletePopplerLink = false; +#endif + break; } #ifdef HAVE_POPPLER_0_64 From 3c5b9b6f81fd46dc265aa400e0e2f3c70eda17ae Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 22 Jun 2019 12:39:42 +0200 Subject: [PATCH 4/4] Fix compile with older poppler --- generators/poppler/generator_pdf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp index 259e07b70..7f6149a1d 100644 --- a/generators/poppler/generator_pdf.cpp +++ b/generators/poppler/generator_pdf.cpp @@ -524,13 +524,13 @@ Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLink, bool break; #endif - case Poppler::Link::OCGState: #ifdef HAVE_POPPLER_0_50 + case Poppler::Link::OCGState: link = new Okular::BackendOpaqueAction(); link->setNativeId( QVariant::fromValue( static_cast( popplerLink ) ) ); deletePopplerLink = false; -#endif break; +#endif } #ifdef HAVE_POPPLER_0_64