Delete DPGI's when parent DPG deleted

Ensure Gui/QGIVxx is removed when App/DVxxxx is deleted
This commit is contained in:
WandererFan
2017-01-07 11:12:17 -05:00
parent 221f80e344
commit d6419b5a7e
11 changed files with 172 additions and 61 deletions

View File

@@ -176,7 +176,9 @@ void DrawProjGroup::onChanged(const App::Property* prop)
TechDraw::DrawPage *page = getPage();
if (!isRestoring() && page) {
if ( prop == &Views ) {
recompute();
if (!isDeleting()) {
recompute();
}
} else if (prop == &Scale) {
updateChildren(Scale.getValue());
//resetPositions();
@@ -808,7 +810,9 @@ TechDraw::DrawProjGroupItem* DrawProjGroup::getAnchor(void)
App::DocumentObject* docObj = Anchor.getValue();
if (docObj == nullptr) {
//explode! DPG w/o anchor
Base::Console().Error("Error - DPG::getAnchor - DPG has no Anchor!!!\n");
if (!isDeleting()) {
Base::Console().Error("Error - DPG::getAnchor - DPG has no Anchor!!!\n");
}
} else {
result = static_cast<DrawProjGroupItem*>(docObj);
}