View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005620||Multi Theft Auto : San Andreas||Client||public||2010-10-30 16:08||2015-03-04 10:31|
|Status||closed||Resolution||no change required|
|Target Version||Fixed in Version|
|Summary||0005620: guiGridListAddColumn returns wrong index after deleting Columns|
The returned index of guiGridListAddColumn increases, though Columns added before have been deleted. e.g.:
guiGridListAddColumn(..) returns 1
if you use guiGridListGetSelectedItem() then it returns the value guiGridListAddColumn should have but hasn't returned: 1
|Steps To Reproduce|
|Tags||No tags attached.|
I just recognized that guiGridListGetItemText, guiGridListSetItemText and guiGridListRemoveColumn are using the bugged Columns, too. Seems that guiGridListGetSelectedItem() is the only one using the real ones.
Confirmed, had this problem when trying to delete all columns in ingame performance browser.
Get ipb resource from mtasa-resources
Observe the debug output:
[2012-10-10 21:45:48] INFO: removing column id a 0 true
Notice the "id b" this should never happen because I already deleted all the columns.
This behavior is intended and necessary to guarantee unique IDs.
Assuming you've written the following code:
-- Later in the code
When you remove a column between other columns now, you'd have to adjust the column index of all columns next to the removed one which will break the code above.