diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-12-25 20:59:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-12-25 21:00:07 +0000 |
commit | b50c438583c4e3f8865eb553694a209803c988f5 (patch) | |
tree | 9a348e760dc0656b3345ccd47c4902567c81bae0 /sw | |
parent | 826cf6f985e790d4e47eec37947eda1c733328c6 (diff) |
coverity#1426945 Unchecked dynamic_cast
Change-Id: I6c3d84a0fb1b4332f78a1c0ca04c9a7700b53c90
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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 ); |