From 118dd2fba2038891d06381e9cda0396e661e60ac Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Sep 2015 13:48:36 +0200 Subject: convert Link<> to typed Change-Id: I83b3a4a637db8f623b18615227a495a15078561f --- sd/source/ui/inc/tools/SlotStateListener.hxx | 6 +++--- sd/source/ui/sidebar/LayoutMenu.cxx | 5 ++--- sd/source/ui/sidebar/LayoutMenu.hxx | 2 +- sd/source/ui/tools/SlotStateListener.cxx | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sd/source/ui/inc/tools/SlotStateListener.hxx b/sd/source/ui/inc/tools/SlotStateListener.hxx index 0983d6b9967b..4d9401e6bcf2 100644 --- a/sd/source/ui/inc/tools/SlotStateListener.hxx +++ b/sd/source/ui/inc/tools/SlotStateListener.hxx @@ -51,7 +51,7 @@ public: explanations about the parameters. */ SlotStateListener ( - Link<>& rCallback, + Link& rCallback, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider>& rxDispatchProvider, const OUString& rSlotName); @@ -66,7 +66,7 @@ public: Changing the callback does not release the listeners. @throws DisposedException */ - void SetCallback (const Link<>& rCallback); + void SetCallback (const Link& rCallback); /** Set the frame whose slots shall be observed. When an object of this class is already observing slots of another frame then these @@ -111,7 +111,7 @@ protected: virtual void SAL_CALL disposing() SAL_OVERRIDE; private: - Link<> maCallback; + Link maCallback; /** Remember the URLs that describe slots whose state changes we are listening to. diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 3eda44c82c08..d5010b2738a2 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -181,7 +181,7 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell ) Window::SetHelpId(HID_SD_TASK_PANE_PREVIEW_LAYOUTS); SetAccessibleName(SdResId(STR_TASKPANEL_LAYOUT_MENU_TITLE)); - Link<> aStateChangeLink (LINK(this,LayoutMenu,StateChangeHandler)); + Link aStateChangeLink (LINK(this,LayoutMenu,StateChangeHandler)); mxListener = new ::sd::tools::SlotStateListener( aStateChangeLink, Reference(mrBase.GetController()->getFrame(), UNO_QUERY), @@ -635,10 +635,9 @@ void LayoutMenu::Command (const CommandEvent& rEvent) } } -IMPL_LINK_NOARG(LayoutMenu, StateChangeHandler) +IMPL_LINK_NOARG_TYPED(LayoutMenu, StateChangeHandler, const OUString&, void) { InvalidateContent(); - return 0; } IMPL_LINK_TYPED(LayoutMenu, OnMenuItemSelected, Menu*, pMenu, bool) diff --git a/sd/source/ui/sidebar/LayoutMenu.hxx b/sd/source/ui/sidebar/LayoutMenu.hxx index 813682f361df..b511251c226e 100644 --- a/sd/source/ui/sidebar/LayoutMenu.hxx +++ b/sd/source/ui/sidebar/LayoutMenu.hxx @@ -190,7 +190,7 @@ private: */ DECL_LINK_TYPED(ClickHandler, ValueSet*, void); DECL_LINK(RightClickHandler, MouseEvent*); - DECL_LINK(StateChangeHandler, void *); + DECL_LINK_TYPED(StateChangeHandler, const OUString&, void); DECL_LINK(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent*); DECL_LINK(WindowEventHandler, VclWindowEvent*); DECL_LINK_TYPED(OnMenuItemSelected, Menu*, bool); diff --git a/sd/source/ui/tools/SlotStateListener.cxx b/sd/source/ui/tools/SlotStateListener.cxx index 2167e761f2f2..a3d1be1c462b 100644 --- a/sd/source/ui/tools/SlotStateListener.cxx +++ b/sd/source/ui/tools/SlotStateListener.cxx @@ -32,7 +32,7 @@ using namespace ::com::sun::star; namespace sd { namespace tools { SlotStateListener::SlotStateListener ( - Link<>& rCallback, + Link& rCallback, const uno::Reference& rxDispatchProvider, const OUString& rSlotName) : SlotStateListenerInterfaceBase(maMutex), @@ -49,7 +49,7 @@ SlotStateListener::~SlotStateListener() ReleaseListeners(); } -void SlotStateListener::SetCallback (const Link<>& rCallback) +void SlotStateListener::SetCallback (const Link& rCallback) { ThrowIfDisposed(); @@ -90,7 +90,7 @@ void SlotStateListener::disposing() { ReleaseListeners(); mxDispatchProviderWeak = uno::WeakReference(NULL); - maCallback = Link<>(); + maCallback = Link(); } util::URL SlotStateListener::MakeURL (const OUString& rSlotName) @@ -123,7 +123,7 @@ void SlotStateListener::statusChanged ( ThrowIfDisposed(); OUString sSlotName (rState.FeatureURL.Complete); if (maCallback.IsSet()) - maCallback.Call(&sSlotName); + maCallback.Call(sSlotName); } void SlotStateListener::ReleaseListeners() -- cgit