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

Noel Grandin noelgrandin at gmail.com
Tue Sep 22 11:59:43 PDT 2015


 sc/source/ui/dbgui/csvtablebox.cxx  |    4 ++--
 sc/source/ui/dbgui/scuiasciiopt.cxx |   12 +++---------
 sc/source/ui/inc/csvtablebox.hxx    |    8 ++++----
 sc/source/ui/inc/scuiasciiopt.hxx   |    4 ++--
 4 files changed, 11 insertions(+), 17 deletions(-)

New commits:
commit f6f4a57b1efb9cfcaa9fbec14744f897cba932e1
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Tue Sep 22 17:11:06 2015 +0200

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

diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 3270504..52dd3eb 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -290,13 +290,13 @@ IMPL_LINK_TYPED( ScCsvTableBox, CsvCmdHdl, ScCsvControl&, rCtrl, void )
             }
         break;
         case CSVCMD_UPDATECELLTEXTS:
-            maUpdateTextHdl.Call( this );
+            maUpdateTextHdl.Call( *this );
         break;
         case CSVCMD_SETCOLUMNTYPE:
             maGrid->SetSelColumnType( nParam1 );
         break;
         case CSVCMD_EXPORTCOLUMNTYPE:
-            maColTypeHdl.Call( this );
+            maColTypeHdl.Call( *this );
         break;
         case CSVCMD_SETFIRSTIMPORTLINE:
             maGrid->SetFirstImportedLine( nParam1 );
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index b45b5d4..0dffe03 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -739,7 +739,7 @@ IMPL_LINK( ScImportAsciiDlg, LbColTypeHdl, ListBox*, pListBox )
     return 0;
 }
 
-IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl)
+IMPL_LINK_NOARG_TYPED(ScImportAsciiDlg, UpdateTextHdl, ScCsvTableBox&, void)
 {
     sal_Int32 nBaseLine = mpTableBox->GetFirstVisLine();
     sal_Int32 nRead = mpTableBox->GetVisLineCount();
@@ -762,15 +762,11 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl)
     mpTableBox->Execute( CSVCMD_SETLINECOUNT, mnRowPosCount);
     bool bMergeSep = pCkbAsOnce->IsChecked();
     mpTableBox->SetUniStrings( maPreviewLine, maFieldSeparators, mcTextSep, bMergeSep);
-
-    return 0;
 }
 
-IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox*, pTableBox )
+IMPL_LINK_TYPED( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox&, rTableBox, void )
 {
-    OSL_ENSURE( pTableBox, "ScImportAsciiDlg::ColTypeHdl - missing sender" );
-
-    sal_Int32 nType = pTableBox->GetSelColumnType();
+    sal_Int32 nType = rTableBox.GetSelColumnType();
     sal_Int32 nTypeCount = pLbType->GetEntryCount();
     bool bEmpty = (nType == CSV_TYPE_MULTI);
     bool bEnable = ((0 <= nType) && (nType < nTypeCount)) || bEmpty;
@@ -785,8 +781,6 @@ IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox*, pTableBox )
     else if( bEnable )
         pLbType->SelectEntryPos( static_cast< sal_uInt16 >( nType ) );
     pLbType->SetSelectHdl( aSelHdl );
-
-    return 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index 23f20ab..2703ebf 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -51,8 +51,8 @@ private:
     VclPtr<ScrollBar>           maVScroll;          /// Vertical scroll bar.
     VclPtr<ScrollBarBox>        maScrollBox;        /// For the bottom right edge.
 
-    Link<>                      maUpdateTextHdl;    /// Updates all cell texts.
-    Link<>                      maColTypeHdl;       /// Handler for exporting the column type.
+    Link<ScCsvTableBox&,void>   maUpdateTextHdl;    /// Updates all cell texts.
+    Link<ScCsvTableBox&,void>   maColTypeHdl;       /// Handler for exporting the column type.
 
     ScCsvColStateVec            maFixColStates;     /// Column states in fixed width mode.
     ScCsvColStateVec            maSepColStates;     /// Column states in separators mode.
@@ -113,9 +113,9 @@ public:
     // event handling ---------------------------------------------------------
 public:
     /** Sets a new handler for "update cell texts" requests. */
-    inline void                 SetUpdateTextHdl( const Link<>& rHdl ) { maUpdateTextHdl = rHdl; }
+    inline void                 SetUpdateTextHdl( const Link<ScCsvTableBox&,void>& rHdl ) { maUpdateTextHdl = rHdl; }
     /** Sets a new handler for "column selection changed" events. */
-    inline void                 SetColTypeHdl( const Link<>& rHdl ) { maColTypeHdl = rHdl; }
+    inline void                 SetColTypeHdl( const Link<ScCsvTableBox&,void>& rHdl ) { maColTypeHdl = rHdl; }
 
 protected:
     virtual void                Resize() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index e86785f..e43a1fb 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -106,8 +106,8 @@ private:
                                 DECL_LINK( SeparatorHdl, Control* );
                                 DECL_LINK_TYPED( SeparatorClickHdl, Button*, void );
                                 DECL_LINK( LbColTypeHdl, ListBox* );
-                                DECL_LINK(UpdateTextHdl, void *);
-                                DECL_LINK( ColTypeHdl, ScCsvTableBox* );
+                                DECL_LINK_TYPED( UpdateTextHdl, ScCsvTableBox&, void );
+                                DECL_LINK_TYPED( ColTypeHdl, ScCsvTableBox&, void );
 };
 
 inline bool ScImportAsciiDlg::Seek(sal_uLong nPos)


More information about the Libreoffice-commits mailing list