summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-03 23:13:19 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-04 22:40:27 -0400
commit6d1c73b744e50f3cfc84c30378d2f6c74a6e528e (patch)
tree831885d042a099dd7b9ddf4f84e776d7f0d71291 /sc
parentd6edecd37c4fe71cdb7aea313ac1c7478c7920e4 (diff)
Calling delete on NULL pointer is safe.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/queryparam.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx
index 44d6201fe6c1..78959267a936 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -73,11 +73,8 @@ ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) :
ScQueryEntry::~ScQueryEntry()
{
delete pStr;
- if ( pSearchParam )
- {
- delete pSearchParam;
- delete pSearchText;
- }
+ delete pSearchParam;
+ delete pSearchText;
}
ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r )
@@ -90,11 +87,9 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r )
nField = r.nField;
nVal = r.nVal;
*pStr = *r.pStr;
- if ( pSearchParam )
- {
- delete pSearchParam;
- delete pSearchText;
- }
+
+ delete pSearchParam;
+ delete pSearchText;
pSearchParam = NULL;
pSearchText = NULL;
@@ -111,11 +106,9 @@ void ScQueryEntry::Clear()
nField = 0;
nVal = 0.0;
pStr->Erase();
- if ( pSearchParam )
- {
- delete pSearchParam;
- delete pSearchText;
- }
+
+ delete pSearchParam;
+ delete pSearchText;
pSearchParam = NULL;
pSearchText = NULL;
}