From 2983d733e39080015927090df558ba4eb0eec710 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 28 Apr 2008 12:47:30 +0000 Subject: [PATCH] fix for PAL19420: the toolbar should be found not only by name but also by corresponding main window (except if main window is null) --- src/Qtx/QtxActionToolMgr.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index e2c4b2048..84f285313 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -102,10 +102,9 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW int tbId = -1; for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end() && tbId == -1; ++it ) { - // NKV - BUG IPAL19144 - search by toolbar title is done below via find() function - // if ( it.value().toolBar->windowTitle().toLower() == title.toLower() ) - // tbId = it.key(); - if (it.key() == tid) tbId = it.key(); + if( it.value().toolBar->windowTitle().toLower() == title.toLower() && + ( !mw || it.value().toolBar->parent()==mw ) ) + tbId = it.key(); } if ( tbId != -1 ) @@ -122,7 +121,7 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW if ( !tb ) { tb = new QtxToolBar( true, tbw ); - mainWindow()->addToolBar( tb ); + //mainWindow()->addToolBar( tb ); tb->setWindowTitle( title ); tb->setObjectName( title ); } -- 2.39.2