[Libreoffice-commits] core.git: cui/source fpicker/source include/sfx2 include/vcl sc/inc sc/source sfx2/source svx/source sw/source vcl/source

Noel Grandin noel at peralex.com
Wed Oct 14 00:31:02 PDT 2015


 cui/source/dialogs/cuigaldlg.cxx             |    9 ++++-----
 cui/source/factory/dlgfact.cxx               |   12 +++++-------
 cui/source/factory/dlgfact.hxx               |    6 +++---
 cui/source/inc/cuigaldlg.hxx                 |    6 +++---
 fpicker/source/office/OfficeFilePicker.cxx   |    5 ++---
 fpicker/source/office/OfficeFilePicker.hxx   |    2 +-
 fpicker/source/office/OfficeFolderPicker.cxx |    7 +++----
 fpicker/source/office/OfficeFolderPicker.hxx |    2 +-
 fpicker/source/office/iodlg.cxx              |    2 +-
 fpicker/source/office/iodlg.hxx              |    2 +-
 include/sfx2/tabdlg.hxx                      |    2 +-
 include/vcl/abstdlg.hxx                      |    3 ++-
 include/vcl/dialog.hxx                       |    2 +-
 sc/inc/arealink.hxx                          |    3 ++-
 sc/source/ui/attrdlg/scdlgfact.hxx           |    4 ++--
 sc/source/ui/docshell/arealink.cxx           |    4 +---
 sc/source/ui/inc/cellsh.hxx                  |    2 +-
 sc/source/ui/view/cellsh1.cxx                |    3 +--
 sfx2/source/dialog/tabdlg.cxx                |    2 +-
 svx/source/gallery2/galbrws1.cxx             |   10 ++++------
 svx/source/gallery2/galbrws1.hxx             |    4 ++--
 sw/source/ui/dbui/mailmergewizard.cxx        |    2 +-
 sw/source/ui/dialog/swdlgfact.cxx            |   14 ++++++--------
 sw/source/ui/dialog/swdlgfact.hxx            |    6 +++---
 sw/source/uibase/app/apphdl.cxx              |    9 ++-------
 sw/source/uibase/dbui/dbui.cxx               |    2 +-
 sw/source/uibase/inc/mailmergewizard.hxx     |    2 +-
 vcl/source/window/dialog.cxx                 |    8 ++++----
 28 files changed, 60 insertions(+), 75 deletions(-)

New commits:
commit b4da5037e0cc2952446b2138d515e0c762172b25
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Oct 13 11:10:38 2015 +0200

    convert Link<> to typed
    
    Change-Id: I1876f327607e0e23292950741df348d4ec31fde1

diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index f820a62..3ed9f44 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -267,7 +267,7 @@ short SearchProgress::Execute()
 
 
 
-void SearchProgress::StartExecuteModal( const Link<>& rEndDialogHdl )
+void SearchProgress::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     assert(!maSearchThread.is());
     maSearchThread = new SearchThread(
@@ -439,7 +439,7 @@ short TakeProgress::Execute()
 
 
 
-void TakeProgress::StartExecuteModal( const Link<>& rEndDialogHdl )
+void TakeProgress::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     assert(!maTakeThread.is());
     maTakeThread = new TakeThread(
@@ -1079,7 +1079,7 @@ void TPGalleryThemeProperties::TakeFiles()
         pTakeProgress->Update();
 
         pTakeProgress->StartExecuteModal(
-            Link<>() /* no postprocessing needed, pTakeProgress
+            Link<Dialog&,void>() /* no postprocessing needed, pTakeProgress
                       will be disposed in TakeProgress::CleanupHdl */ );
     }
 }
@@ -1224,7 +1224,7 @@ IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, PreviewTimerHdl, Timer *, void)
 
 
 
-IMPL_LINK_NOARG(TPGalleryThemeProperties, EndSearchProgressHdl)
+IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, EndSearchProgressHdl, Dialog&, void)
 {
   if( !aFoundList.empty() )
   {
@@ -1240,7 +1240,6 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, EndSearchProgressHdl)
       m_pCbxPreview->Disable();
       bEntriesFound = false;
   }
-  return 0L;
 }
 
 
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 8069f07..91336b4 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -149,7 +149,7 @@ VclAbstractDialog2_Impl::~VclAbstractDialog2_Impl()
 }
 
 // virtual
-void  VclAbstractDialog2_Impl::StartExecuteModal( const Link<>& rEndDialogHdl )
+void  VclAbstractDialog2_Impl::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     m_aEndDlgHdl = rEndDialogHdl;
     m_pDlg->StartExecuteModal(
@@ -162,17 +162,15 @@ long VclAbstractDialog2_Impl::GetResult()
     return m_pDlg->GetResult();
 }
 
-IMPL_LINK( VclAbstractDialog2_Impl, EndDialogHdl, Dialog*, pDlg )
+IMPL_LINK_TYPED( VclAbstractDialog2_Impl, EndDialogHdl, Dialog&, rDlg, void )
 {
-    if ( pDlg != m_pDlg )
+    if ( &rDlg != m_pDlg )
     {
         SAL_WARN( "cui.factory", "VclAbstractDialog2_Impl::EndDialogHdl(): wrong dialog" );
     }
 
-    m_aEndDlgHdl.Call( this );
-    m_aEndDlgHdl = Link<>();
-
-    return 0L;
+    m_aEndDlgHdl.Call( *m_pDlg );
+    m_aEndDlgHdl = Link<Dialog&,void>();
 }
 
 
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 1bb596d..39b645d 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -78,14 +78,14 @@ short Class::Execute()                              \
 class VclAbstractDialog2_Impl : public VclAbstractDialog2
 {
     ScopedVclPtr<Dialog> m_pDlg;
-    Link<>          m_aEndDlgHdl;
+    Link<Dialog&,void>   m_aEndDlgHdl;
 public:
     explicit        VclAbstractDialog2_Impl( Dialog* p ) : m_pDlg( p ) {}
     virtual         ~VclAbstractDialog2_Impl();
-    virtual void    StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    virtual void    StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
     virtual long    GetResult() override;
 private:
-                    DECL_LINK( EndDialogHdl, Dialog* );
+    DECL_LINK_TYPED( EndDialogHdl, Dialog&, void );
 };
 
 class CuiVclAbstractDialog_Impl : public VclAbstractDialog
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index 93594ca..b777a36 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -99,7 +99,7 @@ public:
                         DECL_LINK_TYPED( CleanUpHdl, void*, void );
 
     virtual short       Execute() override;
-    virtual void        StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    virtual void        StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
     void                SetFileType( const OUString& rType ) { m_pFtSearchType->SetText( rType ); }
     void                SetDirectory( const INetURLObject& rURL ) { m_pFtSearchDir->SetText( GetReducedString( rURL, 30 ) ); }
 };
@@ -146,7 +146,7 @@ public:
 
     void                SetFile( const INetURLObject& rURL ) { m_pFtTakeFile->SetText( GetReducedString( rURL, 30 ) ); }
     virtual short       Execute() override;
-    virtual void        StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    virtual void        StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
 };
 
 class ActualizeProgress : public ModalDialog
@@ -286,7 +286,7 @@ class TPGalleryThemeProperties : public SfxTabPage
                         DECL_LINK( SelectFileTypeHdl, void* );
                         DECL_LINK_TYPED( DClickFoundHdl, ListBox&, void );
                         DECL_LINK_TYPED( PreviewTimerHdl, Timer*, void );
-                        DECL_LINK(EndSearchProgressHdl, void *);
+                        DECL_LINK_TYPED( EndSearchProgressHdl, Dialog&, void );
                         DECL_LINK_TYPED( DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void );
 
 public:
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index a2ac1c8..7e4df5a 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -217,16 +217,15 @@ void SvtFilePicker::prepareExecute()
 }
 
 
-IMPL_LINK( SvtFilePicker, DialogClosedHdl, Dialog*, pDlg )
+IMPL_LINK_TYPED( SvtFilePicker, DialogClosedHdl, Dialog&, rDlg, void )
 {
     if ( m_xDlgClosedListener.is() )
     {
-        sal_Int16 nRet = static_cast< sal_Int16 >( pDlg->GetResult() );
+        sal_Int16 nRet = static_cast< sal_Int16 >( rDlg.GetResult() );
         css::ui::dialogs::DialogClosedEvent aEvent( *this, nRet );
         m_xDlgClosedListener->dialogClosed( aEvent );
         m_xDlgClosedListener.clear();
     }
-    return 0;
 }
 
 
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index 78032c1..dbf66e2 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -223,7 +223,7 @@ protected:
 
     void                prepareExecute( );
 
-    DECL_LINK(          DialogClosedHdl, Dialog* );
+    DECL_LINK_TYPED(    DialogClosedHdl, Dialog&, void );
 };
 
 // SvtRemoteFilePicker
diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx
index 28fd1cf..f3cdafb 100644
--- a/fpicker/source/office/OfficeFolderPicker.cxx
+++ b/fpicker/source/office/OfficeFolderPicker.cxx
@@ -98,17 +98,16 @@ void SvtFolderPicker::prepareExecute()
     }
 }
 
-IMPL_LINK( SvtFolderPicker, DialogClosedHdl, Dialog*, pDlg )
+IMPL_LINK_TYPED( SvtFolderPicker, DialogClosedHdl, Dialog&, rDlg, void )
 {
     if ( m_xListener.is() )
     {
-        sal_Int16 nRet = static_cast< sal_Int16 >( pDlg->GetResult() );
+        sal_Int16 nRet = static_cast< sal_Int16 >( rDlg.GetResult() );
         css::ui::dialogs::DialogClosedEvent aEvent( *this, nRet );
         m_xListener->dialogClosed( aEvent );
         m_xListener.clear();
     }
-    return 0;
-  }
+}
 
 void SAL_CALL SvtFolderPicker::setDisplayDirectory( const OUString& aDirectory )
     throw( IllegalArgumentException, RuntimeException, std::exception )
diff --git a/fpicker/source/office/OfficeFolderPicker.hxx b/fpicker/source/office/OfficeFolderPicker.hxx
index 11175fc..2452aa6 100644
--- a/fpicker/source/office/OfficeFolderPicker.hxx
+++ b/fpicker/source/office/OfficeFolderPicker.hxx
@@ -46,7 +46,7 @@ private:
                             m_xListener;
 
     void                            prepareExecute( );
-    DECL_LINK(                      DialogClosedHdl, Dialog* );
+    DECL_LINK_TYPED(                DialogClosedHdl, Dialog&, void );
 
 public:
                                     SvtFolderPicker( const css::uno::Reference < css::lang::XMultiServiceFactory >& xFactory );
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index c318670..ed34f46 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1804,7 +1804,7 @@ short SvtFileDialog::Execute()
 }
 
 
-void SvtFileDialog::StartExecuteModal( const Link<>& rEndDialogHdl )
+void SvtFileDialog::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     PrepareExecute();
 
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 1f02d69..f7cf813 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -167,7 +167,7 @@ public:
     virtual void                dispose() override;
 
     virtual short               Execute() override;
-    virtual void                StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    virtual void                StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
 
             void                FileSelect();
             void                FilterSelect() override;
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index f95fffe..0a9c4710 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -195,7 +195,7 @@ public:
     void                RemoveStandardButton();
 
     short               Execute() override;
-    void                StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    void                StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
     void                Start( bool bShow = true );
 
     const SfxItemSet*   GetExampleSet() const { return pExampleSet; }
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index 3b2dd2d..5ea675c 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -25,6 +25,7 @@
 
 namespace vcl { class Window; }
 class ResId;
+class Dialog;
 
 class VCL_DLLPUBLIC VclAbstractDialog
 {
@@ -39,7 +40,7 @@ class VCL_DLLPUBLIC VclAbstractDialog2
 public:
     virtual             ~VclAbstractDialog2();
 
-    virtual void        StartExecuteModal( const Link<>& rEndDialogHdl ) = 0;
+    virtual void        StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) = 0;
     virtual long        GetResult() = 0;
 };
 
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 6875366..668ab71 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -102,7 +102,7 @@ public:
     // Dialog::Execute replacement API
 public:
     // Link impl: DECL_LINK( MyEndDialogHdl, Dialog* ); <= param is dialog just ended
-    virtual void    StartExecuteModal( const Link<>& rEndDialogHdl );
+    virtual void    StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl );
     long            GetResult() const;
 private:
     bool            ImplStartExecuteModal();
diff --git a/sc/inc/arealink.hxx b/sc/inc/arealink.hxx
index 0eed8a8..afda84c 100644
--- a/sc/inc/arealink.hxx
+++ b/sc/inc/arealink.hxx
@@ -28,6 +28,7 @@
 
 class SfxObjectShell;
 struct AreaLink_Impl;
+class Dialog;
 
 class SC_DLLPUBLIC ScAreaLink : public ::sfx2::SvBaseLink, public ScRefreshTimer
 {
@@ -75,7 +76,7 @@ public:
     const ScRange&  GetDestArea() const     { return aDestArea;     }
 
     DECL_LINK_TYPED( RefreshHdl, Timer*, void );
-    DECL_LINK( AreaEndEditHdl, void* );
+    DECL_LINK_TYPED( AreaEndEditHdl, Dialog&, void );
 };
 
 #endif
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 5f83f0f..5932e94 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -73,7 +73,7 @@ public:                                             \
                      : pDlg(p)                      \
                      {}                             \
     virtual         ~Class();                       \
-    virtual void    StartExecuteModal( const Link<>& rEndDialogHdl ) override; \
+    virtual void    StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override; \
     long            GetResult() override;
 
 #define IMPL_ABSTDLG_BASE(Class)                    \
@@ -89,7 +89,7 @@ short Class::Execute()                              \
 Class::~Class()                                     \
 {                                                   \
 }                                                   \
-void Class::StartExecuteModal( const Link<>& rEndDialogHdl ) \
+void Class::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) \
 {                                                   \
     pDlg->StartExecuteModal( rEndDialogHdl ) ;      \
 }                                                   \
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index f1f2480..016cd79 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -487,7 +487,7 @@ IMPL_LINK_NOARG_TYPED(ScAreaLink, RefreshHdl, Timer *, void)
     Refresh( aFileName, aFilterName, aSourceArea, GetRefreshDelay() );
 }
 
-IMPL_LINK_NOARG(ScAreaLink, AreaEndEditHdl)
+IMPL_LINK_NOARG_TYPED(ScAreaLink, AreaEndEditHdl, Dialog&, void)
 {
     //  #i76514# can't use link argument to access the dialog,
     //  because it's the ScLinkedAreaDlg, not AbstractScLinkedAreaDlg
@@ -504,8 +504,6 @@ IMPL_LINK_NOARG(ScAreaLink, AreaEndEditHdl)
         SetName( aNewLinkName );
     }
     pImpl->m_pDialog = NULL;    // dialog is deleted with parent
-
-    return 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx
index 148b967..84810ef 100644
--- a/sc/source/ui/inc/cellsh.hxx
+++ b/sc/source/ui/inc/cellsh.hxx
@@ -64,7 +64,7 @@ private:
     void ExecuteFillSingleEdit();
 
     DECL_LINK_TYPED( ClipboardChanged, TransferableDataHelper*, void );
-    DECL_LINK( DialogClosed, void* );
+    DECL_LINK_TYPED( DialogClosed, Dialog&, void );
 
     RotateTransliteration m_aRotateCase;
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 8ee420b..12d61c5 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2884,7 +2884,7 @@ void ScCellShell::ExecuteFillSingleEdit()
     SC_MOD()->SetInputMode(SC_INPUT_TABLE, &aInit);
 }
 
-IMPL_LINK_NOARG(ScCellShell, DialogClosed)
+IMPL_LINK_NOARG_TYPED(ScCellShell, DialogClosed, Dialog&, void)
 {
     assert(pImpl->m_pLinkedDlg && "ScCellShell::DialogClosed(): invalid request");
     assert(pImpl->m_pRequest && "ScCellShell::DialogClosed(): invalid request");
@@ -2911,7 +2911,6 @@ IMPL_LINK_NOARG(ScCellShell, DialogClosed)
     }
 
     ExecuteExternalSource( sFile, sFilter, sOptions, sSource, nRefresh, *(pImpl->m_pRequest) );
-    return 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9879325..38d53bc 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -545,7 +545,7 @@ short SfxTabDialog::Execute()
 
 
 
-void SfxTabDialog::StartExecuteModal( const Link<>& rEndDialogHdl )
+void SfxTabDialog::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     if ( !m_pTabCtrl->GetPageCount() )
         return;
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index beebfd6..b5245fb 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -327,16 +327,14 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties( VclAbstractDialog2* pDialog
     Application::PostUserEvent( LINK( this, GalleryBrowser1, DestroyThemePropertiesDlgHdl ), pDialog, true );
 }
 
-IMPL_LINK( GalleryBrowser1, EndNewThemePropertiesDlgHdl, VclAbstractDialog2*, pDialog )
+IMPL_LINK_TYPED( GalleryBrowser1, EndNewThemePropertiesDlgHdl, Dialog&, rDialog, void )
 {
-    ImplEndGalleryThemeProperties( pDialog, true );
-    return 0L;
+    ImplEndGalleryThemeProperties( dynamic_cast<VclAbstractDialog2*>(&rDialog), true );
 }
 
-IMPL_LINK( GalleryBrowser1, EndThemePropertiesDlgHdl, VclAbstractDialog2*, pDialog )
+IMPL_LINK_TYPED( GalleryBrowser1, EndThemePropertiesDlgHdl, Dialog&, rDialog, void )
 {
-    ImplEndGalleryThemeProperties( pDialog, false );
-    return 0L;
+    ImplEndGalleryThemeProperties( dynamic_cast<VclAbstractDialog2*>(&rDialog), false );
 }
 
 IMPL_LINK_TYPED( GalleryBrowser1, DestroyThemePropertiesDlgHdl, void*, p, void )
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index a5ffa51..c3c3f74 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -113,8 +113,8 @@ private:
                             DECL_LINK_TYPED( SelectThemeHdl, ListBox&, void );
                             DECL_LINK_TYPED( ShowContextMenuHdl, void*, void );
                             DECL_LINK_TYPED( PopupMenuHdl, Menu*, bool );
-                            DECL_LINK( EndNewThemePropertiesDlgHdl, VclAbstractDialog2* );
-                            DECL_LINK( EndThemePropertiesDlgHdl, VclAbstractDialog2* );
+                            DECL_LINK_TYPED( EndNewThemePropertiesDlgHdl, Dialog&, void );
+                            DECL_LINK_TYPED( EndThemePropertiesDlgHdl, Dialog&, void );
                             DECL_LINK_TYPED( DestroyThemePropertiesDlgHdl, void*, void );
 
 public:
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index 04bd7f8..d689457 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -303,7 +303,7 @@ short SwMailMergeWizard::Execute()
     return RET_CANCEL;
 }
 
-void SwMailMergeWizard::StartExecuteModal( const Link<>& rEndDialogHdl )
+void SwMailMergeWizard::StartExecuteModal( const Link<Dialog&, void>& rEndDialogHdl )
 {
     ::svt::RoadmapWizard::StartExecuteModal( rEndDialogHdl );
 }
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index ce894f4..b507812 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -592,7 +592,7 @@ AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl()
     pDlg.disposeAndClear();
 }
 
-void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link<>& rEndDialogHdl )
+void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     aEndDlgHdl = rEndDialogHdl;
     pDlg->StartExecuteModal(
@@ -604,15 +604,13 @@ long AbstractMailMergeWizard_Impl::GetResult()
     return pDlg->GetResult();
 }
 
-IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog )
+IMPL_LINK_TYPED( AbstractMailMergeWizard_Impl, EndDialogHdl, Dialog&, rDialog, void )
 {
-    OSL_ENSURE( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" );
-    (void) pDialog; // unused in non-debug
+    OSL_ENSURE( &rDialog == pDlg, "wrong dialog passed to EndDialogHdl!" );
+    (void) rDialog; // unused in non-debug
 
-    aEndDlgHdl.Call( this );
-    aEndDlgHdl = Link<>();
-
-    return 0L;
+    aEndDlgHdl.Call( *pDlg );
+    aEndDlgHdl = Link<Dialog&,void>();
 }
 
 OUString AbstractMailMergeWizard_Impl::GetReloadDocument() const
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index d71baff..61ed7a0 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -345,15 +345,15 @@ class SwMailMergeWizard;
 class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard
 {
     VclPtr<SwMailMergeWizard> pDlg;
-    Link<>             aEndDlgHdl;
+    Link<Dialog&,void>        aEndDlgHdl;
 
-    DECL_LINK( EndDialogHdl, SwMailMergeWizard* );
+    DECL_LINK_TYPED( EndDialogHdl, Dialog&, void );
 public:
     explicit AbstractMailMergeWizard_Impl( SwMailMergeWizard* p )
      : pDlg(p)
      {}
     virtual         ~AbstractMailMergeWizard_Impl();
-    virtual void    StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    virtual void    StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
     virtual long    GetResult() override;
 
     virtual OUString            GetReloadDocument() const override;
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index bb6004e..e4bc035 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -267,7 +267,7 @@ class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject
     SwMailMergeConfigItem*   m_pMMConfig;   // sometimes owner
     AbstractMailMergeWizard* m_pWizard;     // always owner
 
-    DECL_LINK( EndDialogHdl, AbstractMailMergeWizard* );
+    DECL_LINK_TYPED( EndDialogHdl, Dialog&, void );
     DECL_LINK_TYPED( DestroyDialogHdl, void*, void );
     DECL_STATIC_LINK_TYPED( SwMailMergeWizardExecutor, DestroyWizardHdl, void*, void );
     DECL_LINK_TYPED( CancelHdl, void*, void );
@@ -437,11 +437,8 @@ void SwMailMergeWizardExecutor::ExecuteWizard()
         LINK( this, SwMailMergeWizardExecutor, EndDialogHdl ) );
 }
 
-IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, pDialog )
+IMPL_LINK_NOARG_TYPED( SwMailMergeWizardExecutor, EndDialogHdl, Dialog&, void )
 {
-    OSL_ENSURE( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" );
-    (void) pDialog;
-
     long nRet = m_pWizard->GetResult();
     sal_uInt16 nRestartPage = m_pWizard->GetRestartPage();
 
@@ -570,8 +567,6 @@ IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, pD
         }
 
     } // switch
-
-    return 0L;
 }
 
 IMPL_LINK_NOARG_TYPED(SwMailMergeWizardExecutor, DestroyDialogHdl, void*, void)
diff --git a/sw/source/uibase/dbui/dbui.cxx b/sw/source/uibase/dbui/dbui.cxx
index 5c7de4e..75d3d36 100644
--- a/sw/source/uibase/dbui/dbui.cxx
+++ b/sw/source/uibase/dbui/dbui.cxx
@@ -135,7 +135,7 @@ void CancelableDialog::SetCancelHdl( const Link<Button*,void>& rLink )
 void CancelableDialog::Show()
 {
     if (mbModal)
-        StartExecuteModal( Link<>() );
+        StartExecuteModal( Link<Dialog&,void>() );
     else
         Dialog::Show();
 }
diff --git a/sw/source/uibase/inc/mailmergewizard.hxx b/sw/source/uibase/inc/mailmergewizard.hxx
index cadd1cd..1c198c4 100644
--- a/sw/source/uibase/inc/mailmergewizard.hxx
+++ b/sw/source/uibase/inc/mailmergewizard.hxx
@@ -90,7 +90,7 @@ public:
     void                    updateRoadmapItemLabel( WizardState _nState );
 
     virtual short           Execute() override;
-    virtual void            StartExecuteModal( const Link<>& rEndDialogHdl ) override;
+    virtual void            StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override;
 };
 #endif
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index b0f4c83..04bfe04 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -334,7 +334,7 @@ struct DialogImpl
 {
     long    mnResult;
     bool    mbStartedModal;
-    Link<>  maEndDialogHdl;
+    Link<Dialog&,void>  maEndDialogHdl;
 
     DialogImpl() : mnResult( -1 ), mbStartedModal( false ) {}
 };
@@ -915,7 +915,7 @@ short Dialog::Execute()
 }
 
 // virtual
-void Dialog::StartExecuteModal( const Link<>& rEndDialogHdl )
+void Dialog::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl )
 {
     if ( !ImplStartExecuteModal() )
         return;
@@ -972,8 +972,8 @@ void Dialog::EndDialog( long nResult )
             ImplEndExecuteModal();
             if (mpDialogImpl->maEndDialogHdl.IsSet())
             {
-                mpDialogImpl->maEndDialogHdl.Call( this );
-                mpDialogImpl->maEndDialogHdl = Link<>();
+                mpDialogImpl->maEndDialogHdl.Call( *this );
+                mpDialogImpl->maEndDialogHdl = Link<Dialog&,void>();
             }
             mpDialogImpl->mbStartedModal = false;
             mpDialogImpl->mnResult = -1;


More information about the Libreoffice-commits mailing list