summaryrefslogtreecommitdiff
path: root/svtools/source/misc
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 12:59:08 +0100
commit3a2c2ad839860dcb36e30ae1a2867e4d5e1036fc (patch)
tree49d47dbbdae9cc19f1bc7ad2cbda7075e2c85b1d /svtools/source/misc
parent67b0fcea9d748c4dd8101036cbb2c587d65f0bf7 (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/67120 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/misc')
-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 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");
}
}