(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.

This commit is contained in:
frosch
2013-05-26 19:23:42 +00:00
parent b10a4f151a
commit 56e4a8c4d6
61 changed files with 488 additions and 482 deletions

View File

@@ -189,7 +189,7 @@ class ReplaceVehicleWindow : public Window {
}
public:
ReplaceVehicleWindow(const WindowDesc *desc, VehicleType vehicletype, GroupID id_g) : Window()
ReplaceVehicleWindow(WindowDesc *desc, VehicleType vehicletype, GroupID id_g) : Window(desc)
{
if (vehicletype == VEH_TRAIN) {
/* For rail vehicles find the most used vehicle type, which is usually
@@ -217,10 +217,10 @@ public:
this->sel_engine[0] = INVALID_ENGINE;
this->sel_engine[1] = INVALID_ENGINE;
this->CreateNestedTree(desc);
this->CreateNestedTree();
this->vscroll[0] = this->GetScrollbar(WID_RV_LEFT_SCROLLBAR);
this->vscroll[1] = this->GetScrollbar(WID_RV_RIGHT_SCROLLBAR);
this->FinishInitNested(desc, vehicletype);
this->FinishInitNested(vehicletype);
this->owner = _local_company;
this->sel_group = id_g;
@@ -563,7 +563,7 @@ static const NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
EndContainer(),
};
static const WindowDesc _replace_rail_vehicle_desc(
static WindowDesc _replace_rail_vehicle_desc(
WDP_AUTO, 500, 140,
WC_REPLACE_VEHICLE, WC_NONE,
WDF_CONSTRUCTION,
@@ -595,7 +595,7 @@ static const NWidgetPart _nested_replace_vehicle_widgets[] = {
EndContainer(),
};
static const WindowDesc _replace_vehicle_desc(
static WindowDesc _replace_vehicle_desc(
WDP_AUTO, 456, 118,
WC_REPLACE_VEHICLE, WC_NONE,
WDF_CONSTRUCTION,