diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-06-06 00:51:10 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-07 10:45:35 +0200 |
commit | b10bc896bdceeb3f24269c485272fde2e669922f (patch) | |
tree | bfebeb8da6a98b0bca0bb93445feec45111404a4 /svx | |
parent | 17b95a2cb577731687e87126f22e6e64784e782c (diff) |
vcl: svx: misc improvements to pdfium importing
Change-Id: I58f2fd973a731b148f40b37139cd74bac097a7d2
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 2 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 8 | ||||
-rw-r--r-- | svx/source/xoutdev/_xoutbmp.cxx | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index be4ef4377859..6347c7dc1352 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -971,7 +971,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const Size& rSize, const OUS Size aSize(FRound(rSize.Width() * mfScaleX), FRound(rSize.Height() * mfScaleY)); if (eAlg == ALIGN_BASELINE) - aPos.AdjustY(-(FRound(aFontMetric.GetAscent() * mfScaleY))); + aPos.AdjustY(-FRound(aFontMetric.GetAscent() * mfScaleY)); else if (eAlg == ALIGN_BOTTOM) aPos.AdjustY(-nTextHeight); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 238b8dda3c91..988341d528e1 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -764,10 +764,11 @@ 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()) { - if (aGraphic.hasPdfData()) + const std::shared_ptr<uno::Sequence<sal_Int8>>& rPdfData = aGraphic.getPdfData(); + if (rPdfData && rPdfData->hasElements()) { // See if we have this PDF already, and avoid duplicate storage. - auto aIt = maExportPdf.find(aGraphic.getPdfData().get()); + auto aIt = maExportPdf.find(rPdfData.get()); if (aIt != maExportPdf.end()) { auto const& aURLAndMimePair = aIt->second; @@ -779,8 +780,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X // vcl::ImportPDF() possibly downgraded the PDF data from a // higher PDF version, while aGfxLink still contains the // original data provided by the user. - std::shared_ptr<uno::Sequence<sal_Int8>> pPdfData = aGraphic.getPdfData(); - pStream->WriteBytes(pPdfData->getConstArray(), pPdfData->getLength()); + pStream->WriteBytes(rPdfData->getConstArray(), rPdfData->getLength()); } else { diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index a37508c2fcd1..05998009e14a 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -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()) { - std::shared_ptr<uno::Sequence<sal_Int8>> pPdfData = rGraphic.getPdfData(); - pOutStream->WriteBytes(pPdfData->getConstArray(), pPdfData->getLength()); + const std::shared_ptr<uno::Sequence<sal_Int8>>& rPdfData = rGraphic.getPdfData(); + pOutStream->WriteBytes(rPdfData->getConstArray(), rPdfData->getLength()); aMedium.Commit(); if (!aMedium.GetError()) nErr = ERRCODE_NONE; |