removed some hardcoded column numbers

deque
Marc Zinnschlag 11 years ago
parent 85fca19fd9
commit e4a37ef709

@ -13,14 +13,16 @@ std::vector<std::string> CSMWorld::CommandDispatcher::getDeletableRecords() cons
IdTable& model = dynamic_cast<IdTable&> (*mDocument.getData().getTableModel (mId));
int stateColumnIndex = model.findColumnIndex (Columns::ColumnId_Modification);
for (std::vector<std::string>::const_iterator iter (mSelection.begin());
iter!=mSelection.end(); ++iter)
{
int row = model.getModelIndex (*iter, 0).row();
// check record state
RecordBase::State state =
static_cast<RecordBase::State> (model.data (model.index (row, 1)).toInt());
RecordBase::State state = static_cast<RecordBase::State> (
model.data (model.index (row, stateColumnIndex)).toInt());
if (state==RecordBase::State_Deleted)
continue;
@ -53,14 +55,16 @@ std::vector<std::string> CSMWorld::CommandDispatcher::getRevertableRecords() con
if (model.getFeatures() & IdTable::Feature_ReorderWithinTopic)
return result;
int stateColumnIndex = model.findColumnIndex (Columns::ColumnId_Modification);
for (std::vector<std::string>::const_iterator iter (mSelection.begin());
iter!=mSelection.end(); ++iter)
{
int row = model.getModelIndex (*iter, 0).row();
// check record state
RecordBase::State state =
static_cast<RecordBase::State> (model.data (model.index (row, 1)).toInt());
RecordBase::State state = static_cast<RecordBase::State> (
model.data (model.index (row, stateColumnIndex)).toInt());
if (state==RecordBase::State_BaseOnly)
continue;

Loading…
Cancel
Save