summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svtools/source/graphic/grfmgr.cxx3
-rw-r--r--svx/source/svdraw/svdograf.cxx12
2 files changed, 12 insertions, 3 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index f7c6ec6b75cd..ec3c59bf0a6b 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -430,7 +430,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 585abe43ab3f..3e334fc32380 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() );
@@ -1347,8 +1347,16 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
aGraphic, aUserData, *pStream,
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;