Implement Copy/Paste for PropertyEnumeration
This commit is contained in:
parent
6551cc4d81
commit
fba4d14f79
|
@ -509,6 +509,29 @@ void PropertyEnumeration::setPyObject(PyObject *value)
|
|||
}
|
||||
}
|
||||
|
||||
Property *PropertyEnumeration::Copy(void) const
|
||||
{
|
||||
PropertyEnumeration *p= new PropertyEnumeration();
|
||||
p->_lValue = _lValue;
|
||||
if (_CustomEnum) {
|
||||
p->_CustomEnum = true;
|
||||
p->setEnumVector(getEnumVector());
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
void PropertyEnumeration::Paste(const Property &from)
|
||||
{
|
||||
aboutToSetValue();
|
||||
const PropertyEnumeration& prop = dynamic_cast<const PropertyEnumeration&>(from);
|
||||
_lValue = prop._lValue;
|
||||
if (prop._CustomEnum) {
|
||||
this->_CustomEnum = true;
|
||||
this->setEnumVector(prop.getEnumVector());
|
||||
}
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyIntegerConstraint
|
||||
|
|
|
@ -183,6 +183,9 @@ public:
|
|||
virtual void Save (Base::Writer &writer) const;
|
||||
virtual void Restore(Base::XMLReader &reader);
|
||||
|
||||
virtual Property *Copy(void) const;
|
||||
virtual void Paste(const Property &from);
|
||||
|
||||
private:
|
||||
bool _CustomEnum;
|
||||
const char** _EnumArray;
|
||||
|
|
Loading…
Reference in New Issue
Block a user