[Libreoffice-commits] core.git: writerfilter/source
Caolán McNamara
caolanm at redhat.com
Tue Jan 17 11:51:04 UTC 2017
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
New commits:
commit 4b3e8de6b3cb971b02aa0cb90aceb9e104071d3b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 17 11:48:17 2017 +0000
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
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3278f92..dca9bfc 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;
More information about the Libreoffice-commits
mailing list