summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-06-21 21:33:56 +0200
committerAshod Nakashian <ashnakash@gmail.com>2018-06-22 14:26:04 +0200
commit121052be218f15d81772a1cbb2208189563a8aa6 (patch)
tree990fc4a0071b4bd2d604acf61cca92361009d109 /sd
parent121ba866e0d4cc9d4e7e51546aeda561f4267cd3 (diff)
pdfium: Share the GfxLink for PDF files.
Partially based on work by Ashod Nakashian, thanks! Change-Id: Id7e8c4543368b0caf3e459abaff8c53997779c83 Reviewed-on: https://gerrit.libreoffice.org/56265 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 01e6ee5623de..8ca237fd6345 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -111,7 +111,7 @@ 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();
@@ -127,7 +127,7 @@ bool SdPdfFilter::Import()
Graphic aGraphic(aBitmap);
aGraphic.setPdfData(pPdfData);
aGraphic.setPageNumber(nPageNumber);
- aGraphic.SetLink(aGfxLink);
+ aGraphic.SetSharedLink(pGfxLink);
aGraphic.setOriginURL(aFileName);
// Create the page and insert the Graphic.