[Libreoffice-commits] core.git: sd/source

Noel Grandin noelgrandin at gmail.com
Tue Sep 22 11:58:34 PDT 2015


 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx        |    5 ++---
 sd/source/ui/inc/SlideSorterViewShell.hxx                       |    4 ++--
 sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx     |   10 ++++------
 sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx |    6 +++---
 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx         |    4 ++--
 sd/source/ui/tools/EventMultiplexer.cxx                         |    7 +++----
 6 files changed, 16 insertions(+), 20 deletions(-)

New commits:
commit 6f4a024b88ef99a44b78ab9d387dcf950c4d5677
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Sep 22 16:40:35 2015 +0200

    convert Link<> to typed
    
    Change-Id: I6f17e073c50e28f40e3df4e557a63f0bcdc502de
    Reviewed-on: https://gerrit.libreoffice.org/18778
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index b8bf84f..155d83c 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -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)
diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx
index cd590d8..1b38842 100644
--- a/sd/source/ui/inc/SlideSorterViewShell.hxx
+++ b/sd/source/ui/inc/SlideSorterViewShell.hxx
@@ -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;
 
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
index 0768a1e..4d7e7d7 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
@@ -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 (
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx
index eddbf63..9c94041 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSelectionManager.hxx
@@ -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
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 4adcc1f..6e82689 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -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);
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index b776c71..9141973 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -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 =================================================


More information about the Libreoffice-commits mailing list