diff options
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 12 |
2 files changed, 11 insertions, 4 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 51ac45cc58b6..278a2bf19e01 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -429,7 +429,8 @@ void GraphicObject::SetUserData() void GraphicObject::SetUserData( const OUString& rUserData ) { maUserData = rUserData; - SetSwapState(); + if( !rUserData.isEmpty() ) + SetSwapState(); } void GraphicObject::SetSwapStreamHdl() diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 7cf57b07fd7d..91bf6e1a125d 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -562,7 +562,7 @@ OUString SdrGrafObj::GetGrafStreamURL() const void SdrGrafObj::ForceSwapIn() const { - if( mbIsPreview ) + if( mbIsPreview && pGraphic->HasUserData() ) { // removing preview graphic const OUString aUserData( pGraphic->GetUserData() ); @@ -1353,9 +1353,15 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO ) GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData.get())) { const OUString aNewUserData( pGraphic->GetUserData() ); - pGraphic->SetGraphic( aGraphic ); - pGraphic->SetUserData(); + if( mbIsPreview ) + { + pGraphic->SetUserData(aNewUserData); + } + else + { + pGraphic->SetUserData(); + } // Graphic successfully swapped in. pRet = GRFMGR_AUTOSWAPSTREAM_LOADED; |