Resolves: tdf#99857 missing items from toolbar right click
we do an activate/deactivate to force the vcl menu to update so we have a full model before we try to show the gtk one. This particular toplevel menu has a deactivate handler which empties out the submenus on the deactivate, so we don't get the full thing, so we end up with missing entries. The Deactivate to empty the menu is a bit dubious. Even if we limited the activate/deactivate to submenus we still get the deactivate before the "select" so the ordering is fragile. The Deactivate handler seems dubious anyway, why not just clear it out after the Execute has finished which is simpler and more direct anyway dde83e3cea5b5fc1f91ebd336a2071ce8ff75e75 Change-Id: I56145f6236db1787cc4ee623c513cb927bf2a972
This commit is contained in:
@@ -128,7 +128,7 @@ class ToolBarManager : public ToolbarManager_Base
|
||||
|
||||
DECL_LINK_TYPED( MenuButton, ToolBox *, void );
|
||||
DECL_LINK_TYPED( MenuSelect, Menu *, bool );
|
||||
DECL_LINK_TYPED( MenuDeactivate, Menu *, bool );
|
||||
void MenuDeactivated();
|
||||
DECL_LINK_TYPED(AsyncUpdateControllersHdl, Timer *, void);
|
||||
DECL_STATIC_LINK_TYPED( ToolBarManager, ExecuteHdl_Impl, void*, void );
|
||||
|
||||
|
@@ -1332,19 +1332,11 @@ void ToolBarManager::ImplClearPopupMenu( ToolBox *pToolBar )
|
||||
}
|
||||
}
|
||||
|
||||
IMPL_LINK_TYPED( ToolBarManager, MenuDeactivate, Menu*, pMenu, bool )
|
||||
void ToolBarManager::MenuDeactivated()
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
if (m_bDisposed)
|
||||
return true;
|
||||
|
||||
if( pMenu != m_pToolBar->GetMenu() )
|
||||
return true;
|
||||
|
||||
return;
|
||||
ImplClearPopupMenu(m_pToolBar);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference< XModel > ToolBarManager::GetModelFromFrame() const
|
||||
@@ -1539,7 +1531,6 @@ IMPL_LINK_TYPED( ToolBarManager, Command, CommandEvent const *, pCmdEvt, void )
|
||||
// when the menu is being used as an overflow menu.
|
||||
Menu *pManagerMenu = m_pToolBar->GetMenu();
|
||||
pManagerMenu->SetSelectHdl( LINK( this, ToolBarManager, MenuSelect ) );
|
||||
pManagerMenu->SetDeactivateHdl( LINK( this, ToolBarManager, MenuDeactivate ) );
|
||||
|
||||
// make sure all disabled entries will be shown
|
||||
pMenu->SetMenuFlags( pMenu->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
|
||||
@@ -1553,7 +1544,7 @@ IMPL_LINK_TYPED( ToolBarManager, Command, CommandEvent const *, pCmdEvt, void )
|
||||
{
|
||||
// Unlink our listeners again -- see above for why.
|
||||
pManagerMenu->SetSelectHdl( Link<Menu*, bool>() );
|
||||
pManagerMenu->SetDeactivateHdl( Link<Menu *, bool>() );
|
||||
MenuDeactivated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user