Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad

This commit is contained in:
wmayer 2012-10-18 10:31:52 +02:00
commit 5db59ce258
2 changed files with 7 additions and 4 deletions

View File

@ -109,11 +109,11 @@ const char* DocumentObject::getStatusString(void) const
const char *DocumentObject::getNameInDocument(void) const
{
// Note: It can happen that we query the internal name of an object even if it is not
// part of a document (anymore). This is the case e.g. if we have a reference in Python
// to an object that has been removed from the document. In this case we should rather
// Note: It can happen that we query the internal name of an object even if it is not
// part of a document (anymore). This is the case e.g. if we have a reference in Python
// to an object that has been removed from the document. In this case we should rather
// return 0.
//assert(pcNameInDocument);
//assert(pcNameInDocument);
if (!pcNameInDocument) return 0;
return pcNameInDocument->c_str();
}
@ -171,6 +171,7 @@ App::Document *DocumentObject::getDocument(void) const
void DocumentObject::setDocument(App::Document* doc)
{
_pDoc=doc;
onSettingDocument();
}
void DocumentObject::onBeforeChange(const Property* prop)

View File

@ -183,6 +183,8 @@ protected:
virtual void onDocumentRestored() {}
/// get called after duplicating an object
virtual void onFinishDuplicating() {}
/// get called after setting the document
virtual void onSettingDocument() {}
/// python object of this class and all descendend
protected: // attributes