summaryrefslogtreecommitdiff
path: root/sc
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 /sc
parent85d34beec5f8196896487c96028b2dc2ce3cf6c8 (diff)
Deleting a null pointer is safe
Diffstat (limited to 'sc')
-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
3 files changed, 3 insertions, 5 deletions
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