From 9a72bf6ac1f0d12310fba19b393ff3e4e8cc22ac Mon Sep 17 00:00:00 2001 From: twanvl Date: Sun, 18 May 2008 18:00:25 +0000 Subject: [PATCH] Fixed keyword list after yesterdays multi select stuff git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@860 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/control/keyword_list.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gui/control/keyword_list.cpp b/src/gui/control/keyword_list.cpp index 47f291af..b1e9098f 100644 --- a/src/gui/control/keyword_list.cpp +++ b/src/gui/control/keyword_list.cpp @@ -57,24 +57,20 @@ void KeywordList::onChangeSet() { } void KeywordList::onAction(const Action& action, bool undone) { - /*TYPE_CASE(action, AddKeywordAction) { - if (action.adding != undone) { + TYPE_CASE(action, AddKeywordAction) { + if (action.action.adding != undone) { // select the new keyword - selectItem(action.keyword, false /*list will be refreshed anyway* /, true); + selectItem(action.action.steps[0].item, false /*list will be refreshed anyway*/, true); refreshList(); } else { long pos = selected_item_pos; refreshList(); - if (action.keyword == selected_item) { - // select the next keyword, if not possible, select the last - if (pos + 1 < GetItemCount()) { - selectItemPos(pos, true); - } else { - selectItemPos(GetItemCount() - 1, true); - } + if (selected_item_pos == -1) { + // selected keyword was deleted, select the next + selectItemPos(pos, true); } } - }*/ // TODO!!! + } TYPE_CASE(action, ValueAction) { if (!action.card) { KeywordTextValue* value = dynamic_cast(action.valueP.get());