IPAL19241 REGR: Incorrect message on Explode if Point is selected as Main Object.

This commit is contained in:
dmv 2008-05-19 06:58:42 +00:00
parent 17fb3c8639
commit cd6d281a95

View File

@ -215,6 +215,7 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
S.IsNull() || S.IsNull() ||
S.ShapeType() == TopAbs_VERTEX ) S.ShapeType() == TopAbs_VERTEX )
{ {
myObject = GEOM::GEOM_Object::_nil();
updateButtonState(); updateButtonState();
return; return;
} }
@ -524,9 +525,8 @@ GEOM::GEOM_IOperations_ptr EntityGUI_SubShapeDlg::createOperation()
bool EntityGUI_SubShapeDlg::isValid( QString& msg ) bool EntityGUI_SubShapeDlg::isValid( QString& msg )
{ {
bool isOk = false; bool isOk = false;
Handle(SALOME_InteractiveObject) IO = firstIObject();
Standard_Boolean testResult; Standard_Boolean testResult;
myObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult ); GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if ( !testResult || myObject->_is_nil() ) { if ( !testResult || myObject->_is_nil() ) {
updateButtonState(); updateButtonState();
return isOk; return isOk;
@ -535,11 +535,7 @@ bool EntityGUI_SubShapeDlg::isValid( QString& msg )
if ( isAllSubShapes() ) if ( isAllSubShapes() )
isOk = true; isOk = true;
else if ( IObjectCount() == 1 ) { else if ( IObjectCount() == 1 ) {
Standard_Boolean aResult = Standard_False; if ( testResult && !anObj->_is_nil() ) {
GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() ) {
TColStd_IndexedMapOfInteger aMapIndex; TColStd_IndexedMapOfInteger aMapIndex;
myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex ); myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
isOk = aMapIndex.Extent() > 0; isOk = aMapIndex.Extent() > 0;