[TD]code review changes for dgh, dpg, dpgi, dra

This commit is contained in:
Wanderer Fan
2022-08-18 15:24:21 -04:00
committed by WandererFan
parent 90450e8a4a
commit 4cefaa3a13
4 changed files with 40 additions and 31 deletions

View File

@@ -344,16 +344,23 @@ double DrawProjGroupItem::getScale(void) const
void DrawProjGroupItem::unsetupObject()
{
if (getPGroup()) {
if (getPGroup()->hasProjection(Type.getValueAsString()) ) {
if ((getPGroup()->getAnchor() == this) &&
!getPGroup()->isUnsetting() ) {
Base::Console().Warning("Warning - DPG (%s/%s) may be corrupt - Anchor deleted\n",
getPGroup()->getNameInDocument(),getPGroup()->Label.getValue());
getPGroup()->Anchor.setValue(nullptr); //this catches situation where DPGI is deleted w/o DPG::removeProjection
}
}
if (!getPGroup()) {
DrawViewPart::unsetupObject();
return;
}
if (!getPGroup()->hasProjection(Type.getValueAsString()) ) {
DrawViewPart::unsetupObject();
return;
}
if ( getPGroup()->getAnchor() == this &&
!getPGroup()->isUnsetting() ) {
Base::Console().Warning("Warning - DPG (%s/%s) may be corrupt - Anchor deleted\n",
getPGroup()->getNameInDocument(),getPGroup()->Label.getValue());
getPGroup()->Anchor.setValue(nullptr); //this catches situation where DPGI is deleted w/o DPG::removeProjection
}
DrawViewPart::unsetupObject();
}