@@ -1099,14 +1099,14 @@ bool DynamicRibbonWidget::setSelection(int item_id, const int playerID,
|
||||
int row;
|
||||
int id;
|
||||
|
||||
int iterations = 0; // a safeguard to avoid infinite loops (should not happen normally)
|
||||
unsigned int iterations = 0; // a safeguard to avoid infinite loops (should not happen normally)
|
||||
|
||||
while (!findItemInRows(name.c_str(), &row, &id))
|
||||
{
|
||||
// if we get here it means the item is scrolled out. Try to find it.
|
||||
scroll(1, evenIfDeactivated);
|
||||
|
||||
if (iterations > 50)
|
||||
if (iterations > m_items.size())
|
||||
{
|
||||
Log::error("DynamicRibbonWidget::setSelection", "Cannot find item %d (%s)", item_id, name.c_str());
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user