From 116ef9ee399691538fc0dba50f41e6350940a63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 20 Sep 2018 11:19:52 +0200 Subject: [PATCH] [poincare] Fix typo --- escher/include/escher/layout_field.h | 2 +- escher/src/layout_field.cpp | 12 ++++++------ poincare/include/poincare/layout_cursor.h | 4 ++-- poincare/src/layout.cpp | 2 +- poincare/src/layout_cursor.cpp | 12 ++++++------ poincare/src/layout_node.cpp | 4 ++-- poincare/src/matrix_layout.cpp | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/escher/include/escher/layout_field.h b/escher/include/escher/layout_field.h index 1d60582d5..67deede6a 100644 --- a/escher/include/escher/layout_field.h +++ b/escher/include/escher/layout_field.h @@ -27,7 +27,7 @@ public: bool hasText() const { return layout().hasText(); } int serialize(char * buffer, int bufferLength) { return layout().serialize(buffer, bufferLength); } Poincare::Layout layout() const { return m_contentView.expressionView()->layout(); } - char XNTChar() { return m_contentView.cursor()->layouterence().XNTChar(); } + char XNTChar() { return m_contentView.cursor()->layoutReference().XNTChar(); } // ScrollableView void setBackgroundColor(KDColor c) override { diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index 91b0f52f5..5164524fc 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -52,11 +52,11 @@ void LayoutField::ContentView::layoutCursorSubview() { return; } KDPoint expressionViewOrigin = m_expressionView.absoluteDrawingOrigin(); - Layout pointedLayoutR = m_cursor.layouterence(); + Layout pointedLayoutR = m_cursor.layoutReference(); LayoutCursor::Position cursorPosition = m_cursor.position(); LayoutCursor eqCursor = pointedLayoutR.equivalentCursor(&m_cursor); - if (eqCursor.isDefined() && pointedLayoutR.hasChild(eqCursor.layouterence())) { - pointedLayoutR = eqCursor.layouterence(); + if (eqCursor.isDefined() && pointedLayoutR.hasChild(eqCursor.layoutReference())) { + pointedLayoutR = eqCursor.layoutReference(); cursorPosition = eqCursor.position(); } KDPoint cursoredExpressionViewOrigin = pointedLayoutR.absoluteOrigin(); @@ -235,13 +235,13 @@ bool LayoutField::privateHandleMoveEvent(Ion::Events::Event event, bool * should result = m_contentView.cursor()->cursorAtDirection(LayoutCursor::MoveDirection::Down, shouldRecomputeLayout); } else if (event == Ion::Events::ShiftLeft) { *shouldRecomputeLayout = true; - if (m_contentView.cursor()->layouterence().removeGreySquaresFromAllMatrixAncestors()) { + if (m_contentView.cursor()->layoutReference().removeGreySquaresFromAllMatrixAncestors()) { *shouldRecomputeLayout = true; } result.setLayout(layout()); result.setPosition(LayoutCursor::Position::Left); } else if (event == Ion::Events::ShiftRight) { - if (m_contentView.cursor()->layouterence().removeGreySquaresFromAllMatrixAncestors()) { + if (m_contentView.cursor()->layoutReference().removeGreySquaresFromAllMatrixAncestors()) { *shouldRecomputeLayout = true; } result.setLayout(layout()); @@ -301,7 +301,7 @@ void LayoutField::insertLayoutAtCursor(Layout layoutR, Layout pointedLayoutR, bo } // Handle matrices - m_contentView.cursor()->layouterence().addGreySquaresToAllMatrixAncestors(); + m_contentView.cursor()->layoutReference().addGreySquaresToAllMatrixAncestors(); // Handle empty layouts m_contentView.cursor()->hideEmptyLayoutIfNeeded(); diff --git a/poincare/include/poincare/layout_cursor.h b/poincare/include/poincare/layout_cursor.h index bb6eddd24..ebce27dd3 100644 --- a/poincare/include/poincare/layout_cursor.h +++ b/poincare/include/poincare/layout_cursor.h @@ -57,7 +57,7 @@ public: bool isDefined() const { return !m_layout.isUninitialized(); } // Getters and setters - Layout layouterence() { return m_layout; } + Layout layoutReference() { return m_layout; } int layoutIdentifier() { return m_layout.identifier(); } void setLayout(Layout r) { @@ -66,7 +66,7 @@ public: } } void setTo(LayoutCursor * other) { - m_layout = other->layouterence(); + m_layout = other->layoutReference(); m_position = other->position(); } Position position() const { return m_position; } diff --git a/poincare/src/layout.cpp b/poincare/src/layout.cpp index a845fcf1e..d8e36eab4 100644 --- a/poincare/src/layout.cpp +++ b/poincare/src/layout.cpp @@ -94,7 +94,7 @@ void Layout::replaceWithJuxtapositionOf(Layout leftChild, Layout rightChild, Lay } castedParent.addOrMergeChildAtIndex(rightChild, idxInParent, true); castedParent.addOrMergeChildAtIndex(leftChild, idxInParent, true, putCursorInTheMiddle ? cursor : nullptr); - p.removeChild(*this, cursor->layouterence() == *this ? cursor : nullptr); + p.removeChild(*this, cursor->layoutReference() == *this ? cursor : nullptr); } void Layout::addChildAtIndex(Layout l, int index, int currentNumberOfChildren, LayoutCursor * cursor) { diff --git a/poincare/src/layout_cursor.cpp b/poincare/src/layout_cursor.cpp index aa1f19c2a..ed271fa97 100644 --- a/poincare/src/layout_cursor.cpp +++ b/poincare/src/layout_cursor.cpp @@ -26,7 +26,7 @@ KDCoordinate LayoutCursor::baseline() { return k_cursorHeight/2; } KDCoordinate layoutBaseline = m_layout.baseline(); - Layout equivalentLayout = m_layout.equivalentCursor(this).layouterence(); + Layout equivalentLayout = m_layout.equivalentCursor(this).layoutReference(); if (equivalentLayout.isUninitialized()) { return layoutBaseline; } @@ -49,7 +49,7 @@ bool LayoutCursor::isEquivalentTo(LayoutCursor cursor) { /* Position */ KDPoint LayoutCursor::middleLeftPoint() { - KDPoint layoutOrigin = layouterence().absoluteOrigin(); + KDPoint layoutOrigin = layoutReference().absoluteOrigin(); KDCoordinate x = layoutOrigin.x() + (m_position == Position::Left ? 0 : m_layout.layoutSize().width()); KDCoordinate y = layoutOrigin.y() + m_layout.baseline() - k_cursorHeight/2; return KDPoint(x,y); @@ -207,7 +207,7 @@ void LayoutCursor::clearLayout() { /* Private */ KDCoordinate LayoutCursor::layoutHeight() { - Layout equivalentLayout = m_layout.equivalentCursor(this).layouterence(); + Layout equivalentLayout = m_layout.equivalentCursor(this).layoutReference(); if (!equivalentLayout.isUninitialized() && m_layout.hasChild(equivalentLayout)) { return equivalentLayout.layoutSize().height(); } @@ -253,8 +253,8 @@ bool LayoutCursor::baseForNewPowerLayout() { return true; } LayoutCursor equivalentLayoutCursor = m_layout.equivalentCursor(this); - if (equivalentLayoutCursor.layouterence().isUninitialized() - || (equivalentLayoutCursor.layouterence().isHorizontal() + if (equivalentLayoutCursor.layoutReference().isUninitialized() + || (equivalentLayoutCursor.layoutReference().isHorizontal() && equivalentLayoutCursor.position() == Position::Left)) { return false; @@ -273,7 +273,7 @@ bool LayoutCursor::privateShowHideEmptyLayoutIfNeeded(bool show) { adjacentEmptyLayout = m_layout; } else { // Check the equivalent cursor position - Layout equivalentPointedLayout = m_layout.equivalentCursor(this).layouterence(); + Layout equivalentPointedLayout = m_layout.equivalentCursor(this).layoutReference(); if (!equivalentPointedLayout.isUninitialized() && equivalentPointedLayout.isEmpty()) { adjacentEmptyLayout = equivalentPointedLayout; } diff --git a/poincare/src/layout_node.cpp b/poincare/src/layout_node.cpp index 3b883dfe1..7aa1e002c 100644 --- a/poincare/src/layout_node.cpp +++ b/poincare/src/layout_node.cpp @@ -68,7 +68,7 @@ void LayoutNode::invalidAllSizesPositionsAndBaselines() { LayoutCursor LayoutNode::equivalentCursor(LayoutCursor * cursor) { // Only HorizontalLayout may have no parent, and it overloads this method assert(parent() != nullptr); - return (cursor->layouterence().node() == this) ? parent()->equivalentCursor(cursor) : LayoutCursor(); + return (cursor->layoutReference().node() == this) ? parent()->equivalentCursor(cursor) : LayoutCursor(); } // Tree modification @@ -132,7 +132,7 @@ void LayoutNode::moveCursorVertically(VerticalDirection direction, LayoutCursor if (!equivalentPositionVisited) { LayoutCursor cursorEquivalent = equivalentCursor(cursor); if (cursorEquivalent.isDefined()) { - cursor->setLayout(cursorEquivalent.layouterence()); + cursor->setLayout(cursorEquivalent.layoutReference()); cursor->setPosition(cursorEquivalent.position()); if (direction == VerticalDirection::Up) { cursor->layoutNode()->moveCursorUp(cursor, shouldRecomputeLayout, true); diff --git a/poincare/src/matrix_layout.cpp b/poincare/src/matrix_layout.cpp index ca5c7f184..57b085ab0 100644 --- a/poincare/src/matrix_layout.cpp +++ b/poincare/src/matrix_layout.cpp @@ -142,7 +142,7 @@ void MatrixLayoutNode::moveCursorVertically(VerticalDirection direction, LayoutC int firstIndex = direction == VerticalDirection::Up ? 0 : numberOfChildren() - m_numberOfColumns; int lastIndex = direction == VerticalDirection::Up ? m_numberOfColumns : numberOfChildren(); for (int childIndex = firstIndex; childIndex < lastIndex; childIndex++) { - if (cursor->layouterence().hasAncestor(thisRef.childAtIndex(childIndex), true)) { + if (cursor->layoutReference().hasAncestor(thisRef.childAtIndex(childIndex), true)) { // The cursor is leaving the matrix, so remove the grey squares. shouldRemoveGreySquares = true; break;