From 945325b7b3d9989413bf71cb5186911836370a2f Mon Sep 17 00:00:00 2001 From: san Date: Mon, 19 Sep 2011 12:11:24 +0000 Subject: [PATCH] Bug fix: Id of removed tab not removed from myIdIndex map in method tabRemoved(). --- src/Qtx/QtxWorkstack.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 ); } /*! -- 2.39.2