(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user