summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-07 09:47:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-07 10:14:50 +0100
commit15c819987fbf1feb534884e0c3a1fbcda2575252 (patch)
treee6fc0b95dfbc726daf4a28e5301c7e9853b29715 /sc
parent88bb7256d16c490fd93d043ab2d1aefbc0f195a4 (diff)
coverity#735803 Explicit null dereferenced
Change-Id: Icc65234f1ba54b571097efc0b4e4537a7da99ea8
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index cbea8fe11414..3c00f78bfc16 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -848,6 +848,15 @@ void ScColorScale2FrmtEntry::SetInactive()
IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox )
{
+ Edit* pEd = NULL;
+ if (pBox == &maLbEntryTypeMin)
+ pEd = &maEdMin;
+ else if (pBox == &maLbEntryTypeMax)
+ pEd = &maEdMax;
+
+ if (!pEd)
+ return 0;
+
bool bEnableEdit = true;
sal_Int32 nPos = pBox->GetSelectEntryPos();
if(nPos < 2)
@@ -855,13 +864,7 @@ IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox )
bEnableEdit = false;
}
- Edit* pEd = NULL;
- if(pBox == &maLbEntryTypeMin)
- pEd = &maEdMin;
- else if(pBox == &maLbEntryTypeMax)
- pEd = &maEdMax;
-
- if(bEnableEdit)
+ if (bEnableEdit)
pEd->Enable();
else
pEd->Disable();