Kaydet (Commit) 6f4a024b authored tarafından Noel Grandin's avatar Noel Grandin

convert Link<> to typed

Change-Id: I6f17e073c50e28f40e3df4e557a63f0bcdc502de
Reviewed-on: https://gerrit.libreoffice.org/18778Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 3e6bd83c
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
void ReleaseListeners(); void ReleaseListeners();
void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE; void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE;
DECL_LINK_TYPED(WindowEventListener, VclWindowEvent&, void); DECL_LINK_TYPED(WindowEventListener, VclWindowEvent&, void);
DECL_LINK(SelectionChangeListener, void*); DECL_LINK_TYPED(SelectionChangeListener, LinkParamNone*, void);
DECL_LINK_TYPED(BroadcastSelectionChange, void*, void); DECL_LINK_TYPED(BroadcastSelectionChange, void*, void);
DECL_LINK_TYPED(FocusChangeListener, LinkParamNone*, void); DECL_LINK_TYPED(FocusChangeListener, LinkParamNone*, void);
DECL_LINK_TYPED(VisibilityChangeListener, LinkParamNone*, void); DECL_LINK_TYPED(VisibilityChangeListener, LinkParamNone*, void);
...@@ -919,12 +919,11 @@ IMPL_LINK_TYPED(AccessibleSlideSorterView::Implementation, WindowEventListener, ...@@ -919,12 +919,11 @@ IMPL_LINK_TYPED(AccessibleSlideSorterView::Implementation, WindowEventListener,
} }
} }
IMPL_LINK_NOARG(AccessibleSlideSorterView::Implementation, SelectionChangeListener) IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, SelectionChangeListener, LinkParamNone*, void)
{ {
if (mnSelectionChangeUserEventId == 0) if (mnSelectionChangeUserEventId == 0)
mnSelectionChangeUserEventId = Application::PostUserEvent( mnSelectionChangeUserEventId = Application::PostUserEvent(
LINK(this, AccessibleSlideSorterView::Implementation, BroadcastSelectionChange)); LINK(this, AccessibleSlideSorterView::Implementation, BroadcastSelectionChange));
return 1;
} }
IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, BroadcastSelectionChange, void*, void) IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, BroadcastSelectionChange, void*, void)
......
...@@ -162,7 +162,7 @@ public: ...@@ -162,7 +162,7 @@ public:
the second and all following calls are ignored. Each listener the second and all following calls are ignored. Each listener
is added only once. is added only once.
*/ */
void AddSelectionChangeListener (const Link<>& rListener); void AddSelectionChangeListener (const Link<LinkParamNone*,void>& rListener);
/** Remove a listener that was called when the selection of the slide /** Remove a listener that was called when the selection of the slide
sorter changes. sorter changes.
...@@ -170,7 +170,7 @@ public: ...@@ -170,7 +170,7 @@ public:
It is save to pass a listener that was not added are has been It is save to pass a listener that was not added are has been
removed previously. Such calls are ignored. removed previously. Such calls are ignored.
*/ */
void RemoveSelectionChangeListener (const Link<>& rListener); void RemoveSelectionChangeListener (const Link<LinkParamNone*,void>& rListener);
virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController() SAL_OVERRIDE; virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController() SAL_OVERRIDE;
......
...@@ -236,11 +236,9 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible) ...@@ -236,11 +236,9 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible)
pViewShell->UpdatePreview(pDescriptor->GetPage()); pViewShell->UpdatePreview(pDescriptor->GetPage());
// Tell the selection change listeners that the selection has changed. // Tell the selection change listeners that the selection has changed.
::std::vector<Link<>>::iterator iListener (maSelectionChangeListeners.begin()); for (auto& rLink : maSelectionChangeListeners)
::std::vector<Link<>>::iterator iEnd (maSelectionChangeListeners.end());
for (; iListener!=iEnd; ++iListener)
{ {
iListener->Call(NULL); rLink.Call(NULL);
} }
// Reset the insertion position: until set again it is calculated from // Reset the insertion position: until set again it is calculated from
...@@ -249,7 +247,7 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible) ...@@ -249,7 +247,7 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible)
} }
} }
void SelectionManager::AddSelectionChangeListener (const Link<>& rListener) void SelectionManager::AddSelectionChangeListener (const Link<LinkParamNone*,void>& rListener)
{ {
if (::std::find ( if (::std::find (
maSelectionChangeListeners.begin(), maSelectionChangeListeners.begin(),
...@@ -260,7 +258,7 @@ void SelectionManager::AddSelectionChangeListener (const Link<>& rListener) ...@@ -260,7 +258,7 @@ void SelectionManager::AddSelectionChangeListener (const Link<>& rListener)
} }
} }
void SelectionManager::RemoveSelectionChangeListener(const Link<>&rListener) void SelectionManager::RemoveSelectionChangeListener(const Link<LinkParamNone*,void>& rListener)
{ {
maSelectionChangeListeners.erase ( maSelectionChangeListeners.erase (
::std::find ( ::std::find (
......
...@@ -78,7 +78,7 @@ public: ...@@ -78,7 +78,7 @@ public:
the second and all following calls are ignored. Each listener the second and all following calls are ignored. Each listener
is added only once. is added only once.
*/ */
void AddSelectionChangeListener (const Link<>& rListener); void AddSelectionChangeListener (const Link<LinkParamNone*,void>& rListener);
/** Remove a listener that was called when the selection of the slide /** Remove a listener that was called when the selection of the slide
sorter changes. sorter changes.
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
It is save to pass a listener that was not added are has been It is save to pass a listener that was not added are has been
removed previously. Such calls are ignored. removed previously. Such calls are ignored.
*/ */
void RemoveSelectionChangeListener (const Link<>& rListener); void RemoveSelectionChangeListener (const Link<LinkParamNone*,void>& rListener);
/** Return the position where to insert pasted slides based on the /** Return the position where to insert pasted slides based on the
current selection. When there is a selection then the insert current selection. When there is a selection then the insert
...@@ -109,7 +109,7 @@ private: ...@@ -109,7 +109,7 @@ private:
SlideSorter& mrSlideSorter; SlideSorter& mrSlideSorter;
SlideSorterController& mrController; SlideSorterController& mrController;
::std::vector<Link<>> maSelectionChangeListeners; ::std::vector<Link<LinkParamNone*,void>> maSelectionChangeListeners;
/** This array stores the indices of the selected page descriptors at /** This array stores the indices of the selected page descriptors at
the time when the edit mode is switched to EM_MASTERPAGE. With this the time when the edit mode is switched to EM_MASTERPAGE. With this
......
...@@ -693,14 +693,14 @@ void SlideSorterViewShell::SetPageSelection ( ...@@ -693,14 +693,14 @@ void SlideSorterViewShell::SetPageSelection (
} }
void SlideSorterViewShell::AddSelectionChangeListener ( void SlideSorterViewShell::AddSelectionChangeListener (
const Link<>& rCallback) const Link<LinkParamNone*,void>& rCallback)
{ {
OSL_ASSERT(mpSlideSorter.get()!=NULL); OSL_ASSERT(mpSlideSorter.get()!=NULL);
mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback); mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback);
} }
void SlideSorterViewShell::RemoveSelectionChangeListener ( void SlideSorterViewShell::RemoveSelectionChangeListener (
const Link<>& rCallback) const Link<LinkParamNone*,void>& rCallback)
{ {
OSL_ASSERT(mpSlideSorter.get()!=NULL); OSL_ASSERT(mpSlideSorter.get()!=NULL);
mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback); mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback);
......
...@@ -155,7 +155,7 @@ private: ...@@ -155,7 +155,7 @@ private:
void ThrowIfDisposed() void ThrowIfDisposed()
throw (::com::sun::star::lang::DisposedException); throw (::com::sun::star::lang::DisposedException);
DECL_LINK(SlideSorterSelectionChangeListener, void*); DECL_LINK_TYPED(SlideSorterSelectionChangeListener, LinkParamNone*, void);
}; };
const char aCurrentPagePropertyName[] = "CurrentPage"; const char aCurrentPagePropertyName[] = "CurrentPage";
...@@ -704,10 +704,9 @@ void EventMultiplexer::Implementation::CallListeners (EventMultiplexerEvent& rEv ...@@ -704,10 +704,9 @@ void EventMultiplexer::Implementation::CallListeners (EventMultiplexerEvent& rEv
} }
} }
IMPL_LINK_NOARG(EventMultiplexer::Implementation, SlideSorterSelectionChangeListener) IMPL_LINK_NOARG_TYPED(EventMultiplexer::Implementation, SlideSorterSelectionChangeListener, LinkParamNone*, void)
{ {
CallListeners (EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION); CallListeners(EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION);
return 0;
} }
//===== EventMultiplexerEvent ================================================= //===== EventMultiplexerEvent =================================================
......
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