From 294fd65e30856b9a9fde1db93cb7b74fe2f92203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 10 Aug 2018 13:17:50 +0200 Subject: [PATCH] [apps] Fix references to Poincare in VariableBoxController --- apps/variable_box_controller.cpp | 14 +++++++------- apps/variable_box_controller.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/variable_box_controller.cpp b/apps/variable_box_controller.cpp index 9f5497ff1..cda23704a 100644 --- a/apps/variable_box_controller.cpp +++ b/apps/variable_box_controller.cpp @@ -147,7 +147,7 @@ void VariableBoxController::ContentViewController::willDisplayCellForIndex(Highl return; } myCell->displayExpression(true); - if (evaluation) { + if (evaluation.isDefined()) { /* TODO: implement list contexts */ // TODO: handle matrix and scalar! LayoutRef layoutR = layoutRefForIndex(index); @@ -237,27 +237,27 @@ I18n::Message VariableBoxController::ContentViewController::nodeLabelAtIndex(int return labels[index]; } -const Expression * VariableBoxController::ContentViewController::expressionForIndex(int index) { +const Expression VariableBoxController::ContentViewController::expressionForIndex(int index) { if (m_currentPage == Page::Scalar) { const Symbol symbol = Symbol('A'+index); - return m_context->expressionForSymbol(&symbol); + return m_context->expressionForSymbol(symbol); } if (m_currentPage == Page::Matrix) { const Symbol symbol = Symbol::matrixSymbol('0'+(char)index); - return m_context->expressionForSymbol(&symbol); + return m_context->expressionForSymbol(symbol); } #if LIST_VARIABLES if (m_currentPage == Page::List) { - return nullptr; + return Expression(); } #endif - return nullptr; + return Expression(); } LayoutRef VariableBoxController::ContentViewController::layoutRefForIndex(int index) { if (m_currentPage == Page::Matrix) { const Symbol symbol = Symbol::matrixSymbol('0'+(char)index); - return m_context->layoutForSymbol(&symbol, Constant::ShortNumberOfSignificantDigits); + return m_context->layoutForSymbol(symbol, Constant::ShortNumberOfSignificantDigits); } #if LIST_VARIABLES if (m_currentPage == Page::List) { diff --git a/apps/variable_box_controller.h b/apps/variable_box_controller.h index 22c36e1b1..05906cb93 100644 --- a/apps/variable_box_controller.h +++ b/apps/variable_box_controller.h @@ -52,7 +52,7 @@ private: Page pageAtIndex(int index); void putLabelAtIndexInBuffer(int index, char * buffer); I18n::Message nodeLabelAtIndex(int index); - const Poincare::Expression * expressionForIndex(int index); + const Poincare::Expression expressionForIndex(int index); Poincare::LayoutRef layoutRefForIndex(int index); Poincare::GlobalContext * m_context; Responder * m_sender;