summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/qa/unit/GraphicObjectTest.cxx4
-rw-r--r--svtools/source/graphic/grfcache.cxx10
2 files changed, 7 insertions, 7 deletions
diff --git a/svtools/qa/unit/GraphicObjectTest.cxx b/svtools/qa/unit/GraphicObjectTest.cxx
index e304f8e79996..afaf5d30f752 100644
--- a/svtools/qa/unit/GraphicObjectTest.cxx
+++ b/svtools/qa/unit/GraphicObjectTest.cxx
@@ -333,11 +333,11 @@ void GraphicObjectTest::testPdf()
}
CPPUNIT_ASSERT_MESSAGE("Missing image", pGraphicObject);
- CPPUNIT_ASSERT(pGraphicObject->GetGraphic().getPdfData()->hasElements());
+ CPPUNIT_ASSERT(!pGraphicObject->GetGraphic().getPdfData()->empty());
CPPUNIT_ASSERT(pGraphicObject->SwapOut());
CPPUNIT_ASSERT(pGraphicObject->SwapIn());
// This failed, swap out + swap in lost the PDF data.
- CPPUNIT_ASSERT(pGraphicObject->GetGraphic().getPdfData()->hasElements());
+ CPPUNIT_ASSERT(!pGraphicObject->GetGraphic().getPdfData()->empty());
xComponent->dispose();
#endif
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 0bb04b0c5d56..a93d822a2667 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -82,13 +82,13 @@ GraphicID::GraphicID( const GraphicObject& rObj )
}
else if (rGraphic.hasPdfData())
{
- std::shared_ptr<css::uno::Sequence<sal_Int8>> pPdfData = rGraphic.getPdfData();
+ std::shared_ptr<std::vector<sal_Int8>> pPdfData(rGraphic.getPdfData());
const BitmapEx& rBmpEx = rGraphic.GetBitmapEx();
mnID1 |= (rGraphic.getPageNumber() & 0x0fffffff);
mnID2 = rBmpEx.GetSizePixel().Width();
mnID3 = rBmpEx.GetSizePixel().Height();
- mnID4 = vcl_get_checksum(0, pPdfData->getConstArray(), pPdfData->getLength());
+ mnID4 = vcl_get_checksum(0, pPdfData->data(), pPdfData->size());
}
else if( rGraphic.IsAnimated() )
{
@@ -164,7 +164,7 @@ private:
// VectorGraphicData support
VectorGraphicDataPtr maVectorGraphicData;
- std::shared_ptr<uno::Sequence<sal_Int8>> mpPdfData;
+ std::shared_ptr<std::vector<sal_Int8>> mpPdfData;
bool ImplInit( const GraphicObject& rObj );
void ImplFillSubstitute( Graphic& rSubstitute );
@@ -250,7 +250,7 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
else
{
mpBmpEx = new BitmapEx( rGraphic.GetBitmapEx() );
- if (rGraphic.hasPdfData() && rGraphic.getPdfData()->hasElements())
+ if (rGraphic.hasPdfData() && !rGraphic.getPdfData()->empty())
mpPdfData = rGraphic.getPdfData();
}
}
@@ -297,7 +297,7 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
else if( mpBmpEx )
{
rSubstitute = *mpBmpEx;
- if (mpPdfData && mpPdfData->hasElements())
+ if (mpPdfData && !mpPdfData->empty())
rSubstitute.setPdfData(mpPdfData);
}
else if( mpAnimation )