summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-03-08 02:14:11 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-03-08 05:20:17 +0000
commitd062f097cc48bd53247b7fb0c677d90fcc430ab7 (patch)
treef76495b2c5ea562e618984c6d7421940b06b7a45 /sd/source/ui
parenta179f6c91692076e7e17babf4890638caa398384 (diff)
Simplify usage of BinaryDataContainer
It is always used to store data read from streams Change-Id: I613bc446eaadf98d2b1c012002d38f23d79a40ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148450 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/view/sdview3.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 0cbd41b00950..6a1b776f4ead 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -691,13 +691,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
Graphic aGraphic;
if (vcl::ImportPDF(*xStm, aGraphic))
{
- std::unique_ptr<sal_uInt8[]> pGraphicContent;
-
const sal_Int32 nGraphicContentSize(xStm->Tell());
- pGraphicContent.reset(new sal_uInt8[nGraphicContentSize]);
xStm->Seek(0);
- xStm->ReadBytes(pGraphicContent.get(), nGraphicContentSize);
- aGraphic.SetGfxLink(std::make_shared<GfxLink>(std::move(pGraphicContent), nGraphicContentSize, GfxLinkType::NativePdf));
+ BinaryDataContainer aGraphicContent(*xStm, nGraphicContentSize);
+ aGraphic.SetGfxLink(std::make_shared<GfxLink>(aGraphicContent, GfxLinkType::NativePdf));
InsertGraphic(aGraphic, mnAction, aInsertPos, nullptr, nullptr);
bReturn = true;