dynamic properties:
+ reimplment addDynamicProperty and removeDynamicProperty in TransactionalObject to raise exceptions + move addProperty, removeProperty and supportedProperties from ViewProviderPythonFeaturePy to ViewProviderPy
This commit is contained in:
@@ -24,9 +24,11 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <sstream>
|
||||
#endif
|
||||
|
||||
#include <Base/Writer.h>
|
||||
#include <Base/Exception.h>
|
||||
|
||||
#include "Document.h"
|
||||
#include "TransactionalObject.h"
|
||||
@@ -58,3 +60,19 @@ void TransactionalObject::onBeforeChangeProperty(Document *doc, const Property *
|
||||
{
|
||||
doc->onBeforeChangeProperty(this, prop);
|
||||
}
|
||||
|
||||
App::Property* TransactionalObject::addDynamicProperty(const char*, const char*,
|
||||
const char*, const char*,
|
||||
short, bool, bool)
|
||||
{
|
||||
std::stringstream str;
|
||||
str << "Type " << this->getTypeId().getName() << " cannot dynamically add properties";
|
||||
throw Base::RuntimeError(str.str());
|
||||
}
|
||||
|
||||
bool TransactionalObject::removeDynamicProperty(const char*)
|
||||
{
|
||||
std::stringstream str;
|
||||
str << "Type " << this->getTypeId().getName() << " cannot dynamically remove properties";
|
||||
throw Base::RuntimeError(str.str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user