From d36cfcca51ca2dad4d81b1428028a077e4d90d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 14 Dec 2017 11:56:55 +0100 Subject: [PATCH] [apps] In Editable cell table view controller, do not reload all table data if the table dimensions did not evolve --- apps/shared/editable_cell_table_view_controller.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/shared/editable_cell_table_view_controller.cpp b/apps/shared/editable_cell_table_view_controller.cpp index 6220c99a0..ec754c27e 100644 --- a/apps/shared/editable_cell_table_view_controller.cpp +++ b/apps/shared/editable_cell_table_view_controller.cpp @@ -30,11 +30,18 @@ bool EditableCellTableViewController::textFieldDidFinishEditing(TextField * text app()->displayWarning(I18n::Message::UndefinedValue); return false; } + int nbOfRows = numberOfRows(); + int nbOfColumns = numberOfColumns(); if (!setDataAtLocation(floatBody, selectedColumn(), selectedRow())) { app()->displayWarning(I18n::Message::ForbiddenValue); return false; } - selectableTableView()->reloadData(); + for (int j = 0; j < numberOfColumns(); j++) { + selectableTableView()->reloadCellAtLocation(j, selectedRow()); + } + if (nbOfRows != numberOfRows() || nbOfColumns != numberOfColumns()) { + selectableTableView()->reloadData(); + } if (event == Ion::Events::EXE || event == Ion::Events::OK) { selectableTableView()->selectCellAtLocation(selectedColumn(), selectedRow()+1); } else {