mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[poincare] Add asserts in removePointedChildAtIndexAndMoveCursor.
Change-Id: Ifc49b79f18ad53a96a4675d1c6edad69e1c6258f
This commit is contained in:
@@ -95,6 +95,7 @@ void ConjugateLayout::replaceChildAndMoveCursor(const ExpressionLayout * oldChil
|
||||
|
||||
void ConjugateLayout::removePointedChildAtIndexAndMoveCursor(int index, bool deleteAfterRemoval, ExpressionLayoutCursor * cursor) {
|
||||
assert(index >= 0 && index < numberOfChildren());
|
||||
assert((cursor->pointedExpressionLayout() == child(index)) || (cursor->pointedExpressionLayout()->hasAncestor(child(index))));
|
||||
replaceChildAndMoveCursor(child(index), new EmptyVisibleLayout(), deleteAfterRemoval, cursor);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ void DynamicLayoutHierarchy::removeChildAtIndex(int index, bool deleteAfterRemov
|
||||
|
||||
void DynamicLayoutHierarchy::removePointedChildAtIndexAndMoveCursor(int index, bool deleteAfterRemoval, ExpressionLayoutCursor * cursor) {
|
||||
assert(index >= 0 && index < numberOfChildren());
|
||||
assert(cursor->pointedExpressionLayout() == child(index));
|
||||
assert((cursor->pointedExpressionLayout() == child(index)) || (cursor->pointedExpressionLayout()->hasAncestor(child(index))));
|
||||
if (numberOfChildren() == 1) {
|
||||
if (m_parent) {
|
||||
if (!deleteAfterRemoval) {
|
||||
|
||||
@@ -205,6 +205,7 @@ void ExpressionLayout::removeChildAtIndex(int index, bool deleteAfterRemoval) {
|
||||
|
||||
void ExpressionLayout::removePointedChildAtIndexAndMoveCursor(int index, bool deleteAfterRemoval, ExpressionLayoutCursor * cursor) {
|
||||
assert(index >= 0 && index < numberOfChildren());
|
||||
assert((cursor->pointedExpressionLayout() == child(index)) || (cursor->pointedExpressionLayout()->hasAncestor(child(index))));
|
||||
removeChildAtIndex(index, deleteAfterRemoval);
|
||||
if (index < numberOfChildren()) {
|
||||
cursor->setPointedExpressionLayout(editableChild(index));
|
||||
|
||||
@@ -125,6 +125,7 @@ void MatrixLayout::replaceChildAndMoveCursor(const ExpressionLayout * oldChild,
|
||||
|
||||
void MatrixLayout::removePointedChildAtIndexAndMoveCursor(int index, bool deleteAfterRemoval, ExpressionLayoutCursor * cursor) {
|
||||
assert(index >= 0 && index < numberOfChildren());
|
||||
assert((cursor->pointedExpressionLayout() == child(index)) || (cursor->pointedExpressionLayout()->hasAncestor(child(index))));
|
||||
replaceChildAndMoveCursor(child(index), new EmptyVisibleLayout(), deleteAfterRemoval, cursor);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user