summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-03-13 20:04:45 +0100
committerTomaž Vajngerl <quikee@gmail.com>2020-03-23 17:18:00 +0100
commit571755b3653bb06586e7cae232d1ca943719a732 (patch)
tree62b51c6d529632159cf5bc90f21685863f03ec37 /include
parentd5215e23e9f90792718b4462e5c565e9839e932a (diff)
pdfium: support for pages when using PDF import with pdfium
Moving PDF to use VectorGraphicData in Graphic has temporary removed the support for showing different PDF pages when opening the PDF using pdfium (LO_IMPORT_USE_PDFIUM=1). This adds the support for back by specifying whcih PDF page to render when creating the VectorGraphicData (and can't be changd afterwards), which is used to create a Graphic and contains the PDF source data array. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90562 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 27ee05f860e8225a41e15e0853fcef00a9d7a621) Change-Id: Ib915216b8d4c0c063d0fead44ff156b1915a35d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90844 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/graph.hxx2
-rw-r--r--include/vcl/vectorgraphicdata.hxx12
2 files changed, 8 insertions, 6 deletions
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index aff67351e3d9..af77fc9cad1f 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -227,8 +227,6 @@ public:
const VectorGraphicDataPtr& getVectorGraphicData() const;
- /// Set the page number of the multi-page source this Graphic is rendered from.
- void setPageNumber(sal_Int32 nPageNumber);
/// Get the page number of the multi-page source this Graphic is rendered from.
sal_Int32 getPageNumber() const;
diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx
index ad402431181c..bdcfa8a9c4e0 100644
--- a/include/vcl/vectorgraphicdata.hxx
+++ b/include/vcl/vectorgraphicdata.hxx
@@ -69,6 +69,9 @@ private:
// extra:
std::unique_ptr<WmfExternal> mpExternalHeader;
+ // If the vector format has more pages this denotes which page to render
+ sal_Int32 mnPageIndex;
+
// on demand creators
void ensurePdfReplacement();
void ensureReplacement();
@@ -81,10 +84,9 @@ public:
VectorGraphicData(
const VectorGraphicDataArray& rVectorGraphicDataArray,
const OUString& rPath,
- VectorGraphicDataType eVectorDataType);
- VectorGraphicData(
- const OUString& rPath,
- VectorGraphicDataType eVectorDataType);
+ VectorGraphicDataType eVectorDataType,
+ sal_Int32 nPageIndex = -1);
+ VectorGraphicData(const OUString& rPath, VectorGraphicDataType eVectorDataType);
~VectorGraphicData();
/// compare op
@@ -106,6 +108,8 @@ public:
const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& getPrimitive2DSequence() const;
const BitmapEx& getReplacement() const;
BitmapChecksum GetChecksum() const;
+
+ sal_Int32 getPageIndex() const { return mnPageIndex; }
};
typedef std::shared_ptr< VectorGraphicData > VectorGraphicDataPtr;