summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-11-22 19:51:02 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-11-22 21:53:11 +0100
commiteff1a2afdc5763abda103bea7dbc33c8aa20c724 (patch)
tree1f7c2afc64f7d2d54d74b5e7722304c8950048ce /svx
parent85086306939b6bebb8cf549966942f2e5a244388 (diff)
fdo#86573: Impress does not show pictures anymore
Regression from: 286e2f5c6ec829bc0987b1be7016699f7ef03e5e Sometimes SdrGrafObj import the image file just as a preview (with low resolution) and late when the real picture is needed it just throws this preview and tries to load the image again. This preview works only with package URL so in this case we should not forget that URL. Plus two other related potential image loss situation: - SetUserData() is called with empty image URL - Image preview is thrown when we actually have no package URL from we can import the image again. Change-Id: Ib21f400eb6d28133e8598e6b201209e5dd1a976f (cherry picked from commit f0b28806eebb1477066d44de49b5d1d61a8e84cf)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdograf.cxx12
1 files changed, 10 insertions, 2 deletions
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;