diff --git a/poincare/src/layout/fraction_layout.cpp b/poincare/src/layout/fraction_layout.cpp index b2c7632e3..8782aafb5 100644 --- a/poincare/src/layout/fraction_layout.cpp +++ b/poincare/src/layout/fraction_layout.cpp @@ -34,21 +34,21 @@ void FractionLayout::collapseSiblingsAndMoveCursor(ExpressionLayoutCursor * curs } void FractionLayout::deleteBeforeCursor(ExpressionLayoutCursor * cursor) { - // Case: Left of the denominator. - // Replace the fraction with a horizontal juxtaposition of the numerator and - // the denominator. + /* Case: Left of the denominator. + * Replace the fraction with a horizontal juxtaposition of the numerator and + * the denominator. */ if (cursor->pointedExpressionLayout() == denominatorLayout()) { assert(cursor->position() == ExpressionLayoutCursor::Position::Left); if (numeratorLayout()->isEmpty() && denominatorLayout()->isEmpty()) { - // Case: Numerator and denominator are empty. - // Move the cursor then replace the fraction with an empty layout. + /* Case: Numerator and denominator are empty. + * Move the cursor then replace the fraction with an empty layout. */ replaceWithAndMoveCursor(new EmptyLayout(), true, cursor); return; } - // Else, replace the fraction with a juxtaposition of the numerator and - // denominator. Place the cursor in the middle of the juxtaposition, which - // is right of the numerator. + /* Else, replace the fraction with a juxtaposition of the numerator and + * denominator. Place the cursor in the middle of the juxtaposition, which + * is right of the numerator. */ // Juxtapose. ExpressionLayout * numerator = numeratorLayout(); @@ -94,8 +94,8 @@ void FractionLayout::deleteBeforeCursor(ExpressionLayoutCursor * cursor) { return; } - // Case: Right. - // Move Right of the denominator. + /* Case: Right. + * Move Right of the denominator. */ if (cursor->pointedExpressionLayout() == this && cursor->position() == ExpressionLayoutCursor::Position::Right) { diff --git a/poincare/src/layout/horizontal_layout.cpp b/poincare/src/layout/horizontal_layout.cpp index 31c2f5465..139c664f5 100644 --- a/poincare/src/layout/horizontal_layout.cpp +++ b/poincare/src/layout/horizontal_layout.cpp @@ -166,9 +166,9 @@ void HorizontalLayout::privateReplaceChild(const ExpressionLayout * oldChild, Ex void HorizontalLayout::addOrMergeChildAtIndex(ExpressionLayout * eL, int index, bool removeEmptyChildren) { if (eL->isHorizontal()) { mergeChildrenAtIndex(static_cast(eL), index, removeEmptyChildren); - return; + } else { + addChildAtIndex(eL, index); } - addChildAtIndex(eL, index); } ExpressionLayoutCursor HorizontalLayout::cursorLeftOf(ExpressionLayoutCursor cursor, bool * shouldRecomputeLayout) {