(svn r17445) -Fix (r17318): force resort after changing sort type in the industry list window

This commit is contained in:
smatz 2009-09-07 08:52:01 +00:00
parent 1474be7ea7
commit 98e2742863
1 changed files with 6 additions and 5 deletions

View File

@ -803,9 +803,10 @@ protected:
this->industries.RebuildDone(); this->industries.RebuildDone();
this->vscroll.SetCount(this->industries.Length()); // Update scrollbar as well. this->vscroll.SetCount(this->industries.Length()); // Update scrollbar as well.
} }
this->last_industry = NULL;
this->industries.Sort(); if (!this->industries.Sort()) return;
this->InvalidateWidget(IDW_INDUSTRY_LIST); IndustryDirectoryWindow::last_industry = NULL; // Reset name sorter sort cache
this->InvalidateWidget(IDW_INDUSTRY_LIST); // Set the modified widget dirty
} }
/** /**
@ -1045,7 +1046,7 @@ public:
{ {
if (this->industries.SortType() != index) { if (this->industries.SortType() != index) {
this->industries.SetSortType(index); this->industries.SetSortType(index);
this->SetDirty(); this->BuildSortIndustriesList();
} }
} }
@ -1056,8 +1057,8 @@ public:
virtual void OnHundredthTick() virtual void OnHundredthTick()
{ {
this->industries.ForceResort();
this->BuildSortIndustriesList(); this->BuildSortIndustriesList();
this->SetDirty();
} }
virtual void OnInvalidateData(int data) virtual void OnInvalidateData(int data)