From 7ede6573ebc825bc2a1e71c985536981fa7636e7 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 7 Jun 2014 14:39:34 +0200 Subject: [PATCH] removed more hardcoded column numbers --- apps/opencs/view/world/table.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 217d52ec1..0fc7dd4b2 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -230,9 +230,12 @@ CSMWorld::UniversalId CSVWorld::Table::getUniversalId (int row) const { row = mProxyModel->mapToSource (mProxyModel->index (row, 0)).row(); + int idColumn = mModel->findColumnIndex (CSMWorld::Columns::ColumnId_Id); + int typeColumn = mModel->findColumnIndex (CSMWorld::Columns::ColumnId_RecordType); + return CSMWorld::UniversalId ( - static_cast (mModel->data (mModel->index (row, 2)).toInt()), - mModel->data (mModel->index (row, 0)).toString().toUtf8().constData()); + static_cast (mModel->data (mModel->index (row, typeColumn)).toInt()), + mModel->data (mModel->index (row, idColumn)).toString().toUtf8().constData()); } void CSVWorld::Table::editRecord()