[poincare] Use the new hasAncestor parameter.

Change-Id: I1dcb612e01f7ba9ffbeaea7b53ab5e678667f02b
This commit is contained in:
Léa Saviot
2018-04-20 11:31:35 +02:00
parent 829cd06685
commit f2aa4df8a7
4 changed files with 4 additions and 4 deletions

View File

@@ -94,7 +94,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))));
assert(cursor->pointedExpressionLayout()->hasAncestor(child(index), true));
replaceChildAndMoveCursor(child(index), new EmptyLayout(), deleteAfterRemoval, cursor);
}

View File

@@ -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)) || (cursor->pointedExpressionLayout()->hasAncestor(child(index))));
assert(cursor->pointedExpressionLayout()->hasAncestor(child(index), true));
if (numberOfChildren() == 1) {
if (m_parent) {
if (!deleteAfterRemoval) {

View File

@@ -184,7 +184,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))));
assert(cursor->pointedExpressionLayout()->hasAncestor(child(index), true));
removeChildAtIndex(index, deleteAfterRemoval);
if (index < numberOfChildren()) {
cursor->setPointedExpressionLayout(editableChild(index));

View File

@@ -163,7 +163,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))));
assert(cursor->pointedExpressionLayout()->hasAncestor(child(index), true));
replaceChildAndMoveCursor(child(index), new EmptyLayout(), deleteAfterRemoval, cursor);
}