[Libreoffice-commits] core.git: Branch 'feature/perfwork5' - svtools/source svx/source

Zolnai Tamás tamas.zolnai at collabora.com
Sat Nov 22 11:18:21 PST 2014


 svtools/source/graphic/grfmgr.cxx |    3 ++-
 svx/source/svdraw/svdograf.cxx    |   12 +++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 878921749394f64306a1b0996a97400d10eaf553
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Sat Nov 22 20:13:20 2014 +0100

    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.
    
    (cherry picked from commit f0b28806eebb1477066d44de49b5d1d61a8e84cf)
    
    Conflicts:
    	svx/source/svdraw/svdograf.cxx
    
    Change-Id: Ib21f400eb6d28133e8598e6b201209e5dd1a976f

diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 51ac45c..278a2bf 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 7cf57b0..91bf6e1 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;


More information about the Libreoffice-commits mailing list