summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-11-22 22:02:18 +0100
committerAndras Timar <andras.timar@collabora.com>2014-11-23 14:32:38 +0100
commit4a4ecd95861b4b68913d0ae54851e2a34c649295 (patch)
tree131e92c1ccea06b2825940e181054a105b061cff /svx
parentf3ac9a6e7250f19ecf93bf5eafb7ab83e8123316 (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 an other related potential image loss situation: - Image preview is thrown when we actually have no package URL from we can import the image again. (cherry picked from commit f0b28806eebb1477066d44de49b5d1d61a8e84cf) Change-Id: Ib21f400eb6d28133e8598e6b201209e5dd1a976f Reviewed-on: https://gerrit.libreoffice.org/13048 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdograf.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index fcc9d14a1306..43ca601f6426 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -563,7 +563,7 @@ OUString SdrGrafObj::GetGrafStreamURL() const
void SdrGrafObj::ForceSwapIn() const
{
- if( mbIsPreview )
+ if( mbIsPreview && pGraphic->HasUserData() )
{
// removing preview graphic
const OUString aUserData( pGraphic->GetUserData() );
@@ -1372,9 +1372,15 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData))
{
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;