[Scummvm-git-logs] scummvm master -> 530a972d4c630db89cb1f24e0ac2f9e4fe3532cd

criezy noreply at scummvm.org
Wed Jul 19 23:47:00 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
530a972d4c GUI: Clear the selection when calling EditableWidget::setEditString


Commit: 530a972d4c630db89cb1f24e0ac2f9e4fe3532cd
    https://github.com/scummvm/scummvm/commit/530a972d4c630db89cb1f24e0ac2f9e4fe3532cd
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-07-20T00:46:48+01:00

Commit Message:
GUI: Clear the selection when calling EditableWidget::setEditString

This fixes a crash (assert) due to an invalid selection in the EditableWidget
when typing anything in the widget after setEditString was called while some
text was selected.
Here is one way to get the crash (before this commit):
1. In the launcher search box type some text.
2. Select the text or part of the text.
3. Click the clear button.
4. Type something or use the backspace/delete key.

Changed paths:
    gui/widgets/editable.cpp


diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp
index be6f450bb21..d693368c66f 100644
--- a/gui/widgets/editable.cpp
+++ b/gui/widgets/editable.cpp
@@ -85,6 +85,7 @@ void EditableWidget::setEditString(const Common::U32String &str) {
 	// TODO: We probably should filter the input string here,
 	// e.g. using tryInsertChar.
 	_editString = str;
+	clearSelection();
 	setCaretPos(caretVisualPos(str.size()));
 	markAsDirty();
 }




More information about the Scummvm-git-logs mailing list