Fix regression List.Empty

This commit is contained in:
jfa 2008-09-26 11:23:35 +00:00
parent 30b93b81e3
commit 6aed1127dd
4 changed files with 28 additions and 16 deletions

View File

@ -153,14 +153,16 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument()
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
if ( !testResult )
aSelectedObject = GEOM::GEOM_Object::_nil();
if (aSelList.Extent() > 0) {
Standard_Boolean testResult = Standard_False;
aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if (!testResult)
aSelectedObject = GEOM::GEOM_Object::_nil();
}
if ( myEditCurrentArgument == mySelEdit )
if (myEditCurrentArgument == mySelEdit)
myObj = aSelectedObject;
else
myObj2 = aSelectedObject;

View File

@ -140,12 +140,14 @@ void MeasureGUI_DistanceDlg::SelectionIntoArgument()
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
if ( !testResult )
aSelectedObject = GEOM::GEOM_Object::_nil();
if (aSelList.Extent() > 0) {
Standard_Boolean testResult = Standard_False;
aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if (!testResult)
aSelectedObject = GEOM::GEOM_Object::_nil();
}
if ( myEditCurrentArgument == mySelEdit )
myObj = aSelectedObject;

View File

@ -131,11 +131,14 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
if (aSelList.Extent() < 1)
return;
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || aSelectedObject->_is_nil() )
if (!testResult || aSelectedObject->_is_nil())
return;
myObj = aSelectedObject;

View File

@ -250,11 +250,16 @@ void MeasureGUI_Skeleton::SelectionIntoArgument()
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
if (!testResult || aSelectedObject->_is_nil()) {
if (aSelList.Extent() > 0) {
Standard_Boolean testResult = Standard_False;
aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if (!testResult)
aSelectedObject = GEOM::GEOM_Object::_nil();
}
if (aSelectedObject->_is_nil()) {
mySelEdit->setText("");
processObject();
erasePreview();