summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-09-07 08:52:01 +0000
committersmatz <smatz@openttd.org>2009-09-07 08:52:01 +0000
commit98e274286396876e0dd5ecdb3b2a570a74b7cd13 (patch)
treeeb5ab1ea76d7b9dce1d676fea6204cc1e1a78851 /src/industry_gui.cpp
parent1474be7ea7722380755c48ab1bc8b3154aa99511 (diff)
downloadopenttd-98e274286396876e0dd5ecdb3b2a570a74b7cd13.tar.xz
(svn r17445) -Fix (r17318): force resort after changing sort type in the industry list window
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index e18a52d1d..f64be7deb 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -803,9 +803,10 @@ protected:
this->industries.RebuildDone();
this->vscroll.SetCount(this->industries.Length()); // Update scrollbar as well.
}
- this->last_industry = NULL;
- this->industries.Sort();
- this->InvalidateWidget(IDW_INDUSTRY_LIST);
+
+ if (!this->industries.Sort()) return;
+ 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) {
this->industries.SetSortType(index);
- this->SetDirty();
+ this->BuildSortIndustriesList();
}
}
@@ -1056,8 +1057,8 @@ public:
virtual void OnHundredthTick()
{
+ this->industries.ForceResort();
this->BuildSortIndustriesList();
- this->SetDirty();
}
virtual void OnInvalidateData(int data)