From 1af882ddae9041206240e6a2d96775ca2a0d5f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 16 Jul 2019 17:12:29 +0200 Subject: [PATCH] [apps/calculation] Fix calculation history index --- apps/calculation/history_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/calculation/history_controller.cpp b/apps/calculation/history_controller.cpp index c7f79f767..40aedd4b8 100644 --- a/apps/calculation/history_controller.cpp +++ b/apps/calculation/history_controller.cpp @@ -141,7 +141,7 @@ int HistoryController::reusableCellCount(int type) { void HistoryController::willDisplayCellForIndex(HighlightCell * cell, int index) { HistoryViewCell * myCell = (HistoryViewCell *)cell; - myCell->setCalculation((m_calculationStore->calculationAtIndex(index)).pointer(), index == selectedRow() && selectedSubviewType() == SubviewType::Output); + myCell->setCalculation((m_calculationStore->calculationAtIndex(numberOfRows()-index-1)).pointer(), index == selectedRow() && selectedSubviewType() == SubviewType::Output); myCell->setEven(index%2 == 0); myCell->setHighlighted(myCell->isHighlighted()); }