summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2012-01-26 01:02:30 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2012-01-26 03:03:08 +0900
commitbb51e8e72be424f0fd92350006c536a97fd4b210 (patch)
tree043f66cf4677e8fe69309be76565515e4a68f9a0
parent85d34beec5f8196896487c96028b2dc2ce3cf6c8 (diff)
Deleting a null pointer is safe
-rw-r--r--basctl/source/dlged/managelang.cxx3
-rw-r--r--basctl/source/dlged/propbrw.cxx3
-rw-r--r--basic/source/classes/sbxmod.cxx11
-rw-r--r--basic/source/sbx/sbxbase.cxx3
-rw-r--r--sc/source/core/data/column.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx3
-rw-r--r--sc/source/core/data/table4.cxx3
-rw-r--r--sw/source/core/text/itrform2.cxx3
-rw-r--r--sw/source/core/txtnode/atrfld.cxx3
-rw-r--r--sw/source/ui/docvw/edtwin.cxx8
10 files changed, 14 insertions, 28 deletions
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index eb16d60cab63..58fd9484d25e 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -197,8 +197,7 @@ void ManageLanguageDialog::ClearLanguageBox()
for ( i = 0; i < nCount; ++i )
{
LanguageEntry* pEntry = (LanguageEntry*)( m_aLanguageLB.GetEntryData(i) );
- if ( pEntry )
- delete pEntry;
+ delete pEntry;
}
m_aLanguageLB.Clear();
}
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 5ee9c2886289..4e1f90f1f1f6 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -308,8 +308,7 @@ Sequence< Reference< XInterface > >
// next element
pCurrent = pGroupIterator && pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
}
- if (pGroupIterator)
- delete pGroupIterator;
+ delete pGroupIterator;
}
sal_Int32 nCount = aInterfaces.size();
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index d61b63cd0621..40ae0d7bffbf 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -541,13 +541,10 @@ SbModule::SbModule( const String& rName, sal_Bool bVBACompat )
SbModule::~SbModule()
{
OSL_TRACE("Module named %s is destructing", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr() );
- if( pImage )
- delete pImage;
- if( pBreaks )
- delete pBreaks;
- if( pClassData )
- delete pClassData;
- mxWrapper = NULL;
+ delete pImage;
+ delete pBreaks;
+ delete pClassData;
+ mxWrapper = NULL;
}
uno::Reference< script::XInvocation >
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 303f382b6b56..e2987d0724cf 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -55,8 +55,7 @@ SbxAppData& GetSbxData_Impl()
SbxAppData::~SbxAppData()
{
- if( pBasicFormater )
- delete pBasicFormater;
+ delete pBasicFormater;
}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 6c1c8499d5de..50f0e95b153d 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -93,7 +93,7 @@ ScColumn::ScColumn() :
ScColumn::~ScColumn()
{
FreeAll();
- if (pAttrArray) delete pAttrArray;
+ delete pAttrArray;
}
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 66973deed196..991eb6b48a8e 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -273,8 +273,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, bool bRemove
}
}
- if (pDBCollection)
- delete pDBCollection;
+ delete pDBCollection;
pDBCollection = pNewDBCollection;
}
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index bc99c5ca03c3..dac41110b777 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -564,8 +564,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
{
if ( bGetPattern )
{
- if ( pNewPattern )
- delete pNewPattern;
+ delete pNewPattern;
if (bVertical) // rInner&:=nRow, rOuter&:=nCol
pSrcPattern = aCol[nCol].GetPattern(static_cast<SCROW>(nAtSrc));
else // rInner&:=nCol, rOuter&:=nRow
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;