[Libreoffice-commits] core.git: 4 commits - include/svl include/tools include/unotools include/vcl svl/source test/source unotools/source vcl/inc vcl/source

Noel Grandin noel at peralex.com
Wed Sep 9 23:30:41 PDT 2015


 include/svl/zforlist.hxx                    |    2 
 include/tools/link.hxx                      |    4 +
 include/unotools/syslocaleoptions.hxx       |    4 -
 include/vcl/lstbox.hxx                      |   16 +++----
 include/vcl/svapp.hxx                       |    2 
 svl/source/numbers/zforlist.cxx             |    3 -
 test/source/bootstrapfixture.cxx            |    5 --
 test/source/vclbootstrapprotector.cxx       |    6 +-
 unotools/source/config/syslocaleoptions.cxx |    8 +--
 vcl/inc/ilstbox.hxx                         |   64 ++++++++++++++--------------
 vcl/inc/svdata.hxx                          |    2 
 vcl/source/app/svapp.cxx                    |    2 
 vcl/source/control/combobox.cxx             |   28 ++++--------
 vcl/source/control/ilstbox.cxx              |   11 +---
 vcl/source/control/lstbox.cxx               |   26 +++--------
 15 files changed, 82 insertions(+), 101 deletions(-)

New commits:
commit 2466aa27429b2ffcc45f108284396d7527470e78
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Sep 10 08:29:52 2015 +0200

    convert Link<> to typed
    
    Change-Id: Iaeaa33b0b066723d561df0c58f3faedead259d8f

diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 8849057..7e73dc8 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -891,7 +891,7 @@ private:
         sal_uInt16 nPos, const OUString& rSymbol );
 
     // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method>
-    DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* );
+    DECL_DLLPRIVATE_STATIC_LINK_TYPED( SvNumberFormatter, CurrencyChangeLink, LinkParamNone*, void );
 
     // return position of a special character
     sal_Int32 ImpPosToken ( const OUStringBuffer & sFormat, sal_Unicode token, sal_Int32 nStartPos = 0 );
diff --git a/include/unotools/syslocaleoptions.hxx b/include/unotools/syslocaleoptions.hxx
index 99883ac..4dcfaf9 100644
--- a/include/unotools/syslocaleoptions.hxx
+++ b/include/unotools/syslocaleoptions.hxx
@@ -155,8 +155,8 @@ public:
         This is needed because the number formatter isn't part of the svl light
         library, otherwise we could call SetDefaultSystemCurrency() directly.
      */
-    static  void                SetCurrencyChangeLink( const Link<>& rLink );
-    static  const Link<>&       GetCurrencyChangeLink();
+    static  void                SetCurrencyChangeLink( const Link<LinkParamNone*,void>& rLink );
+    static  const Link<LinkParamNone*,void>&       GetCurrencyChangeLink();
 
     /** return the readonly state of the queried option. */
             bool                IsReadOnly( EOption eOption ) const;
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index db8e67d..d7596cb 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3215,14 +3215,13 @@ const NfCurrencyEntry* SvNumberFormatter::GetLegacyOnlyCurrencyEntry( const OUSt
 
 
 // static
-IMPL_STATIC_LINK_NOARG( SvNumberFormatter, CurrencyChangeLink )
+IMPL_STATIC_LINK_NOARG_TYPED( SvNumberFormatter, CurrencyChangeLink, LinkParamNone*, void )
 {
     ::osl::MutexGuard aGuard( GetMutex() );
     OUString aAbbrev;
     LanguageType eLang = LANGUAGE_SYSTEM;
     SvtSysLocaleOptions().GetCurrencyAbbrevAndLanguage( aAbbrev, eLang );
     SetDefaultSystemCurrency( aAbbrev, eLang );
-    return 0;
 }
 
 
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index fb322bc..05d25d0 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -43,7 +43,7 @@ sal_Int32                   SvtSysLocaleOptions::nRefCount = 0;
 namespace
 {
     struct CurrencyChangeLink
-        : public rtl::Static<Link<>, CurrencyChangeLink> {};
+        : public rtl::Static<Link<LinkParamNone*,void>, CurrencyChangeLink> {};
 }
 
 class SvtSysLocaleOptions_Impl : public utl::ConfigItem
@@ -679,7 +679,7 @@ OUString SvtSysLocaleOptions::CreateCurrencyConfigString(
 }
 
 // static
-void SvtSysLocaleOptions::SetCurrencyChangeLink( const Link<>& rLink )
+void SvtSysLocaleOptions::SetCurrencyChangeLink( const Link<LinkParamNone*,void>& rLink )
 {
     MutexGuard aGuard( GetMutex() );
     DBG_ASSERT( !CurrencyChangeLink::get().IsSet(), "SvtSysLocaleOptions::SetCurrencyChangeLink: already set" );
@@ -687,7 +687,7 @@ void SvtSysLocaleOptions::SetCurrencyChangeLink( const Link<>& rLink )
 }
 
 // static
-const Link<>& SvtSysLocaleOptions::GetCurrencyChangeLink()
+const Link<LinkParamNone*,void>& SvtSysLocaleOptions::GetCurrencyChangeLink()
 {
     MutexGuard aGuard( GetMutex() );
     return CurrencyChangeLink::get();
@@ -697,7 +697,7 @@ void SvtSysLocaleOptions::ConfigurationChanged( utl::ConfigurationBroadcaster* p
 {
     if ( nHint & SYSLOCALEOPTIONS_HINT_CURRENCY )
     {
-        const Link<>& rLink = GetCurrencyChangeLink();
+        const Link<LinkParamNone*,void>& rLink = GetCurrencyChangeLink();
         if ( rLink.IsSet() )
             rLink.Call( NULL );
     }
commit 9ea0390f17d5183471a27cf7666b45abf3f1e8a0
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Sep 9 15:52:39 2015 +0200

    convert Link<> to typed
    
    Change-Id: Iaca21344f6a38f508f79e6d5983e515162a6dca3

diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index d9dd2ed..c444d36 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1483,7 +1483,7 @@ public:
     ///@}
 
     // For vclbootstrapprotector:
-    static void setDeInitHook(Link<> const & hook);
+    static void setDeInitHook(Link<LinkParamNone*,void> const & hook);
 
 private:
 
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index e9aefb8..eb50025 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -85,12 +85,11 @@ void test_init_impl(bool bAssertOnDialog, bool bNeedUCB,
 }
 
 struct InitHook {
-    DECL_STATIC_LINK(InitHook, deinitHook, void*);
+    DECL_STATIC_LINK_TYPED(InitHook, deinitHook, LinkParamNone*, void);
 };
 
-IMPL_STATIC_LINK_NOARG(InitHook, deinitHook) {
+IMPL_STATIC_LINK_NOARG_TYPED(InitHook, deinitHook, LinkParamNone*, void) {
     // nothing to do for now
-    return 0;
 }
 
 // this is called from pyuno
diff --git a/test/source/vclbootstrapprotector.cxx b/test/source/vclbootstrapprotector.cxx
index 2aad563..f0c4e92 100644
--- a/test/source/vclbootstrapprotector.cxx
+++ b/test/source/vclbootstrapprotector.cxx
@@ -56,14 +56,15 @@ private:
         SAL_OVERRIDE
     { return functor(); }
 
-    DECL_STATIC_LINK(Protector, deinitHook, void *);
+    DECL_STATIC_LINK_TYPED(Protector, deinitHook, LinkParamNone*, void);
 };
 
 // HACK so that defaultBootstrap_InitialComponentContext (in
 // unobootstrapprotector) is called before InitVCL (above), but component
 // context is disposed (redundantly again in unobootstrapprotector) from within
 // DeInitVCL (cf. Desktop::DeInit, desktop/source/app/app.cxx):
-IMPL_STATIC_LINK_NOARG(Protector, deinitHook) {
+IMPL_STATIC_LINK_NOARG_TYPED(Protector, deinitHook, LinkParamNone*, void)
+{
     css::uno::Reference<css::uno::XComponentContext> context;
     try {
         context = comphelper::getProcessComponentContext();
@@ -82,7 +83,6 @@ IMPL_STATIC_LINK_NOARG(Protector, deinitHook) {
             context, css::uno::UNO_QUERY_THROW)->dispose();
         comphelper::setProcessServiceFactory(0);
     }
-    return 0;
 }
 
 }
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 54fc68f..b879302 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -344,7 +344,7 @@ struct ImplSVData
     std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
     std::unordered_map< int, OUString >* mpPaperNames;
 
-    Link<> maDeInitHook;
+    Link<LinkParamNone*,void> maDeInitHook;
 };
 
 void        ImplDeInitSVData();
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 7b87430..efd8354 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1600,7 +1600,7 @@ Application::createFolderPicker( const Reference< uno::XComponentContext >& xSM
     return pSVData->mpDefInst->createFolderPicker( xSM );
 }
 
-void Application::setDeInitHook(Link<> const & hook) {
+void Application::setDeInitHook(Link<LinkParamNone*,void> const & hook) {
     ImplSVData * pSVData = ImplGetSVData();
     assert(!pSVData->maDeInitHook.IsSet());
     pSVData->maDeInitHook = hook;
commit 71d8cfc13a7269230fc39c895c5a24350ab07357
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Sep 9 15:40:00 2015 +0200

    convert Link<> to typed, and introduce LinkParamNone
    
    as a marker type for unused Link#Call(T) param
    
    Change-Id: Ife9149052a52b27fefd4f810309a5004a0f1771b

diff --git a/include/tools/link.hxx b/include/tools/link.hxx
index fa86e5d..548dbfb 100644
--- a/include/tools/link.hxx
+++ b/include/tools/link.hxx
@@ -146,6 +146,10 @@ private:
     void * instance_;
 };
 
+
+// nondefined class used to indicate that the Call() parameter is not in use.
+class LinkParamNone;
+
 namespace tools { namespace detail {
 
 template<typename Arg, typename Ret>
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 6f47518..1cf863f 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -29,7 +29,7 @@ class ImplListBox;
 class ImplListBoxFloatingWindow;
 class ImplBtn;
 class ImplWin;
-
+class ImplListBoxWindow;
 
 //  - ListBox -
 
@@ -55,14 +55,14 @@ private:
 private:
     SAL_DLLPRIVATE void    ImplInitListBoxData();
 
-    DECL_DLLPRIVATE_LINK(  ImplSelectHdl, void* );
-    DECL_DLLPRIVATE_LINK(  ImplScrollHdl, void* );
-    DECL_DLLPRIVATE_LINK(  ImplCancelHdl, void* );
-    DECL_DLLPRIVATE_LINK(  ImplDoubleClickHdl, void* );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplSelectHdl, LinkParamNone*, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplScrollHdl, ImplListBox*, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplCancelHdl, LinkParamNone*, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplDoubleClickHdl, ImplListBoxWindow*, void );
     DECL_DLLPRIVATE_LINK_TYPED( ImplPopupModeEndHdl, FloatingWindow*, void );
-    DECL_DLLPRIVATE_LINK_TYPED(  ImplSelectionChangedHdl, sal_Int32, void );
-    DECL_DLLPRIVATE_LINK(  ImplFocusHdl, void* );
-    DECL_DLLPRIVATE_LINK(  ImplListItemSelectHdl, void* );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplSelectionChangedHdl, sal_Int32, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplFocusHdl, sal_Int32, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplListItemSelectHdl, LinkParamNone*, void );
 
     SAL_DLLPRIVATE void ImplClickButtonHandler( Control* );
     SAL_DLLPRIVATE void ImplUserDrawHandler( UserDrawEvent* );
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 1ff8df7..db9807f 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -229,13 +229,13 @@ private:
     bool mbCenter : 1;           ///< center Text output
     bool mbEdgeBlending : 1;
 
-    Link<>          maScrollHdl;
-    Link<>          maSelectHdl;
-    Link<>          maCancelHdl;
-    Link<>          maDoubleClickHdl;
-    Link<>          maMRUChangedHdl;
-    Link<>          maFocusHdl;
-    Link<>          maListItemSelectHdl;
+    Link<ImplListBoxWindow*,void>  maScrollHdl;
+    Link<LinkParamNone*,void>      maSelectHdl;
+    Link<LinkParamNone*,void>      maCancelHdl;
+    Link<ImplListBoxWindow*,void>  maDoubleClickHdl;
+    Link<LinkParamNone*,void>      maMRUChangedHdl;
+    Link<sal_Int32,void>           maFocusHdl;
+    Link<LinkParamNone*,void>      maListItemSelectHdl;
 
     vcl::QuickSelectionEngine maQuickSelectionEngine;
 
@@ -332,21 +332,21 @@ public:
     long            GetEntryHeight() const              { return mnMaxHeight; }
     long            GetMaxEntryWidth() const            { return mnMaxWidth; }
 
-    void            SetScrollHdl( const Link<>& rLink ) { maScrollHdl = rLink; }
-    void            SetSelectHdl( const Link<>& rLink ) { maSelectHdl = rLink; }
-    const Link<>&   GetSelectHdl() const                { return maSelectHdl; }
-    void            SetCancelHdl( const Link<>& rLink ) { maCancelHdl = rLink; }
-    const Link<>&   GetCancelHdl() const                { return maCancelHdl; }
-    void            SetDoubleClickHdl( const Link<>& rLink ) { maDoubleClickHdl = rLink; }
-    const Link<>&   GetDoubleClickHdl() const               { return maDoubleClickHdl; }
-    void            SetMRUChangedHdl( const Link<>& rLink ) { maMRUChangedHdl = rLink; }
-    void            SetFocusHdl( const Link<>& rLink )  { maFocusHdl = rLink ; }
-    const Link<>&   GetFocusHdl() const             { return maFocusHdl; }
+    void            SetScrollHdl( const Link<ImplListBoxWindow*,void>& rLink ) { maScrollHdl = rLink; }
+    void            SetSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maSelectHdl = rLink; }
+    const Link<LinkParamNone*,void>&   GetSelectHdl() const                { return maSelectHdl; }
+    void            SetCancelHdl( const Link<LinkParamNone*,void>& rLink ) { maCancelHdl = rLink; }
+    const Link<LinkParamNone*,void>&   GetCancelHdl() const                { return maCancelHdl; }
+    void            SetDoubleClickHdl( const Link<ImplListBoxWindow*,void>& rLink ) { maDoubleClickHdl = rLink; }
+    const Link<ImplListBoxWindow*,void>&   GetDoubleClickHdl() const               { return maDoubleClickHdl; }
+    void            SetMRUChangedHdl( const Link<LinkParamNone*,void>& rLink ) { maMRUChangedHdl = rLink; }
+    void            SetFocusHdl( const Link<sal_Int32,void>& rLink )  { maFocusHdl = rLink ; }
+    const Link<sal_Int32,void>&   GetFocusHdl() const             { return maFocusHdl; }
 
     boost::signals2::signal< void ( UserDrawEvent* ) > userDrawSignal;
 
-    void            SetListItemSelectHdl( const Link<>& rLink ) { maListItemSelectHdl = rLink ; }
-    const Link<>&   GetListItemSelectHdl() const                { return maListItemSelectHdl; }
+    void            SetListItemSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maListItemSelectHdl = rLink ; }
+    const Link<LinkParamNone*,void>&   GetListItemSelectHdl() const                { return maListItemSelectHdl; }
     bool            IsSelectionChanged() const { return mbSelectionChanged; }
     sal_uInt16      GetSelectModifier() const { return mnSelectModifier; }
 
@@ -389,7 +389,7 @@ private:
     bool mbAutoHScroll : 1; // AutoHScroll an oder aus
     bool mbEdgeBlending : 1;
 
-    Link<>              maScrollHdl;    // because it is needed by ImplListBoxWindow itself
+    Link<ImplListBox*,void>   maScrollHdl;    // because it is needed by ImplListBoxWindow itself
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
 
 protected:
@@ -404,8 +404,8 @@ protected:
     void                ImplInitScrollBars();
 
     DECL_LINK_TYPED(    ScrollBarHdl, ScrollBar*, void );
-    DECL_LINK(          LBWindowScrolled, void* );
-    DECL_LINK(          MRUChanged, void* );
+    DECL_LINK_TYPED(    LBWindowScrolled, ImplListBoxWindow*, void );
+    DECL_LINK_TYPED(    MRUChanged, LinkParamNone*, void );
 
 public:
                     ImplListBox( vcl::Window* pParent, WinBits nWinStyle );
@@ -465,15 +465,15 @@ public:
     long            GetEntryHeight() const          { return maLBWindow->GetEntryHeight(); }
     long            GetMaxEntryWidth() const        { return maLBWindow->GetMaxEntryWidth(); }
 
-    void            SetScrollHdl( const Link<>& rLink ) { maScrollHdl = rLink; }
-    void            SetSelectHdl( const Link<>& rLink ) { maLBWindow->SetSelectHdl( rLink ); }
-    void            SetCancelHdl( const Link<>& rLink ) { maLBWindow->SetCancelHdl( rLink ); }
-    void            SetDoubleClickHdl( const Link<>& rLink ) { maLBWindow->SetDoubleClickHdl( rLink ); }
+    void            SetScrollHdl( const Link<ImplListBox*,void>& rLink ) { maScrollHdl = rLink; }
+    void            SetSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maLBWindow->SetSelectHdl( rLink ); }
+    void            SetCancelHdl( const Link<LinkParamNone*,void>& rLink ) { maLBWindow->SetCancelHdl( rLink ); }
+    void            SetDoubleClickHdl( const Link<ImplListBoxWindow*,void>& rLink ) { maLBWindow->SetDoubleClickHdl( rLink ); }
 
     boost::signals2::signal< void ( UserDrawEvent* ) > userDrawSignal;
 
-    void            SetFocusHdl( const Link<>& rLink )  { maLBWindow->SetFocusHdl( rLink ); }
-    void            SetListItemSelectHdl( const Link<>& rLink ) { maLBWindow->SetListItemSelectHdl( rLink ); }
+    void            SetFocusHdl( const Link<sal_Int32,void>& rLink )  { maLBWindow->SetFocusHdl( rLink ); }
+    void            SetListItemSelectHdl( const Link<LinkParamNone*,void>& rLink ) { maLBWindow->SetListItemSelectHdl( rLink ); }
     void            SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maLBWindow->GetEntryList()->SetSelectionChangedHdl( rLnk ); }
     void            SetCallSelectionChangedHdl( bool bCall )    { maLBWindow->GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
     bool            IsSelectionChanged() const                  { return maLBWindow->IsSelectionChanged(); }
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 5009cdd..1851ce1 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -79,12 +79,12 @@ struct ComboBox::Impl
     ComboBoxBounds calcComboBoxDropDownComponentBounds(
         const Size &rOutSize, const Size &rBorderOutSize) const;
 
-    DECL_DLLPRIVATE_LINK( ImplSelectHdl, void* );
-    DECL_DLLPRIVATE_LINK( ImplCancelHdl, void* );
-    DECL_DLLPRIVATE_LINK( ImplDoubleClickHdl, void* );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplSelectHdl, LinkParamNone*, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplCancelHdl, LinkParamNone*, void );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplDoubleClickHdl, ImplListBoxWindow*, void );
     DECL_DLLPRIVATE_LINK_TYPED( ImplPopupModeEndHdl, FloatingWindow*, void );
     DECL_DLLPRIVATE_LINK_TYPED( ImplSelectionChangedHdl, sal_Int32, void );
-    DECL_DLLPRIVATE_LINK( ImplListItemSelectHdl , void* );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplListItemSelectHdl , LinkParamNone*, void );
 
     void ImplClickButtonHandler( ImplBtn* );
     void ImplUserDrawHandler( UserDrawEvent* );
@@ -410,7 +410,7 @@ void ComboBox::Impl::ImplAutocompleteHandler( Edit* pEdit )
     }
 }
 
-IMPL_LINK_NOARG(ComboBox::Impl, ImplSelectHdl)
+IMPL_LINK_NOARG_TYPED(ComboBox::Impl, ImplSelectHdl, LinkParamNone*, void)
 {
     bool bPopup = m_rThis.IsInDropDown();
     bool bCallSelect = false;
@@ -496,22 +496,17 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplSelectHdl)
         m_isSyntheticModify = false;
         m_rThis.Select();
     }
-
-    return 0;
 }
 
-IMPL_LINK_NOARG( ComboBox::Impl, ImplListItemSelectHdl )
+IMPL_LINK_NOARG_TYPED( ComboBox::Impl, ImplListItemSelectHdl, LinkParamNone*, void )
 {
     m_rThis.CallEventListeners( VCLEVENT_DROPDOWN_SELECT );
-    return 1;
 }
 
-IMPL_LINK_NOARG(ComboBox::Impl, ImplCancelHdl)
+IMPL_LINK_NOARG_TYPED(ComboBox::Impl, ImplCancelHdl, LinkParamNone*, void)
 {
     if (m_rThis.IsInDropDown())
         m_pFloatWin->EndPopupMode();
-
-    return 1;
 }
 
 IMPL_LINK_TYPED( ComboBox::Impl, ImplSelectionChangedHdl, sal_Int32, nChanged, void )
@@ -523,10 +518,9 @@ IMPL_LINK_TYPED( ComboBox::Impl, ImplSelectionChangedHdl, sal_Int32, nChanged, v
     }
 }
 
-IMPL_LINK_NOARG(ComboBox::Impl, ImplDoubleClickHdl)
+IMPL_LINK_NOARG_TYPED(ComboBox::Impl, ImplDoubleClickHdl, ImplListBoxWindow*, void)
 {
     m_rThis.DoubleClick();
-    return 0;
 }
 
 void ComboBox::ToggleDropDown()
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index cdb82fe..35248d9 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1165,7 +1165,7 @@ bool ImplListBoxWindow::SelectEntries( sal_Int32 nSelect, LB_EVENT_TYPE eLET, bo
                 ImplShowFocusRect();
             if (bSelectPosChange)
             {
-                maFocusHdl.Call(reinterpret_cast<void*>(nSelect));
+                maFocusHdl.Call(nSelect);
             }
         }
         ImplClearLayoutData();
@@ -2255,13 +2255,12 @@ void ImplListBox::Resize()
     ImplCheckScrollBars();
 }
 
-IMPL_LINK_NOARG(ImplListBox, MRUChanged)
+IMPL_LINK_NOARG_TYPED(ImplListBox, MRUChanged, LinkParamNone*, void)
 {
     CompatStateChanged( StateChangedType::Data );
-    return 1;
 }
 
-IMPL_LINK_NOARG(ImplListBox, LBWindowScrolled)
+IMPL_LINK_NOARG_TYPED(ImplListBox, LBWindowScrolled, ImplListBoxWindow*, void)
 {
     long nSet = GetTopEntry();
     if( nSet > mpVScrollBar->GetRangeMax() )
@@ -2271,8 +2270,6 @@ IMPL_LINK_NOARG(ImplListBox, LBWindowScrolled)
     mpHScrollBar->SetThumbPos( GetLeftIndent() );
 
     maScrollHdl.Call( this );
-
-    return 1;
 }
 
 IMPL_LINK_TYPED( ImplListBox, ScrollBarHdl, ScrollBar*, pSB, void )
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 3516bbb3..c6ab23b 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -210,7 +210,7 @@ void ListBox::ImplLoadRes( const ResId& rResId )
         SelectEntryPos( nSelPos );
 }
 
-IMPL_LINK_NOARG(ListBox, ImplSelectHdl)
+IMPL_LINK_NOARG_TYPED(ListBox, ImplSelectHdl, LinkParamNone*, void)
 {
     bool bPopup = IsInDropDown();
     if( IsDropDownBox() )
@@ -233,34 +233,27 @@ IMPL_LINK_NOARG(ListBox, ImplSelectHdl)
 
     if ( ( !IsTravelSelect() || mpImplLB->IsSelectionChanged() ) || ( bPopup && !IsMultiSelectionEnabled() ) )
         Select();
-
-    return 1;
 }
 
-IMPL_LINK( ListBox, ImplFocusHdl, void *, nPos )
+IMPL_LINK_TYPED( ListBox, ImplFocusHdl, sal_Int32, nPos, void )
 {
-    CallEventListeners( VCLEVENT_LISTBOX_FOCUS , nPos);
-    return 1;
+    CallEventListeners( VCLEVENT_LISTBOX_FOCUS, reinterpret_cast<void*>(nPos) );
 }
 
-IMPL_LINK_NOARG( ListBox, ImplListItemSelectHdl )
+IMPL_LINK_NOARG_TYPED( ListBox, ImplListItemSelectHdl, LinkParamNone*, void )
 {
     CallEventListeners( VCLEVENT_DROPDOWN_SELECT );
-    return 1;
 }
 
-IMPL_LINK_NOARG(ListBox, ImplScrollHdl)
+IMPL_LINK_NOARG_TYPED(ListBox, ImplScrollHdl, ImplListBox*, void)
 {
     CallEventListeners( VCLEVENT_LISTBOX_SCROLLED );
-    return 1;
 }
 
-IMPL_LINK_NOARG(ListBox, ImplCancelHdl)
+IMPL_LINK_NOARG_TYPED(ListBox, ImplCancelHdl, LinkParamNone*, void)
 {
     if( IsInDropDown() )
         mpFloatWin->EndPopupMode();
-
-    return 1;
 }
 
 IMPL_LINK_TYPED( ListBox, ImplSelectionChangedHdl, sal_Int32, nChanged, void )
@@ -292,10 +285,9 @@ IMPL_LINK_TYPED( ListBox, ImplSelectionChangedHdl, sal_Int32, nChanged, void )
     }
 }
 
-IMPL_LINK_NOARG(ListBox, ImplDoubleClickHdl)
+IMPL_LINK_NOARG_TYPED(ListBox, ImplDoubleClickHdl, ImplListBoxWindow*, void)
 {
     DoubleClick();
-    return 1;
 }
 
 void ListBox::ImplClickButtonHandler( Control* )
commit 99d13c792637a4362c50b30bdc57ebbc6f3b7e4a
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Sep 9 15:09:26 2015 +0200

    convert Link<> to typed
    
    Change-Id: Idcc6b760dfe2d388a2634fcc345c66ff5649a62a

diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 78a3b88..6f47518 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -60,7 +60,7 @@ private:
     DECL_DLLPRIVATE_LINK(  ImplCancelHdl, void* );
     DECL_DLLPRIVATE_LINK(  ImplDoubleClickHdl, void* );
     DECL_DLLPRIVATE_LINK_TYPED( ImplPopupModeEndHdl, FloatingWindow*, void );
-    DECL_DLLPRIVATE_LINK(  ImplSelectionChangedHdl, void* );
+    DECL_DLLPRIVATE_LINK_TYPED(  ImplSelectionChangedHdl, sal_Int32, void );
     DECL_DLLPRIVATE_LINK(  ImplFocusHdl, void* );
     DECL_DLLPRIVATE_LINK(  ImplListItemSelectHdl, void* );
 
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 5f79f70..1ff8df7 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -95,7 +95,7 @@ private:
     sal_Int32       mnMRUCount;
     sal_Int32       mnMaxMRUCount;
 
-    Link<>          maSelectionChangedHdl;
+    Link<sal_Int32,void> maSelectionChangedHdl;
     bool            mbCallSelectionChangedHdl;
     boost::ptr_vector<ImplEntryType> maEntries;
 
@@ -154,7 +154,7 @@ public:
     void            SetSelectionAnchor( sal_Int32  nPos )   { mnSelectionAnchor = nPos; }
     sal_Int32       GetSelectionAnchor() const { return mnSelectionAnchor; }
 
-    void            SetSelectionChangedHdl( const Link<>& rLnk ) { maSelectionChangedHdl = rLnk; }
+    void            SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maSelectionChangedHdl = rLnk; }
     void            SetCallSelectionChangedHdl( bool bCall )    { mbCallSelectionChangedHdl = bCall; }
 
     void            SetMRUCount( sal_Int32  n ) { mnMRUCount = n; }
@@ -474,13 +474,13 @@ public:
 
     void            SetFocusHdl( const Link<>& rLink )  { maLBWindow->SetFocusHdl( rLink ); }
     void            SetListItemSelectHdl( const Link<>& rLink ) { maLBWindow->SetListItemSelectHdl( rLink ); }
-    void            SetSelectionChangedHdl( const Link<>& rLnk ) { maLBWindow->GetEntryList()->SetSelectionChangedHdl( rLnk ); }
+    void            SetSelectionChangedHdl( const Link<sal_Int32,void>& rLnk ) { maLBWindow->GetEntryList()->SetSelectionChangedHdl( rLnk ); }
     void            SetCallSelectionChangedHdl( bool bCall )    { maLBWindow->GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
     bool            IsSelectionChanged() const                  { return maLBWindow->IsSelectionChanged(); }
     sal_uInt16      GetSelectModifier() const                   { return maLBWindow->GetSelectModifier(); }
 
     void            SetMRUEntries( const OUString& rEntries, sal_Unicode cSep );
-    OUString   GetMRUEntries( sal_Unicode cSep ) const;
+    OUString        GetMRUEntries( sal_Unicode cSep ) const;
     void            SetMaxMRUCount( sal_Int32  n )                  { maLBWindow->GetEntryList()->SetMaxMRUCount( n ); }
     sal_Int32       GetMaxMRUCount() const                      { return maLBWindow->GetEntryList()->GetMaxMRUCount(); }
     sal_uInt16      GetDisplayLineCount() const
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 4de4ec97..5009cdd 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -83,7 +83,7 @@ struct ComboBox::Impl
     DECL_DLLPRIVATE_LINK( ImplCancelHdl, void* );
     DECL_DLLPRIVATE_LINK( ImplDoubleClickHdl, void* );
     DECL_DLLPRIVATE_LINK_TYPED( ImplPopupModeEndHdl, FloatingWindow*, void );
-    DECL_DLLPRIVATE_LINK( ImplSelectionChangedHdl, void* );
+    DECL_DLLPRIVATE_LINK_TYPED( ImplSelectionChangedHdl, sal_Int32, void );
     DECL_DLLPRIVATE_LINK( ImplListItemSelectHdl , void* );
 
     void ImplClickButtonHandler( ImplBtn* );
@@ -514,15 +514,13 @@ IMPL_LINK_NOARG(ComboBox::Impl, ImplCancelHdl)
     return 1;
 }
 
-IMPL_LINK( ComboBox::Impl, ImplSelectionChangedHdl, void*, n )
+IMPL_LINK_TYPED( ComboBox::Impl, ImplSelectionChangedHdl, sal_Int32, nChanged, void )
 {
     if (!m_pImplLB->IsTrackingSelect())
     {
-        sal_Int32 nChanged = (sal_Int32)reinterpret_cast<sal_uLong>(n);
         if (!m_pSubEdit->IsReadOnly() && m_pImplLB->GetEntryList()->IsEntryPosSelected(nChanged))
             m_pSubEdit->SetText(m_pImplLB->GetEntryList()->GetEntryText(nChanged));
     }
-    return 1;
 }
 
 IMPL_LINK_NOARG(ComboBox::Impl, ImplDoubleClickHdl)
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 87b17e9..cdb82fe 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -94,7 +94,7 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect )
         {
             iter->mbIsSelected = bSelect;
             if ( mbCallSelectionChangedHdl )
-                maSelectionChangedHdl.Call( reinterpret_cast<void*>(nPos) );
+                maSelectionChangedHdl.Call( nPos );
         }
     }
 }
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index a108a53..3516bbb3 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -263,11 +263,10 @@ IMPL_LINK_NOARG(ListBox, ImplCancelHdl)
     return 1;
 }
 
-IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
+IMPL_LINK_TYPED( ListBox, ImplSelectionChangedHdl, sal_Int32, nChanged, void )
 {
     if ( !mpImplLB->IsTrackingSelect() )
     {
-        sal_Int32 nChanged = (sal_Int32)reinterpret_cast<sal_uLong>(n);
         const ImplEntryList* pEntryList = mpImplLB->GetEntryList();
         if ( pEntryList->IsEntryPosSelected( nChanged ) )
         {
@@ -291,7 +290,6 @@ IMPL_LINK( ListBox, ImplSelectionChangedHdl, void*, n )
         }
         mpImplWin->Invalidate();
     }
-    return 1;
 }
 
 IMPL_LINK_NOARG(ListBox, ImplDoubleClickHdl)


More information about the Libreoffice-commits mailing list