From f2e86e860e4100e1c15b6f6eef8850f6e99bcaea Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 5 Sep 2013 13:59:09 +0200 Subject: [PATCH] allow the use of record types in string filters --- apps/opencs/model/world/columns.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index 2a47a73fb0..80525b59e6 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -3,6 +3,8 @@ #include +#include "universalid.hpp" + namespace CSMWorld { namespace Columns @@ -271,7 +273,7 @@ namespace bool CSMWorld::Columns::hasEnums (ColumnId column) { - return getEnumNames (column)!=0; + return getEnumNames (column)!=0 || column==ColumnId_RecordType; } std::vector CSMWorld::Columns::getEnums (ColumnId column) @@ -281,6 +283,13 @@ std::vector CSMWorld::Columns::getEnums (ColumnId column) if (const char **table = getEnumNames (column)) for (int i=0; table[i]; ++i) enums.push_back (table[i]); + else if (column==ColumnId_RecordType) + { + enums.push_back (""); // none + + for (int i=UniversalId::Type_None+1; i (i)).getTypeName()); + } return enums; } \ No newline at end of file