diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 6 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 018aef7e018b..48949649e8f5 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -282,7 +282,7 @@ sdr::contact::ViewContact* SdrGrafObj::CreateObjectSpecificViewContact() void SdrGrafObj::onGraphicChanged() { - if (!mpGraphicObject) // don't force swap-in for this + if (!mpGraphicObject || !mpGraphicObject->GetGraphic().isAvailable()) return; const VectorGraphicDataPtr& rVectorGraphicDataPtr = mpGraphicObject->GetGraphic().getVectorGraphicData(); @@ -551,12 +551,12 @@ bool SdrGrafObj::IsSwappedOut() const return false; } -const MapMode& SdrGrafObj::GetGrafPrefMapMode() const +MapMode SdrGrafObj::GetGrafPrefMapMode() const { return mpGraphicObject->GetPrefMapMode(); } -const Size& SdrGrafObj::GetGrafPrefSize() const +Size SdrGrafObj::GetGrafPrefSize() const { return mpGraphicObject->GetPrefSize(); } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index e420cc103274..971402aea6b0 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -493,15 +493,20 @@ OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const OUString& rFileName ) Graphic SvXMLGraphicHelper::ImplReadGraphic( const OUString& rPictureStorageName, const OUString& rPictureStreamName ) { - Graphic aGraphic; + Graphic aReturnGraphic; SvxGraphicHelperStream_Impl aStream( ImplGetGraphicStream( rPictureStorageName, rPictureStreamName ) ); - if( aStream.xStream.is() ) + if (aStream.xStream.is()) { - std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aStream.xStream )); - GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *pStream ); + GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); + std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(aStream.xStream)); + Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(*pStream); + if (aGraphic) + aReturnGraphic = aGraphic; + else + rGraphicFilter.ImportGraphic(aReturnGraphic, "", *pStream); } - return aGraphic; + return aReturnGraphic; } void SvXMLGraphicHelper::Init( const uno::Reference < embed::XStorage >& rXMLStorage, |