diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-14 11:04:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-15 09:37:31 +0200 |
commit | 30350f72d8ce9d60ae6c47d602eff90f34bf71a9 (patch) | |
tree | ce47b62618d93ce59bd527320e6c37a345afd473 | |
parent | dccd68adba8affbac7080cfe7ac97451037b79a0 (diff) |
convert Link<> to typed
Change-Id: I99ae0ff43a25dbaf8f6f5f03ec0f8751f0893ccb
-rw-r--r-- | include/svtools/menuoptions.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/inc/virtmenu.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/menu/virtmenu.cxx | 4 | ||||
-rw-r--r-- | svtools/source/config/menuoptions.cxx | 31 |
4 files changed, 16 insertions, 25 deletions
diff --git a/include/svtools/menuoptions.hxx b/include/svtools/menuoptions.hxx index 064898d80084..7f448dcda765 100644 --- a/include/svtools/menuoptions.hxx +++ b/include/svtools/menuoptions.hxx @@ -58,8 +58,8 @@ class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions: public utl::detail::Options SvtMenuOptions(); virtual ~SvtMenuOptions(); - void AddListenerLink( const Link<>& rLink ); - void RemoveListenerLink( const Link<>& rLink ); + void AddListenerLink( const Link<LinkParamNone*,void>& rLink ); + void RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ); /*-**************************************************************************************************** @short interface methods to get and set value of config key "org.openoffice.Office.Common/View/Menu/..." diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx index 370e24f1b956..f353169ab0d7 100644 --- a/sfx2/source/inc/virtmenu.hxx +++ b/sfx2/source/inc/virtmenu.hxx @@ -72,7 +72,7 @@ protected: DECL_STATIC_LINK_TYPED( SfxVirtualMenu, Highlight, Menu *, bool ); DECL_LINK_TYPED( Activate, Menu *, bool ); DECL_LINK_TYPED( Deactivate, Menu *, bool ); - DECL_LINK( SettingsChanged, void* ); + DECL_LINK_TYPED( SettingsChanged, LinkParamNone*, void ); // Used for runtime popup menus void UpdateImages( Menu* pMenu ); diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 5bbda1cd4a3e..7f471bfeb7fb 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -490,7 +490,7 @@ IMPL_STATIC_LINK_NOARG_TYPED( return true; } -IMPL_LINK_NOARG(SfxVirtualMenu, SettingsChanged) +IMPL_LINK_NOARG_TYPED(SfxVirtualMenu, SettingsChanged, LinkParamNone*, void) { sal_uInt16 nItemCount = pSVMenu->GetItemCount(); SfxViewFrame *pViewFrame = pBindings->GetDispatcher()->GetFrame(); @@ -552,8 +552,6 @@ IMPL_LINK_NOARG(SfxVirtualMenu, SettingsChanged) if ( pImageControl ) pImageControl->Update(); - - return 0; } diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 32d54b2f175c..2f9626a4c10b 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -69,7 +69,7 @@ class SvtMenuOptions_Impl : public ConfigItem private: - ::std::list<Link<>> aList; + ::std::list<Link<LinkParamNone*,void>> aList; bool m_bDontHideDisabledEntries ; /// cache "DontHideDisabledEntries" of Menu section bool m_bFollowMouse ; /// cache "FollowMouse" of Menu section TriState m_eMenuIcons ; /// cache "MenuIcons" of Menu section @@ -87,8 +87,8 @@ class SvtMenuOptions_Impl : public ConfigItem SvtMenuOptions_Impl(); virtual ~SvtMenuOptions_Impl(); - void AddListenerLink( const Link<>& rLink ); - void RemoveListenerLink( const Link<>& rLink ); + void AddListenerLink( const Link<LinkParamNone*,void>& rLink ); + void RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ); // override methods of baseclass @@ -126,8 +126,8 @@ class SvtMenuOptions_Impl : public ConfigItem { m_eMenuIcons = eState; SetModified(); - for ( ::std::list<Link<>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter ) - iter->Call( this ); + for ( ::std::list<Link<LinkParamNone*,void>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter ) + iter->Call( nullptr ); // tdf#93451: don't Commit() here, it's too early } @@ -285,8 +285,8 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) if ( bMenuSettingsChanged ) m_eMenuIcons = bSystemMenuIcons ? TRISTATE_INDET : static_cast<TriState>(bMenuIcons); - for ( ::std::list<Link<>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter ) - iter->Call( this ); + for ( ::std::list<Link<LinkParamNone*,void>>::const_iterator iter = aList.begin(); iter != aList.end(); ++iter ) + iter->Call( nullptr ); } @@ -347,21 +347,14 @@ Sequence< OUString > SvtMenuOptions_Impl::impl_GetPropertyNames() return seqPropertyNames; } -void SvtMenuOptions_Impl::AddListenerLink( const Link<>& rLink ) +void SvtMenuOptions_Impl::AddListenerLink( const Link<LinkParamNone*,void>& rLink ) { aList.push_back( rLink ); } -void SvtMenuOptions_Impl::RemoveListenerLink( const Link<>& rLink ) +void SvtMenuOptions_Impl::RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ) { - for ( ::std::list<Link<>>::iterator iter = aList.begin(); iter != aList.end(); ++iter ) - { - if ( *iter == rLink ) - { - aList.erase(iter); - break; - } - } + aList.erase(std::remove(aList.begin(), aList.end(), rLink), aList.end()); } @@ -460,12 +453,12 @@ Mutex& SvtMenuOptions::GetOwnStaticMutex() return *pMutex; } -void SvtMenuOptions::AddListenerLink( const Link<>& rLink ) +void SvtMenuOptions::AddListenerLink( const Link<LinkParamNone*,void>& rLink ) { m_pDataContainer->AddListenerLink( rLink ); } -void SvtMenuOptions::RemoveListenerLink( const Link<>& rLink ) +void SvtMenuOptions::RemoveListenerLink( const Link<LinkParamNone*,void>& rLink ) { m_pDataContainer->RemoveListenerLink( rLink ); } |