Salome HOME
Update SketchBuilder to work on faces with holes (issue #1320)
[modules/shaper.git] / src / XGUI / XGUI_Tools.cpp
index 4cf6fdeeffc0d4ae84037982914f717cc12a17df..9bb1dfa84d357c5c5c3cde1cbdad0019ebbab8ea 100644 (file)
@@ -2,6 +2,11 @@
 
 #include "XGUI_Tools.h"
 
+#include "XGUI_ModuleConnector.h"
+#include "XGUI_Workshop.h"
+
+#include "ModuleBase_IWorkshop.h"
+
 #include <TopoDS_Shape.hxx>
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Result.h>
@@ -241,7 +246,8 @@ void refsDirectToFeatureInAllDocuments(const ObjectPtr& theSourceObject, const O
   for (; anIIt != anILast; anIIt++) {
     aFullIgnoreList.append(*anIIt);
     CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(*anIIt);
-    if (aComposite.get()) {
+    // if the current feature is aborted, the composite is removed and has invalid data
+    if (aComposite.get() && aComposite->data()->isValid()) {
       int aNbSubs = aComposite->numberOfSubs();
       for (int aSub = 0; aSub < aNbSubs; aSub++) {
         aFullIgnoreList.append(aComposite->subFeature(aSub));
@@ -319,4 +325,10 @@ void refsDirectToFeatureInAllDocuments(const ObjectPtr& theSourceObject, const O
   }
 }
 
+XGUI_Workshop* workshop(ModuleBase_IWorkshop* theWorkshop)
+{
+  XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
+  return aConnector->workshop();
+}
+
 }