From: vsv Date: Mon, 15 Jun 2015 08:15:24 +0000 (+0300) Subject: Abort operation ExtrusionCur if sketcher was aborted X-Git-Tag: V_1.3.0~240 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e44cf263319d3014a4a9d759bb77e62b167b93da;p=modules%2Fshaper.git Abort operation ExtrusionCur if sketcher was aborted --- diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index c0a43dbfd..fb687a891 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -133,11 +133,7 @@ bool PartSet_WidgetSketchCreator::focusTo() if (aCompFeature->numberOfSubs() == 0) return ModuleBase_ModelWidget::focusTo(); - CompositeFeaturePtr aSketchFeature = - std::dynamic_pointer_cast(aCompFeature->subFeature(0)); - if (aSketchFeature->numberOfSubs() == 0) { - connect(myModule, SIGNAL(operationResumed(ModuleBase_Operation*)), SLOT(onResumed(ModuleBase_Operation*))); - } + connect(myModule, SIGNAL(operationResumed(ModuleBase_Operation*)), SLOT(onResumed(ModuleBase_Operation*))); SessionPtr aMgr = ModelAPI_Session::get(); bool aIsOp = aMgr->isOperation(); // Open transaction if it was closed before @@ -150,11 +146,17 @@ bool PartSet_WidgetSketchCreator::focusTo() void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) { - // Abort operation - SessionPtr aMgr = ModelAPI_Session::get(); - bool aIsOp = aMgr->isOperation(); - // Close transaction - if (aIsOp) - aMgr->abortOperation(); - theOp->abort(); + CompositeFeaturePtr aCompFeature = + std::dynamic_pointer_cast(myFeature); + CompositeFeaturePtr aSketchFeature = + std::dynamic_pointer_cast(aCompFeature->subFeature(0)); + if (aSketchFeature->numberOfSubs() == 0) { + // Abort operation + SessionPtr aMgr = ModelAPI_Session::get(); + bool aIsOp = aMgr->isOperation(); + // Close transaction + if (aIsOp) + aMgr->abortOperation(); + theOp->abort(); + } }