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:
void ReleaseListeners();
void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE;
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(FocusChangeListener, LinkParamNone*, void);
DECL_LINK_TYPED(VisibilityChangeListener, LinkParamNone*, void);
......@@ -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)
mnSelectionChangeUserEventId = Application::PostUserEvent(
LINK(this, AccessibleSlideSorterView::Implementation, BroadcastSelectionChange));
return 1;
}
IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, BroadcastSelectionChange, void*, void)
......
......@@ -162,7 +162,7 @@ public:
the second and all following calls are ignored. Each listener
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
sorter changes.
......@@ -170,7 +170,7 @@ public:
It is save to pass a listener that was not added are has been
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;
......
......@@ -236,11 +236,9 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible)
pViewShell->UpdatePreview(pDescriptor->GetPage());
// Tell the selection change listeners that the selection has changed.
::std::vector<Link<>>::iterator iListener (maSelectionChangeListeners.begin());
::std::vector<Link<>>::iterator iEnd (maSelectionChangeListeners.end());
for (; iListener!=iEnd; ++iListener)
for (auto& rLink : maSelectionChangeListeners)
{
iListener->Call(NULL);
rLink.Call(NULL);
}
// Reset the insertion position: until set again it is calculated from
......@@ -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 (
maSelectionChangeListeners.begin(),
......@@ -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 (
::std::find (
......
......@@ -78,7 +78,7 @@ public:
the second and all following calls are ignored. Each listener
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
sorter changes.
......@@ -86,7 +86,7 @@ public:
It is save to pass a listener that was not added are has been
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
current selection. When there is a selection then the insert
......@@ -109,7 +109,7 @@ private:
SlideSorter& mrSlideSorter;
SlideSorterController& mrController;
::std::vector<Link<>> maSelectionChangeListeners;
::std::vector<Link<LinkParamNone*,void>> maSelectionChangeListeners;
/** This array stores the indices of the selected page descriptors at
the time when the edit mode is switched to EM_MASTERPAGE. With this
......
......@@ -693,14 +693,14 @@ void SlideSorterViewShell::SetPageSelection (
}
void SlideSorterViewShell::AddSelectionChangeListener (
const Link<>& rCallback)
const Link<LinkParamNone*,void>& rCallback)
{
OSL_ASSERT(mpSlideSorter.get()!=NULL);
mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback);
}
void SlideSorterViewShell::RemoveSelectionChangeListener (
const Link<>& rCallback)
const Link<LinkParamNone*,void>& rCallback)
{
OSL_ASSERT(mpSlideSorter.get()!=NULL);
mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback);
......
......@@ -155,7 +155,7 @@ private:
void ThrowIfDisposed()
throw (::com::sun::star::lang::DisposedException);
DECL_LINK(SlideSorterSelectionChangeListener, void*);
DECL_LINK_TYPED(SlideSorterSelectionChangeListener, LinkParamNone*, void);
};
const char aCurrentPagePropertyName[] = "CurrentPage";
......@@ -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);
return 0;
CallListeners(EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION);
}
//===== 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