summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-30 10:12:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-30 15:42:07 +0100
commit00bf2dc3ccf462174aeefca30e28a6a87a6b93ee (patch)
treef89186c83d82cb8376369e55414843bc5d836669 /svtools
parent1bb9126567becd881453da342315f139b4a564c9 (diff)
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/67128 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/embedhlp.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index fa7f7b791b1d..5f6593905648 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -431,12 +431,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");
}
}