summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-04-02 22:12:28 +0200
committerJan Holesovsky <kendy@collabora.com>2019-04-03 17:54:02 +0200
commitba328bb8862810712393e2ce3329ce798db84541 (patch)
treeac28251c29c5b3d9d8e0be298d5d1a1da24a0dce /svx
parent8aca771675f7f76c84bbbd117b9dc1cc9c5ada8b (diff)
pdfium: Use std::vector to hold the PdfData.
This fixes the destruction of the static cache of the PDF data; without this, there were already missing uno runtime info. Change-Id: I877c9ccf96c4b7eabf3d643e17f324d86d987f94
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdograf.cxx2
-rw-r--r--svx/source/svdraw/svdpdf.cxx4
-rw-r--r--svx/source/svdraw/svdpdf.hxx4
-rw-r--r--svx/source/xml/xmlgrhlp.cxx4
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx4
5 files changed, 9 insertions, 9 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index df190f4861ee..f84d5e37f0ab 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1126,7 +1126,7 @@ bool SdrGrafObj::isEmbeddedPdfData() const
return pGraphic->GetGraphic().hasPdfData();
}
-std::shared_ptr<uno::Sequence<sal_Int8>> SdrGrafObj::getEmbeddedPdfData() const
+std::shared_ptr<std::vector<sal_Int8>> SdrGrafObj::getEmbeddedPdfData() const
{
return pGraphic->GetGraphic().getPdfData();
}
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index f9417709f541..64fbdb83dbf9 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -114,7 +114,7 @@ struct FPDFBitmapDeleter
using namespace com::sun::star;
ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools::Rectangle& rRect,
- const std::shared_ptr<uno::Sequence<sal_Int8>>& pPdfData)
+ const std::shared_ptr<std::vector<sal_Int8>>& pPdfData)
: maTmpList()
, mpVD(VclPtr<VirtualDevice>::Create())
, maScaleRect(rRect)
@@ -168,7 +168,7 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools:
FPDF_InitLibraryWithConfig(&aConfig);
// Load the buffer using pdfium.
- mpPdfDocument = FPDF_LoadMemDocument(mpPdfData->getConstArray(), mpPdfData->getLength(),
+ mpPdfDocument = FPDF_LoadMemDocument(mpPdfData->data(), mpPdfData->size(),
/*password=*/nullptr);
if (!mpPdfDocument)
{
diff --git a/svx/source/svdraw/svdpdf.hxx b/svx/source/svdraw/svdpdf.hxx
index d3ea4aece8c4..df8eac35bbe7 100644
--- a/svx/source/svdraw/svdpdf.hxx
+++ b/svx/source/svdraw/svdpdf.hxx
@@ -155,7 +155,7 @@ class ImpSdrPdfImport final
::std::vector<SdrObject*> maTmpList;
ScopedVclPtr<VirtualDevice> mpVD;
tools::Rectangle maScaleRect;
- const std::shared_ptr<css::uno::Sequence<sal_Int8>> mpPdfData;
+ const std::shared_ptr<std::vector<sal_Int8>> mpPdfData;
size_t mnMapScalingOfs; // from here on, not edited with MapScaling
std::unique_ptr<SfxItemSet> mpLineAttr;
std::unique_ptr<SfxItemSet> mpFillAttr;
@@ -232,7 +232,7 @@ class ImpSdrPdfImport final
public:
ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools::Rectangle& rRect,
- const std::shared_ptr<css::uno::Sequence<sal_Int8>>& pPdfData);
+ const std::shared_ptr<std::vector<sal_Int8>>& pPdfData);
~ImpSdrPdfImport();
int GetPageCount() const { return mnPageCount; }
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 38be563ba9c6..cdbda1db341c 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -558,8 +558,8 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName,
// 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());
+ std::shared_ptr<std::vector<sal_Int8>> pPdfData = aGraphic.getPdfData();
+ pStream->WriteBytes(pPdfData->data(), pPdfData->size());
// put into cache
maExportPdf[aGraphic.getPdfData().get()] = std::make_pair(rPictureStreamName, aMimeType);
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 3b7b5045b42b..63687c3a8313 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -192,8 +192,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())
{
- const std::shared_ptr<uno::Sequence<sal_Int8>>& rPdfData = rGraphic.getPdfData();
- pOutStream->WriteBytes(rPdfData->getConstArray(), rPdfData->getLength());
+ const std::shared_ptr<std::vector<sal_Int8>>& rPdfData = rGraphic.getPdfData();
+ pOutStream->WriteBytes(rPdfData->data(), rPdfData->size());
aMedium.Commit();
if (!aMedium.GetError())
nErr = ERRCODE_NONE;