| 23 | } |
| 24 | |
| 25 | void ActionCloneData::doAction() |
| 26 | { |
| 27 | if (mData == nullptr) |
| 28 | { |
| 29 | mData = Data::CreateInstance(); |
| 30 | mData->setType(DataTypeManager::getInstance().getType(mType)); |
| 31 | |
| 32 | DataUtility::cloneData(mData, mPrototype); |
| 33 | |
| 34 | if (!mUniqueProperty.empty()) |
| 35 | mData->setPropertyValue( |
| 36 | "Name", |
| 37 | DataUtility::getUniqueName(mParent, mPrototype->getPropertyValue("Name") + "_")); |
| 38 | } |
| 39 | |
| 40 | mParent->addChild(mData); |
| 41 | |
| 42 | DataSelectorManager::getInstance().changeParent(mParent); |
| 43 | |
| 44 | if (!mUniqueProperty.empty()) |
| 45 | PropertyUtility::storeUniqueNameProperty("Name", mUniqueProperty, mParent, mOldValues); |
| 46 | } |
| 47 | |
| 48 | void ActionCloneData::undoAction() |
| 49 | { |
nothing calls this directly
no test coverage detected