From 106b8cea89023fae3d029056e5921299f392ecc3 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 27 Feb 2009 11:09:02 +0000 Subject: [PATCH] 0020183: EDF SMESH 966 : Mesh element info anomaly fix GetElemObjId(): prevent from out_of_range error if theVtkID==myVTK2ObjIds.size() --- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index c9f40a734..aa3055f2b 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -23,7 +23,6 @@ // File : VTKViewer_GeometryFilter.cxx // Author : Michael ZORIN // Module : SALOME -// $Header$ // #include "VTKViewer_GeometryFilter.h" #include "VTKViewer_ConvexTool.h" @@ -994,11 +993,7 @@ VTKViewer_GeometryFilter vtkIdType VTKViewer_GeometryFilter::GetElemObjId( int theVtkID ) { - if( myVTK2ObjIds.empty() || theVtkID > (int)myVTK2ObjIds.size() ) + if( theVtkID < 0 || theVtkID >= (int)myVTK2ObjIds.size() ) return -1; -#if defined __GNUC_2__ return myVTK2ObjIds[theVtkID]; -#else - return myVTK2ObjIds.at(theVtkID); -#endif } -- 2.39.2