summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-11 09:15:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-11 12:00:03 +0000
commit39611d60204cd18e278ea822cfe3ef7ea09e6389 (patch)
tree790ad3935b8846c8857389c434e7c95f16c0559a /starmath
parentGuard against createInstance throwing non-Runtime-Exception (diff)
downloadcore-39611d60204cd18e278ea822cfe3ef7ea09e6389.tar.gz
core-39611d60204cd18e278ea822cfe3ef7ea09e6389.zip
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.cxx12
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();