[regression] Fix CalculationController with new Poincare API

This commit is contained in:
Émilie Feral
2018-09-06 16:39:52 +02:00
parent 2cc01dc2a5
commit 03dcb58096
2 changed files with 3 additions and 17 deletions

View File

@@ -2,9 +2,7 @@
#include "../constant.h"
#include "../apps_container.h"
#include "../shared/poincare_helpers.h"
#include "../../poincare/src/layout/char_layout.h"
#include "../../poincare/src/layout/horizontal_layout.h"
#include "../../poincare/src/layout/vertical_offset_layout.h"
#include <poincare.h>
#include <assert.h>
@@ -29,13 +27,6 @@ CalculationController::CalculationController(Responder * parentResponder, Button
m_r2Layout = HorizontalLayoutRef(CharLayoutRef('r', KDText::FontSize::Small), VerticalOffsetLayoutRef(CharLayoutRef('2', KDText::FontSize::Small), VerticalOffsetLayoutNode::Type::Superscript));
}
CalculationController::~CalculationController() {
if (m_r2Layout) {
delete m_r2Layout;
m_r2Layout = nullptr;
}
}
const char * CalculationController::title() {
return I18n::translate(I18n::Message::StatTab);
}
@@ -118,7 +109,7 @@ void CalculationController::willDisplayCellAtLocation(HighlightCell * cell, int
int numberRows = numberOfRows();
if (shouldDisplayRAndR2 && j == numberRows-1) {
EvenOddExpressionCell * myCell = (EvenOddExpressionCell *)cell;
myCell->setExpressionLayout(m_r2Layout);
myCell->setLayoutRef(m_r2Layout);
return;
}
MarginEvenOddMessageTextCell * myCell = (MarginEvenOddMessageTextCell *)cell;

View File

@@ -17,11 +17,6 @@ class CalculationController : public Shared::TabTableController, public TableVie
public:
CalculationController(Responder * parentResponder, ButtonRowController * header, Store * store);
~CalculationController();
CalculationController(const CalculationController& other) = delete;
CalculationController(CalculationController&& other) = delete;
CalculationController& operator=(const CalculationController& other) = delete;
CalculationController& operator=(CalculationController&& other) = delete;
// View Controller
const char * title() override;
@@ -78,7 +73,7 @@ private:
int maxNumberOfCoefficients() const;
Shared::MarginEvenOddMessageTextCell * m_titleCells[k_maxNumberOfDisplayableRows];
EvenOddExpressionCell * m_r2TitleCell;
Poincare::ExpressionLayout * m_r2Layout;
Poincare::LayoutReference m_r2Layout;
ColumnTitleCell * m_columnTitleCells[Store::k_numberOfSeries];
EvenOddDoubleBufferTextCellWithSeparator * m_doubleCalculationCells[k_numberOfDoubleCalculationCells];
Shared::SeparatorEvenOddBufferTextCell * m_calculationCells[k_numberOfCalculationCells];