summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-02-03 15:09:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-02-03 15:20:30 +0100
commit17ee6a55f3178324b123e301e4854c413b640738 (patch)
tree509a475bd4ee6e540e8d8ebafc665e5d7fd78ec7
parent12c151f9873f85d6f4d4fc54372a239478248e8f (diff)
QPdfDocument::pageSize(): add checkPageComplete()
checkPageComplete() calls FPDFAvail_IsPageAvail(), which does some initialization that is necessary before PDFium is able to provide any information about that page. The static readImage() function in qquickpixmapcache.cpp calls QImageReader::size() before rendering, to determine the size of the image that will be read, and that ends up calling QPdfDocument::pageSize(); so it's important to "go to" that page before attempting to read its size. In summary, checkPageComplete() is the "go to page" function that must be called before any other page-specific function. Amends 9231d3444555945297857ee4aae05919083ea479 Change-Id: Idf5ba9d013b62395c284d055fbfe835fe949df79 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/pdf/qpdfdocument.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index 37eeb8426..69dc6e9ad 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -608,7 +608,7 @@ int QPdfDocument::pageCount() const
QSizeF QPdfDocument::pageSize(int page) const
{
QSizeF result;
- if (!d->doc)
+ if (!d->doc || !d->checkPageComplete(page))
return result;
const QPdfMutexLocker lock;