]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1343 Improvement of Extrusion and Revolution operations: use transaction to...
authornds <nds@opencascade.com>
Wed, 23 Mar 2016 17:23:14 +0000 (20:23 +0300)
committerdbv <dbv@opencascade.com>
Wed, 6 Apr 2016 10:24:31 +0000 (13:24 +0300)
src/PartSet/PartSet_WidgetSketchCreator.cpp

index 24e0f5f504b6c40171fb39a8f9768de90517c7f7..58c2776d1119b7ec5de2a105dcb90f7378f95a96 100644 (file)
@@ -195,7 +195,16 @@ bool PartSet_WidgetSketchCreator::canCommitCurrentSketch(ModuleBase_IWorkshop* t
                              std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aParentFeature);
     // check if both features are composite: extrusion and sketch
     if (aCompositeFeature.get() && aPCompositeFeature.get()) {
+      // selection attribute list is currently filled in execute(), so we need to call it
+      // if there is no opened transaction, it should be started and finished
+      SessionPtr aMgr = ModelAPI_Session::get();
+      bool aIsOp = aMgr->isOperation();
+      if (!aIsOp)
+        aMgr->startOperation();
       aPCompositeFeature->execute(); // to fill attribute selection list
+      if (!aIsOp)
+        aMgr->finishOperation();
+
       std::list<AttributePtr> aSelListAttributes = aParentFeature->data()->attributes(
                                                         ModelAPI_AttributeSelectionList::typeId());
       if (aSelListAttributes.size() == 1) {