Parcourir la source

Spreadsheet: Clear the cell and commit when the delete key is pressed

...as the initial stroke that begins an edit.
This is still imperfect, as it completely ignores selections.
Fixes #4168 (sort of).
AnotherTest il y a 4 ans
Parent
commit
a20f1202a8
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      Applications/Spreadsheet/SpreadsheetView.cpp

+ 6 - 0
Applications/Spreadsheet/SpreadsheetView.cpp

@@ -47,6 +47,12 @@ SpreadsheetView::~SpreadsheetView()
 
 void SpreadsheetView::EditingDelegate::set_value(const GUI::Variant& value)
 {
+    if (value.as_string().is_null()) {
+        StringModelEditingDelegate::set_value("");
+        commit();
+        return;
+    }
+
     if (m_has_set_initial_value)
         return StringModelEditingDelegate::set_value(value);