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 7992bd73a2)

Change-Id: I8f63d805a593a5950c8cb08eaeebd34e977b4700
Reviewed-on: https://gerrit.libreoffice.org/79552
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
This commit is contained in:
Michael Stahl
2019-09-25 13:18:01 +02:00
committed by Michael Stahl
parent bdc8fda4be
commit 0dd1d80f48

View File

@@ -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;