From a5bff416d18f69ea945c2bf24325628de77351e2 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Fri, 6 Sep 2019 14:30:22 +0200 Subject: [PATCH] [apps/*/expression_model_list_controller] Use isAddEmptyRow --- apps/sequence/list/list_controller.cpp | 3 +-- apps/solver/list_controller.cpp | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/sequence/list/list_controller.cpp b/apps/sequence/list/list_controller.cpp index e3e2f631c..d78c13d57 100644 --- a/apps/sequence/list/list_controller.cpp +++ b/apps/sequence/list/list_controller.cpp @@ -40,8 +40,7 @@ int ListController::numberOfExpressionRows() const { KDCoordinate ListController::expressionRowHeight(int j) { KDCoordinate defaultHeight = Metric::StoreRowHeight; - if (modelStore()->numberOfModels() < modelStore()->maxNumberOfModels() && j == numberOfRows() - 1) { - // Add sequence row + if (isAddEmptyRow(j)) { return defaultHeight; } Sequence * sequence = modelStore()->modelForRecord(modelStore()->recordAtIndex(modelIndexForRow(j))); diff --git a/apps/solver/list_controller.cpp b/apps/solver/list_controller.cpp index 902c226c5..c9d30fa88 100644 --- a/apps/solver/list_controller.cpp +++ b/apps/solver/list_controller.cpp @@ -43,10 +43,7 @@ Button * ListController::buttonAtIndex(int index, ButtonRowController::Position } int ListController::typeAtLocation(int i, int j) { - if (j == m_equationStore->numberOfModels()) { - return 1; - } - return 0; + return isAddEmptyRow(j); } HighlightCell * ListController::reusableCell(int index, int type) { @@ -71,7 +68,7 @@ int ListController::reusableCellCount(int type) { } void ListController::willDisplayCellForIndex(HighlightCell * cell, int index) { - if (index != m_equationStore->numberOfModels()) { + if (!isAddEmptyRow(index)) { willDisplayExpressionCellAtIndex(cell, index); } cell->setHighlighted(index == selectedRow());