From bfe0723e1089aad32f2aa52ae29d2a456c95e385 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 15 Oct 2012 22:56:49 +0000 Subject: [PATCH] - bugfix in hotkey jumping in listboxes --- source/glest_game/facilities/components.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/glest_game/facilities/components.cpp b/source/glest_game/facilities/components.cpp index 6f8ed30a..72a228b5 100644 --- a/source/glest_game/facilities/components.cpp +++ b/source/glest_game/facilities/components.cpp @@ -462,7 +462,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) { if(b1) { bool bFound = false; if(advanceToItemStartingWith != "") { - for(unsigned int i = selectedItemIndex - 1; i >= 0; --i) { + for(int i = selectedItemIndex - 1; i >= 0; --i) { string item = items[i]; if(StartsWith(toLower(item),toLower(advanceToItemStartingWith)) == true) { bFound = true; @@ -471,7 +471,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) { } } if(bFound == false) { - for(unsigned int i = items.size() - 1; i >= selectedItemIndex; --i) { + for(int i = items.size() - 1; i >= selectedItemIndex; --i) { string item = items[i]; //printf("Trying to match [%s] with item [%s]\n",advanceToItemStartingWith.c_str(),item.c_str()); if(StartsWith(toLower(item),toLower(advanceToItemStartingWith)) == true) { @@ -492,7 +492,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) { else if(b2) { bool bFound = false; if(advanceToItemStartingWith != "") { - for(unsigned int i = selectedItemIndex + 1; i < items.size(); ++i) { + for(int i = selectedItemIndex + 1; i < items.size(); ++i) { string item = items[i]; //printf("Trying to match [%s] with item [%s]\n",advanceToItemStartingWith.c_str(),item.c_str()); if(StartsWith(toLower(item),toLower(advanceToItemStartingWith)) == true) { @@ -502,7 +502,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) { } } if(bFound == false) { - for(unsigned int i = 0; i <= selectedItemIndex; ++i) { + for(int i = 0; i <= selectedItemIndex; ++i) { string item = items[i]; //printf("Trying to match [%s] with item [%s]\n",advanceToItemStartingWith.c_str(),item.c_str()); if(StartsWith(toLower(item),toLower(advanceToItemStartingWith)) == true) {