[Libreoffice-commits] core.git: svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 30 11:59:33 UTC 2019


 svtools/source/misc/embedhlp.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 3a2c2ad839860dcb36e30ae1a2867e4d5e1036fc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jan 30 10:12:44 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jan 30 12:59:08 2019 +0100

    crashtesting: crash exporting ooo58458-1.odt to doc
    
    since...
    
    commit 8780fa41dcd164af244742461f4e57a4bcf4c7a4
    Date:   Tue Oct 30 12:23:36 2018 +0100
    
        svtools: fix lost replacement grpahic when updating it via OLE fails
    
    EmbeddedObjectRef::UpdateReplacementOnDemand is called by a chart during
    EmbeddedObjectRef::GetReplacement which resets mpImpl->pGraphic to null
    
    Change-Id: Id473b807582164eeb1791a26f6e0005a240f5989
    Reviewed-on: https://gerrit.libreoffice.org/67120
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 29878846dc20..c66291d79f81 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -434,12 +434,14 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
         mpImpl->mnGraphicVersion++;
     }
 
-    if (bUpdate && !*mpImpl->pGraphic && aOldGraphic)
+    // note that UpdateReplacementOnDemand which resets mpImpl->pGraphic to null may have been called
+    // e.g. when exporting ooo58458-1.odt to doc
+    if (bUpdate && (!mpImpl->pGraphic || !*mpImpl->pGraphic) && aOldGraphic)
     {
         // We used to have an old graphic, tried to update and the update
         // failed. Go back to the old graphic instead of having no graphic at
         // all.
-        (*mpImpl->pGraphic) = aOldGraphic;
+        mpImpl->pGraphic.reset(new Graphic(aOldGraphic));
         SAL_WARN("svtools.misc", "EmbeddedObjectRef::GetReplacement: update failed");
     }
 }


More information about the Libreoffice-commits mailing list