From 2796ee3c59261b90400040b69b7def11908e23d4 Mon Sep 17 00:00:00 2001 From: skv Date: Tue, 28 Jan 2014 09:15:19 +0000 Subject: [PATCH] Exception in Check --- .../MeasureGUI_CheckCompoundOfBlocksDlg.cxx | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx index 7b1d13987..e7fc90a4c 100644 --- a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx @@ -360,22 +360,25 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged() return; } - GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem]; - GEOM::ListOfLong aObjLst = aErr.incriminated; - QStringList aSubShapeList; - TopoDS_Shape aSelShape; - if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) { - TopTools_IndexedMapOfShape anIndices; - TopExp::MapShapes( aSelShape, anIndices ); - for ( int i = 0, n = aObjLst.length(); i < n; i++ ) { - TopoDS_Shape aSubShape = anIndices.FindKey( aObjLst[i] ); - QString aType = GEOMBase::GetShapeTypeString( aSubShape ); - if ( !aType.isEmpty() ) - aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) ); + myGrp->ListBox2->clear(); + + if (aCurItem < aErrs.length()) { + GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem]; + GEOM::ListOfLong aObjLst = aErr.incriminated; + QStringList aSubShapeList; + TopoDS_Shape aSelShape; + if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) { + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes( aSelShape, anIndices ); + for ( int i = 0, n = aObjLst.length(); i < n; i++ ) { + TopoDS_Shape aSubShape = anIndices.FindKey( aObjLst[i] ); + QString aType = GEOMBase::GetShapeTypeString( aSubShape ); + if ( !aType.isEmpty() ) + aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) ); + } } + myGrp->ListBox2->addItems( aSubShapeList ); } - myGrp->ListBox2->clear(); - myGrp->ListBox2->addItems( aSubShapeList ); } //================================================================================= -- 2.30.2