[Libreoffice-commits] core.git: sc/source
Noel Grandin
noelgrandin at gmail.com
Tue Sep 22 11:59:19 PDT 2015
sc/source/ui/dbgui/csvcontrol.cxx | 2 +-
sc/source/ui/dbgui/csvtablebox.cxx | 12 ++++--------
sc/source/ui/inc/csvcontrol.hxx | 4 ++--
sc/source/ui/inc/csvtablebox.hxx | 2 +-
4 files changed, 8 insertions(+), 12 deletions(-)
New commits:
commit 3563fd5b12d5d16d8625cd911ed8562e34a73b1a
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Tue Sep 22 16:58:19 2015 +0200
convert Link<> to typed
Change-Id: Ie63553874b4f353eb5551f212a4d0f78ec9603b9
Reviewed-on: https://gerrit.libreoffice.org/18780
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx
index 583b510..e604504 100644
--- a/sc/source/ui/dbgui/csvcontrol.cxx
+++ b/sc/source/ui/dbgui/csvcontrol.cxx
@@ -167,7 +167,7 @@ void ScCsvControl::EnableRepaint( bool bInvalidate )
void ScCsvControl::Execute( ScCsvCmdType eType, sal_Int32 nParam1, sal_Int32 nParam2 )
{
maCmd.Set( eType, nParam1, nParam2 );
- maCmdHdl.Call( this );
+ maCmdHdl.Call( *this );
}
// layout helpers -------------------------------------------------------------
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 27d027d..3270504 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -39,7 +39,7 @@ ScCsvTableBox::ScCsvTableBox( vcl::Window* pParent, WinBits nBits ) :
maHScroll->SetLineSize( 1 );
maVScroll->SetLineSize( 1 );
- Link<> aLink = LINK( this, ScCsvTableBox, CsvCmdHdl );
+ Link<ScCsvControl&,void> aLink = LINK( this, ScCsvTableBox, CsvCmdHdl );
SetCmdHdl( aLink );
maRuler->SetCmdHdl( aLink );
maGrid->SetCmdHdl( aLink );
@@ -251,11 +251,9 @@ void ScCsvTableBox::DataChanged( const DataChangedEvent& rDCEvt )
ScCsvControl::DataChanged( rDCEvt );
}
-IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
+IMPL_LINK_TYPED( ScCsvTableBox, CsvCmdHdl, ScCsvControl&, rCtrl, void )
{
- OSL_ENSURE( pCtrl, "ScCsvTableBox::CsvCmdHdl - missing sender" );
-
- const ScCsvCmd& rCmd = pCtrl->GetCmd();
+ const ScCsvCmd& rCmd = rCtrl.GetCmd();
ScCsvCmdType eType = rCmd.GetType();
sal_Int32 nParam1 = rCmd.GetParam1();
sal_Int32 nParam2 = rCmd.GetParam2();
@@ -334,7 +332,7 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
bFound = false;
}
if( bFound )
- return 0;
+ return;
const ScCsvLayoutData aOldData( maData );
switch( eType )
@@ -388,8 +386,6 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
maGrid->ApplyLayout( aOldData );
EnableRepaint();
}
-
- return 0;
}
IMPL_LINK_TYPED( ScCsvTableBox, ScrollHdl, ScrollBar*, pScrollBar, void )
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index 82cad60..46866da 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -229,7 +229,7 @@ protected:
::css::accessibility::XAccessible > XAccessibleRef;
private:
- Link<> maCmdHdl; /// External command handler.
+ Link<ScCsvControl&,void> maCmdHdl; /// External command handler.
ScCsvCmd maCmd; /// Data of last command.
const ScCsvLayoutData& mrData; /// Shared layout data.
@@ -285,7 +285,7 @@ public:
// command handling -------------------------------------------------------
/** Sets a new command handler. */
- inline void SetCmdHdl( const Link<>& rHdl ) { maCmdHdl = rHdl; }
+ inline void SetCmdHdl( const Link<ScCsvControl&,void>& rHdl ) { maCmdHdl = rHdl; }
/** Returns data of the last command. */
inline const ScCsvCmd& GetCmd() const { return maCmd; }
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index ff30afe..23f20ab 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -123,7 +123,7 @@ protected:
virtual Size GetOptimalSize() const SAL_OVERRIDE;
private:
- DECL_DLLPRIVATE_LINK( CsvCmdHdl, ScCsvControl* );
+ DECL_DLLPRIVATE_LINK_TYPED( CsvCmdHdl, ScCsvControl&, void );
DECL_DLLPRIVATE_LINK_TYPED( ScrollHdl, ScrollBar*, void );
DECL_DLLPRIVATE_LINK_TYPED( ScrollEndHdl, ScrollBar*, void );
More information about the Libreoffice-commits
mailing list