From: san Date: Mon, 19 Sep 2011 12:11:24 +0000 (+0000) Subject: Bug fix: Id of removed tab not removed from myIdIndex map in method tabRemoved(). X-Git-Tag: V5_1_14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=945325b7b3d9989413bf71cb5186911836370a2f;p=modules%2Fgui.git Bug fix: Id of removed tab not removed from myIdIndex map in method tabRemoved(). --- diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 08f82ef9c..a9c4bf558 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -1483,16 +1483,23 @@ void QtxWorkstackTabBar::tabInserted( int index ) if ( it.value() >= index ) it.value()++; } + myIdIndex.insert( tabId( index ), index ); } void QtxWorkstackTabBar::tabRemoved( int index ) { QTabBar::tabRemoved( index ); + int id = -1; for ( QMap::iterator it = myIdIndex.begin(); it != myIdIndex.end(); ++it ) { - if ( it.value() > index ) + if ( it.value() == index ) + id = it.key(); + else if ( it.value() > index ) it.value()--; } + + if ( id >= 0 ) + myIdIndex.remove( id ); } /*!