diff options
| author | Caolán McNamara <caolanm@redhat.com> | 2016-07-05 10:52:29 +0100 | 
|---|---|---|
| committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-07 07:20:21 +0000 | 
| commit | 9fa1c8005ac02c1c2b75313fac168f77b42f0c17 (patch) | |
| tree | f6ef9f3438ff6c56a807030e131ea5f9ca25cdf9 | |
| parent | 16a431962905208116f8a4028e922557e3a24da3 (diff) | |
Resolves: tdf#100770 crash on loading specific docx
use same safeguards as RemoveLastParagraph does
Change-Id: I43ed4eb28f44654054fd266bc464840af7014fea
(cherry picked from commit 000263f799d4aa9ad21e63f474def55438ce601e)
Reviewed-on: https://gerrit.libreoffice.org/26943
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
| -rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 5450f1db901a..398f4ed75b90 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -329,7 +329,14 @@ void DomainMapper_Impl::RemoveDummyParaForTableInSection()      SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );      if (!pSectionContext)          return; -    uno::Reference< text::XTextCursor > xCursor = GetTopTextAppend()->createTextCursorByRange(pSectionContext->GetStartingRange()); + +    if (m_aTextAppendStack.empty()) +        return; +    uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend; +    if (!xTextAppend.is()) +        return; + +    uno::Reference< text::XTextCursor > xCursor = xTextAppend->createTextCursorByRange(pSectionContext->GetStartingRange());      // Remove the extra NumPicBullets from the document,      // which get attached to the first paragraph in the @@ -368,7 +375,7 @@ void DomainMapper_Impl::RemoveLastParagraph( )  {      if (m_aTextAppendStack.empty())          return; -    uno::Reference< text::XTextAppend >  xTextAppend = m_aTextAppendStack.top().xTextAppend; +    uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;      if (!xTextAppend.is())          return;      try  | 
