From 04f02a5b9ec633f2f87f535d59201941c6df1252 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 30 Aug 2021 20:28:52 +0430 Subject: [PATCH] Spreadsheet: Don't invalidate the model on set_data() No previous model index will be invalidated afterwards, so avoid invalidating them. Also fixes an issue where committing to an edit with the inline cell editor makes the focused cell switch to A0. Fixes #9677. --- Userland/Applications/Spreadsheet/SpreadsheetModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp index fdd11865f7..1b2558464b 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp @@ -146,7 +146,7 @@ void SheetModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& valu auto& cell = m_sheet->ensure({ (size_t)index.column(), (size_t)index.row() }); cell.set_data(value.to_string()); - invalidate(); + did_update(UpdateFlag::DontInvalidateIndices); } void SheetModel::update()