[poincare] Fix typo

This commit is contained in:
Léa Saviot
2018-09-20 11:19:52 +02:00
parent 369b333692
commit 116ef9ee39
7 changed files with 19 additions and 19 deletions

View File

@@ -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 {

View File

@@ -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();

View File

@@ -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; }

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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;