diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-11-29 11:11:51 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-30 12:07:45 +0100 |
commit | a20f1202a8a9659bcf003b03741d2e05f2d46151 (patch) | |
tree | ac2cf063ce0d2c93ef2ab367228a21271d37afda /Applications | |
parent | b66f3166cb1a082fd776e4d045593ebee451956d (diff) | |
download | serenity-a20f1202a8a9659bcf003b03741d2e05f2d46151.zip |
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).
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/Spreadsheet/SpreadsheetView.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Applications/Spreadsheet/SpreadsheetView.cpp b/Applications/Spreadsheet/SpreadsheetView.cpp index 2148b9281f..a8431ef1b3 100644 --- a/Applications/Spreadsheet/SpreadsheetView.cpp +++ b/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); |