Insert nested rows after selected row, or at start if none selected.

pull/1/head
Aesylwinn 9 years ago
parent d0ef95a1e1
commit ded8862e9d

@ -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()));
}

Loading…
Cancel
Save