X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetSketchLabel.cpp;h=2ce6f152e509dc63d733a5228c3e3a327f96f137;hb=1834431e0e067cbb4616f42679562d56af528f5e;hp=239aeb75ad18beec5d7b656c7b4f61110cf63136;hpb=af899dd91be39cdb63992c001908f27833835174;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 239aeb75a..2ce6f152e 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -85,6 +85,17 @@ PartSet_WidgetSketchLabel::~PartSet_WidgetSketchLabel() erasePreviewPlanes(); } +bool PartSet_WidgetSketchLabel::setSelection(const QList& theValues, int& thePosition) +{ + // do not use the given selection if the plane of the sketch has been already set. + // If this check is absent, a selected plane in the viewer can be set in the sketch + // even if the sketch is built on another plane. + if (plane().get()) + return true; + + return ModuleBase_WidgetValidated::setSelection(theValues, thePosition); +} + QList PartSet_WidgetSketchLabel::getControls() const { QList aResult; @@ -215,7 +226,7 @@ bool PartSet_WidgetSketchLabel::setSelectionCustom(const ModuleBase_ViewerPrs& t } else if (!aShape.IsNull()) { aDir = setSketchPlane(aShape); - isOwnerSet = aDir; + isOwnerSet = aDir.get(); } return isOwnerSet; }