[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Mon Dec 25 21:02:32 UTC 2017


 sw/source/core/doc/docfmt.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit b50c438583c4e3f8865eb553694a209803c988f5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 25 20:59:46 2017 +0000

    coverity#1426945 Unchecked dynamic_cast
    
    Change-Id: I6c3d84a0fb1b4332f78a1c0ca04c9a7700b53c90

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index c344a2f6e966..c4bbf0b78ce3 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1027,10 +1027,9 @@ static bool lcl_SetTextFormatColl( const SwNodePtr& rpNode, void* pArgs )
         {
             // Check, if the list style of the paragraph will change.
             bool bChangeOfListStyleAtParagraph( true );
-            SwTextNode* pTNd( dynamic_cast<SwTextNode*>(pCNd) );
-            OSL_ENSURE( pTNd, "<lcl_SetTextFormatColl(..)> - text node expected -> crash" );
+            SwTextNode& rTNd(dynamic_cast<SwTextNode&>(*pCNd));
             {
-                SwNumRule* pNumRuleAtParagraph( pTNd->GetNumRule() );
+                SwNumRule* pNumRuleAtParagraph(rTNd.GetNumRule());
                 if ( pNumRuleAtParagraph )
                 {
                     const SwNumRuleItem& rNumRuleItemAtParagraphStyle =
@@ -1048,7 +1047,7 @@ static bool lcl_SetTextFormatColl( const SwNodePtr& rpNode, void* pArgs )
                 std::unique_ptr< SwRegHistory > pRegH;
                 if ( pPara->pHistory )
                 {
-                    pRegH.reset( new SwRegHistory( pTNd, *pTNd, pPara->pHistory ) );
+                    pRegH.reset(new SwRegHistory(&rTNd, rTNd, pPara->pHistory));
                 }
 
                 pCNd->ResetAttr( RES_PARATR_NUMRULE );


More information about the Libreoffice-commits mailing list