From 3d0988b8ca11eb8e80a3eae5f033512fb9bab0ce Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Oct 2014 09:25:55 +0100 Subject: coverity#982478 Dereference after null check maybe sort of can be considered a regression from commit 733b831970204059b9d89eff203551d6d3bf4bbe Date: Tue Jan 5 16:37:41 2010 +0100 swunolocking1: swtypes.hxx: rename frame anchor types enum RndStdIds: rename frame anchor types (FLY_*) to be more intuitive. where if (0 == (pAnchorPos = pAnch->GetCntntAnchor())) bCallMake = sal_False; turned to if (pAnchorPos) bCallMake = sal_False; but there would always be a following de-ref of a potential NULL pAnchorPos which wasn't FLY_AT_PAGE Change-Id: I808b4f178887ab6149e38bab6e36eb68d7a1eb29 --- sw/source/core/doc/doclay.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 865324ac2bf5..288ba1fa0fa9 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -304,7 +304,6 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, SwFrmFmt* pFrmFmt, bool bCalledFromShell ) { SwFlyFrmFmt* pFmt = 0; - bool bCallMake = true; if ( !pAnchorPos && (FLY_AT_PAGE != eAnchorType) ) { const SwFmtAnchor* pAnch; @@ -316,15 +315,11 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, if ( (FLY_AT_PAGE != pAnch->GetAnchorId()) ) { pAnchorPos = pAnch->GetCntntAnchor(); - if (pAnchorPos) - { - bCallMake = false; - } } } } - if( bCallMake ) + if (pAnchorPos) { if( !pFrmFmt ) pFrmFmt = getIDocumentStylePoolAccess().GetFrmFmtFromPool( RES_POOLFRM_FRAME ); -- cgit