summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-09-23 12:45:40 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-09-24 05:48:25 +0000
commitb50465bfa2b94aee497ecc66b2ddb02fa64d2357 (patch)
tree345ac4b359d113a229bf50f5427f593d5c78d86a
parent39857cd7a2f5d819b100e8839b0f6d5d1b2d9cdd (diff)
PDF: Load the PDF when jumping to the image otherwise it will fail
If the PDF is not loaded before it jumps to the image then it fails to jump to the specified page and ends up showing the first one. Change-Id: I6061431e1fd9b743afaca3df0aec03dc6a1144bf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit e2e249b8bb399ef7bcf6fe3be0b4f2fc9fa18182) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/imageformats/pdf/qpdfiohandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/imageformats/pdf/qpdfiohandler.cpp b/src/plugins/imageformats/pdf/qpdfiohandler.cpp
index 98e4f4663..4f610935c 100644
--- a/src/plugins/imageformats/pdf/qpdfiohandler.cpp
+++ b/src/plugins/imageformats/pdf/qpdfiohandler.cpp
@@ -211,7 +211,7 @@ bool QPdfIOHandler::supportsOption(ImageOption option) const
bool QPdfIOHandler::jumpToImage(int frame)
{
qCDebug(qLcPdf) << Q_FUNC_INFO << frame;
- if (frame < 0 || frame >= m_doc.pageCount())
+ if (frame < 0 || frame >= imageCount())
return false;
m_page = frame;
return true;