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-05-22 12:17:10 +0200
commit23642eead069133d794bb1ac5cf9e7042d18d876 (patch)
treebe0598b977e2037051212627ae795ccc302728a4 /sd
parent42733c51385b6518678a8d5483c234909db2af40 (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 5fe44c4f0112..88e6f76f8308 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);