summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-05-14 08:15:30 -0400
committerJan Holesovsky <kendy@collabora.com>2018-06-01 08:59:11 +0200
commit396e8bb3f0406c36bf0428c3e220aba7c5ab5f12 (patch)
treeed2daf2b170f12c0c27919c0f290a8d5659d79e8 /sd
parent52a0b46bfdc32e5c37b3d7343a42c6388f3d569d (diff)
svx: share PDF stream when saving imported PDF as images
Change-Id: I05dd9ccb8f61c795212f8c587ee0a69c3cd75cf6
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 307998073682..ade8bac0e1f0 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -109,6 +109,7 @@ bool SdPdfFilter::Import()
std::unique_ptr<sal_uInt8[]> pGraphicContent(new sal_uInt8[nGraphicContentSize]);
memcpy(pGraphicContent.get(), aPdfData.get(), nGraphicContentSize);
GfxLink aGfxLink(std::move(pGraphicContent), nGraphicContentSize, GfxLinkType::NativePdf);
+ auto pPdfData = std::make_shared<uno::Sequence<sal_Int8>>(aPdfData);
mrDocument.CreateFirstPages();
for (int i = 0; i < aBitmaps.size() - 1; ++i)
@@ -121,7 +122,7 @@ bool SdPdfFilter::Import()
{
// Create the Graphic and link the original PDF stream.
Graphic aGraphic(aBitmap);
- aGraphic.setPdfData(std::make_shared<uno::Sequence<sal_Int8>>(aPdfData));
+ aGraphic.setPdfData(pPdfData);
aGraphic.SetLink(aGfxLink);
aGraphic.setOriginURL(aFileName);