diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-09-25 13:18:01 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-09-26 10:30:12 +0200 |
commit | 0dd1d80f48e94c4cd16095bace52664ce1e8a3a9 (patch) | |
tree | 824d54259641a9523cc7685465ad91458af24023 /writerfilter | |
parent | bdc8fda4be875ff9cfa9c3f4b5e40284a8637374 (diff) |
writerfilter: fix crash on import of tdf113230-1.docx
The SvxUnoTextBase::finishParagraph() returns null because there's no
GetTextForwarder(); in any case the ListId property isn't supported by
SvxUnoTextRange.
(regression from 7992bd73a2307edce96a145e954f8e4c3ab9f57d)
Change-Id: I8f63d805a593a5950c8cb08eaeebd34e977b4700
Reviewed-on: https://gerrit.libreoffice.org/79552
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 81acdf59ebce..f8d67f0710c1 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1527,7 +1527,8 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con xTextRange = xTextAppend->finishParagraph( comphelper::containerToSequence(aProperties) ); m_xPreviousParagraph.set(xTextRange, uno::UNO_QUERY); - if (isNumberingViaStyle || itNumberingRules != aProperties.end()) + if (m_xPreviousParagraph.is() && // null for SvxUnoTextBase + (isNumberingViaStyle || itNumberingRules != aProperties.end())) { assert(dynamic_cast<ParagraphPropertyMap*>(pPropertyMap.get())); sal_Int32 const nListId( isNumberingViaStyle @@ -1535,8 +1536,11 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con : static_cast<ParagraphPropertyMap*>(pPropertyMap.get())->GetListId()); if (ListDef::Pointer const& pList = m_pListTable->GetList(nListId)) { // styles could refer to non-existing lists... - if (AbstractListDef::Pointer const& pAbsList = - pList->GetAbstractDefinition()) + AbstractListDef::Pointer const& pAbsList = + pList->GetAbstractDefinition(); + if (pAbsList && + // SvxUnoTextRange doesn't have ListId + m_xPreviousParagraph->getPropertySetInfo()->hasPropertyByName("ListId")) { OUString paraId; m_xPreviousParagraph->getPropertyValue("ListId") >>= paraId; |