svx/source/svdraw/svdograf.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 74ebc6dcbc85ce9f49d7451e08d71a41f794f569
Author:     Tomaž Vajngerl <>
AuthorDate: Wed Mar 25 10:28:53 2020 +0100
Commit:     Tomaž Vajngerl <>
CommitDate: Wed Mar 25 13:41:59 2020 +0100

    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
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <>

diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index a924a9694a6e..0d298e27bd30 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -138,6 +138,12 @@ void SdrGrafObj::onGraphicChanged()
     if (!rVectorGraphicDataPtr.get())
+    // 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() == 
+        return;
     const drawinglayer::primitive2d::Primitive2DContainer 
     if (aSequence.empty())
Libreoffice-commits mailing list

Reply via email to