Kaydet (Commit) 0f3a3c38 authored tarafından Ras-al-Ghul's avatar Ras-al-Ghul Kaydeden (comit) Michael Meeks

tdf#96888 Kill internal vcl dog-tags ..

Made pBorderWin a VclPtr

Change-Id: I1869371b410276df2e7504b32617c2d1e2b6725f
Reviewed-on: https://gerrit.libreoffice.org/21281Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst ba539fa9
......@@ -432,15 +432,13 @@ void ToolBox::Highlight()
void ToolBox::Select()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
VclPtr<vcl::Window> xWindow = this;
CallEventListeners( VCLEVENT_TOOLBOX_SELECT );
maSelectHdl.Call( this );
if ( aDelData.IsDead() )
if ( xWindow->IsDisposed() )
return;
ImplRemoveDel( &aDelData );
// TODO: GetFloatingWindow in DockingWindow is currently inline, change it to check dockingwrapper
ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
......@@ -1892,22 +1890,19 @@ void ToolBox::ImplExecuteCustomMenu()
GetMenu()->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
// toolbox might be destroyed during execute
ImplDelData aDelData;
ImplAddDel( &aDelData );
ImplDelData aBorderDel;
bool bBorderDel = false;
vcl::Window *pWin = this;
VclPtr<vcl::Window> pWin = this;
Rectangle aMenuRect = mpData->maMenubuttonItem.maRect;
VclPtr<ImplBorderWindow> pBorderWin;
if( IsFloatingMode() )
{
// custom menu is placed in the decoration
ImplBorderWindow *pBorderWin = dynamic_cast<ImplBorderWindow*>( GetWindow( GetWindowType::Border ) );
pBorderWin = dynamic_cast<ImplBorderWindow*>( GetWindow( GetWindowType::Border ) );
if( pBorderWin && !pBorderWin->GetMenuRect().IsEmpty() )
{
pWin = pBorderWin;
aMenuRect = pBorderWin->GetMenuRect();
pWin->ImplAddDel( &aBorderDel );
bBorderDel = true;
}
}
......@@ -1915,17 +1910,15 @@ void ToolBox::ImplExecuteCustomMenu()
sal_uInt16 uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ),
PopupMenuFlags::ExecuteDown | PopupMenuFlags::NoMouseUpClose );
if ( aDelData.IsDead() )
if ( pWin->IsDisposed() )
return;
ImplRemoveDel( &aDelData );
if( GetMenu() )
GetMenu()->RemoveEventListener( LINK( this, ToolBox, ImplCustomMenuListener ) );
if( bBorderDel )
{
if( aBorderDel.IsDead() )
if( pBorderWin->IsDisposed() )
return;
pWin->ImplRemoveDel( &aBorderDel );
}
pWin->Invalidate( aMenuRect );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment