summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-06-08 22:54:48 -0400
committerJan Holesovsky <kendy@collabora.com>2019-03-26 11:54:43 +0100
commitc8f81dbb30e89a19bb7a82f8b52cc02b9049e717 (patch)
tree6db79c631157a12b99ed6bb2c0085ce501d82b24 /sd
parentd2fd88f8fab892185ab0d845fdba6e8fac1ad1c5 (diff)
vcl: share GfxLink
When importing PDF as images, we store the PDF stream in the GfxLink. For large PDFs storing a copy of the full PDF with each page is overkill. For example a 10MB PDF with 200 pages will consume 2GB of memory! Change-Id: I99913514cf5c562683080bc817668095bee69427 Reviewed-on: https://gerrit.libreoffice.org/55571 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/69624 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 26d7c70bdd54..a4747456123b 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -111,7 +111,8 @@ bool SdPdfFilter::Import()
const size_t nGraphicContentSize = aPdfData.getLength();
std::unique_ptr<sal_uInt8[]> pGraphicContent(new sal_uInt8[nGraphicContentSize]);
memcpy(pGraphicContent.get(), aPdfData.get(), nGraphicContentSize);
- GfxLink aGfxLink(std::move(pGraphicContent), nGraphicContentSize, GfxLinkType::NativePdf);
+ std::shared_ptr<GfxLink> pGfxLink(std::make_shared<GfxLink>(
+ std::move(pGraphicContent), nGraphicContentSize, GfxLinkType::NativePdf));
auto pPdfData = std::make_shared<uno::Sequence<sal_Int8>>(aPdfData);
mrDocument.CreateFirstPages();