summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-29 17:42:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-03-30 01:26:43 +0200
commitd74e54824e7ad130e2d221c8f951092462dba547 (patch)
treed7c7ce4bf0446473f4f8dc7c0ef319d7e60ee6bc
parent3ea82be2ca7e1d65c718097ccc674ae98ecd98c5 (diff)
forcepoint#36 avoid dangling SvTextShapeImportHelper in case of exceptions
Change-Id: Ibdbc047029c31d2b06d2349d68e1cbd9b15fd514 Reviewed-on: https://gerrit.libreoffice.org/52135 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rwxr-xr-xsw/qa/core/data/odt/fail/forcepoint-dtor-1.odtbin0 -> 220389 bytes
-rw-r--r--sw/source/filter/xml/xmlimp.cxx5
2 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/core/data/odt/fail/forcepoint-dtor-1.odt b/sw/qa/core/data/odt/fail/forcepoint-dtor-1.odt
new file mode 100755
index 000000000000..6442200cdeda
--- /dev/null
+++ b/sw/qa/core/data/odt/fail/forcepoint-dtor-1.odt
Binary files differ
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 1a4988339d5a..8def02edd002 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -431,6 +431,11 @@ SwXMLImport::SwXMLImport(
SwXMLImport::~SwXMLImport() throw ()
{
+ if (HasShapeImport())
+ {
+ SAL_WARN("sw", "endDocument skipped, dropping shapes now to avoid dangling SvTextShapeImportHelper pointing to this");
+ ClearShapeImport();
+ }
delete m_pDocElemTokenMap;
delete m_pTableElemTokenMap;
delete m_pTableCellAttrTokenMap;