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

Noel Grandin noelgrandin at gmail.com
Fri Sep 25 11:19:43 PDT 2015


 cui/source/factory/dlgfact.cxx                             |    4 ++--
 cui/source/factory/dlgfact.hxx                             |    4 ++--
 cui/source/options/optcolor.cxx                            |    6 +++---
 cui/source/options/optcolor.hxx                            |    2 +-
 include/svx/svxdlg.hxx                                     |    2 +-
 sd/source/ui/docshell/docshel2.cxx                         |   11 ++++-------
 sd/source/ui/inc/DrawDocShell.hxx                          |    8 ++++----
 sd/source/ui/inc/DrawViewShell.hxx                         |    2 +-
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx     |   11 ++++-------
 sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx |    2 +-
 sd/source/ui/view/drviewsb.cxx                             |    9 +++------
 11 files changed, 26 insertions(+), 35 deletions(-)

New commits:
commit 51b2ad378a8531a7b02433594cd7f6bbd6a61222
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Thu Sep 24 18:59:52 2015 +0200

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

diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 88806b3..94356f2 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -587,7 +587,7 @@ void AbstractSvxNameDialog_Impl::GetName(OUString& rName)
     pDlg->GetName( rName );
 }
 
-void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const Link<>& rLink, bool bCheckImmediately )
+void AbstractSvxNameDialog_Impl::SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& rLink, bool bCheckImmediately )
 {
     aCheckNameHdl = rLink;
     if( rLink.IsSet() )
@@ -610,7 +610,7 @@ void AbstractSvxNameDialog_Impl::SetText( const OUString& rStr )
 IMPL_LINK_NOARG_TYPED(AbstractSvxNameDialog_Impl, CheckNameHdl, SvxNameDialog&, bool)
 {
     if( aCheckNameHdl.IsSet() )
-        return aCheckNameHdl.Call(this);
+        return aCheckNameHdl.Call(*this);
     return false;
 }
 
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 5477392..949e252 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -325,13 +325,13 @@ class AbstractSvxNameDialog_Impl :public AbstractSvxNameDialog
 {
     DECL_ABSTDLG_BASE(AbstractSvxNameDialog_Impl,SvxNameDialog)
     virtual void    GetName( OUString& rName ) SAL_OVERRIDE ;
-    virtual void    SetCheckNameHdl( const Link<>& rLink, bool bCheckImmediately = false ) SAL_OVERRIDE ;
+    virtual void    SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& rLink, bool bCheckImmediately = false ) SAL_OVERRIDE ;
     virtual void    SetEditHelpId(const OString&) SAL_OVERRIDE ;
     //from class Window
     virtual void    SetHelpId( const OString& ) SAL_OVERRIDE ;
     virtual void    SetText( const OUString& rStr ) SAL_OVERRIDE ;
 private:
-    Link<> aCheckNameHdl;
+    Link<AbstractSvxNameDialog&,bool> aCheckNameHdl;
     DECL_LINK_TYPED(CheckNameHdl, SvxNameDialog&, bool);
 };
 
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 76a2ec3..d95fd2a 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -1227,11 +1227,11 @@ IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, vo
     m_pDeleteSchemePB->Enable( m_pColorSchemeLB->GetEntryCount() > 1 );
 }
 
-IMPL_LINK(SvxColorOptionsTabPage, CheckNameHdl_Impl, AbstractSvxNameDialog*, pDialog )
+IMPL_LINK_TYPED(SvxColorOptionsTabPage, CheckNameHdl_Impl, AbstractSvxNameDialog&, rDialog, bool )
 {
     OUString sName;
-    pDialog->GetName(sName);
-    return long(!sName.isEmpty() && LISTBOX_ENTRY_NOTFOUND == m_pColorSchemeLB->GetEntryPos( sName ));
+    rDialog.GetName(sName);
+    return !sName.isEmpty() && LISTBOX_ENTRY_NOTFOUND == m_pColorSchemeLB->GetEntryPos( sName );
 }
 
 void SvxColorOptionsTabPage::FillUserData()
diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx
index ca29041..f182e4b 100644
--- a/cui/source/options/optcolor.hxx
+++ b/cui/source/options/optcolor.hxx
@@ -43,7 +43,7 @@ class SvxColorOptionsTabPage : public SfxTabPage
 
     DECL_LINK(SchemeChangedHdl_Impl, ListBox*);
     DECL_LINK_TYPED(SaveDeleteHdl_Impl, Button*, void);
-    DECL_LINK(CheckNameHdl_Impl, AbstractSvxNameDialog*);
+    DECL_LINK_TYPED(CheckNameHdl_Impl, AbstractSvxNameDialog&, bool);
     void UpdateColorConfig();
 
 public:
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 459b61e..d97090b 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -158,7 +158,7 @@ class AbstractSvxNameDialog :public VclAbstractDialog
 {
 public:
     virtual void    GetName( OUString& rName ) = 0;
-    virtual void    SetCheckNameHdl( const Link<>& rLink, bool bCheckImmediately = false ) = 0;
+    virtual void    SetCheckNameHdl( const Link<AbstractSvxNameDialog&,bool>& rLink, bool bCheckImmediately = false ) = 0;
     virtual void    SetEditHelpId(const OString&) = 0;
     //from class Window
     virtual void    SetHelpId( const OString& ) = 0;
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 88d14a6..87b9798 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -410,16 +410,13 @@ bool DrawDocShell::IsNewPageNameValid( OUString & rInOutPageName, bool bResetStr
     return bCanUseNewName;
 }
 
-IMPL_LINK( DrawDocShell, RenameSlideHdl, AbstractSvxNameDialog*, pDialog )
+IMPL_LINK_TYPED( DrawDocShell, RenameSlideHdl, AbstractSvxNameDialog&, rDialog, bool )
 {
-    if( ! pDialog )
-        return long(false);
-
     OUString aNewName;
-    pDialog->GetName( aNewName );
-
-    return long(IsNewPageNameValid( aNewName ));
+    rDialog.GetName( aNewName );
+    return IsNewPageNameValid( aNewName );
 }
+
 } // end of namespace sd
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 6ba5aee..009dafa 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -197,7 +197,7 @@ public:
     */
     virtual OutputDevice* GetDocumentRefDev() SAL_OVERRIDE;
 
-    DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog* );
+    DECL_LINK_TYPED( RenameSlideHdl, AbstractSvxNameDialog&, bool );
 
     // ExecuteSpellPopup now handled by DrawDocShell
     DECL_LINK_TYPED( OnlineSpellCallback, SpellCallbackInfo&, void );
@@ -216,9 +216,9 @@ protected:
     FontList*               mpFontList;
     rtl::Reference<FuPoor> mxDocShellFunction;
     DocumentType            meDocType;
-    sal_uInt16                  mnStyleFamily;
-    const sal_uInt16*           mpFilterSIDs;
-    sal_uInt16                  mnFilterCount;
+    sal_uInt16              mnStyleFamily;
+    const sal_uInt16*       mpFilterSIDs;
+    sal_uInt16              mnFilterCount;
     bool                    mbFilterEnable;
     bool                    mbSdDataObj;
     bool                    mbInDestruction;
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index c3bf37d..1970900 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -406,7 +406,7 @@ protected:
                     DECL_LINK_TYPED( ClipboardChanged, TransferableDataHelper*, void );
                     DECL_LINK_TYPED( TabSplitHdl, TabBar *, void );
                     DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
-                    DECL_LINK( RenameSlideHdl, AbstractSvxNameDialog* );
+                    DECL_LINK_TYPED( RenameSlideHdl, AbstractSvxNameDialog&, bool );
 
     void            DeleteActualPage();
     void            DeleteActualLayer();
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 446c6fc..5945a4a 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -934,13 +934,10 @@ void SlotManager::RenameSlide()
     }
 }
 
-IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog*, pDialog)
+IMPL_LINK_TYPED(SlotManager, RenameSlideHdl, AbstractSvxNameDialog&, rDialog, bool)
 {
-    if( ! pDialog )
-        return 0;
-
     OUString aNewName;
-    pDialog->GetName( aNewName );
+    rDialog.GetName( aNewName );
 
     model::SharedPageDescriptor pDescriptor (
         mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide());
@@ -948,9 +945,9 @@ IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog*, pDialog)
     if (pDescriptor.get() != NULL)
         pCurrentPage = pDescriptor->GetPage();
 
-    return long( (pCurrentPage!=NULL && aNewName == pCurrentPage->GetName())
+    return (pCurrentPage!=NULL && aNewName == pCurrentPage->GetName())
         || (mrSlideSorter.GetViewShell()
-            && mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) ));
+            && mrSlideSorter.GetViewShell()->GetDocSh()->IsNewPageNameValid( aNewName ) );
 }
 
 bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUString & rName  )
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
index e9db2ce..814a17d 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
@@ -89,7 +89,7 @@ private:
         drviews2.cxx.
     */
     void RenameSlide();
-    DECL_LINK(RenameSlideHdl, AbstractSvxNameDialog*);
+    DECL_LINK_TYPED(RenameSlideHdl, AbstractSvxNameDialog&, bool);
     bool RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUString& rName);
 
     /** Handle SID_INSERTPAGE slot calls.
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index cdad442..7694df7 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -138,17 +138,14 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName  )
     return bSuccess;
 }
 
-IMPL_LINK( DrawViewShell, RenameSlideHdl, AbstractSvxNameDialog*, pDialog )
+IMPL_LINK_TYPED( DrawViewShell, RenameSlideHdl, AbstractSvxNameDialog&, rDialog, bool )
 {
-    if( ! pDialog )
-        return 0;
-
     OUString aNewName;
-    pDialog->GetName( aNewName );
+    rDialog.GetName( aNewName );
 
     SdPage* pCurrentPage = GetDoc()->GetSdPage( maTabControl->GetCurPageId() - 1, GetPageKind() );
 
-    return long(pCurrentPage && ( aNewName == pCurrentPage->GetName() || GetDocSh()->IsNewPageNameValid( aNewName ) ));
+    return pCurrentPage && ( aNewName == pCurrentPage->GetName() || GetDocSh()->IsNewPageNameValid( aNewName ) );
 }
 
 void DrawViewShell::ModifyLayer (


More information about the Libreoffice-commits mailing list