From: dmv Date: Mon, 1 Mar 2010 14:00:46 +0000 (+0000) Subject: Correct implementation of Max Subshape limiter. X-Git-Tag: V5_1_4a1~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12cb4bfcddbc3f550c5e38ab2e3ea787b89f1d0e;p=modules%2Fsmesh.git Correct implementation of Max Subshape limiter. --- diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx index 26527d85b..5350cf9d2 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx @@ -83,7 +83,7 @@ StdMeshersGUI_SubShapeSelectorWdg ::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent ): QWidget( parent ), myPreviewActor( 0 ), - myMaxSize( 0 ) + myMaxSize( -1 ) { QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) ); @@ -270,7 +270,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd() return; myListWidget->blockSignals( true ); - for (int i = 0; i < mySelectedIDs.size() && (myMaxSize < 1 || myListOfIDs.size() < myMaxSize); i++) { + for (int i = 0; i < mySelectedIDs.size() && (myMaxSize == -1 || myListOfIDs.size() < myMaxSize); i++) { if ( myListOfIDs.indexOf( mySelectedIDs.at(i) ) == -1 ) { QString anID = QString(" %1").arg( mySelectedIDs.at(i) ); @@ -282,7 +282,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd() } onListSelectionChanged(); myListWidget->blockSignals( false ); - myAddButton->setEnabled( myListOfIDs.size() < myMaxSize ); + myAddButton->setEnabled( myMaxSize == -1 || myListOfIDs.size() < myMaxSize ); } //=================================================================================