diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-11 09:15:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-11 12:00:03 +0000 |
commit | 39611d60204cd18e278ea822cfe3ef7ea09e6389 (patch) | |
tree | 790ad3935b8846c8857389c434e7c95f16c0559a /starmath | |
parent | b871fad7a5b482c6ad1c0054adf0e068701395bd (diff) |
coverity#1267649 Logically dead code
and
coverity#1267645 Logically dead code
coverity#1267651 Logically dead code
Change-Id: If92e17708576bf11cefc28f903a24ad271b826c8
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/cursor.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 9a45577ce77d..4318a3bf93bb 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -262,9 +262,11 @@ void SmCursor::Delete(){ SmStructureNode* pLineParent = pLine->GetParent(); //Find line offset in parent int nLineOffset = pLineParent->IndexOfSubNode(pLine); - assert(nLineOffset != -1); //pLine must be a child of its parent! if (nLineOffset == -1) + { + SAL_WARN("starmath", "pLine must be a child of its parent!"); return; + } //Position after delete SmCaretPos PosAfterDelete; @@ -813,9 +815,11 @@ bool SmCursor::InsertRow() { SmStructureNode *pLineParent = pLine->GetParent(); int nParentIndex = pLineParent->IndexOfSubNode(pLine); - assert(nParentIndex != -1); //pLine must be a subnode of pLineParent if (nParentIndex == -1) + { + SAL_WARN("starmath", "pLine must be a subnode of pLineParent!"); return false; + } //Discover the context of this command SmTableNode *pTable = NULL; @@ -934,9 +938,11 @@ void SmCursor::InsertFraction() { //Find Parent and offset in parent SmStructureNode *pLineParent = pLine->GetParent(); int nParentIndex = pLineParent->IndexOfSubNode(pLine); - assert(nParentIndex != -1); //pLine must be a subnode of pLineParent! if (nParentIndex == -1) + { + SAL_WARN("starmath", "pLine must be a subnode of pLineParent!"); return; + } //We begin modifying the tree here BeginEdit(); |