summaryrefslogtreecommitdiffstats
path: root/src/pdf/qpdfdocument.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-02-03 16:54:40 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-02-03 23:43:34 +0100
commitb700f65011eaecefc60f6a4760547ecfb5542e34 (patch)
tree9f9d701a0f4d9aba3287a6afefa9919c4b82f4c7 /src/pdf/qpdfdocument.cpp
parent17ee6a55f3178324b123e301e4854c413b640738 (diff)
QPdfDocumentPrivate::load(): check the first two pages
This seems to make QPdfLinkModel happy for some reason; otherwise QPdfLinkModelPrivate::update() does not succeed in getting page numbers when it calls FPDFDest_GetDestPageIndex(). Amends 9231d3444555945297857ee4aae05919083ea479 Change-Id: Iaed3301a1ab304ac9813c3b605b2f9c7465bf8e7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/pdf/qpdfdocument.cpp')
-rw-r--r--src/pdf/qpdfdocument.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 69dc6e9ad..3719938a2 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -211,8 +211,9 @@ void QPdfDocumentPrivate::load(QIODevice *newDevice, bool transferDeviceOwnershi
emit q->pageCountChanged(pageCount);
}
- // If it's a local file, and the first page is available, probably the whole document is available.
- if (checkPageComplete(0)) {
+ // If it's a local file, and the first couple of pages are available,
+ // probably the whole document is available.
+ if (checkPageComplete(0) && (pageCount < 2 || checkPageComplete(1))) {
setStatus(QPdfDocument::Ready);
} else {
updateLastError();