summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-10 10:19:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-10 11:21:08 +0000
commit4817ee4f6f15a24b0a3f695111ff417de595882e (patch)
treef9ce7d5634ce6c61cb598b5f704aa50c5e8f2341 /sc
parent7afef62b72e91cff4d9684e6e717c9b03a37caf1 (diff)
coverity#1130441 Dereference before null check
Change-Id: I619cc45eccda4da9f9cb88028a3174d67e7011f9
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/data/postit.cxx5
2 files changed, 2 insertions, 5 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index fdbb1fa198e3..0f24c234c827 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6165,7 +6165,7 @@ void ScDocument::SetNote(const ScAddress& rPos, ScPostIt* pNote)
void ScDocument::SetNote(SCCOL nCol, SCROW nRow, SCTAB nTab, ScPostIt* pNote)
{
- return maTabs[nTab]->aCol[nCol].SetCellNote(nRow, pNote);
+ return maTabs[nTab]->aCol[nCol].SetCellNote(nRow, pNote);
}
bool ScDocument::HasNote(const ScAddress& rPos)
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 374d54692f11..4922b1eeb75e 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -906,10 +906,7 @@ ScPostIt* ScNoteUtil::CreateNoteFromObjectData(
rDoc.SetNote(rPos, pNote);
- if(pNote)
- return pNote;
- else
- return NULL;
+ return pNote;
}
ScPostIt* ScNoteUtil::CreateNoteFromString(