diff --git a/apps/opencs/view/world/nestedtable.cpp b/apps/opencs/view/world/nestedtable.cpp index 23d566439..0ccb88ce5 100644 --- a/apps/opencs/view/world/nestedtable.cpp +++ b/apps/opencs/view/world/nestedtable.cpp @@ -119,9 +119,14 @@ void CSVWorld::NestedTable::removeRowActionTriggered() void CSVWorld::NestedTable::addNewRowActionTriggered() { + int row = 0; + + if (!selectionModel()->selectedRows().empty()) + row = selectionModel()->selectedRows().back().row() + 1; + mDocument.getUndoStack().push(new CSMWorld::AddNestedCommand(*(mModel->model()), mModel->getParentId(), - selectionModel()->selectedRows().size(), + row, mModel->getParentColumn())); }