diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-26 01:02:30 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-01-26 03:03:08 +0900 |
commit | bb51e8e72be424f0fd92350006c536a97fd4b210 (patch) | |
tree | 043f66cf4677e8fe69309be76565515e4a68f9a0 /sw | |
parent | New unit test for pivot table's date output handling. (diff) | |
download | core-bb51e8e72be424f0fd92350006c536a97fd4b210.tar.gz core-bb51e8e72be424f0fd92350006c536a97fd4b210.zip |
Deleting a null pointer is safe
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrfld.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 8 |
3 files changed, 4 insertions, 10 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 54a78254e048..b46d5b83354a 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1629,8 +1629,7 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos ) GetInfo().GetParaPortion()->GetReformat()->LeftMove( GetInfo().GetIdx() ); // delete master copy of rest portion - if ( pSaveFld ) - delete pSaveFld; + delete pSaveFld; xub_StrLen nNewStart = nStartPos + pCurr->GetLen(); diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 4789c5f01ee4..dc285ef90b1a 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -134,8 +134,7 @@ void SwFmtFld::RegisterToFieldType( SwFieldType& rType ) // #111840# void SwFmtFld::SetFld(SwField * _pField) { - if (NULL != pField) - delete pField; + delete pField; pField = _pField; Broadcast( SwFmtFldHint( this, SWFMTFLD_CHANGED ) ); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 77ec22116bdb..df44378cbad8 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -4602,11 +4602,7 @@ SwEditWin::~SwEditWin() delete pApplyTempl; rView.SetDrawFuncPtr(NULL); - if(pUserMarker) - { - delete pUserMarker; - } - + delete pUserMarker; delete pAnchorMarker; } @@ -5468,7 +5464,7 @@ void QuickHelpData::Move( QuickHelpData& rCpy ) bIsTip = rCpy.bIsTip; bIsAutoText = rCpy.bIsAutoText; - if( pCETID ) delete pCETID; + delete pCETID; pCETID = rCpy.pCETID; rCpy.pCETID = 0; |