From 4eb2553b3588219a1bc4555a83898b30057dfc26 Mon Sep 17 00:00:00 2001 From: Felix Raimundo Date: Fri, 18 Mar 2016 11:17:04 +0100 Subject: [PATCH] Removed some dead code. Change-Id: I1dec8aa22ee9f429335b3402c900b7bf19356e57 --- poincare/src/expression.cpp | 45 ----------------------- poincare/src/layout/horizontal_layout.cpp | 8 ---- 2 files changed, 53 deletions(-) diff --git a/poincare/src/expression.cpp b/poincare/src/expression.cpp index 36069ed12..b3c0f5de8 100644 --- a/poincare/src/expression.cpp +++ b/poincare/src/expression.cpp @@ -20,48 +20,3 @@ Expression * Expression::parse(char * string) { Expression::~Expression() { } - -/* -bool Expression::identicalTo(Expression * e) { - // By default, two expression are not identical. - // This should obviously be overriden in subclasses! - return false; -} - - -void Expression::forEachChild(ExpressionAction action) { - Expression ** childPointer = children(); - if (childPointer == NULL) { - return; - } - while(*childPointer != NULL) { - (*childPointer->*action)(); - childPointer++; - } -} - -void Expression::recursiveLayout() { - forEachChild(&Expression::recursiveLayout); - layout(); -} - -void Expression::recursiveDraw() { - KDPoint origin = KDGetOrigin(); - KDSetOrigin(KDPOINT(origin.x + m_frame.origin.x, - origin.y + m_frame.origin.y)); - - forEachChild(&Expression::recursiveDraw); - - draw(); - - KDSetOrigin(origin); -} - -void Expression::draw() { - // No-op by default -} - -void Expression::layout() { - // No-op by default -} -*/ diff --git a/poincare/src/layout/horizontal_layout.cpp b/poincare/src/layout/horizontal_layout.cpp index f709f3040..ea816aa73 100644 --- a/poincare/src/layout/horizontal_layout.cpp +++ b/poincare/src/layout/horizontal_layout.cpp @@ -51,7 +51,6 @@ ExpressionLayout * HorizontalLayout::child(uint16_t index) { KDPoint HorizontalLayout::positionOfChild(ExpressionLayout * child) { KDPoint position = (KDPoint){.x = 0, .y = 0}; -#if 1 uint16_t index = 0; for (int i=0;i<3;i++) { if (m_children[i] == child) { @@ -64,13 +63,6 @@ KDPoint HorizontalLayout::positionOfChild(ExpressionLayout * child) { assert(previousChild != nullptr); position.x = previousChild->origin().x + previousChild->size().width; } -#else - int i = 0; - while(i<3 && m_children[i] != child) { - position.x += m_children[i]->size().width; - i++; - } -#endif position.y = (size().height - child->size().height)/2; return position; }