[Libreoffice-commits] core.git: sc/inc sc/source

Noel Grandin noelgrandin at gmail.com
Tue Sep 22 12:00:07 PDT 2015


 sc/inc/cellsuno.hxx               |    6 +++---
 sc/inc/chart2uno.hxx              |    2 +-
 sc/source/ui/unoobj/cellsuno.cxx  |    9 ++++-----
 sc/source/ui/unoobj/chart2uno.cxx |    7 +++----
 4 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit fc30b2a6b8ff02a83fd0472179c5b26ae7e5df09
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Sep 22 17:19:01 2015 +0200

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

diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index f36c3cf..24f699d 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -109,9 +109,9 @@ namespace editeng { class SvxBorderLine; }
 
 class ScLinkListener : public SvtListener
 {
-    Link<>  aLink;
+    Link<const SfxHint&,void>  aLink;
 public:
-                    ScLinkListener(const Link<>& rL) : aLink(rL) {}
+                    ScLinkListener(const Link<const SfxHint&,void>& rL) : aLink(rL) {}
     virtual         ~ScLinkListener();
     virtual void Notify( const SfxHint& rHint ) SAL_OVERRIDE;
 };
@@ -190,7 +190,7 @@ private:
     bool                    bGotDataChangedHint;
     XModifyListenerArr_Impl aValueListeners;
 
-    DECL_LINK( ValueListenerHdl, SfxHint* );
+    DECL_LINK_TYPED( ValueListenerHdl, const SfxHint&, void );
 
 private:
     void            PaintRanges_Impl( sal_uInt16 nPart );
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 54cfd98..5911765 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -370,7 +370,7 @@ private:
 
     // Implementation
     void    RefChanged();
-    DECL_LINK( ValueListenerHdl, SfxHint* );
+    DECL_LINK_TYPED( ValueListenerHdl, const SfxHint&, void );
 
 private:
     ScChart2DataSequence(const ScChart2DataSequence& r) SAL_DELETED_FUNCTION;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index c1ed4da..855d659 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -887,7 +887,7 @@ ScLinkListener::~ScLinkListener()
 
 void ScLinkListener::Notify( const SfxHint& rHint )
 {
-    aLink.Call( const_cast<SfxHint*>(&rHint) );
+    aLink.Call( rHint );
 }
 
 static void lcl_CopyProperties( beans::XPropertySet& rDest, beans::XPropertySet& rSource )
@@ -2795,10 +2795,10 @@ void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence<
     OSL_FAIL("not implemented");
 }
 
-IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint )
+IMPL_LINK_TYPED( ScCellRangesBase, ValueListenerHdl, const SfxHint&, rHint, void )
 {
-    if ( pDocShell && pHint && dynamic_cast<const SfxSimpleHint*>(pHint) &&
-            (static_cast<const SfxSimpleHint*>(pHint)->GetId() & SC_HINT_DATACHANGED))
+    if ( pDocShell && dynamic_cast<const SfxSimpleHint*>(&rHint) &&
+            (static_cast<const SfxSimpleHint&>(rHint).GetId() & SC_HINT_DATACHANGED))
     {
         //  This may be called several times for a single change, if several formulas
         //  in the range are notified. So only a flag is set that is checked when
@@ -2806,7 +2806,6 @@ IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint )
 
         bGotDataChangedHint = true;
     }
-    return 0;
 }
 
 // XTolerantMultiPropertySet
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 6335ce6..35e8d31 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2953,10 +2953,10 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
     }
 }
 
-IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
+IMPL_LINK_TYPED( ScChart2DataSequence, ValueListenerHdl, const SfxHint&, rHint, void )
 {
-    if ( m_pDocument && pHint && dynamic_cast<const SfxSimpleHint*>(pHint) &&
-            static_cast<const SfxSimpleHint*>(pHint)->GetId() & SC_HINT_DATACHANGED)
+    if ( m_pDocument && dynamic_cast<const SfxSimpleHint*>(&rHint) &&
+            static_cast<const SfxSimpleHint&>(rHint).GetId() & SC_HINT_DATACHANGED)
     {
         //  This may be called several times for a single change, if several formulas
         //  in the range are notified. So only a flag is set that is checked when
@@ -2964,7 +2964,6 @@ IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
 
         setDataChangedHint(true);
     }
-    return 0;
 }
 
 ScChart2DataSequence::ExternalRefListener::ExternalRefListener(


More information about the Libreoffice-commits mailing list