X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Workshop.cpp;h=cb56c38795c4e51f8a1c29093dfa6b31a54ee0f2;hb=220bd2b37119be1c65abf88a88792445cb9d99f8;hp=c754c7de3663bf108d0b52fbb6aa61595655f509;hpb=e7df788b6775ede4d90fb4579ab5c3e630e2a88f;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index c754c7de3..cb56c3879 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1436,6 +1436,11 @@ bool XGUI_Workshop::isDeleteFeatureWithReferences(const QObjectPtrList& theList, QStringList aPartFeatureNames; foreach (ObjectPtr aObj, theList) { FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + // invalid feature data means that the feature is already removed in model, + // we needn't process it. E.g. delete of feature from create operation. The operation abort + // will delete the operation + if (!aFeature->data()->isValid()) + continue; ResultPtr aFirstResult = aFeature->firstResult(); std::string aResultGroupName = aFirstResult->groupName(); if (aResultGroupName == ModelAPI_ResultPart::group()) @@ -1973,8 +1978,14 @@ void XGUI_Workshop::synchronizeGroupInViewer(const DocumentPtr& theDoc, int aSize = theDoc->size(theGroup); for (int i = 0; i < aSize; i++) { aObj = theDoc->object(theGroup, i); - if (aObj->isDisplayed()) + if (aObj->isDisplayed()) { + // Hide the presentation with an empty shape. But isDisplayed state of the object should not + // be changed to the object becomes visible when the shape becomes not empty + ResultPtr aRes = std::dynamic_pointer_cast(aObj); + if (aRes.get() && (!aRes->shape().get() || aRes->shape()->isNull())) + continue; myDisplayer->display(aObj, false); + } } if (theUpdateViewer) myDisplayer->updateViewer();