From fb8fba4a99e71ba9faa9d93dc126bae80baffdde Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 30 Aug 2017 09:22:45 +0100 Subject: Resolves tdf#112101 crash on particular file with office:event-listeners Change-Id: I99a007543f90f4024666d296e9a775f8cee15086 Reviewed-on: https://gerrit.libreoffice.org/41725 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/qa/core/data/odt/pass/tdf112101.odt | Bin 0 -> 1935 bytes xmloff/source/text/txtparai.cxx | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 sw/qa/core/data/odt/pass/tdf112101.odt diff --git a/sw/qa/core/data/odt/pass/tdf112101.odt b/sw/qa/core/data/odt/pass/tdf112101.odt new file mode 100644 index 000000000000..ca29bd732ea4 Binary files /dev/null and b/sw/qa/core/data/odt/pass/tdf112101.odt differ diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index b37db9a9d551..f2fad10da496 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -427,7 +427,7 @@ XMLImpHyperlinkContext_Impl::XMLImpHyperlinkContext_Impl( XMLImpHyperlinkContext_Impl::~XMLImpHyperlinkContext_Impl() { - if( mpHint != nullptr ) + if (mpHint) mpHint->SetEnd( GetImport().GetTextImport() ->GetCursorAsRange()->getStart() ); } @@ -441,7 +441,8 @@ SvXMLImportContext *XMLImpHyperlinkContext_Impl::CreateChildContext( { XMLEventsImportContext* pCtxt = new XMLEventsImportContext( GetImport(), nPrefix, rLocalName); - mpHint->SetEventsContext(pCtxt); + if (mpHint) + mpHint->SetEventsContext(pCtxt); return pCtxt; } else -- cgit v1.2.3