//------------------------------------------------------------------------
void WidgetShowNPoints::OnDeleteCollection(wxCommandEvent &event)
{
- if ( lstModelShowNPoints.size()>=1 )
+ if ( lstModelShowNPoints.size()>1 )
{
DeleteAllPoints(); // Actual Collection
lstModelShowNPoints.erase( lstModelShowNPoints.begin()+mActualCollection );
- mActualCollection--;
+ lstViewShowNPoints.erase( lstViewShowNPoints.begin()+mActualCollection );
+ if ( mActualCollection>=lstModelShowNPoints.size() )
+ {
+ mActualCollection--;
+ } // if
}
RefreshCollectionText();
}