From f4c80aaf3f2b97661ecf1cfd014aaa5ad00da846 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 10 Jun 2014 14:07:19 +0100 Subject: coverity#1209547 Unchecked dynamic_cast Change-Id: Ibf614156aeafcd74be444cf388e02a9273d38d5f --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8d09c69c4b4f..b3ef441c3238 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1039,7 +1039,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) dmapper_logger->attribute("isTextAppend", xTextAppend.is()); #endif - if(xTextAppend.is() && ! getTableManager( ).isIgnore() && pParaContext != NULL) + if (xTextAppend.is() && !getTableManager( ).isIgnore() && pParaContext != NULL) { try { @@ -1174,14 +1174,17 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) } m_bParaChanged = false; - if(!pParaContext->IsFrameMode()) + if (!pParaContext || !pParaContext->IsFrameMode()) { // If the paragraph is in a frame, it's not a paragraph of the section itself. m_bIsFirstParaInSection = false; m_bIsLastParaInSection = false; } - // Reset the frame properties for the next paragraph - pParaContext->ResetFrameProperties(); + if (pParaContext) + { + // Reset the frame properties for the next paragraph + pParaContext->ResetFrameProperties(); + } #ifdef DEBUG_DOMAINMAPPER dmapper_logger->endElement(); -- cgit