diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 48b5339924..4d5554d863 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -490,12 +490,11 @@ void CSVWorld::Table::dropEvent(QDropEvent *event) if (dynamic_cast(event->mimeData())->holdsType(display)) { - const CSMWorld::TableMimeData* mime = dynamic_cast(event->mimeData()); - CSMWorld::UniversalId record(mime->returnMatching(display)); - mUndoStack.push (new CSMWorld::ModifyCommand ( *mModel, - index, - QVariant(record.getId().c_str()) - )); + const CSMWorld::TableMimeData* mime = dynamic_cast (event->mimeData()); + CSMWorld::UniversalId record (mime->returnMatching (display)); + std::auto_ptr command (new CSMWorld::ModifyCommand + (*mProxyModel, index, QVariant (QString::fromStdString (record.getId())))); + mUndoStack.push (command.release()); } }