summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-03-25 10:28:53 +0100
committerTomaž Vajngerl <quikee@gmail.com>2020-03-25 16:32:06 +0100
commitb639a1b6407a879e9da44a3b87bbcade838c8a24 (patch)
tree823b227592ff30a268fdb3631d19d3457d228317
parent132834e2e9d5c8310ece4adbee84588e41bec35c (diff)
SdrGrafObj: don't check the primitive sequence for PDF to get metadata
For a PDF we create a BitmapPrimitive2D only, so it doesn't have any metadata in the primitive sequence itself, but a call to the getVectorGraphicData() method will render the PDF in order to create the BitmapPrimitive2D. This is a problem when we have multiple pages as we want them to be rendered on demand and not right away on load. This change short-circuits the gathering of metadata for PDF to prevent unnecessary early rendering of PDF pages. Change-Id: If5c286e88e72c4c0ba5083a98c7db707d207b6cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91034 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 74ebc6dcbc85ce9f49d7451e08d71a41f794f569) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90955 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r--svx/source/svdraw/svdograf.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 155ea15252b0..e24e1d8adebc 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -151,6 +151,12 @@ void SdrGrafObj::onGraphicChanged()
if (!rVectorGraphicDataPtr.get())
return;
+ // Skip for PDF as it is only a bitmap primitive in a sequence and
+ // doesn't contain metadata. However getting the primitive sequence
+ // will also trigger a premature rendering of the PDF.
+ if (rVectorGraphicDataPtr->getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
+ return;
+
const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVectorGraphicDataPtr->getPrimitive2DSequence());
if (aSequence.empty())