Task Description
Preliminary note: Might be related to PS#5642
Symptom The 0th skill is updated in “unsortedSkills” so flush → then after update results an inconsistent list: unsortedSkills @Flush:
Swords
Knives & Daggers
....
Heavy Armor
....
unsortedSkills @2nd update:
Heavy Armor
Knives & Daggers
....
Heavy Armor
....
Problem 1: idx is used to get row from unsortedSkills while there is no real connection. 2: Modified row replaces the one in unsortedSkills even if it was (!flush) update and the row is actually derived from it. Plus 1st point
Proposed resolution Linear search in HandleSkillCategory as I couldn’t find any better way:
@@ -859,7 +859,15 @@
pawsListBoxRow* row = NULL;
if (!flush)
{
- row = unsortedSkills[idx]; + //If updating progress we have to get the corresponding skill from unsortedSkills first + for(size_t i=0;i<unsortedSkills.GetSize();i++) + { + if (skillName==(dynamic_cast <pawsTextBox*> (unsortedSkills[i]→GetColumn(0)))→GetText()) + { + row = unsortedSkills[i]; + break; + } + }
}
if (row == NULL)
@@ -906,10 +914,6 @@
if (flush)
{
unsortedSkills.Push(row);
- } - else - { - unsortedSkills[idx] = row;
}
if (skillName == selectedSkill)
|