diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-12-16 18:02:30 +0900 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2015-12-23 00:39:56 +0000 |
commit | 4753d78cf93bad974f062d8cfe75b4b610385b7e (patch) | |
tree | 138e05074e45ddd5a3bdaad187820166c3152eca /starmath/inc | |
parent | 27450bc72d88b8490d17cb506f85fb4d838df0ea (diff) |
starmath: Assert that a parent always finds its child
Change-Id: I6cb75e0d62141dba2809aaec62761cedd8c3257a
Reviewed-on: https://gerrit.libreoffice.org/20733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/cursor.hxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx index 9de6b5309d57..6962cf5d89c3 100644 --- a/starmath/inc/cursor.hxx +++ b/starmath/inc/cursor.hxx @@ -12,6 +12,7 @@ #include "node.hxx" #include "caret.hxx" +#include <cassert> #include <list> #include <memory> @@ -268,8 +269,8 @@ private: SmNode* pNode = rpNode; if(rpNode && rpNode->GetParent()){ //Don't remove this, correctness relies on it int index = rpNode->GetParent()->IndexOfSubNode(rpNode); - if(index != -1) - rpNode->GetParent()->SetSubNode(index, nullptr); + assert(index >= 0); + rpNode->GetParent()->SetSubNode(index, nullptr); } rpNode = nullptr; //Create line from node |