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:
wmayer
2016-11-08 19:55:17 +01:00
parent 1c5cc8bf62
commit 37339057f8
6 changed files with 112 additions and 79 deletions

View File

@@ -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());
}