diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-08 07:49:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-08 07:50:14 +0200 |
commit | fc4726a1f41ded40ce7d7100350c322863646b37 (patch) | |
tree | d0505d763b406081439b77b2e2630c4dd76bb656 | |
parent | 0c415f61e4d2fb4efc50fe0401376657af47d203 (diff) |
Use typed Menu::Set[De]actuivateHdl Links
Change-Id: I6736383ad0ec5c9f2ea2281bfdcfa280cd712032
-rw-r--r-- | framework/inc/classes/menumanager.hxx | 4 | ||||
-rw-r--r-- | framework/inc/uielement/menubarmanager.hxx | 4 | ||||
-rw-r--r-- | framework/inc/uielement/toolbarmanager.hxx | 2 | ||||
-rw-r--r-- | framework/source/classes/menumanager.cxx | 12 | ||||
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 10 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 10 | ||||
-rw-r--r-- | include/sfx2/mnuitem.hxx | 2 | ||||
-rw-r--r-- | include/vcl/menu.hxx | 10 | ||||
-rw-r--r-- | sfx2/source/inc/virtmenu.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/menu/mnuitem.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/menu/virtmenu.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/glossary.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PageBreakWin.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/inc/PageBreakWin.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/glossary.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/swuicnttab.hxx | 2 |
17 files changed, 46 insertions, 48 deletions
diff --git a/framework/inc/classes/menumanager.hxx b/framework/inc/classes/menumanager.hxx index 92dc2d6028cd..4c471a29f398 100644 --- a/framework/inc/classes/menumanager.hxx +++ b/framework/inc/classes/menumanager.hxx @@ -76,8 +76,8 @@ class MenuManager : public ::cppu::WeakImplHelper1< css::frame::XStatusListener protected: DECL_LINK_TYPED(Highlight, Menu *, bool); - DECL_LINK( Activate, Menu * ); - DECL_LINK( Deactivate, Menu * ); + DECL_LINK_TYPED( Activate, Menu *, bool ); + DECL_LINK_TYPED( Deactivate, Menu *, bool ); private: void UpdateSpecialFileMenu( Menu* pMenu ); diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index 23cd41d5a54a..b72d515be311 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -152,8 +152,8 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener protected: DECL_LINK_TYPED(Highlight, Menu *, bool); - DECL_LINK( Activate, Menu * ); - DECL_LINK( Deactivate, Menu * ); + DECL_LINK_TYPED( Activate, Menu *, bool ); + DECL_LINK_TYPED( Deactivate, Menu *, bool ); DECL_LINK_TYPED( AsyncSettingsHdl, Timer *, void ); void RemoveListener(); diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 3acc8c6fe3f2..78fb5a03f0c6 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -140,7 +140,7 @@ class ToolBarManager : public ToolbarManager_Base DECL_LINK_TYPED( MenuButton, ToolBox *, void ); DECL_LINK( MenuSelect, Menu * ); - DECL_LINK( MenuDeactivate, Menu * ); + DECL_LINK_TYPED( MenuDeactivate, Menu *, bool ); DECL_LINK_TYPED(AsyncUpdateControllersHdl, Timer *, void); DECL_STATIC_LINK( ToolBarManager, ExecuteHdl_Impl, ExecuteInfo* ); diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index 761d903e8ddf..e2e182700b9e 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -709,7 +709,7 @@ void MenuManager::CreatePicklistArguments( Sequence< PropertyValue >& aArgsList, // vcl handler -IMPL_LINK( MenuManager, Activate, Menu *, pMenu ) +IMPL_LINK_TYPED( MenuManager, Activate, Menu *, pMenu, bool ) { if ( pMenu == m_pVCLMenu ) { @@ -726,7 +726,7 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu ) pMenu->SetMenuFlags( nFlag ); if ( m_bActive ) - return 0; + return false; m_bActive = true; @@ -751,7 +751,7 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu ) } if ( m_bInitialized ) - return 0; + return false; else { URL aTargetURL; @@ -806,15 +806,15 @@ IMPL_LINK( MenuManager, Activate, Menu *, pMenu ) } } - return 1; + return true; } -IMPL_LINK( MenuManager, Deactivate, Menu *, pMenu ) +IMPL_LINK_TYPED( MenuManager, Deactivate, Menu *, pMenu, bool ) { if ( pMenu == m_pVCLMenu ) m_bActive = false; - return 1; + return true; } IMPL_LINK( MenuManager, Select, Menu *, pMenu ) diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 785080c29f83..7cb3b9046feb 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -723,7 +723,7 @@ private: } -IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) +IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool ) { if ( pMenu == m_pVCLMenu ) { @@ -747,7 +747,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) pMenu->SetMenuFlags( nFlag ); if ( m_bActive ) - return 0; + return false; m_bActive = true; @@ -917,10 +917,10 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) } } - return 1; + return true; } -IMPL_LINK( MenuBarManager, Deactivate, Menu *, pMenu ) +IMPL_LINK_TYPED( MenuBarManager, Deactivate, Menu *, pMenu, bool ) { if ( pMenu == m_pVCLMenu ) { @@ -936,7 +936,7 @@ IMPL_LINK( MenuBarManager, Deactivate, Menu *, pMenu ) } } - return 1; + return true; } IMPL_LINK_NOARG_TYPED( MenuBarManager, AsyncSettingsHdl, Timer*, void) diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index d175b6edba44..0c0eb437d0d4 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1606,19 +1606,19 @@ void ToolBarManager::ImplClearPopupMenu( ToolBox *pToolBar ) } } -IMPL_LINK( ToolBarManager, MenuDeactivate, Menu*, pMenu ) +IMPL_LINK_TYPED( ToolBarManager, MenuDeactivate, Menu*, pMenu, bool ) { SolarMutexGuard g; if ( m_bDisposed ) - return 1; + return true; if( pMenu != m_pToolBar->GetMenu() ) - return 1; + return true; ImplClearPopupMenu( m_pToolBar ); - return 0; + return false; } Reference< XModel > ToolBarManager::GetModelFromFrame() const @@ -1806,7 +1806,7 @@ IMPL_LINK_TYPED( ToolBarManager, Command, CommandEvent const *, pCmdEvt, void ) { // Unlink our listeners again -- see above for why. pManagerMenu->SetSelectHdl( Link<>() ); - pManagerMenu->SetDeactivateHdl( Link<>() ); + pManagerMenu->SetDeactivateHdl( Link<Menu *, bool>() ); } } } diff --git a/include/sfx2/mnuitem.hxx b/include/sfx2/mnuitem.hxx index 98f0cc1a95d3..0d40854922a5 100644 --- a/include/sfx2/mnuitem.hxx +++ b/include/sfx2/mnuitem.hxx @@ -127,7 +127,7 @@ class SfxAppMenuControl_Impl : public SfxMenuControl bool m_bShowMenuImages; protected: - DECL_LINK( Activate, Menu * ); // Needed to support high contrast images + DECL_LINK_TYPED( Activate, Menu *, bool ); // Needed to support high contrast images public: SfxAppMenuControl_Impl( sal_uInt16 nPos, Menu& rMenu, SfxBindings& rBindings ); diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 352efaf6628b..7c570f0f646b 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -126,8 +126,8 @@ private: Menu* pStartedFrom; VclPtr<vcl::Window> pWindow; - Link<> aActivateHdl; // Active-Handler - Link<> aDeactivateHdl; // Deactivate-Handler + Link<Menu *, bool> aActivateHdl; // Active-Handler + Link<Menu *, bool> aDeactivateHdl; // Deactivate-Handler Link<Menu *, bool> aHighlightHdl; // Highlight-Handler Link<> aSelectHdl; // Highlight-Handler @@ -320,11 +320,9 @@ public: void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId ); OString GetHelpId( sal_uInt16 nItemId ) const; - void SetActivateHdl( const Link<>& rLink ) { aActivateHdl = rLink; } - const Link<>& GetActivateHdl() const { return aActivateHdl; } + void SetActivateHdl( const Link<Menu *, bool>& rLink ) { aActivateHdl = rLink; } - void SetDeactivateHdl( const Link<>& rLink ) { aDeactivateHdl = rLink; } - const Link<>& GetDeactivateHdl() const { return aDeactivateHdl; } + void SetDeactivateHdl( const Link<Menu *, bool>& rLink ) { aDeactivateHdl = rLink; } void SetHighlightHdl( const Link<Menu *, bool>& rLink ) { aHighlightHdl = rLink; } diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx index 0bf8dc7a12e6..48b5064e395b 100644 --- a/sfx2/source/inc/virtmenu.hxx +++ b/sfx2/source/inc/virtmenu.hxx @@ -70,8 +70,8 @@ protected: void CreateFromSVMenu(); DECL_LINK_TYPED( Highlight, Menu *, bool ); - DECL_LINK( Activate, Menu * ); - DECL_LINK( Deactivate, Menu * ); + DECL_LINK_TYPED( Activate, Menu *, bool ); + DECL_LINK_TYPED( Deactivate, Menu *, bool ); DECL_LINK( SettingsChanged, void* ); // Used for runtime popup menus diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 61cf0048daf1..0866ef8993e6 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -326,7 +326,7 @@ SfxAppMenuControl_Impl::~SfxAppMenuControl_Impl() delete pMenu; } -IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) +IMPL_LINK_TYPED( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu, bool ) { if ( pActMenu ) { @@ -382,10 +382,10 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) } } - return sal_True; + return true; } - return sal_False; + return false; } SfxUnoMenuControl* SfxMenuControl::CreateControl( const OUString& rCmd, diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index dd0682ac714f..36ff55a9fde3 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -775,7 +775,7 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu ) // called on activation of the SV-Menu -IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) +IMPL_LINK_TYPED( SfxVirtualMenu, Activate, Menu *, pMenu, bool ) { SAL_INFO( "sfx", @@ -801,7 +801,7 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) { // Prevent Double Activate if ( bIsActive ) - return sal_True; + return true; // ggf. Pick-Menu erzeugen if ( pParent && pSVMenu == pParent->pPickMenu ) @@ -894,7 +894,7 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) // Suppress the Status updates until Deactivate pBindings->ENTERREGISTRATIONS(); ++nLocks; bIsActive = true; - return sal_True; + return true; } else { @@ -905,13 +905,13 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu ) if ( !bRet) DBG_WARNING( "W1: Virtual menu could not be created!" ); #endif - return long(bRet); + return bRet; } } -IMPL_LINK( SfxVirtualMenu, Deactivate, Menu *, pMenu ) +IMPL_LINK_TYPED( SfxVirtualMenu, Deactivate, Menu *, pMenu, bool ) { SAL_INFO( "sfx", @@ -925,7 +925,7 @@ IMPL_LINK( SfxVirtualMenu, Deactivate, Menu *, pMenu ) UnbindControllers(); pBindings->LEAVEREGISTRATIONS(); --nLocks; bIsActive = false; } - return sal_True; + return true; } diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index fefe6b925a25..9bdf2e16af2c 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1487,10 +1487,10 @@ IMPL_LINK(SwTOXSelectTabPage, AddStylesHdl, PushButton*, pButton) return 0; } -IMPL_LINK(SwTOXSelectTabPage, MenuEnableHdl, Menu*, pMenu) +IMPL_LINK_TYPED(SwTOXSelectTabPage, MenuEnableHdl, Menu*, pMenu, bool) { pMenu->EnableItem("edit", !sAutoMarkURL.isEmpty()); - return 0; + return false; } IMPL_LINK(SwTOXSelectTabPage, MenuExecuteHdl, Menu*, pMenu) diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index c8d4f0799cfc..1f7a6ffb72cf 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -418,7 +418,7 @@ IMPL_LINK( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox ) return 0; } -IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn ) +IMPL_LINK_TYPED( SwGlossaryDlg, EnableHdl, Menu *, pMn, bool ) { SvTreeListEntry* pEntry = m_pCategoryBox->FirstSelected(); @@ -437,7 +437,7 @@ IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn ) pMn->EnableItem("macro", bExists && !bIsGroup && !bIsOld && !pGlossaryHdl->IsReadOnly() ); pMn->EnableItem("import", bIsGroup && !bIsOld && !pGlossaryHdl->IsReadOnly() ); - return 1; + return true; } IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 0840c825261c..226d46df59d8 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -434,11 +434,11 @@ void SwPageBreakWin::Fade( bool bFadeIn ) m_aFadeTimer.Start( ); } -IMPL_LINK_NOARG(SwPageBreakWin, HideHandler) +IMPL_LINK_NOARG_TYPED(SwPageBreakWin, HideHandler, Menu *, bool) { Fade( false ); - return 0; + return false; } IMPL_LINK_NOARG_TYPED(SwPageBreakWin, FadeHandler, Timer *, void) diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx index d2c165e043b1..6efb632f0ada 100644 --- a/sw/source/uibase/inc/PageBreakWin.hxx +++ b/sw/source/uibase/inc/PageBreakWin.hxx @@ -55,7 +55,7 @@ public: private: /// Hide the button (used when the popup menu is closed by clicking outside) - DECL_LINK( HideHandler, void * ); + DECL_LINK_TYPED( HideHandler, Menu *, bool ); DECL_LINK_TYPED( FadeHandler, Timer *, void ); }; diff --git a/sw/source/uibase/inc/glossary.hxx b/sw/source/uibase/inc/glossary.hxx index ca045327711c..56fd84460843 100644 --- a/sw/source/uibase/inc/glossary.hxx +++ b/sw/source/uibase/inc/glossary.hxx @@ -127,7 +127,7 @@ class SwGlossaryDlg : public SvxStandardDialog DECL_LINK( NameDoubleClick, SvTreeListBox * ); DECL_LINK( GrpSelect, SvTreeListBox * ); DECL_LINK( MenuHdl, Menu * ); - DECL_LINK( EnableHdl, Menu * ); + DECL_LINK_TYPED( EnableHdl, Menu *, bool ); DECL_LINK(BibHdl, void *); DECL_LINK_TYPED(EditHdl, MenuButton *, void); DECL_LINK(InsertHdl, void *); diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index 2f4da99cf181..7a35d4744fbb 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -205,7 +205,7 @@ class SwTOXSelectTabPage : public SfxTabPage DECL_LINK(TOXTypeHdl, ListBox* ); DECL_LINK(AddStylesHdl, PushButton* ); - DECL_LINK(MenuEnableHdl, Menu*); + DECL_LINK_TYPED(MenuEnableHdl, Menu*, bool); DECL_LINK(MenuExecuteHdl, Menu*); DECL_LINK(LanguageHdl, ListBox*); |