diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-31 20:25:11 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-01 07:16:44 +0200 |
commit | 573de30566e4477c8dc09abec08f1082d16c74bc (patch) | |
tree | d04107a69ef6544ae4133bccafc03812e947ea5e /include | |
parent | d585cad3e63c894aba33993ad970ca5452fdfcc0 (diff) |
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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95227
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/vectorgraphicdata.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx index 62e7617cdb56..8fce6666e6e8 100644 --- a/include/vcl/vectorgraphicdata.hxx +++ b/include/vcl/vectorgraphicdata.hxx @@ -26,6 +26,7 @@ #include <rtl/ustring.hxx> #include <deque> #include <memory> +#include <algorithm> namespace com::sun::star::graphic { class XPrimitive2D; } struct WmfExternal; @@ -110,7 +111,7 @@ public: const BitmapEx& getReplacement() const; BitmapChecksum GetChecksum() const; - sal_Int32 getPageIndex() const { return mnPageIndex; } + sal_Int32 getPageIndex() const { return std::max(sal_Int32(0), mnPageIndex); } bool isPrimitiveSequenceCreated() const { return mbSequenceCreated; } }; |