diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-17 11:48:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-17 11:50:36 +0000 |
commit | 4b3e8de6b3cb971b02aa0cb90aceb9e104071d3b (patch) | |
tree | 8b378835d762af12d47266188f67491fd697341a | |
parent | 98e910fbecd3e4f4fee7b527f332a3f7219aebd9 (diff) |
Resolves: tdf#103063 don't crash on importing this file
doesn't go on to successfully open the docx, but it doesn't crash
Change-Id: Ie37c115f81908695142849bd366583a5692ea806
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 3278f9237538..dca9bfc6415e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1179,16 +1179,18 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap ) getTableManager( ).handle(xTextRange); m_aSmartTagHandler.handle(xTextRange); - // Get the end of paragraph character inserted - uno::Reference< text::XTextCursor > xCur = xTextRange->getText( )->createTextCursor( ); - if (rAppendContext.xInsertPosition.is()) - xCur->gotoRange( rAppendContext.xInsertPosition, false ); - else - xCur->gotoEnd( false ); - xCur->goLeft( 1 , true ); - uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY ); - CheckParaMarkerRedline( xParaEnd ); - + if (xTextRange.is()) + { + // Get the end of paragraph character inserted + uno::Reference< text::XTextCursor > xCur = xTextRange->getText( )->createTextCursor( ); + if (rAppendContext.xInsertPosition.is()) + xCur->gotoRange( rAppendContext.xInsertPosition, false ); + else + xCur->gotoEnd( false ); + xCur->goLeft( 1 , true ); + uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY ); + CheckParaMarkerRedline( xParaEnd ); + } } if( !bKeepLastParagraphProperties ) rAppendContext.pLastParagraphProperties = pToBeSavedProperties; |