prepare view provider for undo/redo

This commit is contained in:
wmayer
2016-06-18 21:03:13 +02:00
parent 62a8828dc8
commit f0e00311cd
18 changed files with 498 additions and 102 deletions

View File

@@ -30,17 +30,17 @@
#include "Document.h"
#include "DocumentObject.h"
#include "DocumentObjectPy.h"
#include "DocumentObjectGroup.h"
#include "PropertyLinks.h"
#include "PropertyExpressionEngine.h"
#include <App/DocumentObjectPy.h>
#include <boost/signals/connection.hpp>
#include <boost/bind.hpp>
using namespace App;
PROPERTY_SOURCE(App::DocumentObject, App::PropertyContainer)
PROPERTY_SOURCE(App::DocumentObject, App::TransactionalObject)
DocumentObjectExecReturn *DocumentObject::StdReturn = 0;
@@ -123,6 +123,18 @@ const char *DocumentObject::getNameInDocument(void) const
return pcNameInDocument->c_str();
}
bool DocumentObject::isAttachedToDocument() const
{
return (pcNameInDocument != 0);
}
const char* DocumentObject::detachFromDocument()
{
const std::string* name = pcNameInDocument;
pcNameInDocument = 0;
return name ? name->c_str() : 0;
}
std::vector<DocumentObject*> DocumentObject::getOutList(void) const
{
std::vector<Property*> List;
@@ -231,7 +243,7 @@ void DocumentObject::onBeforeChange(const Property* prop)
oldLabel = Label.getStrValue();
if (_pDoc)
_pDoc->onBeforeChangeProperty(this,prop);
onBeforeChangeProperty(_pDoc, prop);
}
/// get called by the container when a Property was changed