[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - include/vcl svx/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sun May 31 18:30:39 UTC 2020


 include/vcl/vectorgraphicdata.hxx |    2 +-
 svx/source/svdraw/svdedtv2.cxx    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c4226858298f898843efa568305c2e4d0a619be2
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun May 31 20:25:11 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sun May 31 20:25:11 2020 +0200

    tdf#133547 Fix breaking of PDF graphic objects
    
    ImpSdrPdfImport did not handle -1 as the page number correctly.
    When the page number is -1 it means it was never explicitly set
    and should be treated as page with index 0 most of the time. So
    instead of allowing -1 as the page index, return it as 0 already
    in Graphic (VectorGraphicData).
    
    Change-Id: I3813f3ceeb5e41cb06fc40d67297d2439d7f3407

diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx
index 62e7617cdb56..5ee8a54577a6 100644
--- a/include/vcl/vectorgraphicdata.hxx
+++ b/include/vcl/vectorgraphicdata.hxx
@@ -110,7 +110,7 @@ public:
     const BitmapEx& getReplacement() const;
     BitmapChecksum GetChecksum() const;
 
-    sal_Int32 getPageIndex() const { return mnPageIndex; }
+    sal_Int32 getPageIndex() const { return std::max(0, mnPageIndex); }
 
     bool isPrimitiveSequenceCreated() const { return mbSequenceCreated; }
 };
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 661dd0779e18..de8c521b3119 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -2104,7 +2104,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo)
 #if HAVE_FEATURE_PDFIUM
                 aLogicRect = pGraf->GetLogicRect();
                 ImpSdrPdfImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect, aGraphic);
-                if (pGraf->getEmbeddedPageNumber() < aFilter.GetPageCount())
+                if (aGraphic.getPageNumber() < aFilter.GetPageCount())
                 {
                     nInsCnt = aFilter.DoImport(*pOL, nInsPos, aGraphic.getPageNumber(), pProgrInfo);
                 }


More information about the Libreoffice-commits mailing list