diff options
Diffstat (limited to 'svx/source/xml/xmlgrhlp.cxx')
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 04b92711aa69..3946bb94c3c0 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -555,7 +555,20 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aStream.xStream )); if( bUseGfxLink && aGfxLink.GetDataSize() && aGfxLink.GetData() ) - pStream->WriteBytes(aGfxLink.GetData(), aGfxLink.GetDataSize()); + { + const uno::Sequence<sal_Int8>& rPdfData = aGraphic.getPdfData(); + if (rPdfData.hasElements()) + { + // 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()); + bRet = (pStream->GetError() == 0); + } + else + pStream->WriteBytes(aGfxLink.GetData(), aGfxLink.GetDataSize()); + } else { if( aGraphic.GetType() == GraphicType::Bitmap ) |