From d1290ac5568704b15d3e85b711684ff40aa33d52 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Wed, 12 Mar 2014 15:46:27 +0100 Subject: [PATCH] skip deleled or erased records --- apps/opencs/view/world/dialoguesubview.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/opencs/view/world/dialoguesubview.cpp b/apps/opencs/view/world/dialoguesubview.cpp index a8bd899c9..97f116c06 100644 --- a/apps/opencs/view/world/dialoguesubview.cpp +++ b/apps/opencs/view/world/dialoguesubview.cpp @@ -23,6 +23,7 @@ #include "../../model/world/columnbase.hpp" #include "../../model/world/idtable.hpp" #include "../../model/world/columns.hpp" +#include "../../model/world/record.hpp" #include "recordstatusdelegate.hpp" #include "util.hpp" @@ -387,6 +388,13 @@ void CSVWorld::DialogueSubView::prevId() return; } + CSMWorld::RecordBase::State state = static_cast(mTable->data (mTable->index (newRow, 1)).toInt()); + if (state == CSMWorld::RecordBase::State_Deleted || state == CSMWorld::RecordBase::State_Deleted) + { + prevId(); + return; + } + mEditWidget->remake(newRow); setUniversalId(CSMWorld::UniversalId (static_cast (mTable->data (mTable->index (newRow, 2)).toInt()), mTable->data (mTable->index (newRow, 0)).toString().toStdString())); @@ -404,6 +412,13 @@ void CSVWorld::DialogueSubView::nextId() return; } + CSMWorld::RecordBase::State state = static_cast(mTable->data (mTable->index (newRow, 1)).toInt()); + if (state == CSMWorld::RecordBase::State_Deleted || state == CSMWorld::RecordBase::State_Deleted) + { + nextId(); + return; + } + mEditWidget->remake(newRow); setUniversalId(CSMWorld::UniversalId (static_cast (mTable->data (mTable->index (newRow, 2)).toInt()), mTable->data (mTable->index (newRow, 0)).toString().toStdString()));