mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#573) Added new copy method for PdmObjects
Added copy method to XmlObjectHandle, and use this method from PasteEclipseCases
This commit is contained in:
@@ -170,6 +170,21 @@ PdmObjectHandle* PdmXmlObjectHandle::readUnknownObjectFromXmlString(const QStrin
|
||||
return newObject;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmObjectHandle* PdmXmlObjectHandle::copyByXmlSerialization(PdmObjectFactory* objectFactory)
|
||||
{
|
||||
this->setupBeforeSaveRecursively();
|
||||
|
||||
QString xmlString = this->writeObjectToXmlString();
|
||||
|
||||
PdmObjectHandle* objectCopy = PdmXmlObjectHandle::readUnknownObjectFromXmlString(xmlString, objectFactory);
|
||||
objectCopy->xmlCapability()->initAfterReadRecursively();
|
||||
|
||||
return objectCopy;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
void readObjectFromXmlString(const QString& xmlString, PdmObjectFactory* objectFactory);
|
||||
QString writeObjectToXmlString();
|
||||
static PdmObjectHandle* readUnknownObjectFromXmlString(const QString& xmlString, PdmObjectFactory* objectFactory);
|
||||
PdmObjectHandle* copyByXmlSerialization(PdmObjectFactory* objectFactory);
|
||||
|
||||
// Main XML serialization methods that is used internally by the document serialization system
|
||||
// Not supposed to be used directly.
|
||||
|
||||
Reference in New Issue
Block a user