refrences cloning does not work

actorid
Marek Kochanowicz 11 years ago
parent b3b51992ef
commit 4d9d31b25e

@ -205,6 +205,7 @@ namespace CSMWorld
const UniversalId::ArgumentType argumentType)
{
Record<ESXRecordT> copy = getRecord(origin);
copy.mState = RecordBase::State_ModifiedOnly;
if (argumentType == UniversalId::ArgumentType_Id)
{
copy.get().mId = destination;

@ -194,6 +194,7 @@ CSMWorld::Data::Data() : mRefs (mCells)
mRefs.addColumn (new StringIdColumn<CellRef> (true));
mRefs.addColumn (new RecordStateColumn<CellRef>);
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
mRefs.addColumn (new CellColumn<CellRef>);
mRefs.addColumn (new IdColumn<CellRef>);
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 0, false));

@ -133,8 +133,6 @@ void CSMWorld::IdTable::cloneRecord(const std::string& origin,
beginInsertRows (QModelIndex(), index, index);
mIdCollection->cloneRecord(origin, destination, type, argumentType);
endInsertRows();
emit dataChanged (CSMWorld::IdTable::index (0, 0),
CSMWorld::IdTable::index (mIdCollection->getSize()-1, mIdCollection->getColumns()-1));
}

@ -43,10 +43,8 @@ void CSMWorld::RefCollection::cloneRecord(const std::string& origin,
const CSMWorld::UniversalId::Type type,
const CSMWorld::UniversalId::ArgumentType argumentType)
{
Record<CSMWorld::CellRef> originRecord = getRecord(origin);
Record<CSMWorld::CellRef> *copy = dynamic_cast<Record<CSMWorld::CellRef>* >(originRecord.clone());
copy->mState = CSMWorld::RecordBase::State_ModifiedOnly;
copy->get().mId = getNewId();
insertRecord(*copy, getAppendIndex(destination, type));
delete copy;
Record<CSMWorld::CellRef> clone(getRecord(origin));
clone.mState = CSMWorld::RecordBase::State_ModifiedOnly;
clone.get().mId = destination;
insertRecord(clone, getAppendIndex(destination, type), type);
}

@ -157,9 +157,4 @@ void CSVWorld::GenericCreator::cloneMode(const std::string& originid,
mClonedId = originid;
mClonedType = type;
mArgumentType = argumentType;
if (argumentType == CSMWorld::UniversalId::ArgumentType_Id)
{
mId->setText(QString::fromStdString(mClonedId));
}
}
}

@ -40,9 +40,9 @@ CSVWorld::ReferenceCreator::ReferenceCreator (CSMWorld::Data& data, QUndoStack&
void CSVWorld::ReferenceCreator::reset()
{
GenericCreator::reset();
mCell->setText ("");
mId = getData().getReferences().getNewId();
GenericCreator::reset();
}
std::string CSVWorld::ReferenceCreator::getErrors() const

Loading…
Cancel
Save