From f2aa4df8a7e24b79ee89af7a372e19d53fbf98f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 20 Apr 2018 11:31:35 +0200 Subject: [PATCH] [poincare] Use the new hasAncestor parameter. Change-Id: I1dcb612e01f7ba9ffbeaea7b53ab5e678667f02b --- poincare/src/layout/conjugate_layout.cpp | 2 +- poincare/src/layout/dynamic_layout_hierarchy.cpp | 2 +- poincare/src/layout/expression_layout.cpp | 2 +- poincare/src/layout/matrix_layout.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/poincare/src/layout/conjugate_layout.cpp b/poincare/src/layout/conjugate_layout.cpp index 593225e91..e113afd2f 100644 --- a/poincare/src/layout/conjugate_layout.cpp +++ b/poincare/src/layout/conjugate_layout.cpp @@ -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); } diff --git a/poincare/src/layout/dynamic_layout_hierarchy.cpp b/poincare/src/layout/dynamic_layout_hierarchy.cpp index 5bbcad605..60b0de32b 100644 --- a/poincare/src/layout/dynamic_layout_hierarchy.cpp +++ b/poincare/src/layout/dynamic_layout_hierarchy.cpp @@ -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) { diff --git a/poincare/src/layout/expression_layout.cpp b/poincare/src/layout/expression_layout.cpp index 2672f233d..bb8ed4b83 100644 --- a/poincare/src/layout/expression_layout.cpp +++ b/poincare/src/layout/expression_layout.cpp @@ -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)); diff --git a/poincare/src/layout/matrix_layout.cpp b/poincare/src/layout/matrix_layout.cpp index 4e12f4271..df13a623f 100644 --- a/poincare/src/layout/matrix_layout.cpp +++ b/poincare/src/layout/matrix_layout.cpp @@ -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); }