From: nds Date: Wed, 23 Mar 2016 17:23:14 +0000 (+0300) Subject: Issue #1343 Improvement of Extrusion and Revolution operations: use transaction to... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3171524bb6f29701e49ad6fae636bea0ee7af0fc;p=modules%2Fshaper.git Issue #1343 Improvement of Extrusion and Revolution operations: use transaction to avoid warning about modification model outside of a transaction. --- diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 24e0f5f50..58c2776d1 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -195,7 +195,16 @@ bool PartSet_WidgetSketchCreator::canCommitCurrentSketch(ModuleBase_IWorkshop* t std::dynamic_pointer_cast(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 aSelListAttributes = aParentFeature->data()->attributes( ModelAPI_AttributeSelectionList::typeId()); if (aSelListAttributes.size() == 1) {