summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/qa/unit/GraphicObjectTest.cxx4
-rw-r--r--svtools/source/graphic/grfcache.cxx12
2 files changed, 8 insertions, 8 deletions
diff --git a/svtools/qa/unit/GraphicObjectTest.cxx b/svtools/qa/unit/GraphicObjectTest.cxx
index 44a677617091..e304f8e79996 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()->hasElements());
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()->hasElements());
xComponent->dispose();
#endif
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index da41b631fc93..443cfa91aa90 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -154,7 +154,7 @@ private:
// VectorGraphicData support
VectorGraphicDataPtr maVectorGraphicData;
- uno::Sequence<sal_Int8> maPdfData;
+ std::shared_ptr<uno::Sequence<sal_Int8>> mpPdfData;
bool ImplInit( const GraphicObject& rObj );
void ImplFillSubstitute( Graphic& rSubstitute );
@@ -240,8 +240,8 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
else
{
mpBmpEx = new BitmapEx( rGraphic.GetBitmapEx() );
- if (rGraphic.getPdfData().hasElements())
- maPdfData = rGraphic.getPdfData();
+ if (rGraphic.hasPdfData() && rGraphic.getPdfData()->hasElements())
+ mpPdfData = rGraphic.getPdfData();
}
}
break;
@@ -287,8 +287,8 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
else if( mpBmpEx )
{
rSubstitute = *mpBmpEx;
- if (maPdfData.hasElements())
- rSubstitute.setPdfData(maPdfData);
+ if (mpPdfData && mpPdfData->hasElements())
+ rSubstitute.setPdfData(mpPdfData);
}
else if( mpAnimation )
{
@@ -384,7 +384,7 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut()
// #119176# also reset VectorGraphicData
maVectorGraphicData.reset();
- maPdfData = uno::Sequence<sal_Int8>();
+ mpPdfData.reset();
}
void GraphicCacheEntry::GraphicObjectWasSwappedIn( const GraphicObject& rObj )