diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-11-17 22:13:42 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-11-17 22:45:10 +0400 |
commit | 3616dfb094089589b5c9082fc96702ad1155045f (patch) | |
tree | 60f96e277c910ccc0eb76e22f76d6a51c7a82cdc /sw/source/core/text | |
parent | 538c8cfc3f1df95cde6789f52a120c8de0a75511 (diff) |
redundant if not-null checks on delete
Diffstat (limited to 'sw/source/core/text')
-rw-r--r-- | sw/source/core/text/itradj.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/txtdrop.cxx | 3 |
4 files changed, 6 insertions, 13 deletions
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index a50246072bbb..19fb4d1ee278 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -597,8 +597,7 @@ SwMarginPortion *SwTxtAdjuster::CalcRightMargin( SwLineLayout *pCurrent, aCurrRect.Left( nLeftMar + nPrtWidth ); pFly = CalcFlyPortion( nRealWidth, aCurrRect ); } - if( pFly ) - delete pFly; + delete pFly; } SwMarginPortion *pRight = new SwMarginPortion( 0 ); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 53a092c6fce9..ee83603875e3 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -86,11 +86,8 @@ namespace { inline void ClearFly( SwTxtFormatInfo &rInf ) { - if( rInf.GetFly() ) - { - delete rInf.GetFly(); - rInf.SetFly(0); - } + delete rInf.GetFly(); + rInf.SetFly(0); } /************************************************************************* diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index d3604143742e..f9d69365b2dc 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -155,13 +155,11 @@ sal_Bool lcl_ConnectToPrev( xub_Unicode cCh, xub_Unicode cPrevCh ) SwLineLayout::~SwLineLayout() { Truncate(); - if( GetNext() ) - delete GetNext(); + delete pNext; if( pBlink ) pBlink->Delete( this ); delete pLLSpaceAdd; - if ( pKanaComp ) - delete pKanaComp; + delete pKanaComp; } /************************************************************************* diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 298a3e91e3bd..961931b79c52 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -116,8 +116,7 @@ SwDropSave::~SwDropSave() SwDropPortionPart::~SwDropPortionPart() { - if ( pFollow ) - delete pFollow; + delete pFollow; delete pFnt; } |