summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-12-31 21:10:27 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-01-22 07:48:09 +0100
commit2d0cefae7a899e5ed62730468f4fb0f25d6297e3 (patch)
tree23343f34642e047fac0ea67e89ef03813c335f00 /filter/source
parent05aedcba6672979d317b540bbfa74f5c9b409402 (diff)
[API CHANGE] change XPdfDecomposer to use XBinaryDataContainer
Using BinaryDataContainer doesn't require to copy the data as it is compatible with what is used in Graphic, VectorGraphicData and GfxLink. Change-Id: I01589158ae6bf6ac407bde60f07952e3968e3970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109597 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/pdf/pdfdecomposer.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/filter/source/pdf/pdfdecomposer.cxx b/filter/source/pdf/pdfdecomposer.cxx
index ce1321a3ceb5..f4572f93742a 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -17,11 +17,14 @@
#include <vcl/pdfread.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/BinaryDataContainer.hxx>
+#include <vcl/BinaryDataContainerTools.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/graphic/XPdfDecomposer.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XBinaryDataContainer.hpp>
using namespace css;
@@ -38,7 +41,7 @@ public:
// XPdfDecomposer
uno::Sequence<uno::Reference<graphic::XPrimitive2D>> SAL_CALL
- getDecomposition(const uno::Sequence<sal_Int8>& xPdfData,
+ getDecomposition(const uno::Reference<util::XBinaryDataContainer>& xDataContainer,
const uno::Sequence<beans::PropertyValue>& xDecompositionParameters) override;
// XServiceInfo
@@ -49,8 +52,9 @@ public:
XPdfDecomposer::XPdfDecomposer(uno::Reference<uno::XComponentContext> const&) {}
-uno::Sequence<uno::Reference<graphic::XPrimitive2D>> SAL_CALL XPdfDecomposer::getDecomposition(
- const uno::Sequence<sal_Int8>& xPdfData, const uno::Sequence<beans::PropertyValue>& xParameters)
+uno::Sequence<uno::Reference<graphic::XPrimitive2D>> SAL_CALL
+XPdfDecomposer::getDecomposition(const uno::Reference<util::XBinaryDataContainer>& xDataContainer,
+ const uno::Sequence<beans::PropertyValue>& xParameters)
{
sal_Int32 nPageIndex = -1;
@@ -66,8 +70,10 @@ uno::Sequence<uno::Reference<graphic::XPrimitive2D>> SAL_CALL XPdfDecomposer::ge
if (nPageIndex < 0)
nPageIndex = 0;
+ BinaryDataContainer aDataContainer = vcl::convertUnoBinaryDataContainer(xDataContainer);
+
std::vector<BitmapEx> aBitmaps;
- int rv = vcl::RenderPDFBitmaps(xPdfData.getConstArray(), xPdfData.getLength(), aBitmaps,
+ int rv = vcl::RenderPDFBitmaps(aDataContainer.getData(), aDataContainer.getSize(), aBitmaps,
nPageIndex, 1);
if (rv == 0)
return {}; // happens if we do not have PDFium