summaryrefslogtreecommitdiff
path: root/framework/source/uielement/toolbarmanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/uielement/toolbarmanager.cxx')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 5ca1bb8daa69..1ee4797d889b 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -232,13 +232,10 @@ void ToolBarManager::Destroy()
delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( nItemId ));
}
- // Hide toolbar as lazy delete can destroy the toolbar much later.
- m_pToolBar->Hide();
- // #i93173# delete toolbar lazily as we can still be in one of its handlers
// tdf#119390 this will reparent the toolbar, so focus is restored from a
// floating toolbar to the last focused control of the application window.
- m_pToolBar->doLazyDelete();
-
+ m_pToolBar->SetParentToDefaultWindow();
+ // #i93173# note we can still be in one of the toolbar's handlers
m_pToolBar->SetSelectHdl( Link<ToolBox *, void>() );
m_pToolBar->SetActivateHdl( Link<ToolBox *, void>() );
m_pToolBar->SetDeactivateHdl( Link<ToolBox *, void>() );
@@ -248,7 +245,7 @@ void ToolBarManager::Destroy()
m_pToolBar->SetStateChangedHdl( Link<StateChangedType const *, void>() );
m_pToolBar->SetDataChangedHdl( Link<DataChangedEvent const *, void>() );
- m_pToolBar.clear();
+ m_pToolBar.disposeAndClear();
SvtMiscOptions().RemoveListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
}