convert Link<> to typed

Change-Id: Ifdcd9121b16b7f33632cf6671449152ebee8beef
This commit is contained in:
Noel Grandin
2015-09-17 14:10:46 +02:00
parent d360dd3599
commit cdadaa5556
3 changed files with 10 additions and 11 deletions

View File

@@ -83,7 +83,7 @@ public:
DECL_LINK(WindowEventListener, VclWindowEvent*); DECL_LINK(WindowEventListener, VclWindowEvent*);
DECL_LINK(SelectionChangeListener, void*); DECL_LINK(SelectionChangeListener, void*);
DECL_LINK_TYPED(BroadcastSelectionChange, void*, void); DECL_LINK_TYPED(BroadcastSelectionChange, void*, void);
DECL_LINK(FocusChangeListener, void*); DECL_LINK_TYPED(FocusChangeListener, LinkParamNone*, void);
DECL_LINK_TYPED(VisibilityChangeListener, LinkParamNone*, void); DECL_LINK_TYPED(VisibilityChangeListener, LinkParamNone*, void);
DECL_LINK_TYPED(UpdateChildrenCallback, void*, void); DECL_LINK_TYPED(UpdateChildrenCallback, void*, void);
@@ -937,7 +937,7 @@ IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, BroadcastSelect
Any()); Any());
} }
IMPL_LINK_NOARG(AccessibleSlideSorterView::Implementation, FocusChangeListener) IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, FocusChangeListener, LinkParamNone*, void)
{ {
sal_Int32 nNewFocusedIndex ( sal_Int32 nNewFocusedIndex (
mrSlideSorter.GetController().GetFocusManager().GetFocusedPageIndex()); mrSlideSorter.GetController().GetFocusManager().GetFocusedPageIndex());
@@ -977,7 +977,6 @@ IMPL_LINK_NOARG(AccessibleSlideSorterView::Implementation, FocusChangeListener)
if (bSentFocus) if (bSentFocus)
mnFocusedIndex = nNewFocusedIndex; mnFocusedIndex = nNewFocusedIndex;
} }
return 1;
} }
IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, UpdateChildrenCallback, void*, void) IMPL_LINK_NOARG_TYPED(AccessibleSlideSorterView::Implementation, UpdateChildrenCallback, void*, void)

View File

@@ -243,7 +243,7 @@ void FocusManager::ShowFocusIndicator (
} }
} }
void FocusManager::AddFocusChangeListener (const Link<>& rListener) void FocusManager::AddFocusChangeListener (const Link<LinkParamNone*,void>& rListener)
{ {
if (::std::find (maFocusChangeListeners.begin(), maFocusChangeListeners.end(), rListener) if (::std::find (maFocusChangeListeners.begin(), maFocusChangeListeners.end(), rListener)
== maFocusChangeListeners.end()) == maFocusChangeListeners.end())
@@ -252,7 +252,7 @@ void FocusManager::AddFocusChangeListener (const Link<>& rListener)
} }
} }
void FocusManager::RemoveFocusChangeListener (const Link<>& rListener) void FocusManager::RemoveFocusChangeListener (const Link<LinkParamNone*,void>& rListener)
{ {
maFocusChangeListeners.erase ( maFocusChangeListeners.erase (
::std::find (maFocusChangeListeners.begin(), maFocusChangeListeners.end(), rListener)); ::std::find (maFocusChangeListeners.begin(), maFocusChangeListeners.end(), rListener));
@@ -261,11 +261,11 @@ void FocusManager::RemoveFocusChangeListener (const Link<>& rListener)
void FocusManager::NotifyFocusChangeListeners() const void FocusManager::NotifyFocusChangeListeners() const
{ {
// Create a copy of the listener list to be safe when that is modified. // Create a copy of the listener list to be safe when that is modified.
::std::vector<Link<>> aListeners (maFocusChangeListeners); ::std::vector<Link<LinkParamNone*,void>> aListeners (maFocusChangeListeners);
// 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 (aListeners.begin()); ::std::vector<Link<LinkParamNone*,void>>::iterator iListener (aListeners.begin());
::std::vector<Link<>>::iterator iEnd (aListeners.end()); ::std::vector<Link<LinkParamNone*,void>>::iterator iEnd (aListeners.end());
for (; iListener!=iEnd; ++iListener) for (; iListener!=iEnd; ++iListener)
{ {
iListener->Call(NULL); iListener->Call(NULL);

View File

@@ -143,14 +143,14 @@ 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 AddFocusChangeListener (const Link<>& rListener); void AddFocusChangeListener (const Link<LinkParamNone*,void>& rListener);
/** Remove a focus change listener. /** Remove a focus change listener.
@param rListener @param rListener
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 RemoveFocusChangeListener (const Link<>& rListener); void RemoveFocusChangeListener (const Link<LinkParamNone*,void>& rListener);
/** Create an instance of this class to temporarily hide the focus /** Create an instance of this class to temporarily hide the focus
indicator. It is restored to its former visibility state when the indicator. It is restored to its former visibility state when the
@@ -179,7 +179,7 @@ private:
*/ */
bool mbPageIsFocused; bool mbPageIsFocused;
::std::vector<Link<>> maFocusChangeListeners; ::std::vector<Link<LinkParamNone*,void>> maFocusChangeListeners;
/** When vertical wrap is active then pressing UP in the top row moves /** When vertical wrap is active then pressing UP in the top row moves
the focus to the bottom row, DOWN in the bottom row moves the focus the focus to the bottom row, DOWN in the bottom row moves the focus