summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-03-17 15:33:54 -0400
committerJan Holesovsky <kendy@collabora.com>2018-06-07 10:45:17 +0200
commit9b11fdd36ec80f9d1ae0a05455745361e0ce9ced (patch)
tree857ad890a0ff1c96d707cb145fafd74b79d53603 /svx
parent99bbed5cd87af8ff1b7e3d197d937fb17af021e6 (diff)
pdf: share pdf data in Graphic
Change-Id: I8146aa4e206788afff71142e1877fd7a885f4652
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdograf.cxx2
-rw-r--r--svx/source/xml/xmlgrhlp.cxx6
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx6
3 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index cd80929059b7..2f8129b03257 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -433,7 +433,7 @@ const GraphicObject* SdrGrafObj::GetReplacementGraphicObject() const
{
const_cast< SdrGrafObj* >(this)->mpReplacementGraphicObject.reset(new GraphicObject(rVectorGraphicDataPtr->getReplacement()));
}
- else if (mpGraphicObject->GetGraphic().getPdfData().hasElements() ||
+ else if (mpGraphicObject->GetGraphic().hasPdfData() ||
mpGraphicObject->GetGraphic().GetType() == GraphicType::GdiMetafile)
{
// Replacement graphic for PDF and metafiles is just the bitmap.
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index a0f01b8671ac..c261e8450858 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -764,14 +764,14 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X
std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(aStream.xStream));
if (bUseGfxLink && aGfxLink.GetDataSize() && aGfxLink.GetData())
{
- const uno::Sequence<sal_Int8>& rPdfData = aGraphic.getPdfData();
- if (rPdfData.hasElements())
+ if (aGraphic.hasPdfData())
{
// The graphic has PDF data attached to it, use that.
// vcl::ImportPDF() possibly downgraded the PDF data from a
// higher PDF version, while aGfxLink still contains the
// original data provided by the user.
- pStream->WriteBytes(rPdfData.getConstArray(), rPdfData.getLength());
+ std::shared_ptr<uno::Sequence<sal_Int8>> pPdfData = aGraphic.getPdfData();
+ pStream->WriteBytes(pPdfData->getConstArray(), pPdfData->getLength());
}
else
{
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 55128d08f7d8..a37508c2fcd1 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -173,7 +173,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
}
// Write PDF data in original form if possible.
- if (rGraphic.getPdfData().hasElements() && rFilterName.equalsIgnoreAsciiCase("pdf"))
+ if (rGraphic.hasPdfData() && rFilterName.equalsIgnoreAsciiCase("pdf"))
{
if (!(nFlags & XOutFlags::DontAddExtension))
aURL.setExtension(rFilterName);
@@ -182,8 +182,8 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
SfxMedium aMedium(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::WRITE|StreamMode::SHARE_DENYNONE|StreamMode::TRUNC);
if (SvStream* pOutStream = aMedium.GetOutStream())
{
- uno::Sequence<sal_Int8> aPdfData = rGraphic.getPdfData();
- pOutStream->WriteBytes(aPdfData.getConstArray(), aPdfData.getLength());
+ std::shared_ptr<uno::Sequence<sal_Int8>> pPdfData = rGraphic.getPdfData();
+ pOutStream->WriteBytes(pPdfData->getConstArray(), pPdfData->getLength());
aMedium.Commit();
if (!aMedium.GetError())
nErr = ERRCODE_NONE;