From e2e249b8bb399ef7bcf6fe3be0b4f2fc9fa18182 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 23 Sep 2020 12:45:40 +0200 Subject: 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. Pick-to: 5.15 Change-Id: I6061431e1fd9b743afaca3df0aec03dc6a1144bf Reviewed-by: Shawn Rutledge --- src/plugins/imageformats/pdf/qpdfiohandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/imageformats/pdf') 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; -- cgit v1.2.3