summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej@ahunt.org>2015-10-21 14:24:44 +0200
committerAndrzej Hunt <andrzej@ahunt.org>2015-10-21 14:24:44 +0200
commit0d7d7f22337c56623da15ad3003bceae2c1a063c (patch)
tree58290662ddcb45ec29944d41eea2dcdb57a6736b
parentf54a180271349de75b6c3e5dc80a58e91b5b289b (diff)
unit-verification: more convert Link<> to typed
Change-Id: I8f330dbfb3b5a0a7409475a5a8802c3640e6bb31
-rw-r--r--sc/source/ui/inc/unitsconversiondlg.hxx10
-rw-r--r--sc/source/ui/miscdlgs/unitsconversiondlg.cxx26
2 files changed, 14 insertions, 22 deletions
diff --git a/sc/source/ui/inc/unitsconversiondlg.hxx b/sc/source/ui/inc/unitsconversiondlg.hxx
index cda8f83e6124..d5a1f3cfb43d 100644
--- a/sc/source/ui/inc/unitsconversiondlg.hxx
+++ b/sc/source/ui/inc/unitsconversiondlg.hxx
@@ -85,11 +85,11 @@ private:
void PerformConversion();
DECL_LINK_TYPED( OkClicked, Button*, void );
- DECL_LINK( GetFocusHandler, Control* );
- DECL_LINK( LoseFocusHandler, void* );
- DECL_LINK( OutputUnitsModified, void* );
- DECL_LINK( OutputUnitsGetFocusHandler, void* );
- DECL_LINK( OutputUnitsLoseFocusHandler, void* );
+ DECL_LINK_TYPED( GetFocusHandler, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHandler, Control&, void );
+ DECL_LINK_TYPED( OutputUnitsModified, Edit&, void );
+ DECL_LINK_TYPED( OutputUnitsGetFocusHandler, Control&, void );
+ DECL_LINK_TYPED( OutputUnitsLoseFocusHandler, Control&, void );
};
#endif // INCLUDED_SC_SOURCE_UI_INC_UNITSCONVERSIONDLG_HXX
diff --git a/sc/source/ui/miscdlgs/unitsconversiondlg.cxx b/sc/source/ui/miscdlgs/unitsconversiondlg.cxx
index cea5405422b5..0e6e922046e8 100644
--- a/sc/source/ui/miscdlgs/unitsconversiondlg.cxx
+++ b/sc/source/ui/miscdlgs/unitsconversiondlg.cxx
@@ -75,7 +75,7 @@ void ScUnitsConversionDialog::dispose()
void ScUnitsConversionDialog::Init()
{
- Link<> aLink = LINK( this, ScUnitsConversionDialog, GetFocusHandler );
+ Link<Control&, void> aLink = LINK( this, ScUnitsConversionDialog, GetFocusHandler );
mpInputRangeEdit->SetGetFocusHdl( aLink );
mpInputRangeButton->SetGetFocusHdl( aLink );
@@ -206,38 +206,34 @@ IMPL_LINK_TYPED( ScUnitsConversionDialog, OkClicked, Button*, /*pButton*/, void
Close();
}
-IMPL_LINK( ScUnitsConversionDialog, GetFocusHandler, Control*, pCtrl )
+IMPL_LINK_TYPED( ScUnitsConversionDialog, GetFocusHandler, Control&, rCtrl, void )
{
Edit* pEdit = NULL;
- if( (pCtrl == mpInputRangeEdit.get()) || (pCtrl == mpInputRangeButton.get()) ) {
+ if ( ( &rCtrl == static_cast<Control*>( mpInputRangeEdit ) ) ||
+ ( &rCtrl == static_cast<Control*>( mpInputRangeButton ) ) ) {
pEdit = mpInputRangeEdit;
}
- if( pEdit ) {
+ if ( pEdit ) {
pEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
}
-
- return 0;
}
-IMPL_LINK_NOARG( ScUnitsConversionDialog, LoseFocusHandler )
+IMPL_LINK_NOARG_TYPED( ScUnitsConversionDialog, LoseFocusHandler, Control&, void )
{
mbDialogLostFocus = !IsActive();
- return 0;
}
-IMPL_LINK_NOARG( ScUnitsConversionDialog, OutputUnitsGetFocusHandler )
+IMPL_LINK_NOARG_TYPED( ScUnitsConversionDialog, OutputUnitsGetFocusHandler, Control&, void )
{
// The warning box may have been enabled because of an incompatible unit,
// however we should disable it during editing (it will then be reenabled
// if needed once the user completes editing their desired output unit).
mpIncompatibleOutputBox->Show( false );
-
- return 0;
}
-IMPL_LINK_NOARG( ScUnitsConversionDialog, OutputUnitsModified )
+IMPL_LINK_NOARG_TYPED( ScUnitsConversionDialog, OutputUnitsModified, Edit&, void )
{
OUString sOutputUnit = mpOutputUnitsEdit->GetText();
@@ -251,15 +247,11 @@ IMPL_LINK_NOARG( ScUnitsConversionDialog, OutputUnitsModified )
mpOutputUnitsEdit->SetControlForeground( Color( COL_BLACK ) );
mpOutputUnitsEdit->set_font_attribute( "underline", "false" );
}
-
- return 0;
}
-IMPL_LINK_NOARG( ScUnitsConversionDialog, OutputUnitsLoseFocusHandler )
+IMPL_LINK_NOARG_TYPED( ScUnitsConversionDialog, OutputUnitsLoseFocusHandler, Control&, void )
{
mpIncompatibleOutputBox->Show( !CheckUnitsAreConvertible() );
-
- return 0;
}
void ScUnitsConversionDialog::PerformConversion()