From a31524173f828bdcb7304e34b453220720a87de6 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Thu, 5 Mar 2020 16:29:07 +0100 Subject: [PATCH] [apps/calculation/history_controller] Factor handleEvent --- apps/calculation/history_controller.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/calculation/history_controller.cpp b/apps/calculation/history_controller.cpp index 8b245c289..cafa5c4cd 100644 --- a/apps/calculation/history_controller.cpp +++ b/apps/calculation/history_controller.cpp @@ -125,11 +125,7 @@ bool HistoryController::handleEvent(Ion::Events::Event event) { return true; } m_selectableTableView.selectCellAtLocation(0, (focusRow > 0) * (focusRow - 1)); - if (subviewType == SubviewType::Input) { - tableViewDidChangeSelection(&m_selectableTableView, 0, selectedRow()); - } else { - tableViewDidChangeSelection(&m_selectableTableView, 0, -1); - } + tableViewDidChangeSelection(&m_selectableTableView, 0, (subviewType == SubviewType::Input) ? selectedRow() : -1); m_selectableTableView.scrollToCell(0, selectedRow()); return true; }