Implement Copy/Paste for PropertyEnumeration

This commit is contained in:
wmayer 2013-05-02 14:02:55 +02:00
parent 6551cc4d81
commit fba4d14f79
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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;