(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)

This commit is contained in:
smatz
2009-05-17 01:00:56 +00:00
parent ed1e54bd84
commit 871107f529
78 changed files with 242 additions and 303 deletions

View File

@@ -76,7 +76,7 @@ static void ShowGroupActionDropdown(Window *w, GroupID gid)
list->push_back(new DropDownListStringItem(STR_SEND_FOR_SERVICING, GALF_SERVICE, false));
list->push_back(new DropDownListStringItem(STR_SEND_TRAIN_TO_DEPOT, GALF_DEPOT, false));
if (IsValidGroupID(gid)) {
if (Group::IsValidID(gid)) {
list->push_back(new DropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE, GALF_ADD_SHARED, false));
list->push_back(new DropDownListStringItem(STR_GROUP_REMOVE_ALL_VEHICLES, GALF_REMOVE_ALL, false));
}
@@ -321,7 +321,7 @@ public:
this->groups.ForceResort();
}
if (!(IsAllGroupID(this->group_sel) || IsDefaultGroupID(this->group_sel) || IsValidGroupID(this->group_sel))) {
if (!(IsAllGroupID(this->group_sel) || IsDefaultGroupID(this->group_sel) || Group::IsValidID(this->group_sel))) {
this->group_sel = ALL_GROUP;
HideDropDownMenu(this);
}
@@ -567,7 +567,7 @@ public:
}
case GRP_WIDGET_RENAME_GROUP: { // Rename the selected roup
assert(IsValidGroupID(this->group_sel));
assert(Group::IsValidID(this->group_sel));
const Group *g = Group::Get(this->group_sel);
@@ -595,7 +595,7 @@ public:
}
case GRP_WIDGET_REPLACE_PROTECTION:
if (IsValidGroupID(this->group_sel)) {
if (Group::IsValidID(this->group_sel)) {
const Group *g = Group::Get(this->group_sel);
DoCommandP(0, this->group_sel, !g->replace_protection, CMD_SET_GROUP_REPLACE_PROTECTION);
@@ -703,12 +703,12 @@ public:
| DEPOT_MASS_SEND, GetCmdSendToDepot(this->vehicle_type));
break;
case GALF_ADD_SHARED: // Add shared Vehicles
assert(IsValidGroupID(this->group_sel));
assert(Group::IsValidID(this->group_sel));
DoCommandP(0, this->group_sel, this->vehicle_type, CMD_ADD_SHARED_VEHICLE_GROUP | CMD_MSG(STR_GROUP_CAN_T_ADD_SHARED_VEHICLE));
break;
case GALF_REMOVE_ALL: // Remove all Vehicles from the selected group
assert(IsValidGroupID(this->group_sel));
assert(Group::IsValidID(this->group_sel));
DoCommandP(0, this->group_sel, this->vehicle_type, CMD_REMOVE_ALL_VEHICLES_GROUP | CMD_MSG(STR_GROUP_CAN_T_REMOVE_ALL_VEHICLES));
break;
@@ -758,7 +758,7 @@ static WindowDesc _group_desc(
void ShowCompanyGroup(CompanyID company, VehicleType vehicle_type)
{
if (!IsValidCompanyID(company)) return;
if (!Company::IsValidID(company)) return;
_group_desc.cls = GetWindowClassForVehicleType(vehicle_type);
WindowNumber num = (vehicle_type << 11) | VLW_GROUP_LIST | company;