diff options
author | rubidium <rubidium@openttd.org> | 2009-02-06 18:00:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-06 18:00:05 +0000 |
commit | 9f1a20a2be8b36023bdd10a638f7075d1f5e7970 (patch) | |
tree | 549f6eccba291590efb076d37b3aa5118c193086 /src/network | |
parent | e85628702940989a8e53245ada5d16711a180fdc (diff) | |
download | openttd-9f1a20a2be8b36023bdd10a638f7075d1f5e7970.tar.xz |
(svn r15377) -Fix [FS#2607]: filter did resort when unneeded and didn't deselect properly in some cases (Roujin)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_content_gui.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 5ae37eca1..3c56a69c8 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -279,15 +279,18 @@ class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback { { if (!this->content.Filter(this->edit_str_buf)) return; - this->selected = NULL; - this->list_pos = 0; - + /* update list position */ for (ConstContentIterator iter = this->content.Begin(); iter != this->content.End(); iter++) { if (*iter == this->selected) { this->list_pos = iter - this->content.Begin(); - break; + this->ScrollToSelected(); + return; } } + + /* previously selected item not in list anymore */ + this->selected = NULL; + this->list_pos = 0; } /** Make sure that the currently selected content info is within the visible part of the matrix */ |