From e80cdab64bc7f26a1be67d72e0b0028d767adbe8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 27 Mar 2005 11:27:07 +0000 Subject: [PATCH] Patch #1171300: ListWidget + Chooser Patch svn-id: r17260 --- gui/ListWidget.cpp | 2 ++ gui/ListWidget.h | 2 +- gui/chooser.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index f4a0a81e84f..d2229a31f37 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -380,6 +380,8 @@ void ListWidget::startEditMode() { } void ListWidget::endEditMode() { + if(!_editMode) + return; // send a message that editing finished with a return/enter key press _editMode = false; _list[_selectedItem] = _editString; diff --git a/gui/ListWidget.h b/gui/ListWidget.h index 36ce8150c09..6d36fc45022 100644 --- a/gui/ListWidget.h +++ b/gui/ListWidget.h @@ -86,6 +86,7 @@ public: // Made startEditMode for SCUMM's SaveLoadChooser void startEditMode(); + void endEditMode(); protected: void drawWidget(bool hilite); @@ -93,7 +94,6 @@ protected: int findItem(int x, int y) const; void scrollBarRecalc(); - void endEditMode(); void abortEditMode(); Common::Rect getEditRect() const; diff --git a/gui/chooser.cpp b/gui/chooser.cpp index e1a8184f7f9..429d60b1710 100644 --- a/gui/chooser.cpp +++ b/gui/chooser.cpp @@ -53,6 +53,7 @@ void ChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data switch (cmd) { case kChooseCmd: case kListItemDoubleClickedCmd: + _list->endEditMode(); setResult(item); close(); break;