summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-09-24 13:53:17 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-09-24 16:19:37 +0000
commite85b2333bce7b1dcae73861df6d90b48b9f4efe5 (patch)
tree21d066cecfbfda9ace96b26953ddcc3ae1764001
parentff6462e6307e6924dc6c8178043ae9032f4b4152 (diff)
convert Link<> to typed
Change-Id: I59d325c3b051690303a5841907317122fa1ec98b Reviewed-on: https://gerrit.libreoffice.org/18825 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--basctl/source/basicide/bastype3.hxx4
-rw-r--r--basctl/source/basicide/bastypes.cxx6
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx31
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx2
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx3
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx4
-rw-r--r--cui/source/dialogs/hldoctp.cxx4
-rw-r--r--cui/source/dialogs/hlinettp.cxx3
-rw-r--r--cui/source/dialogs/hyphen.cxx3
-rw-r--r--cui/source/inc/chardlg.hxx2
-rw-r--r--cui/source/inc/cuifmsearch.hxx2
-rw-r--r--cui/source/inc/grfpage.hxx2
-rw-r--r--cui/source/inc/hldoctp.hxx4
-rw-r--r--cui/source/inc/hlinettp.hxx10
-rw-r--r--cui/source/inc/hyphen.hxx2
-rw-r--r--cui/source/inc/numfmt.hxx2
-rw-r--r--cui/source/inc/numpages.hxx1
-rw-r--r--cui/source/inc/page.hxx12
-rw-r--r--cui/source/inc/paragrph.hxx2
-rw-r--r--cui/source/inc/swpossizetabpage.hxx2
-rw-r--r--cui/source/inc/tabstpge.hxx4
-rw-r--r--cui/source/options/optcolor.cxx19
-rw-r--r--cui/source/options/optgdlg.cxx6
-rw-r--r--cui/source/options/optgdlg.hxx1
-rw-r--r--cui/source/options/optinet2.cxx6
-rw-r--r--cui/source/options/optinet2.hxx2
-rw-r--r--cui/source/tabpages/chardlg.cxx10
-rw-r--r--cui/source/tabpages/grfpage.cxx14
-rw-r--r--cui/source/tabpages/numfmt.cxx8
-rw-r--r--cui/source/tabpages/numpages.cxx17
-rw-r--r--cui/source/tabpages/page.cxx31
-rw-r--r--cui/source/tabpages/paragrph.cxx17
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx28
-rw-r--r--cui/source/tabpages/tabstpge.cxx14
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx40
-rw-r--r--dbaccess/source/ui/dlg/paramdialog.cxx25
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx23
-rw-r--r--dbaccess/source/ui/inc/FieldDescControl.hxx4
-rw-r--r--dbaccess/source/ui/inc/paramdialog.hxx3
-rw-r--r--dbaccess/source/ui/inc/queryfilter.hxx2
-rw-r--r--extensions/source/propctrlr/browserline.cxx3
-rw-r--r--extensions/source/propctrlr/browserline.hxx2
-rw-r--r--extensions/source/propctrlr/commoncontrol.cxx8
-rw-r--r--extensions/source/propctrlr/commoncontrol.hxx5
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx2
-rw-r--r--formula/source/ui/dlg/ControlHelper.hxx4
-rw-r--r--formula/source/ui/dlg/funcutl.cxx12
-rw-r--r--formula/source/ui/dlg/parawin.cxx2
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx3
-rw-r--r--fpicker/source/office/RemoteFilesDialog.hxx2
-rw-r--r--fpicker/source/office/iodlg.cxx5
-rw-r--r--fpicker/source/office/iodlg.hxx2
-rw-r--r--include/sfx2/dinfdlg.hxx4
-rw-r--r--include/sfx2/mgetempl.hxx4
-rw-r--r--include/svtools/addresstemplate.hxx4
-rw-r--r--include/svx/dialcontrol.hxx2
-rw-r--r--include/svx/hdft.hxx2
-rw-r--r--include/svx/imapdlg.hxx2
-rw-r--r--include/svx/srchdlg.hxx4
-rw-r--r--include/vcl/ctrl.hxx10
-rw-r--r--include/vcl/slider.hxx1
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx14
-rw-r--r--reportdesign/source/ui/inc/GroupsSorting.hxx4
-rw-r--r--sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx11
-rw-r--r--sc/source/ui/StatisticsDialogs/SamplingDialog.cxx19
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx19
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx29
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx5
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx19
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx13
-rw-r--r--sc/source/ui/dbgui/validate.cxx9
-rw-r--r--sc/source/ui/inc/PivotLayoutDialog.hxx4
-rw-r--r--sc/source/ui/inc/RandomNumberGeneratorDialog.hxx4
-rw-r--r--sc/source/ui/inc/SamplingDialog.hxx4
-rw-r--r--sc/source/ui/inc/StatisticsInputOutputDialog.hxx4
-rw-r--r--sc/source/ui/inc/StatisticsTwoVariableDialog.hxx4
-rw-r--r--sc/source/ui/inc/areasdlg.hxx2
-rw-r--r--sc/source/ui/inc/condformatdlg.hxx2
-rw-r--r--sc/source/ui/inc/consdlg.hxx2
-rw-r--r--sc/source/ui/inc/crnrdlg.hxx4
-rw-r--r--sc/source/ui/inc/namedefdlg.hxx2
-rw-r--r--sc/source/ui/inc/namedlg.hxx2
-rw-r--r--sc/source/ui/inc/optsolver.hxx4
-rw-r--r--sc/source/ui/inc/solvrdlg.hxx4
-rw-r--r--sc/source/ui/inc/tabopdlg.hxx4
-rw-r--r--sc/source/ui/inc/tpdefaults.hxx2
-rw-r--r--sc/source/ui/inc/tpformula.hxx2
-rw-r--r--sc/source/ui/inc/validate.hxx4
-rw-r--r--sc/source/ui/inc/xmlsourcedlg.hxx2
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx13
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx23
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx15
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx15
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx3
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx3
-rw-r--r--sc/source/ui/optdlg/tpdefaults.cxx5
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx13
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx18
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx13
-rw-r--r--sd/source/ui/dlg/tpaction.cxx8
-rw-r--r--sd/source/ui/inc/tpaction.hxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx30
-rw-r--r--sfx2/source/dialog/mgetempl.cxx14
-rw-r--r--starmath/inc/dialog.hxx2
-rw-r--r--starmath/source/dialog.cxx13
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx11
-rw-r--r--svx/source/dialog/_bmpmask.cxx7
-rw-r--r--svx/source/dialog/dialcontrol.cxx19
-rw-r--r--svx/source/dialog/hdft.cxx18
-rw-r--r--svx/source/dialog/imapdlg.cxx12
-rw-r--r--svx/source/dialog/srchdlg.cxx18
-rw-r--r--sw/source/ui/config/optpage.cxx6
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx8
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx8
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx9
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.hxx1
-rw-r--r--sw/source/ui/envelp/envfmt.cxx17
-rw-r--r--sw/source/ui/envelp/envfmt.hxx1
-rw-r--r--sw/source/ui/envelp/labfmt.cxx27
-rw-r--r--sw/source/ui/envelp/labfmt.hxx6
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx38
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx54
-rw-r--r--sw/source/ui/index/cnttab.cxx14
-rw-r--r--sw/source/ui/misc/num.cxx17
-rw-r--r--sw/source/ui/misc/outline.cxx3
-rw-r--r--sw/source/ui/misc/pgfnote.cxx7
-rw-r--r--sw/source/ui/misc/pggrid.cxx20
-rw-r--r--sw/source/ui/table/tabledlg.cxx27
-rw-r--r--sw/source/uibase/inc/frmpage.hxx3
-rw-r--r--sw/source/uibase/inc/navipi.hxx2
-rw-r--r--sw/source/uibase/inc/num.hxx1
-rw-r--r--sw/source/uibase/inc/optpage.hxx2
-rw-r--r--sw/source/uibase/inc/outline.hxx2
-rw-r--r--sw/source/uibase/inc/pgfnote.hxx2
-rw-r--r--sw/source/uibase/inc/pggrid.hxx2
-rw-r--r--sw/source/uibase/inc/prcntfld.hxx2
-rw-r--r--sw/source/uibase/inc/swuicnttab.hxx10
-rw-r--r--sw/source/uibase/inc/wrap.hxx1
-rw-r--r--sw/source/uibase/table/tablepg.hxx5
-rw-r--r--sw/source/uibase/utlui/navipi.cxx6
-rw-r--r--vcl/source/control/ctrl.cxx4
-rw-r--r--vcl/source/control/slider.cxx52
142 files changed, 640 insertions, 648 deletions
diff --git a/basctl/source/basicide/bastype3.hxx b/basctl/source/basicide/bastype3.hxx
index 3106cf767fca..5f946ca5a2c3 100644
--- a/basctl/source/basicide/bastype3.hxx
+++ b/basctl/source/basicide/bastype3.hxx
@@ -35,8 +35,8 @@ private:
protected:
DECL_LINK_TYPED( EditAccHdl, Accelerator&, void );
- DECL_LINK(ImplGetFocusHdl, void *);
- DECL_LINK(ImplLoseFocusHdl, void *);
+ DECL_LINK_TYPED( ImplGetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( ImplLoseFocusHdl, Control&, void );
public:
ExtendedEdit( vcl::Window* pParent, IDEResId nRes );
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 92f921c7e04f..4d98fdee68f9 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -437,18 +437,16 @@ ExtendedEdit::ExtendedEdit( vcl::Window* pParent, IDEResId nRes ) :
Control::SetLoseFocusHdl( LINK( this, ExtendedEdit, ImplLoseFocusHdl ) );
}
-IMPL_LINK_NOARG(ExtendedEdit, ImplGetFocusHdl)
+IMPL_LINK_NOARG_TYPED(ExtendedEdit, ImplGetFocusHdl, Control&, void)
{
Application::InsertAccel( &aAcc );
aLoseFocusHdl.Call( this );
- return 0;
}
-IMPL_LINK_NOARG(ExtendedEdit, ImplLoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(ExtendedEdit, ImplLoseFocusHdl, Control&, void)
{
Application::RemoveAccel( &aAcc );
- return 0;
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index f7eaf5ded901..d318371ab7f7 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -172,7 +172,7 @@ public:
*/
void applyChanges();
- void SetGetFocusHdl( const Link<>& rLink );
+ void SetGetFocusHdl( const Link<Control&,void>& rLink );
void SetEditChangedHdl( const Link<SeriesHeaderEdit*,void> & rLink );
@@ -340,7 +340,7 @@ IMPL_LINK_NOARG(SeriesHeader, SeriesNameEdited)
return 0;
}
-void SeriesHeader::SetGetFocusHdl( const Link<>& rLink )
+void SeriesHeader::SetGetFocusHdl( const Link<Control&,void>& rLink )
{
m_spSeriesName->SetGetFocusHdl( rLink );
}
@@ -591,7 +591,7 @@ void DataBrowser::RenewTable()
// fill series headers
clearHeaders();
const DataBrowserModel::tDataHeaderVector& aHeaders( m_apDataBrowserModel->getDataHeaders());
- Link<> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
+ Link<Control&,void> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
Link<impl::SeriesHeaderEdit*,void> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
@@ -1225,7 +1225,7 @@ void DataBrowser::RenewSeriesHeaders()
clearHeaders();
DataBrowserModel::tDataHeaderVector aHeaders( m_apDataBrowserModel->getDataHeaders());
- Link<> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
+ Link<Control&,void> aFocusLink( LINK( this, DataBrowser, SeriesHeaderGotFocus ));
Link<impl::SeriesHeaderEdit*,void> aSeriesHeaderChangedLink( LINK( this, DataBrowser, SeriesHeaderChanged ));
for( DataBrowserModel::tDataHeaderVector::const_iterator aIt( aHeaders.begin());
@@ -1305,22 +1305,19 @@ void DataBrowser::ImplAdjustHeaderControls()
}
}
-IMPL_LINK( DataBrowser, SeriesHeaderGotFocus, impl::SeriesHeaderEdit*, pEdit )
+IMPL_LINK_TYPED( DataBrowser, SeriesHeaderGotFocus, Control&, rControl, void )
{
- if( pEdit )
- {
- pEdit->SetShowWarningBox( !m_bDataValid );
+ impl::SeriesHeaderEdit* pEdit = static_cast<impl::SeriesHeaderEdit*>(&rControl);
+ pEdit->SetShowWarningBox( !m_bDataValid );
- if( !m_bDataValid )
- GoToCell( 0, 0 );
- else
- {
- MakeFieldVisible( GetCurRow(), static_cast< sal_uInt16 >( pEdit->getStartColumn()), true /* bComplete */ );
- ActivateCell();
- m_aCursorMovedHdlLink.Call( this );
- }
+ if( !m_bDataValid )
+ GoToCell( 0, 0 );
+ else
+ {
+ MakeFieldVisible( GetCurRow(), static_cast< sal_uInt16 >( pEdit->getStartColumn()), true /* bComplete */ );
+ ActivateCell();
+ m_aCursorMovedHdlLink.Call( this );
}
- return 0;
}
IMPL_LINK_TYPED( DataBrowser, SeriesHeaderChanged, impl::SeriesHeaderEdit*, pEdit, void )
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index ad0081612fbd..a04101b0595a 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -180,7 +180,7 @@ private:
OUString GetColString( sal_Int32 nColumnId ) const;
static OUString GetRowString( sal_Int32 nRow );
- DECL_LINK( SeriesHeaderGotFocus, impl::SeriesHeaderEdit* );
+ DECL_LINK_TYPED( SeriesHeaderGotFocus, Control&, void );
DECL_LINK_TYPED( SeriesHeaderChanged, impl::SeriesHeaderEdit*, void );
DataBrowser( const DataBrowser & ) SAL_DELETED_FUNCTION;
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 8b3803186db0..b0d80cf2ba40 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -404,10 +404,9 @@ IMPL_LINK_NOARG(FmSearchDialog, OnSearchTextModified)
return 0;
}
-IMPL_LINK(FmSearchDialog, OnFocusGrabbed, ComboBox*,)
+IMPL_LINK_NOARG_TYPED(FmSearchDialog, OnFocusGrabbed, Control&, void)
{
m_pcmbSearchText->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
- return 0;
}
IMPL_LINK(FmSearchDialog, OnPositionSelected, ListBox*, pBox)
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 36570b951304..0ef8e1fd24eb 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1380,9 +1380,9 @@ namespace svx
void SuggestionEdit::DoJump( bool _bUp )
{
- const Link<>& rLoseFocusHdl = GetLoseFocusHdl();
+ const Link<Control&,void>& rLoseFocusHdl = GetLoseFocusHdl();
if( rLoseFocusHdl.IsSet() )
- rLoseFocusHdl.Call( this );
+ rLoseFocusHdl.Call( *this );
m_pScrollBar->SetThumbPos( m_pScrollBar->GetThumbPos() + ( _bUp? -1 : 1 ) );
( static_cast< HangulHanjaEditDictDialog* >( GetParentDialog() ) )->UpdateScrollbar();
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 764d5f382602..f7c27b39e36b 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -315,13 +315,11 @@ IMPL_LINK_NOARG(SvxHyperlinkDocTp, ModifiedTargetHdl_Impl)
|*
|************************************************************************/
-IMPL_LINK_NOARG(SvxHyperlinkDocTp, LostFocusPathHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvxHyperlinkDocTp, LostFocusPathHdl_Impl, Control&, void)
{
maStrURL = GetCurrentURL();
m_pFtFullURL->SetText( maStrURL );
-
- return 0L;
}
/*************************************************************************
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index c58df74f8278..3f8a73256211 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -383,10 +383,9 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, ClickAnonymousHdl_Impl, Button*, v
|*
|************************************************************************/
-IMPL_LINK_NOARG(SvxHyperlinkInternetTp, LostFocusTargetHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, LostFocusTargetHdl_Impl, Control&, void)
{
RefreshMarkWindow();
- return 0L;
}
/*************************************************************************
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 9b7dd37e194c..5d00a0803242 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -428,10 +428,9 @@ IMPL_LINK_NOARG_TYPED(SvxHyphenWordDialog, Right_Impl, Button*, void)
}
-IMPL_LINK_NOARG(SvxHyphenWordDialog, GetFocusHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvxHyphenWordDialog, GetFocusHdl_Impl, Control&, void)
{
m_pWordEdit->SetSelection( Selection( m_nOldPos, m_nOldPos + 1 ) );
- return 0;
}
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 4d5506ec54b6..f750d0eda0b9 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -299,7 +299,7 @@ private:
DECL_LINK_TYPED( FitToLineHdl_Impl, Button*, void );
DECL_LINK( KerningSelectHdl_Impl, void *);
DECL_LINK( KerningModifyHdl_Impl, void *);
- DECL_LINK( LoseFocusHdl_Impl, MetricField* );
+ DECL_LINK_TYPED( LoseFocusHdl_Impl, Control&, void );
DECL_LINK( ScaleWidthModifyHdl_Impl, void *);
public:
diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx
index 42a9fab92c1c..c41ea5c886e3 100644
--- a/cui/source/inc/cuifmsearch.hxx
+++ b/cui/source/inc/cuifmsearch.hxx
@@ -166,7 +166,7 @@ private:
DECL_LINK( OnPositionSelected, ListBox* );
DECL_LINK( OnFieldSelected, ListBox* );
- DECL_LINK( OnFocusGrabbed, ComboBox* );
+ DECL_LINK_TYPED( OnFocusGrabbed, Control&, void );
DECL_LINK_TYPED( OnCheckBoxToggled, CheckBox&, void );
DECL_LINK( OnContextSelection, ListBox* );
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index f756d374a97c..6449dfa7d7e1 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -98,7 +98,7 @@ class SvxGrfCropPage : public SfxTabPage
DECL_LINK( ZoomHdl, MetricField * );
DECL_LINK( SizeHdl, MetricField * );
DECL_LINK( CropHdl, const MetricField * );
- DECL_LINK( CropLoseFocusHdl, MetricField * );
+ DECL_LINK_TYPED( CropLoseFocusHdl, Control&, void );
DECL_LINK( CropModifyHdl, MetricField * );
DECL_LINK_TYPED(OrigSizeHdl, Button*, void);
DECL_LINK_TYPED(Timeout, Timer *, void);
diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx
index e65dbaed1748..6a301b62d2d0 100644
--- a/cui/source/inc/hldoctp.hxx
+++ b/cui/source/inc/hldoctp.hxx
@@ -47,9 +47,9 @@ private:
DECL_LINK (ModifiedPathHdl_Impl , void * ); ///< Contens of combobox "Path" modified
DECL_LINK (ModifiedTargetHdl_Impl, void * ); ///< Contens of editfield "Target" modified
- DECL_LINK (LostFocusPathHdl_Impl, void * ); ///< Combobox "path" lost its focus
+ DECL_LINK_TYPED( LostFocusPathHdl_Impl, Control&, void ); ///< Combobox "path" lost its focus
- DECL_LINK_TYPED(TimeoutHdl_Impl, Timer *, void); ///< Handler for timer -timeout
+ DECL_LINK_TYPED( TimeoutHdl_Impl, Timer *, void ); ///< Handler for timer -timeout
enum EPathType { Type_Unknown, Type_Invalid,
Type_ExistsFile, Type_File,
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index 60216f581e9a..e1febf0d4e9f 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -47,14 +47,14 @@ private:
bool mbMarkWndOpen;
- DECL_LINK_TYPED (Click_SmartProtocol_Impl , Button*, void ); ///< Radiobutton clicked: Type HTTP or FTP
- DECL_LINK_TYPED (ClickAnonymousHdl_Impl , Button*, void ); ///< Checkbox : Anonymous User
- DECL_LINK_TYPED (ClickBrowseHdl_Impl , Button*, void ); ///< Button : Browse
+ DECL_LINK_TYPED( Click_SmartProtocol_Impl , Button*, void ); ///< Radiobutton clicked: Type HTTP or FTP
+ DECL_LINK_TYPED( ClickAnonymousHdl_Impl , Button*, void ); ///< Checkbox : Anonymous User
+ DECL_LINK_TYPED( ClickBrowseHdl_Impl , Button*, void ); ///< Button : Browse
DECL_LINK (ModifiedLoginHdl_Impl , void * ); ///< Contens of editfield "Login" modified
- DECL_LINK (LostFocusTargetHdl_Impl , void * ); ///< Combobox "Target" lost its focus
+ DECL_LINK_TYPED( LostFocusTargetHdl_Impl, Control&, void ); ///< Combobox "Target" lost its focus
DECL_LINK (ModifiedTargetHdl_Impl , void * ); ///< Contens of editfield "Target" modified
- DECL_LINK_TYPED(TimeoutHdl_Impl, Timer *, void); ///< Handler for timer -timeout
+ DECL_LINK_TYPED( TimeoutHdl_Impl, Timer *, void); ///< Handler for timer -timeout
void SetScheme(const OUString& rScheme);
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 29cc98576e8f..b515ca74f9c7 100644
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
@@ -77,7 +77,7 @@ class SvxHyphenWordDialog : public SfxModalDialog
DECL_LINK_TYPED(DeleteHdl_Impl, Button*, void);
DECL_LINK_TYPED( HyphenateAllHdl_Impl, Button*, void );
DECL_LINK_TYPED(CancelHdl_Impl, Button*, void);
- DECL_LINK(GetFocusHdl_Impl, void *);
+ DECL_LINK_TYPED(GetFocusHdl_Impl, Control&, void);
public:
SvxHyphenWordDialog( const OUString &rWord, LanguageType nLang,
diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx
index 3ce1a6765bd2..f004a7633a66 100644
--- a/cui/source/inc/numfmt.hxx
+++ b/cui/source/inc/numfmt.hxx
@@ -151,7 +151,7 @@ private:
void AddAutomaticLanguage_Impl(LanguageType eAutoLang, bool bSelect);
bool Click_Impl(PushButton* pIB);
// Handler
- DECL_LINK( LostFocusHdl_Impl, Edit* );
+ DECL_LINK_TYPED( LostFocusHdl_Impl, Control&, void );
DECL_LINK_TYPED( DoubleClickHdl_Impl, SvTreeListBox*, bool );
DECL_LINK( SelFormatHdl_Impl, void * );
DECL_LINK_TYPED( SelFormatListBoxHdl_Impl, SvTreeListBox*, void );
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index 790915fc703e..5b96a904a21e 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -429,6 +429,7 @@ class SvxNumPositionTabPage : public SfxTabPage
DECL_LINK( LevelHdl_Impl, ListBox * );
DECL_LINK( EditModifyHdl_Impl, void *);
DECL_LINK( DistanceHdl_Impl, MetricField * );
+ DECL_LINK_TYPED( DistanceFocusHdl_Impl, Control&, void );
DECL_LINK_TYPED( RelativeHdl_Impl, Button*, void );
DECL_LINK_TYPED( StandardHdl_Impl, Button*, void);
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index 0c39b832d57c..1d55426a4545 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -149,23 +149,23 @@ private:
bool mbEnableDrawingLayerFillStyles : 1;
void Init_Impl();
- DECL_LINK(LayoutHdl_Impl, void *);
- DECL_LINK(PaperBinHdl_Impl, void *);
+ DECL_LINK( LayoutHdl_Impl, void *);
+ DECL_LINK_TYPED( PaperBinHdl_Impl, Control&, void);
DECL_LINK_TYPED( SwapOrientation_Impl, Button*, void );
void SwapFirstValues_Impl( bool bSet );
- DECL_LINK(BorderModify_Impl, void *);
+ DECL_LINK( BorderModify_Impl, void *);
void InitHeadFoot_Impl( const SfxItemSet& rSet );
- DECL_LINK_TYPED(CenterHdl_Impl, Button*, void);
+ DECL_LINK_TYPED( CenterHdl_Impl, Button*, void);
void UpdateExample_Impl( bool bResetbackground = false );
DECL_LINK( PaperSizeSelect_Impl, ListBox* );
- DECL_LINK(PaperSizeModify_Impl, void *);
+ DECL_LINK( PaperSizeModify_Impl, void *);
DECL_LINK( FrameDirectionModify_Impl, ListBox* );
void ResetBackground_Impl( const SfxItemSet& rSet );
- DECL_LINK(RangeHdl_Impl, void *);
+ DECL_LINK_TYPED( RangeHdl_Impl, Control&, void );
void CalcMargin_Impl();
DECL_LINK_TYPED( RegisterModify, Button*, void );
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index 12e23f4dce93..fdb840c71334 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -102,7 +102,7 @@ public:
virtual ~SvxStdParagraphTabPage();
virtual void dispose() SAL_OVERRIDE;
- DECL_LINK(ELRLoseFocusHdl, void *);
+ DECL_LINK_TYPED(ELRLoseFocusHdl, Control&, void);
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pStdRanges; }
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index 5c4245f8c0c0..10f63451d0e2 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -98,7 +98,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage
- DECL_LINK(RangeModifyHdl, void *);
+ DECL_LINK_TYPED(RangeModifyHdl, Control&, void);
DECL_LINK_TYPED(RangeModifyClickHdl, Button*, void);
DECL_LINK_TYPED(AnchorTypeHdl, Button*, void);
DECL_LINK( PosHdl, ListBox * );
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx
index c415eab9aaa6..455caa2777ef 100644
--- a/cui/source/inc/tabstpge.hxx
+++ b/cui/source/inc/tabstpge.hxx
@@ -116,8 +116,8 @@ private:
DECL_LINK(SelectHdl_Impl, void *);
DECL_LINK(ModifyHdl_Impl, void *);
- DECL_LINK( GetFillCharHdl_Impl, Edit* );
- DECL_LINK( GetDezCharHdl_Impl, Edit* );
+ DECL_LINK_TYPED( GetFillCharHdl_Impl, Control&, void );
+ DECL_LINK_TYPED( GetDezCharHdl_Impl, Control&, void );
virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
};
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 830b89864776..76a2ec3172f4 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -177,7 +177,7 @@ public:
virtual void dispose() SAL_OVERRIDE;
public:
- void SetLinks (Link<Button*,void> const&, Link<> const&, Link<> const&);
+ void SetLinks (Link<Button*,void> const&, Link<> const&, Link<Control&,void> const&);
unsigned GetEntryHeight () const { return vEntries[0]->GetHeight(); }
void Update (EditableColorConfig const*, EditableExtendedColorConfig const*);
void ScrollHdl(const ScrollBar&);
@@ -219,7 +219,7 @@ private:
void SetAppearance(Wallpaper const& aTextWall, ColorListBox const& aSampleList);
void SetTextColor (Color C) { m_pText->SetTextColor(C); }
public:
- void SetLinks (Link<Button*,void> const&, Link<> const&, Link<> const&);
+ void SetLinks (Link<Button*,void> const&, Link<> const&, Link<Control&,void> const&);
void Update (ColorConfigEntry, ColorConfigValue const&);
void Update (ExtendedColorConfigValue const&);
void ColorChanged (ColorConfigEntry, ColorConfigValue&);
@@ -415,7 +415,7 @@ void ColorConfigWindow_Impl::Entry::SetAppearance(
// SetLinks()
void ColorConfigWindow_Impl::Entry::SetLinks(
Link<Button*,void> const& aCheckLink, Link<> const& aColorLink,
- Link<> const& aGetFocusLink)
+ Link<Control&,void> const& aGetFocusLink)
{
m_pColorList->SetSelectHdl(aColorLink);
m_pColorList->SetGetFocusHdl(aGetFocusLink);
@@ -689,7 +689,7 @@ void ColorConfigWindow_Impl::Init(ScrollBar *pVScroll, HeaderBar *pHeaderHB)
// SetLinks()
void ColorConfigWindow_Impl::SetLinks (
- Link<Button*,void> const& aCheckLink, Link<> const& aColorLink, Link<> const& aGetFocusLink
+ Link<Button*,void> const& aCheckLink, Link<> const& aColorLink, Link<Control&,void> const& aGetFocusLink
) {
for (unsigned i = 0; i != vEntries.size(); ++i)
vEntries[i]->SetLinks(aCheckLink, aColorLink, aGetFocusLink);
@@ -847,7 +847,7 @@ class ColorConfigCtrl_Impl : public VclVBox
DECL_LINK_TYPED(ScrollHdl, ScrollBar*, void);
DECL_LINK_TYPED(ClickHdl, Button*, void);
DECL_LINK(ColorHdl, ColorListBox*);
- DECL_LINK(ControlFocusHdl, Control*);
+ DECL_LINK_TYPED(ControlFocusHdl, Control&, void);
virtual bool PreNotify (NotifyEvent& rNEvt) SAL_OVERRIDE;
virtual void Command (CommandEvent const& rCEvt) SAL_OVERRIDE;
@@ -901,7 +901,7 @@ ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(vcl::Window* pParent)
Link<Button*,void> aCheckLink = LINK(this, ColorConfigCtrl_Impl, ClickHdl);
Link<> aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl);
- Link<> aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl);
+ Link<Control&,void> aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl);
m_pScrollWindow->SetLinks(aCheckLink, aColorLink, aGetFocusLink);
m_pHeaderHB->Show();
@@ -1013,14 +1013,14 @@ IMPL_LINK(ColorConfigCtrl_Impl, ColorHdl, ColorListBox*, pBox)
m_pScrollWindow->ColorHdl(pColorConfig, pExtColorConfig, pBox);
return 0;
}
-IMPL_LINK(ColorConfigCtrl_Impl, ControlFocusHdl, Control*, pCtrl)
+IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ControlFocusHdl, Control&, rCtrl, void)
{
// determine whether a control is completely visible
// and make it visible
- long aCtrlPosY = pCtrl->GetPosPixel().Y();
+ long aCtrlPosY = rCtrl.GetPosPixel().Y();
unsigned const nWinHeight = m_pScrollWindow->GetSizePixel().Height();
unsigned const nEntryHeight = m_pScrollWindow->GetEntryHeight();
- if ((GetFocusFlags::Tab & pCtrl->GetGetFocusFlags()) &&
+ if ((GetFocusFlags::Tab & rCtrl.GetGetFocusFlags()) &&
(aCtrlPosY < 0 || nWinHeight < aCtrlPosY + nEntryHeight)
) {
long nThumbPos = m_pVScroll->GetThumbPos();
@@ -1039,7 +1039,6 @@ IMPL_LINK(ColorConfigCtrl_Impl, ControlFocusHdl, Control*, pCtrl)
m_pVScroll->SetThumbPos(nThumbPos);
ScrollHdl(m_pVScroll);
}
- return 0;
};
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 2feda57c3cbb..5c582919fb78 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -290,7 +290,7 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
Link<> aLink = LINK( this, OfaMiscTabPage, TwoFigureConfigHdl );
m_pYearValueField->SetDownHdl( aLink );
m_pYearValueField->SetUpHdl( aLink );
- m_pYearValueField->SetLoseFocusHdl( aLink );
+ m_pYearValueField->SetLoseFocusHdl( LINK( this, OfaMiscTabPage, TwoFigureConfigFocusHdl ) );
m_pYearValueField->SetFirstHdl( aLink );
TwoFigureConfigHdl(m_pYearValueField);
@@ -434,6 +434,10 @@ IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd )
return 0;
}
+IMPL_LINK_TYPED( OfaMiscTabPage, TwoFigureConfigFocusHdl, Control&, rControl, void )
+{
+ TwoFigureConfigHdl(static_cast<NumericField*>(&rControl));
+}
IMPL_LINK( OfaMiscTabPage, TwoFigureConfigHdl, NumericField*, pEd )
{
sal_Int64 nNum = m_pYearValueField->GetValue();
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index baafb9d79329..ae66faa9b637 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -60,6 +60,7 @@ private:
DECL_LINK( TwoFigureHdl, NumericField* );
DECL_LINK( TwoFigureConfigHdl, NumericField* );
+ DECL_LINK_TYPED( TwoFigureConfigFocusHdl, Control&, void );
#ifdef WNT
DECL_LINK( OnFileDlgToggled, void* );
#endif
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 4891a4550e73..5c17f39066c2 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -182,7 +182,7 @@ SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
get(m_pNoProxyForED, "noproxy");
get(m_pNoProxyDescFT, "noproxydesc");
- Link<> aLink = LINK( this, SvxProxyTabPage, LoseFocusHdl_Impl );
+ Link<Control&,void> aLink = LINK( this, SvxProxyTabPage, LoseFocusHdl_Impl );
m_pHttpPortED->SetLoseFocusHdl( aLink );
m_pHttpsPortED->SetLoseFocusHdl( aLink );
m_pFtpPortED->SetLoseFocusHdl( aLink );
@@ -541,13 +541,13 @@ IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox )
-IMPL_STATIC_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit *, pEdit )
+IMPL_STATIC_LINK_TYPED( SvxProxyTabPage, LoseFocusHdl_Impl, Control&, rControl, void )
{
+ Edit* pEdit = static_cast<Edit*>(&rControl);
OUString aValue = pEdit->GetText();
if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.toInt32() > USHRT_MAX )
pEdit->SetText( OUString('0') );
- return 0;
}
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 0c5da70c3cee..32804fb4a9d9 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -96,7 +96,7 @@ private:
void RestoreConfigDefaults_Impl();
DECL_LINK( ProxyHdl_Impl, ListBox * );
- DECL_STATIC_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit * );
+ DECL_STATIC_LINK_TYPED( SvxProxyTabPage, LoseFocusHdl_Impl, Control&, void );
public:
SvxProxyTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 3127082839dd..9048d44aa02f 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2720,9 +2720,9 @@ void SvxCharPositionPage::Initialize()
m_pHighLowMF->SetModifyHdl( aLink );
m_pFontSizeMF->SetModifyHdl( aLink );
- aLink = LINK( this, SvxCharPositionPage, LoseFocusHdl_Impl );
- m_pHighLowMF->SetLoseFocusHdl( aLink );
- m_pFontSizeMF->SetLoseFocusHdl( aLink );
+ Link<Control&,void> aLink3 = LINK( this, SvxCharPositionPage, LoseFocusHdl_Impl );
+ m_pHighLowMF->SetLoseFocusHdl( aLink3 );
+ m_pFontSizeMF->SetLoseFocusHdl( aLink3 );
m_pHighLowRB->SetClickHdl( LINK( this, SvxCharPositionPage, AutoPositionHdl_Impl ) );
m_pFitToLineCB->SetClickHdl( LINK( this, SvxCharPositionPage, FitToLineHdl_Impl ) );
@@ -2911,8 +2911,9 @@ IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl)
-IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField )
+IMPL_LINK_TYPED( SvxCharPositionPage, LoseFocusHdl_Impl, Control&, rControl, void )
{
+ MetricField* pField = static_cast<MetricField*>(&rControl);
bool bHigh = m_pHighPosBtn->IsChecked();
bool bLow = m_pLowPosBtn->IsChecked();
DBG_ASSERT( bHigh || bLow, "normal position is not valid" );
@@ -2931,7 +2932,6 @@ IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField )
else
m_nSuperProp = (sal_uInt8)m_pFontSizeMF->GetValue();
}
- return 0;
}
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 1ef5ae44a712..9988726f86a6 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -111,11 +111,11 @@ SvxGrfCropPage::SvxGrfCropPage ( vcl::Window *pParent, const SfxItemSet &rSet )
m_pTopMF->SetModifyHdl( aLk );
m_pBottomMF->SetModifyHdl( aLk );
- aLk = LINK(this, SvxGrfCropPage, CropLoseFocusHdl);
- m_pLeftMF->SetLoseFocusHdl( aLk );
- m_pRightMF->SetLoseFocusHdl( aLk );
- m_pTopMF->SetLoseFocusHdl( aLk );
- m_pBottomMF->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk2 = LINK(this, SvxGrfCropPage, CropLoseFocusHdl);
+ m_pLeftMF->SetLoseFocusHdl( aLk2 );
+ m_pRightMF->SetLoseFocusHdl( aLk2 );
+ m_pTopMF->SetLoseFocusHdl( aLk2 );
+ m_pBottomMF->SetLoseFocusHdl( aLk2 );
m_pOrigSizePB->SetClickHdl( LINK(this, SvxGrfCropPage, OrigSizeHdl) );
@@ -740,12 +740,12 @@ IMPL_LINK_NOARG_TYPED(SvxGrfCropPage, Timeout, Timer *, void)
}
-IMPL_LINK( SvxGrfCropPage, CropLoseFocusHdl, MetricField*, pField )
+IMPL_LINK_TYPED( SvxGrfCropPage, CropLoseFocusHdl, Control&, rControl, void )
{
+ MetricField* pField = static_cast<MetricField*>(&rControl);
aTimer.Stop();
CropHdl(pField);
pLastCropField = 0;
- return 0;
}
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 2c2a725db5d9..e8b45bbb1a6f 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -356,9 +356,9 @@ void SvxNumberFormatTabPage::Init_Impl()
m_pIbInfo->SetClickHdl( HDL( ClickHdl_Impl ) );
UpdateThousandEngineeringText();
- aLink = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl);
+ Link<Control&,void> aLink2 = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl);
- m_pEdComment->SetLoseFocusHdl( aLink);
+ m_pEdComment->SetLoseFocusHdl( aLink2);
aResetWinTimer.SetTimeoutHdl(LINK( this, SvxNumberFormatTabPage, TimeHdl_Impl));
aResetWinTimer.SetTimeout( 10);
@@ -1636,8 +1636,9 @@ IMPL_LINK_NOARG_TYPED(SvxNumberFormatTabPage, TimeHdl_Impl, Timer *, void)
#*
#************************************************************************/
-IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Edit *, pEd)
+IMPL_LINK_TYPED( SvxNumberFormatTabPage, LostFocusHdl_Impl, Control&, rControl, void)
{
+ Edit* pEd = static_cast<Edit*>(&rControl);
if (pEd == m_pEdComment)
{
aResetWinTimer.Start();
@@ -1652,7 +1653,6 @@ IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Edit *, pEd)
m_pEdComment->SetText(m_pLbCategory->GetEntry(1)); // String for user defined
}
}
- return 0;
}
/*************************************************************************
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index fc8e3fd07380..3877183e4921 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2792,18 +2792,19 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(vcl::Window* pParent,
m_pAlign2LB->SetDropDownLineCount( m_pAlign2LB->GetEntryCount() );
Link<> aLk = LINK(this, SvxNumPositionTabPage, DistanceHdl_Impl);
+ Link<Control&,void> aLk2 = LINK(this, SvxNumPositionTabPage, DistanceFocusHdl_Impl);
m_pDistBorderMF->SetUpHdl(aLk);
m_pDistBorderMF->SetDownHdl(aLk);
- m_pDistBorderMF->SetLoseFocusHdl(aLk);
+ m_pDistBorderMF->SetLoseFocusHdl(aLk2);
m_pDistNumMF->SetUpHdl(aLk);
m_pDistNumMF->SetDownHdl(aLk);
- m_pDistNumMF->SetLoseFocusHdl(aLk);
+ m_pDistNumMF->SetLoseFocusHdl(aLk2);
m_pIndentMF->SetUpHdl(aLk);
m_pIndentMF->SetDownHdl(aLk);
- m_pIndentMF->SetLoseFocusHdl(aLk);
+ m_pIndentMF->SetLoseFocusHdl(aLk2);
m_pLabelFollowedByLB->SetDropDownLineCount( m_pLabelFollowedByLB->GetEntryCount() );
m_pLabelFollowedByLB->SetSelectHdl( LINK(this, SvxNumPositionTabPage, LabelFollowedByHdl_Impl) );
@@ -2811,17 +2812,17 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(vcl::Window* pParent,
aLk = LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl);
m_pListtabMF->SetUpHdl(aLk);
m_pListtabMF->SetDownHdl(aLk);
- m_pListtabMF->SetLoseFocusHdl(aLk);
+ m_pListtabMF->SetLoseFocusHdl(aLk2);
aLk = LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl);
m_pAlignedAtMF->SetUpHdl(aLk);
m_pAlignedAtMF->SetDownHdl(aLk);
- m_pAlignedAtMF->SetLoseFocusHdl(aLk);
+ m_pAlignedAtMF->SetLoseFocusHdl(aLk2);
aLk = LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl);
m_pIndentAtMF->SetUpHdl(aLk);
m_pIndentAtMF->SetDownHdl(aLk);
- m_pIndentAtMF->SetLoseFocusHdl(aLk);
+ m_pIndentAtMF->SetLoseFocusHdl(aLk2);
m_pLevelLB->EnableMultiSelection(true);
m_pLevelLB->SetSelectHdl(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl));
@@ -3388,6 +3389,10 @@ IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox )
return 0;
}
+IMPL_LINK_TYPED( SvxNumPositionTabPage, DistanceFocusHdl_Impl, Control&, rControl, void )
+{
+ DistanceHdl_Impl(static_cast<MetricField*>(&rControl));
+}
IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, MetricField *, pFld )
{
if(bInInintControl)
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 0fcf338a9d42..fc90d1fa01d7 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -428,13 +428,13 @@ void SvxPageDescPage::Init_Impl()
m_pTopMarginEdit->SetModifyHdl( aLink );
m_pBottomMarginEdit->SetModifyHdl( aLink );
- aLink = LINK( this, SvxPageDescPage, RangeHdl_Impl );
- m_pPaperWidthEdit->SetLoseFocusHdl( aLink );
- m_pPaperHeightEdit->SetLoseFocusHdl( aLink );
- m_pLeftMarginEdit->SetLoseFocusHdl( aLink );
- m_pRightMarginEdit->SetLoseFocusHdl( aLink );
- m_pTopMarginEdit->SetLoseFocusHdl( aLink );
- m_pBottomMarginEdit->SetLoseFocusHdl( aLink );
+ Link<Control&,void> aLink2 = LINK( this, SvxPageDescPage, RangeHdl_Impl );
+ m_pPaperWidthEdit->SetLoseFocusHdl( aLink2 );
+ m_pPaperHeightEdit->SetLoseFocusHdl( aLink2 );
+ m_pLeftMarginEdit->SetLoseFocusHdl( aLink2 );
+ m_pRightMarginEdit->SetLoseFocusHdl( aLink2 );
+ m_pTopMarginEdit->SetLoseFocusHdl( aLink2 );
+ m_pBottomMarginEdit->SetLoseFocusHdl( aLink2 );
m_pHorzBox->SetClickHdl( LINK( this, SvxPageDescPage, CenterHdl_Impl ) );
m_pVertBox->SetClickHdl( LINK( this, SvxPageDescPage, CenterHdl_Impl ) );
@@ -637,7 +637,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
// display background and border in the example
ResetBackground_Impl( *rSet );
//! UpdateExample_Impl();
- RangeHdl_Impl( 0 );
+ RangeHdl_Impl( *m_pPaperWidthEdit );
InitHeadFoot_Impl( *rSet );
@@ -952,11 +952,11 @@ IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl)
-IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvxPageDescPage, PaperBinHdl_Impl, Control&, void)
{
if ( m_pPaperTrayBox->GetEntryCount() > 1 )
// already filled
- return 0;
+ return;
OUString aOldName = m_pPaperTrayBox->GetSelectEntry();
m_pPaperTrayBox->SetUpdateMode( false );
@@ -983,8 +983,6 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl)
}
m_pPaperTrayBox->SelectEntry( aOldName );
m_pPaperTrayBox->SetUpdateMode( true );
-
- return 0;
}
@@ -1012,7 +1010,7 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox )
CalcMargin_Impl();
- RangeHdl_Impl( 0 );
+ RangeHdl_Impl( *m_pPaperWidthEdit );
UpdateExample_Impl( true );
if ( eMode == SVX_PAGE_MODE_PRESENTATION )
@@ -1106,7 +1104,7 @@ IMPL_LINK_TYPED( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void )
CalcMargin_Impl();
PaperSizeSelect_Impl( m_pPaperSizeBox );
- RangeHdl_Impl( 0 );
+ RangeHdl_Impl( *m_pPaperWidthEdit );
SwapFirstValues_Impl( bBorderModified );
UpdateExample_Impl( true );
}
@@ -1476,7 +1474,7 @@ void SvxPageDescPage::ActivatePage( const SfxItemSet& rSet )
InitHeadFoot_Impl( rSet );
UpdateExample_Impl();
ResetBackground_Impl( rSet );
- RangeHdl_Impl( 0 );
+ RangeHdl_Impl( *m_pPaperWidthEdit );
}
@@ -1535,7 +1533,7 @@ SfxTabPage::sfxpg SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
-IMPL_LINK_NOARG(SvxPageDescPage, RangeHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvxPageDescPage, RangeHdl_Impl, Control&, void)
{
// example window
long nHHeight = m_pBspWin->GetHdHeight();
@@ -1599,7 +1597,6 @@ IMPL_LINK_NOARG(SvxPageDescPage, RangeHdl_Impl)
// Right
nMax = nW - nBL - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
m_pRightMarginEdit->SetMax(m_pRightMarginEdit->Normalize(nMax), FUNIT_TWIP);
- return 0;
}
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 71bbb4b60944..d4617e22548b 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -155,7 +155,7 @@ sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet)
}
-IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(SvxStdParagraphTabPage, ELRLoseFocusHdl, Control&, void)
{
SfxItemPool* pPool = GetItemSet().GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
@@ -190,7 +190,6 @@ IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
if ( aTmp.isEmpty() )
m_pRightIndent->SetEmptyFieldValue();
- return 0;
}
VclPtr<SfxTabPage> SvxStdParagraphTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
@@ -580,7 +579,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
// this sets the min/max limits; do this _after_ setting the values,
// because for Impress the min of first-line indent depends on value of
// left-indent!
- ELRLoseFocusHdl( NULL );
+ ELRLoseFocusHdl( *m_pFLineIndent );
m_pAutoCB->SaveValue();
m_pContextualCB->SaveValue();
m_pLineDist->SaveValue();
@@ -614,7 +613,7 @@ void SvxStdParagraphTabPage::EnableRelativeMode()
SfxTabPage::sfxpg SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
{
- ELRLoseFocusHdl( NULL );
+ ELRLoseFocusHdl( *m_pFLineIndent );
if ( _pSet )
FillItemSet( _pSet );
@@ -847,12 +846,12 @@ void SvxStdParagraphTabPage::Init_Impl()
m_pLineDist->SetSelectHdl(
LINK( this, SvxStdParagraphTabPage, LineDistHdl_Impl ) );
- Link<> aLink = LINK( this, SvxStdParagraphTabPage, ELRLoseFocusHdl );
- m_pFLineIndent->SetLoseFocusHdl( aLink );
- m_pLeftIndent->SetLoseFocusHdl( aLink );
- m_pRightIndent->SetLoseFocusHdl( aLink );
+ Link<Control&,void> aLink2 = LINK( this, SvxStdParagraphTabPage, ELRLoseFocusHdl );
+ m_pFLineIndent->SetLoseFocusHdl( aLink2 );
+ m_pLeftIndent->SetLoseFocusHdl( aLink2 );
+ m_pRightIndent->SetLoseFocusHdl( aLink2 );
- aLink = LINK( this, SvxStdParagraphTabPage, ModifyHdl_Impl );
+ Link<> aLink = LINK( this, SvxStdParagraphTabPage, ModifyHdl_Impl );
m_pFLineIndent->SetModifyHdl( aLink );
m_pLeftIndent->SetModifyHdl( aLink );
m_pRightIndent->SetModifyHdl( aLink );
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 997e55ac4046..b51ef9553ed3 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -557,14 +557,14 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(vcl::Window* pParent, const SfxItemSet&
SetExchangeSupport();
- Link<> aLk = LINK(this, SvxSwPosSizeTabPage, RangeModifyHdl);
- m_pWidthMF->SetLoseFocusHdl( aLk );
- m_pHeightMF->SetLoseFocusHdl( aLk );
- m_pHoriByMF->SetLoseFocusHdl( aLk );
- m_pVertByMF->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK(this, SvxSwPosSizeTabPage, RangeModifyHdl);
+ m_pWidthMF->SetLoseFocusHdl( aLk3 );
+ m_pHeightMF->SetLoseFocusHdl( aLk3 );
+ m_pHoriByMF->SetLoseFocusHdl( aLk3 );
+ m_pVertByMF->SetLoseFocusHdl( aLk3 );
m_pFollowCB->SetClickHdl( LINK(this, SvxSwPosSizeTabPage, RangeModifyClickHdl) );
- aLk = LINK(this, SvxSwPosSizeTabPage, ModifyHdl);
+ Link<> aLk = LINK(this, SvxSwPosSizeTabPage, ModifyHdl);
m_pWidthMF->SetModifyHdl( aLk );
m_pHeightMF->SetModifyHdl( aLk );
m_pHoriByMF->SetModifyHdl( aLk );
@@ -1075,7 +1075,7 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
// #i18732#
m_pFollowCB->SaveValue();
- RangeModifyHdl(m_pWidthMF); // initially set maximum values
+ RangeModifyHdl(*m_pWidthMF); // initially set maximum values
}
}
@@ -1138,12 +1138,12 @@ short SvxSwPosSizeTabPage::GetAnchorType(bool* pbHasChanged)
IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, RangeModifyClickHdl, Button*, void)
{
- RangeModifyHdl(NULL);
+ RangeModifyHdl(*m_pWidthMF);
}
-IMPL_LINK_NOARG(SvxSwPosSizeTabPage, RangeModifyHdl)
+IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, RangeModifyHdl, Control&, void)
{
if(m_bPositioningDisabled)
- return 0;
+ return;
SvxSwFrameValidation aVal;
aVal.nAnchorType = GetAnchorType();
@@ -1220,8 +1220,6 @@ IMPL_LINK_NOARG(SvxSwPosSizeTabPage, RangeModifyHdl)
m_pVertByMF->SetMax(m_pVertByMF->Normalize(aVal.nMaxVPos), FUNIT_TWIP);
if ( aVal.nVPos != nAtVertPosVal )
m_pVertByMF->SetValue(m_pVertByMF->Normalize(aVal.nVPos), FUNIT_TWIP);
-
- return 0;
}
IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, AnchorTypeHdl, Button*, void)
@@ -1235,7 +1233,7 @@ IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, AnchorTypeHdl, Button*, void)
short nId = GetAnchorType();
InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
- RangeModifyHdl(0);
+ RangeModifyHdl(*m_pWidthMF);
if(m_bHtmlMode)
{
@@ -1277,7 +1275,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB )
}
}
if (pLB) // only if the hanlder has been called by a change of the controller
- RangeModifyHdl(0);
+ RangeModifyHdl(*m_pWidthMF);
return 0;
@@ -1307,7 +1305,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB )
m_pVertByFT->Enable( bEnable );
}
- RangeModifyHdl( 0 );
+ RangeModifyHdl( *m_pWidthMF );
short nRel = 0;
if (pLB->GetSelectEntryCount())
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 7f3fbb8fa097..b0cd52c44e6e 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -216,8 +216,8 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
NewHdl_Impl( 0 );
// Call the LoseFocus-Handler first
- GetDezCharHdl_Impl(m_pDezChar);
- GetFillCharHdl_Impl(m_pFillChar);
+ GetDezCharHdl_Impl(*m_pDezChar);
+ GetFillCharHdl_Impl(*m_pFillChar);
FillUpWithDefTabs_Impl(nDefDist, aNewTabs);
SfxItemPool* pPool = rSet->GetPool();
@@ -628,9 +628,9 @@ IMPL_LINK_TYPED( SvxTabulatorTabPage, FillTypeCheckHdl_Impl, Button *, pBox, voi
}
}
-IMPL_LINK( SvxTabulatorTabPage, GetFillCharHdl_Impl, Edit *, pEdit )
+IMPL_LINK_TYPED( SvxTabulatorTabPage, GetFillCharHdl_Impl, Control&, rControl, void )
{
- OUString aChar( pEdit->GetText() );
+ OUString aChar( static_cast<Edit&>(rControl).GetText() );
if ( !aChar.isEmpty() )
aAktTab.GetFill() = aChar[0];
@@ -641,12 +641,11 @@ IMPL_LINK( SvxTabulatorTabPage, GetFillCharHdl_Impl, Edit *, pEdit )
aNewTabs.Remove( nPos );
aNewTabs.Insert( aAktTab );
}
- return 0;
}
-IMPL_LINK( SvxTabulatorTabPage, GetDezCharHdl_Impl, Edit *, pEdit )
+IMPL_LINK_TYPED( SvxTabulatorTabPage, GetDezCharHdl_Impl, Control&, rControl, void )
{
- OUString aChar( pEdit->GetText() );
+ OUString aChar( static_cast<Edit*>(&rControl)->GetText() );
if ( !aChar.isEmpty() && ( aChar[0] >= ' '))
aAktTab.GetDecimal() = aChar[0];
@@ -656,7 +655,6 @@ IMPL_LINK( SvxTabulatorTabPage, GetDezCharHdl_Impl, Edit *, pEdit )
aNewTabs.Remove( nPos );
aNewTabs.Insert( aAktTab );
}
- return 0;
}
IMPL_LINK_NOARG(SvxTabulatorTabPage, SelectHdl_Impl)
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 92a4dc55ea6a..fbe4ddc8d587 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -1439,81 +1439,77 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr )
SetReadOnly( bRead );
}
-IMPL_LINK(OFieldDescControl, OnControlFocusGot, Control*, pControl )
+IMPL_LINK_TYPED(OFieldDescControl, OnControlFocusGot, Control&, rControl, void )
{
OUString strHelpText;
- OPropNumericEditCtrl* pNumeric = dynamic_cast< OPropNumericEditCtrl* >( pControl );
+ OPropNumericEditCtrl* pNumeric = dynamic_cast< OPropNumericEditCtrl* >( &rControl );
if ( pNumeric )
{
pNumeric->SaveValue();
strHelpText = pNumeric->GetHelp();
}
- OPropColumnEditCtrl* pColumn = dynamic_cast< OPropColumnEditCtrl* >( pControl );
+ OPropColumnEditCtrl* pColumn = dynamic_cast< OPropColumnEditCtrl* >( &rControl );
if ( pColumn )
{
pColumn->SaveValue();
strHelpText = pColumn->GetHelp();
}
- OPropEditCtrl* pEdit = dynamic_cast< OPropEditCtrl* >( pControl );
+ OPropEditCtrl* pEdit = dynamic_cast< OPropEditCtrl* >( &rControl );
if ( pEdit )
{
pEdit->SaveValue();
strHelpText = pEdit->GetHelp();
}
- OPropListBoxCtrl* pListBox = dynamic_cast< OPropListBoxCtrl* >( pControl );
+ OPropListBoxCtrl* pListBox = dynamic_cast< OPropListBoxCtrl* >( &rControl );
if ( pListBox )
{
pListBox->SaveValue();
strHelpText = pListBox->GetHelp();
}
- if (pControl == pFormat)
+ if (&rControl == pFormat)
strHelpText = ModuleRes(STR_HELP_FORMAT_BUTTON);
if (!strHelpText.isEmpty() && (pHelp != nullptr))
pHelp->SetHelpText(strHelpText);
- m_pActFocusWindow = pControl;
-
- return 0L;
+ m_pActFocusWindow = &rControl;
}
-IMPL_LINK(OFieldDescControl, OnControlFocusLost, Control*, pControl )
+IMPL_LINK_TYPED(OFieldDescControl, OnControlFocusLost, Control&, rControl, void )
{
- if ((pControl == pLength) || (pControl == pTextLen) || (pControl == pScale))
+ if ((&rControl == pLength) || (&rControl == pTextLen) || (&rControl == pScale))
{
- OPropNumericEditCtrl* pConverted = static_cast<OPropNumericEditCtrl*>(pControl);
+ OPropNumericEditCtrl* pConverted = static_cast<OPropNumericEditCtrl*>(&rControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
- if(pControl == m_pColumnName)
+ if(&rControl == m_pColumnName)
{
- OPropColumnEditCtrl* pConverted = static_cast<OPropColumnEditCtrl*>(pControl);
+ OPropColumnEditCtrl* pConverted = static_cast<OPropColumnEditCtrl*>(&rControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
- else if ((pControl == pDefault) || (pControl == pFormatSample) || (pControl == m_pAutoIncrementValue) )
+ else if ((&rControl == pDefault) || (&rControl == pFormatSample) || (&rControl == m_pAutoIncrementValue) )
{
- OPropEditCtrl* pConverted = static_cast<OPropEditCtrl*>(pControl);
+ OPropEditCtrl* pConverted = static_cast<OPropEditCtrl*>(&rControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
- else if ((pControl == pRequired) || (pControl == pNumType) || (pControl == pAutoIncrement) || (pControl == pBoolDefault) || (pControl == m_pType))
+ else if ((&rControl == pRequired) || (&rControl == pNumType) || (&rControl == pAutoIncrement) || (&rControl == pBoolDefault) || (&rControl == m_pType))
{
- OPropListBoxCtrl* pConverted = static_cast<OPropListBoxCtrl*>(pControl);
+ OPropListBoxCtrl* pConverted = static_cast<OPropListBoxCtrl*>(&rControl);
if (pConverted->IsModified())
CellModified(-1, pConverted->GetPos());
}
- if (pControl == pDefault)
+ if (&rControl == pDefault)
UpdateFormatSample(pActFieldDescr);
- implFocusLost(pControl);
-
- return 0L;
+ implFocusLost(&rControl);
}
void OFieldDescControl::SaveData( OFieldDescription* pFieldDescr )
diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx
index 36766be76ca3..2a8fedd2607a 100644
--- a/dbaccess/source/ui/dlg/paramdialog.cxx
+++ b/dbaccess/source/ui/dlg/paramdialog.cxx
@@ -131,7 +131,7 @@ namespace dbaui
void OParameterDialog::Construct()
{
m_pAllParams->SetSelectHdl(LINK(this, OParameterDialog, OnEntrySelected));
- m_pParam->SetLoseFocusHdl(LINK(this, OParameterDialog, OnValueLoseFocus));
+ m_pParam->SetLoseFocusHdl(LINK(this, OParameterDialog, OnValueLoseFocusHdl));
m_pParam->SetModifyHdl(LINK(this, OParameterDialog, OnValueModified));
m_pTravelNext->SetClickHdl(LINK(this, OParameterDialog, OnButtonClicked));
m_pOKBtn->SetClickHdl(LINK(this, OParameterDialog, OnButtonClicked));
@@ -157,13 +157,18 @@ namespace dbaui
m_pParam->GrabFocus();
}
- IMPL_LINK(OParameterDialog, OnValueLoseFocus, Control*, /*pSource*/)
+ IMPL_LINK_NOARG_TYPED(OParameterDialog, OnValueLoseFocusHdl, Control&, void)
+ {
+ OnValueLoseFocus();
+ }
+
+ bool OParameterDialog::OnValueLoseFocus()
{
if (m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND)
{
if ( ( m_aVisitedParams[ m_nCurrentlySelected ] & EF_DIRTY ) == 0 )
// nothing to do, the value isn't dirty
- return 0L;
+ return false;
}
Reference< XPropertySet > xParamAsSet;
@@ -184,7 +189,7 @@ namespace dbaui
else
{
if (!m_bNeedErrorOnCurrent)
- return 1L;
+ return true;
OUString sName;
try
@@ -200,12 +205,12 @@ namespace dbaui
sMessage = sMessage.replaceAll( "$name$", sName );
ScopedVclPtrInstance<MessageDialog>::Create(nullptr, sMessage)->Execute();
m_pParam->GrabFocus();
- return 1L;
+ return true;
}
}
}
- return 0L;
+ return false;
}
IMPL_LINK_TYPED(OParameterDialog, OnButtonClicked, Button*, pButton, void)
@@ -213,7 +218,7 @@ namespace dbaui
if (m_pCancelBtn == pButton)
{
// no interpreting of the given values anymore ....
- m_pParam->SetLoseFocusHdl(Link<>()); // no direct call from the control anymore ...
+ m_pParam->SetLoseFocusHdl(Link<Control&,void>()); // no direct call from the control anymore ...
m_bNeedErrorOnCurrent = false; // in case of any indirect calls -> no error message
m_pCancelBtn->SetClickHdl(Link<Button*,void>());
m_pCancelBtn->Click();
@@ -291,7 +296,7 @@ namespace dbaui
if (m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND)
{
// do the transformation of the current text
- if (LINK(this, OParameterDialog, OnValueLoseFocus).Call(m_pParam) != 0L)
+ if (OnValueLoseFocus())
{ // there was an error interpreting the text
m_pAllParams->SelectEntryPos(m_nCurrentlySelected);
return 1L;
@@ -347,7 +352,7 @@ namespace dbaui
Selection aSel;
if (pOldFocus == m_pParam)
{
- m_pParam->SetLoseFocusHdl(Link<>());
+ m_pParam->SetLoseFocusHdl(Link<Control&,void>());
aSel = m_pParam->GetSelection();
}
m_pTravelNext->GrabFocus();
@@ -357,7 +362,7 @@ namespace dbaui
// restore the settings for the value edit
if (pOldFocus == m_pParam)
{
- m_pParam->SetLoseFocusHdl(LINK(this, OParameterDialog, OnValueLoseFocus));
+ m_pParam->SetLoseFocusHdl(LINK(this, OParameterDialog, OnValueLoseFocusHdl));
m_pParam->SetSelection(aSel);
}
}
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index 373b6d0fb568..764ce8ff2042 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -453,23 +453,18 @@ Reference< XPropertySet > DlgFilterCrit::getMatchingColumn( const Edit& _rValueI
return getColumn( sField );
}
-IMPL_LINK( DlgFilterCrit, PredicateLoseFocus, Edit*, _pField )
+IMPL_LINK_TYPED( DlgFilterCrit, PredicateLoseFocus, Control&, rControl, void )
{
- OSL_ENSURE( _pField, "DlgFilterCrit::PredicateLoseFocus: invalid event source!" );
- if ( _pField )
+ Edit* _pField = static_cast<Edit*>(&rControl);
+ // retrieve the field affected
+ Reference< XPropertySet> xColumn( getMatchingColumn( *_pField ) );
+ // and normalize it's content
+ if ( xColumn.is() )
{
- // retrieve the field affected
- Reference< XPropertySet> xColumn( getMatchingColumn( *_pField ) );
- // and normalize it's content
- if ( xColumn.is() )
- {
- OUString sText( _pField->GetText() );
- m_aPredicateInput.normalizePredicateString( sText, xColumn );
- _pField->SetText( sText );
- }
+ OUString sText( _pField->GetText() );
+ m_aPredicateInput.normalizePredicateString( sText, xColumn );
+ _pField->SetText( sText );
}
-
- return 0L;
}
void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,bool _bOr )
diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx
index 791bcb4f7f9b..f5fefbd3033a 100644
--- a/dbaccess/source/ui/inc/FieldDescControl.hxx
+++ b/dbaccess/source/ui/inc/FieldDescControl.hxx
@@ -120,8 +120,8 @@ namespace dbaui
DECL_LINK( ChangeHdl, ListBox * );
// used by ActivatePropertyField
- DECL_LINK( OnControlFocusLost, Control* );
- DECL_LINK( OnControlFocusGot, Control* );
+ DECL_LINK_TYPED( OnControlFocusLost, Control&, void );
+ DECL_LINK_TYPED( OnControlFocusGot, Control&, void );
void UpdateFormatSample(OFieldDescription* pFieldDescr);
void ArrangeAggregates();
diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx
index 44d3316dd61d..58bb7c4113d7 100644
--- a/dbaccess/source/ui/inc/paramdialog.hxx
+++ b/dbaccess/source/ui/inc/paramdialog.hxx
@@ -99,7 +99,8 @@ namespace dbaui
DECL_LINK(OnValueModified, Control*);
DECL_LINK(OnEntrySelected, ListBox*);
DECL_LINK_TYPED(OnButtonClicked, Button*, void);
- DECL_LINK(OnValueLoseFocus, Control*);
+ DECL_LINK_TYPED(OnValueLoseFocusHdl, Control&, void);
+ bool OnValueLoseFocus();
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx
index 32fb47c0ed38..d09f69064bf3 100644
--- a/dbaccess/source/ui/inc/queryfilter.hxx
+++ b/dbaccess/source/ui/inc/queryfilter.hxx
@@ -118,7 +118,7 @@ namespace dbaui
void BuildWherePart();
protected:
- DECL_LINK( PredicateLoseFocus, Edit* );
+ DECL_LINK_TYPED( PredicateLoseFocus, Control&, void );
};
}
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 37bf731a357a..a2f2c59ee74e 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -485,7 +485,7 @@ namespace pcr
}
- IMPL_LINK( OBrowserLine, OnButtonFocus, PushButton*, /*pPB*/ )
+ IMPL_LINK_NOARG_TYPED( OBrowserLine, OnButtonFocus, Control&, void )
{
if ( m_xControl.is() )
{
@@ -499,7 +499,6 @@ namespace pcr
DBG_UNHANDLED_EXCEPTION();
}
}
- return 0;
}
} // namespace pcr
diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx
index c28c7861a775..7dc1f846a9e1 100644
--- a/extensions/source/propctrlr/browserline.hxx
+++ b/extensions/source/propctrlr/browserline.hxx
@@ -115,7 +115,7 @@ namespace pcr
private:
DECL_LINK_TYPED( OnButtonClicked, Button*, void );
- DECL_LINK( OnButtonFocus, PushButton* );
+ DECL_LINK_TYPED( OnButtonFocus, Control&, void );
void implHideBrowseButton( bool _bPrimary, bool _bReLayout );
void implUpdateEnabledDisabled();
diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx
index 1bfeed319853..5ac12303a6ae 100644
--- a/extensions/source/propctrlr/commoncontrol.cxx
+++ b/extensions/source/propctrlr/commoncontrol.cxx
@@ -126,7 +126,7 @@ namespace pcr
if (nKey == KEY_RETURN && !aKeyCode.IsShift())
{
- LoseFocusHdl(m_pControlWindow);
+ notifyModifiedValue();
impl_activateNextControl_nothrow();
return true;
}
@@ -143,7 +143,7 @@ namespace pcr
}
- IMPL_LINK( ControlHelper, GetFocusHdl, vcl::Window*, /*_pWin*/ )
+ IMPL_LINK_NOARG_TYPED( ControlHelper, GetFocusHdl, Control&, void )
{
try
{
@@ -154,17 +154,15 @@ namespace pcr
{
DBG_UNHANDLED_EXCEPTION();
}
- return 0;
}
- IMPL_LINK( ControlHelper, LoseFocusHdl, vcl::Window*, /*_pWin*/ )
+ IMPL_LINK_NOARG_TYPED( ControlHelper, LoseFocusHdl, Control&, void )
{
// TODO/UNOize: should this be outside the default control's implementations? If somebody
// has an own control implementation, which does *not* do this - would this be allowed?
// If not, then we must move this logic out of here.
notifyModifiedValue();
- return 0;
}
diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx
index 7b631a7965db..b74e985a766e 100644
--- a/extensions/source/propctrlr/commoncontrol.hxx
+++ b/extensions/source/propctrlr/commoncontrol.hxx
@@ -28,6 +28,7 @@
#include <vcl/window.hxx>
class NotifyEvent;
+class Control;
namespace pcr
{
@@ -152,8 +153,8 @@ namespace pcr
/// may be used by derived classes, they forward the event to the PropCtrListener
DECL_LINK( ModifiedHdl, vcl::Window* );
- DECL_LINK( GetFocusHdl, vcl::Window* );
- DECL_LINK( LoseFocusHdl, vcl::Window* );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
private:
/** fail-safe wrapper around calling our context's activateNextControl
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 9ffb0daeee66..3d1c199a4b07 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -1112,7 +1112,7 @@ namespace pcr
{
if ( m_pHelper )
{
- m_pHelper->LoseFocusHdl( m_pImplEdit.get() );
+ m_pHelper->LoseFocusHdl( *m_pImplEdit.get() );
m_pHelper->activateNextControl();
}
}
diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx
index d9e12173b290..18af2e9e5396 100644
--- a/formula/source/ui/dlg/ControlHelper.hxx
+++ b/formula/source/ui/dlg/ControlHelper.hxx
@@ -98,8 +98,8 @@ private:
VclPtr<RefButton> pRefBtn;
DECL_LINK_TYPED( FxBtnClickHdl, Button*, void );
- DECL_LINK( FxBtnFocusHdl, ImageButton* );
- DECL_LINK( EdFocusHdl, ArgEdit* );
+ DECL_LINK_TYPED( FxBtnFocusHdl, Control&, void );
+ DECL_LINK_TYPED( EdFocusHdl, Control&, void );
DECL_LINK( EdModifyHdl,ArgEdit* );
protected:
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index 50d8b01f3df0..5c7d8ad170da 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -285,20 +285,16 @@ IMPL_LINK_TYPED( ArgInput, FxBtnClickHdl, Button*, pBtn, void )
FxClick();
}
-IMPL_LINK( ArgInput, FxBtnFocusHdl, ImageButton*, pBtn )
+IMPL_LINK_TYPED( ArgInput, FxBtnFocusHdl, Control&, rControl, void )
{
- if(pBtn == pBtnFx)
+ if(&rControl == pBtnFx)
FxFocus();
-
- return 0;
}
-IMPL_LINK( ArgInput, EdFocusHdl, ArgEdit*, pEd )
+IMPL_LINK_TYPED( ArgInput, EdFocusHdl, Control&, rControl, void )
{
- if(pEd == pEdArg)
+ if(&rControl == pEdArg)
EdFocus();
-
- return 0;
}
IMPL_LINK( ArgInput, EdModifyHdl,ArgEdit*, pEd )
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index 05a0b71ef646..8c9b33a651ff 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -228,7 +228,7 @@ void ParaWin::dispose()
{
// #i66422# if the focus changes during destruction of the controls,
// don't call the focus handlers
- Link<> aEmptyLink;
+ Link<Control&,void> aEmptyLink;
m_pBtnFx1->SetGetFocusHdl( aEmptyLink );
m_pBtnFx2->SetGetFocusHdl( aEmptyLink );
m_pBtnFx3->SetGetFocusHdl( aEmptyLink );
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index b3a60c860cbc..83cd52c98cf6 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -980,10 +980,9 @@ IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, SelectHdl, SvTreeListBox*, void )
}
}
-IMPL_LINK_NOARG( RemoteFilesDialog, FileNameGetFocusHdl )
+IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, FileNameGetFocusHdl, Control&, void )
{
m_pFileView->SetNoSelection();
- return 1;
}
IMPL_LINK_NOARG( RemoteFilesDialog, FileNameModifyHdl )
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index 30fff9de7beb..78488cc15a5c 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -192,7 +192,7 @@ private:
DECL_LINK_TYPED( DoubleClickHdl, SvTreeListBox*, bool );
DECL_LINK_TYPED( SelectHdl, SvTreeListBox*, void );
- DECL_LINK( FileNameGetFocusHdl, void * );
+ DECL_LINK_TYPED( FileNameGetFocusHdl, Control&, void );
DECL_LINK( FileNameModifyHdl, void * );
DECL_LINK_TYPED( SplitHdl, Splitter*, void );
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index b684ae9d34df..0f850eabb3f2 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1312,18 +1312,17 @@ IMPL_LINK_NOARG_TYPED(SvtFileDialog, FilterSelectTimerHdl_Impl, Timer*, void)
ExecuteFilter();
}
-IMPL_LINK_NOARG( SvtFileDialog, FileNameGetFocusHdl_Impl )
+IMPL_LINK_NOARG_TYPED( SvtFileDialog, FileNameGetFocusHdl_Impl, Control&, void )
{
_pFileView->SetNoSelection();
_pFileView->Update();
- return 0;
}
IMPL_LINK_NOARG( SvtFileDialog, FileNameModifiedHdl_Impl )
{
- FileNameGetFocusHdl_Impl( NULL );
+ FileNameGetFocusHdl_Impl( *_pImp->_pEdFileName );
return 0;
}
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 93c493426037..19b5d8ab0e2e 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -90,7 +90,7 @@ private:
DECL_LINK_TYPED( OpenUrlHdl_Impl, SvtURLBox*, void );
DECL_LINK_TYPED( OpenClickHdl_Impl, Button*, void );
DECL_LINK_TYPED( CancelHdl_Impl, Button*, void );
- DECL_LINK( FileNameGetFocusHdl_Impl, void* );
+ DECL_LINK_TYPED( FileNameGetFocusHdl_Impl, Control&, void );
DECL_LINK( FileNameModifiedHdl_Impl, void* );
DECL_LINK_TYPED( URLBoxModifiedHdl_Impl, SvtURLBox*, void );
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 5629902b60cb..c33120863f34 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -428,8 +428,8 @@ private:
DECL_STATIC_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox* );
DECL_LINK_TYPED( RemoveHdl, Button*, void );
- DECL_LINK( EditLoseFocusHdl, CustomPropertiesEdit* );
- DECL_LINK( BoxLoseFocusHdl, CustomPropertiesTypeBox* );
+ DECL_LINK_TYPED( EditLoseFocusHdl, Control&, void );
+ DECL_LINK_TYPED( BoxLoseFocusHdl, Control&, void );
//add lose focus handlers of Date/TimeField?
DECL_LINK_TYPED(EditTimeoutHdl, Idle *, void);
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 607833f66af8..f719b721a95e 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -69,8 +69,8 @@ class SfxManageStyleSheetPage : public SfxTabPage
private:
friend class SfxStyleDialog;
- DECL_LINK( GetFocusHdl, Edit * );
- DECL_LINK( LoseFocusHdl, Edit * );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
DECL_LINK( EditStyleSelectHdl_Impl, void * );
DECL_LINK_TYPED( EditStyleHdl_Impl, Button*, void );
DECL_LINK( EditLinkStyleSelectHdl_Impl, void * );
diff --git a/include/svtools/addresstemplate.hxx b/include/svtools/addresstemplate.hxx
index be355f34ec6a..00b532a0ba3a 100644
--- a/include/svtools/addresstemplate.hxx
+++ b/include/svtools/addresstemplate.hxx
@@ -128,8 +128,8 @@ namespace svt
DECL_LINK_TYPED(OnFieldScroll, ScrollBar*, void);
DECL_LINK(OnFieldSelect, ListBox*);
DECL_LINK_TYPED(OnAdministrateDatasources, Button*, void);
- DECL_STATIC_LINK(AddressBookSourceDialog, OnComboGetFocus, ComboBox*);
- DECL_LINK(OnComboLoseFocus, ComboBox*);
+ DECL_STATIC_LINK_TYPED(AddressBookSourceDialog, OnComboGetFocus, Control&, void);
+ DECL_LINK_TYPED(OnComboLoseFocus, Control&, void);
DECL_LINK(OnComboSelect, ComboBox*);
DECL_LINK_TYPED(OnOkClicked, Button*, void);
DECL_LINK_TYPED(OnDelayedInitialize, void*, void);
diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx
index b11ec1607f87..89908719bcd7 100644
--- a/include/svx/dialcontrol.hxx
+++ b/include/svx/dialcontrol.hxx
@@ -160,6 +160,8 @@ private:
DECL_LINK( LinkedFieldModifyHdl, NumericField* );
+ DECL_LINK_TYPED( LinkedFieldFocusHdl, Control&, void );
+ void LinkedFieldModifyHdl();
};
/** Wrapper for usage of a DialControl in item connections. */
diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx
index 7e0b45d31dac..d26ef8d470a0 100644
--- a/include/svx/hdft.hxx
+++ b/include/svx/hdft.hxx
@@ -102,6 +102,8 @@ protected:
void UpdateExample();
DECL_LINK(RangeHdl, void *);
+ DECL_LINK_TYPED(RangeFocusHdl, Control&, void);
+ void RangeHdl();
private:
SVX_DLLPRIVATE void ResetBackground_Impl( const SfxItemSet& rSet );
diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx
index 223e5eb62b33..405ab411910c 100644
--- a/include/svx/imapdlg.hxx
+++ b/include/svx/imapdlg.hxx
@@ -123,7 +123,7 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
DECL_LINK_TYPED( MousePosHdl, GraphCtrl*, void );
DECL_LINK_TYPED( GraphSizeHdl, GraphCtrl*, void );
DECL_LINK( URLModifyHdl, void* );
- DECL_LINK( URLLoseFocusHdl, void* );
+ DECL_LINK_TYPED( URLLoseFocusHdl, Control&, void );
DECL_LINK_TYPED( UpdateHdl, Idle *, void );
DECL_LINK_TYPED( StateHdl, GraphCtrl*, void );
DECL_LINK_TYPED( MiscHdl, LinkParamNone*, void );
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 1403fafa4510..1d1286358dc7 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -234,9 +234,9 @@ private:
DECL_LINK_TYPED( FlagHdl_Impl, Button*, void );
DECL_LINK_TYPED( CommandHdl_Impl, Button*, void );
DECL_LINK_TYPED(TemplateHdl_Impl, Button*, void);
- DECL_LINK( FocusHdl_Impl, Control* );
+ DECL_LINK_TYPED( FocusHdl_Impl, Control&, void );
DECL_LINK( LBSelectHdl_Impl, Control* );
- DECL_LINK(LoseFocusHdl_Impl, void *);
+ DECL_LINK_TYPED(LoseFocusHdl_Impl, Control&, void);
DECL_LINK_TYPED(FormatHdl_Impl, Button*, void);
DECL_LINK_TYPED(NoFormatHdl_Impl, Button*, void);
DECL_LINK_TYPED(AttributeHdl_Impl, Button*, void);
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index 115d9dd87ea5..28bf572b54ac 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -42,8 +42,8 @@ protected:
private:
bool mbHasControlFocus;
bool mbShowAccelerator;
- Link<> maGetFocusHdl;
- Link<> maLoseFocusHdl;
+ Link<Control&,void> maGetFocusHdl;
+ Link<Control&,void> maLoseFocusHdl;
SAL_DLLPRIVATE void ImplInitControlData();
@@ -161,9 +161,9 @@ public:
*/
long ToRelativeLineIndex( long nIndex ) const;
- void SetGetFocusHdl( const Link<>& rLink ) { maGetFocusHdl = rLink; }
- void SetLoseFocusHdl( const Link<>& rLink ) { maLoseFocusHdl = rLink; }
- const Link<>& GetLoseFocusHdl() const { return maLoseFocusHdl; }
+ void SetGetFocusHdl( const Link<Control&,void>& rLink ) { maGetFocusHdl = rLink; }
+ void SetLoseFocusHdl( const Link<Control&,void>& rLink ) { maLoseFocusHdl = rLink; }
+ const Link<Control&,void>& GetLoseFocusHdl() const { return maLoseFocusHdl; }
/** determines whether the control currently has the focus
*/
diff --git a/include/vcl/slider.hxx b/include/vcl/slider.hxx
index 46ab0f30c7d3..9423936f60ae 100644
--- a/include/vcl/slider.hxx
+++ b/include/vcl/slider.hxx
@@ -58,6 +58,7 @@ private:
Link<Slider*,void> maEndSlideHdl;
DECL_LINK(LinkedFieldModifyHdl, NumericField*);
+ DECL_LINK_TYPED(LinkedFieldLoseFocusHdl, Control&, void);
using Control::ImplInitSettings;
using Window::ImplInit;
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index d2f4281dc90d..68ce8f2f20c6 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -1104,19 +1104,19 @@ sal_Int32 OGroupsSortingDialog::getColumnDataType(const OUString& _sColumnName)
return nDataType;
}
-IMPL_LINK(OGroupsSortingDialog, OnControlFocusGot, Control*, pControl )
+IMPL_LINK_TYPED(OGroupsSortingDialog, OnControlFocusGot, Control&, rControl, void )
{
if ( m_pFieldExpression && m_pFieldExpression->getExpressionControl() )
{
Control* pControls[] = { m_pFieldExpression->getExpressionControl(), m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pGroupIntervalEd, m_pKeepTogetherLst, m_pOrderLst};
for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
{
- if ( pControl == pControls[i] )
+ if ( &rControl == pControls[i] )
{
- ListBox* pListBox = dynamic_cast< ListBox* >( pControl );
+ ListBox* pListBox = dynamic_cast< ListBox* >( &rControl );
if ( pListBox )
pListBox->SaveValue();
- NumericField* pNumericField = dynamic_cast< NumericField* >( pControl );
+ NumericField* pNumericField = dynamic_cast< NumericField* >( &rControl );
if ( pNumericField )
pNumericField->SaveValue();
showHelpText(static_cast<sal_uInt16>(i+STR_RPT_HELP_FIELD));
@@ -1124,17 +1124,15 @@ IMPL_LINK(OGroupsSortingDialog, OnControlFocusGot, Control*, pControl )
}
}
}
- return 0L;
}
-IMPL_LINK(OGroupsSortingDialog, OnControlFocusLost, Control*, pControl )
+IMPL_LINK_TYPED(OGroupsSortingDialog, OnControlFocusLost, Control&, rControl, void )
{
- if (m_pFieldExpression && pControl == m_pGroupIntervalEd)
+ if (m_pFieldExpression && &rControl == m_pGroupIntervalEd)
{
if ( m_pGroupIntervalEd->IsModified() )
SaveData(m_pFieldExpression->GetCurRow());
}
- return 0L;
}
IMPL_LINK_NOARG_TYPED( OGroupsSortingDialog, OnFormatAction, ToolBox*, void )
diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx
index f3f74919b931..714191c2c887 100644
--- a/reportdesign/source/ui/inc/GroupsSorting.hxx
+++ b/reportdesign/source/ui/inc/GroupsSorting.hxx
@@ -82,8 +82,8 @@ class OGroupsSortingDialog : public FloatingWindow
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns;
bool m_bReadOnly;
private:
- DECL_LINK( OnControlFocusLost, Control* );
- DECL_LINK( OnControlFocusGot, Control* );
+ DECL_LINK_TYPED( OnControlFocusLost, Control&, void );
+ DECL_LINK_TYPED( OnControlFocusGot, Control&, void );
DECL_LINK( LBChangeHdl, ListBox* );
DECL_LINK_TYPED( OnFormatAction, ToolBox*, void );
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 7482da61a6f2..fe2fbc0fcb91 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -112,7 +112,7 @@ void ScRandomNumberGeneratorDialog::Init()
mpButtonClose->SetClickHdl( LINK( this, ScRandomNumberGeneratorDialog, CloseClicked ) );
mpButtonApply->SetClickHdl( LINK( this, ScRandomNumberGeneratorDialog, ApplyClicked ) );
- Link<> aLink = LINK( this, ScRandomNumberGeneratorDialog, GetFocusHandler );
+ Link<Control&,void> aLink = LINK( this, ScRandomNumberGeneratorDialog, GetFocusHandler );
mpInputRangeEdit->SetGetFocusHdl( aLink );
mpInputRangeButton->SetGetFocusHdl( aLink );
@@ -342,23 +342,20 @@ IMPL_LINK_NOARG_TYPED( ScRandomNumberGeneratorDialog, CloseClicked, Button*, voi
Close();
}
-IMPL_LINK( ScRandomNumberGeneratorDialog, GetFocusHandler, Control*, pCtrl )
+IMPL_LINK_TYPED( ScRandomNumberGeneratorDialog, GetFocusHandler, Control&, rCtrl, void )
{
Edit* pEdit = NULL;
- if( (pCtrl == static_cast<Control*>(mpInputRangeEdit)) || (pCtrl == static_cast<Control*>(mpInputRangeButton)) )
+ if( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)) )
pEdit = mpInputRangeEdit;
if( pEdit )
pEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, LoseFocusHandler)
+IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, LoseFocusHandler, Control&, void)
{
mbDialogLostFocus = !IsActive();
- return 0;
}
IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, InputRangeModified)
diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
index 0d71b2687490..258f19e8b9ff 100644
--- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
@@ -89,7 +89,7 @@ void ScSamplingDialog::Init()
mpButtonOk->SetClickHdl( LINK( this, ScSamplingDialog, OkClicked ) );
mpButtonOk->Enable(false);
- Link<> aLink = LINK( this, ScSamplingDialog, GetFocusHandler );
+ Link<Control&,void> aLink = LINK( this, ScSamplingDialog, GetFocusHandler );
mpInputRangeEdit->SetGetFocusHdl( aLink );
mpInputRangeButton->SetGetFocusHdl( aLink );
mpOutputRangeEdit->SetGetFocusHdl( aLink );
@@ -101,9 +101,9 @@ void ScSamplingDialog::Init()
mpOutputRangeEdit->SetLoseFocusHdl( aLink );
mpOutputRangeButton->SetLoseFocusHdl( aLink );
- aLink = LINK( this, ScSamplingDialog, RefInputModifyHandler);
- mpInputRangeEdit->SetModifyHdl( aLink);
- mpOutputRangeEdit->SetModifyHdl( aLink);
+ Link<> aLink2 = LINK( this, ScSamplingDialog, RefInputModifyHandler);
+ mpInputRangeEdit->SetModifyHdl( aLink2);
+ mpOutputRangeEdit->SetModifyHdl( aLink2);
mpSampleSize->SetModifyHdl( LINK( this, ScSamplingDialog, SamplingSizeValueModified ));
@@ -294,25 +294,22 @@ IMPL_LINK_NOARG_TYPED( ScSamplingDialog, OkClicked, Button*, void )
Close();
}
-IMPL_LINK( ScSamplingDialog, GetFocusHandler, Control*, pCtrl )
+IMPL_LINK_TYPED( ScSamplingDialog, GetFocusHandler, Control&, rCtrl, void )
{
mpActiveEdit = NULL;
- if( (pCtrl == static_cast<Control*>(mpInputRangeEdit)) || (pCtrl == static_cast<Control*>(mpInputRangeButton)) )
+ if( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)) )
mpActiveEdit = mpInputRangeEdit;
- else if( (pCtrl == static_cast<Control*>(mpOutputRangeEdit)) || (pCtrl == static_cast<Control*>(mpOutputRangeButton)) )
+ else if( (&rCtrl == static_cast<Control*>(mpOutputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpOutputRangeButton)) )
mpActiveEdit = mpOutputRangeEdit;
if( mpActiveEdit )
mpActiveEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG(ScSamplingDialog, LoseFocusHandler)
+IMPL_LINK_NOARG_TYPED(ScSamplingDialog, LoseFocusHandler, Control&, void)
{
mDialogLostFocus = !IsActive();
- return 0;
}
IMPL_LINK_NOARG(ScSamplingDialog, SamplingSizeValueModified)
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
index c676bda90320..276f5c1ba2c1 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -113,7 +113,7 @@ void ScStatisticsInputOutputDialog::Init()
mpButtonOk->SetClickHdl( LINK( this, ScStatisticsInputOutputDialog, OkClicked ) );
mpButtonOk->Enable(false);
- Link<> aLink = LINK( this, ScStatisticsInputOutputDialog, GetFocusHandler );
+ Link<Control&,void> aLink = LINK( this, ScStatisticsInputOutputDialog, GetFocusHandler );
mpInputRangeEdit->SetGetFocusHdl( aLink );
mpInputRangeButton->SetGetFocusHdl( aLink );
mpOutputRangeEdit->SetGetFocusHdl( aLink );
@@ -125,9 +125,9 @@ void ScStatisticsInputOutputDialog::Init()
mpOutputRangeEdit->SetLoseFocusHdl( aLink );
mpOutputRangeButton->SetLoseFocusHdl( aLink );
- aLink = LINK( this, ScStatisticsInputOutputDialog, RefInputModifyHandler);
- mpInputRangeEdit->SetModifyHdl( aLink);
- mpOutputRangeEdit->SetModifyHdl( aLink);
+ Link<> aLink2 = LINK( this, ScStatisticsInputOutputDialog, RefInputModifyHandler);
+ mpInputRangeEdit->SetModifyHdl( aLink2);
+ mpOutputRangeEdit->SetModifyHdl( aLink2);
mpOutputRangeEdit->GrabFocus();
@@ -198,25 +198,22 @@ IMPL_LINK_NOARG_TYPED( ScStatisticsInputOutputDialog, OkClicked, Button*, void )
Close();
}
-IMPL_LINK( ScStatisticsInputOutputDialog, GetFocusHandler, Control*, pCtrl )
+IMPL_LINK_TYPED( ScStatisticsInputOutputDialog, GetFocusHandler, Control&, rCtrl, void )
{
mpActiveEdit = NULL;
- if( (pCtrl == static_cast<Control*>(mpInputRangeEdit)) || (pCtrl == static_cast<Control*>(mpInputRangeButton)) )
+ if( (&rCtrl == static_cast<Control*>(mpInputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpInputRangeButton)) )
mpActiveEdit = mpInputRangeEdit;
- else if( (pCtrl == static_cast<Control*>(mpOutputRangeEdit)) || (pCtrl == static_cast<Control*>(mpOutputRangeButton)) )
+ else if( (&rCtrl == static_cast<Control*>(mpOutputRangeEdit)) || (&rCtrl == static_cast<Control*>(mpOutputRangeButton)) )
mpActiveEdit = mpOutputRangeEdit;
if( mpActiveEdit )
mpActiveEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, LoseFocusHandler )
+IMPL_LINK_NOARG_TYPED( ScStatisticsInputOutputDialog, LoseFocusHandler, Control&, void )
{
mDialogLostFocus = !IsActive();
- return 0;
}
IMPL_LINK_NOARG_TYPED( ScStatisticsInputOutputDialog, GroupByChanged, RadioButton&, void )
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
index 44fdfecc3cc0..16816f5a0f89 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -95,7 +95,7 @@ void ScStatisticsTwoVariableDialog::Init()
mpButtonOk->SetClickHdl( LINK( this, ScStatisticsTwoVariableDialog, OkClicked ) );
mpButtonOk->Enable(false);
- Link<> aLink = LINK( this, ScStatisticsTwoVariableDialog, GetFocusHandler );
+ Link<Control&,void> aLink = LINK( this, ScStatisticsTwoVariableDialog, GetFocusHandler );
mpVariable1RangeEdit->SetGetFocusHdl( aLink );
mpVariable1RangeButton->SetGetFocusHdl( aLink );
mpVariable2RangeEdit->SetGetFocusHdl( aLink );
@@ -111,10 +111,10 @@ void ScStatisticsTwoVariableDialog::Init()
mpOutputRangeEdit->SetLoseFocusHdl( aLink );
mpOutputRangeButton->SetLoseFocusHdl( aLink );
- aLink = LINK( this, ScStatisticsTwoVariableDialog, RefInputModifyHandler);
- mpVariable1RangeEdit->SetModifyHdl( aLink);
- mpVariable2RangeEdit->SetModifyHdl( aLink);
- mpOutputRangeEdit->SetModifyHdl( aLink);
+ Link<> aLink2 = LINK( this, ScStatisticsTwoVariableDialog, RefInputModifyHandler);
+ mpVariable1RangeEdit->SetModifyHdl( aLink2);
+ mpVariable2RangeEdit->SetModifyHdl( aLink2);
+ mpOutputRangeEdit->SetModifyHdl( aLink2);
mpOutputRangeEdit->GrabFocus();
@@ -211,35 +211,32 @@ IMPL_LINK_NOARG_TYPED( ScStatisticsTwoVariableDialog, OkClicked, Button*, void )
Close();
}
-IMPL_LINK( ScStatisticsTwoVariableDialog, GetFocusHandler, Control*, pCtrl )
+IMPL_LINK_TYPED( ScStatisticsTwoVariableDialog, GetFocusHandler, Control&, rCtrl, void )
{
mpActiveEdit = NULL;
- if( pCtrl == mpVariable1RangeEdit
- || pCtrl == mpVariable1RangeButton )
+ if( &rCtrl == mpVariable1RangeEdit
+ || &rCtrl == mpVariable1RangeButton )
{
mpActiveEdit = mpVariable1RangeEdit;
}
- else if( pCtrl == mpVariable2RangeEdit
- || pCtrl == mpVariable2RangeButton )
+ else if( &rCtrl == mpVariable2RangeEdit
+ || &rCtrl == mpVariable2RangeButton )
{
mpActiveEdit = mpVariable2RangeEdit;
}
- else if( pCtrl == mpOutputRangeEdit
- || pCtrl == mpOutputRangeButton )
+ else if( &rCtrl == mpOutputRangeEdit
+ || &rCtrl == mpOutputRangeButton )
{
mpActiveEdit = mpOutputRangeEdit;
}
if( mpActiveEdit )
mpActiveEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, LoseFocusHandler )
+IMPL_LINK_NOARG_TYPED( ScStatisticsTwoVariableDialog, LoseFocusHandler, Control&, void )
{
mDialogLostFocus = !IsActive();
- return 0;
}
IMPL_LINK_NOARG_TYPED( ScStatisticsTwoVariableDialog, GroupByChanged, RadioButton&, void )
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 60f13958ff70..27cc8d0a93b0 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -786,10 +786,9 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit )
return 0;
}
-IMPL_LINK( ScCondFormatDlg, RangeGetFocusHdl, formula::RefEdit*, pEdit )
+IMPL_LINK_TYPED( ScCondFormatDlg, RangeGetFocusHdl, Control&, rControl, void )
{
- mpLastEdit = pEdit;
- return 0;
+ mpLastEdit = static_cast<formula::RefEdit*>(&rControl);
}
// ------------------------------------------------------
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 85203ca54aeb..87eb9c75ee6e 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -78,8 +78,6 @@ ScPivotLayoutDialog::ScPivotLayoutDialog(
maAddressDetails (mpDocument->GetAddressConvention(), 0, 0),
mbDialogLostFocus (false)
{
- Link<> aLink;
-
get(mpListBoxField, "listbox-fields");
get(mpListBoxPage, "listbox-page");
get(mpListBoxColumn, "listbox-column");
@@ -117,7 +115,7 @@ ScPivotLayoutDialog::ScPivotLayoutDialog(
mpSourceEdit->SetReferences(this, mpSourceRadioSelection);
mpSourceButton->SetReferences(this, mpSourceEdit);
- aLink = LINK(this, ScPivotLayoutDialog, GetFocusHandler);
+ Link<Control&,void> aLink = LINK(this, ScPivotLayoutDialog, GetFocusHandler);
mpSourceEdit->SetGetFocusHdl(aLink);
mpSourceButton->SetGetFocusHdl(aLink);
@@ -655,31 +653,28 @@ IMPL_LINK_NOARG_TYPED( ScPivotLayoutDialog, CancelClicked, Button*, void )
Close();
}
-IMPL_LINK(ScPivotLayoutDialog, GetFocusHandler, Control*, pCtrl)
+IMPL_LINK_TYPED(ScPivotLayoutDialog, GetFocusHandler, Control&, rCtrl, void)
{
mpActiveEdit = NULL;
- if (pCtrl == static_cast<Control*>(mpSourceEdit) ||
- pCtrl == static_cast<Control*>(mpSourceButton))
+ if (&rCtrl == static_cast<Control*>(mpSourceEdit) ||
+ &rCtrl == static_cast<Control*>(mpSourceButton))
{
mpActiveEdit = mpSourceEdit;
}
- else if (pCtrl == static_cast<Control*>(mpDestinationEdit) ||
- pCtrl == static_cast<Control*>(mpDestinationButton))
+ else if (&rCtrl == static_cast<Control*>(mpDestinationEdit) ||
+ &rCtrl == static_cast<Control*>(mpDestinationButton))
{
mpActiveEdit = mpDestinationEdit;
}
if (mpActiveEdit)
mpActiveEdit->SetSelection(Selection(0, SELECTION_MAX));
-
- return 0;
}
-IMPL_LINK_NOARG(ScPivotLayoutDialog, LoseFocusHandler)
+IMPL_LINK_NOARG_TYPED(ScPivotLayoutDialog, LoseFocusHandler, Control&, void)
{
mbDialogLostFocus = !IsActive();
- return 0;
}
IMPL_LINK_NOARG(ScPivotLayoutDialog, SourceEditModified)
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 1977ee8d3425..ab3772cd7ec3 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -345,22 +345,21 @@ bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd )
// Handler:
-IMPL_LINK( ScConsolidateDlg, GetFocusHdl, Control*, pCtr )
+IMPL_LINK_TYPED( ScConsolidateDlg, GetFocusHdl, Control&, rControl, void )
{
- if ( pCtr ==static_cast<Control*>(pEdDataArea) ||
- pCtr ==static_cast<Control*>(pEdDestArea))
+ if ( &rControl ==static_cast<Control*>(pEdDataArea) ||
+ &rControl ==static_cast<Control*>(pEdDestArea))
{
- pRefInputEdit = static_cast<formula::RefEdit*>(pCtr);
+ pRefInputEdit = static_cast<formula::RefEdit*>(&rControl);
}
- else if(pCtr ==static_cast<Control*>(pLbDataArea) )
+ else if(&rControl ==static_cast<Control*>(pLbDataArea) )
{
pRefInputEdit = pEdDataArea;
}
- else if(pCtr ==static_cast<Control*>(pLbDestArea) )
+ else if(&rControl ==static_cast<Control*>(pLbDestArea) )
{
pRefInputEdit = pEdDestArea;
}
- return 0;
}
IMPL_LINK_NOARG_TYPED(ScConsolidateDlg, OkHdl, Button*, void)
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 2262955ce46e..ae2628455887 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -576,7 +576,7 @@ void ScTPValidationValue::RemoveRefDlg()
}
}
-IMPL_LINK_NOARG(ScTPValidationValue, EditSetFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScTPValidationValue, EditSetFocusHdl, Control&, void)
{
const sal_Int32 nPos = m_pLbAllow->GetSelectEntryPos();
@@ -584,12 +584,11 @@ IMPL_LINK_NOARG(ScTPValidationValue, EditSetFocusHdl)
{
SetupRefDlg();
}
-
- return 0;
}
-IMPL_LINK( ScTPValidationValue, KillFocusHdl, vcl::Window *, pWnd )
+IMPL_LINK_TYPED( ScTPValidationValue, KillFocusHdl, Control&, rControl, void )
{
+ vcl::Window* pWnd = static_cast<vcl::Window*>(&rControl);
if( pWnd == m_pRefEdit || pWnd == m_pBtnRef )
if( ScValidationDlg *pValidationDlg = GetValidationDlg() )
if ( (pValidationDlg->IsActive() || pValidationDlg->IsChildFocus() ) && !pValidationDlg->IsRefInputting() )
@@ -597,8 +596,6 @@ IMPL_LINK( ScTPValidationValue, KillFocusHdl, vcl::Window *, pWnd )
{
RemoveRefDlg();
}
-
- return 0;
}
IMPL_LINK_NOARG(ScTPValidationValue, SelectHdl)
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx
index a299d3fa0df0..e8aeaecb95d0 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -90,8 +90,8 @@ private:
DECL_LINK_TYPED(CancelClicked, Button*, void);
DECL_LINK_TYPED(OKClicked, Button*, void);
- DECL_LINK(GetFocusHandler, Control*);
- DECL_LINK(LoseFocusHandler, void*);
+ DECL_LINK_TYPED(GetFocusHandler, Control&, void);
+ DECL_LINK_TYPED(LoseFocusHandler, Control&, void);
DECL_LINK_TYPED(ToggleSource, RadioButton&, void);
DECL_LINK_TYPED(ToggleDestination, RadioButton&, void);
DECL_LINK(SourceEditModified, void*);
diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
index a588b503d727..b9d7934bd4f5 100644
--- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
+++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
@@ -73,8 +73,8 @@ private:
DECL_LINK_TYPED( OkClicked, Button*, void );
DECL_LINK_TYPED( CloseClicked, Button*, void );
DECL_LINK_TYPED( ApplyClicked, Button*, void );
- DECL_LINK( GetFocusHandler, Control* );
- DECL_LINK( LoseFocusHandler, void* );
+ DECL_LINK_TYPED( GetFocusHandler, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHandler, Control&, void );
DECL_LINK( InputRangeModified, void* );
DECL_LINK( Parameter1ValueModified, void* );
diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx
index 15b54d78279d..10507378f558 100644
--- a/sc/source/ui/inc/SamplingDialog.hxx
+++ b/sc/source/ui/inc/SamplingDialog.hxx
@@ -73,8 +73,8 @@ private:
ScRange PerformPeriodicSampling(ScDocShell* pDocShell);
DECL_LINK_TYPED( OkClicked, Button*, void );
- DECL_LINK( GetFocusHandler, Control* );
- DECL_LINK( LoseFocusHandler, void* );
+ DECL_LINK_TYPED( GetFocusHandler, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHandler, Control&, void );
DECL_LINK( SamplingSizeValueModified, void* );
DECL_LINK_TYPED( ToggleSamplingMethod, RadioButton&, void );
DECL_LINK( RefInputModifyHandler, void* );
diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
index 340e5fbdd550..21510d6cf884 100644
--- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
+++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
@@ -81,8 +81,8 @@ private:
DECL_LINK_TYPED( GroupByChanged, RadioButton&, void );
DECL_LINK_TYPED( OkClicked, Button*, void );
- DECL_LINK( GetFocusHandler, Control* );
- DECL_LINK( LoseFocusHandler, void* );
+ DECL_LINK_TYPED( GetFocusHandler, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHandler, Control&, void );
DECL_LINK( RefInputModifyHandler, void* );
};
diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
index 0a18619ab6ea..ebe8de00494d 100644
--- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
+++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
@@ -84,8 +84,8 @@ private:
DECL_LINK_TYPED( GroupByChanged, RadioButton&, void );
DECL_LINK_TYPED( OkClicked, Button*, void );
- DECL_LINK( GetFocusHandler, Control* );
- DECL_LINK( LoseFocusHandler, void* );
+ DECL_LINK_TYPED( GetFocusHandler, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHandler, Control&, void );
DECL_LINK( RefInputModifyHandler, void* );
};
diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx
index b48233e4e4c4..7b93cc8f46a8 100644
--- a/sc/source/ui/inc/areasdlg.hxx
+++ b/sc/source/ui/inc/areasdlg.hxx
@@ -76,7 +76,7 @@ private:
DECL_LINK( Impl_SelectHdl, ListBox* );
DECL_LINK( Impl_ModifyHdl, formula::RefEdit* );
DECL_LINK_TYPED( Impl_BtnHdl, Button*, void );
- DECL_LINK( Impl_GetFocusHdl, Control* );
+ DECL_LINK_TYPED( Impl_GetFocusHdl, Control&, void );
};
#endif
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index 62678a1efd89..bac7c365f590 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -148,7 +148,7 @@ public:
void InvalidateRefData();
DECL_LINK_TYPED( BtnPressedHdl, Button*, void );
- DECL_LINK( RangeGetFocusHdl, formula::RefEdit* );
+ DECL_LINK_TYPED( RangeGetFocusHdl, Control&, void );
};
#endif
diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx
index 2bdf95278847..e875010bfda9 100644
--- a/sc/source/ui/inc/consdlg.hxx
+++ b/sc/source/ui/inc/consdlg.hxx
@@ -93,7 +93,7 @@ private:
DECL_LINK_TYPED( OkHdl, Button*, void );
DECL_LINK_TYPED( ClickHdl, Button*, void );
- DECL_LINK( GetFocusHdl, Control* );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
DECL_LINK( ModifyHdl, formula::RefEdit* );
DECL_LINK( SelectHdl, ListBox* );
diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx
index a8f4a7174460..8e84a04daaea 100644
--- a/sc/source/ui/inc/crnrdlg.hxx
+++ b/sc/source/ui/inc/crnrdlg.hxx
@@ -86,8 +86,8 @@ private:
DECL_LINK_TYPED( ColClickHdl, Button*, void );
DECL_LINK_TYPED( RowClickHdl, Button*, void );
DECL_LINK( Range2DataModifyHdl, void * );
- DECL_LINK( GetFocusHdl, Control* );
- DECL_LINK( LoseFocusHdl, void* );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
};
#endif // INCLUDED_SC_SOURCE_UI_INC_CRNRDLG_HXX
diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx
index 94c3bfc55d9a..0cc9c6cd9911 100644
--- a/sc/source/ui/inc/namedefdlg.hxx
+++ b/sc/source/ui/inc/namedefdlg.hxx
@@ -67,7 +67,7 @@ private:
DECL_LINK_TYPED( CancelBtnHdl, Button*, void );
DECL_LINK_TYPED( AddBtnHdl, Button*, void );
DECL_LINK( NameModifyHdl, void* );
- DECL_LINK( AssignGetFocusHdl, void * );
+ DECL_LINK_TYPED( AssignGetFocusHdl, Control&, void );
protected:
virtual void RefInputDone( bool bForced = false ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx
index 9a8329ab00d1..332a0d7b0b0d 100644
--- a/sc/source/ui/inc/namedlg.hxx
+++ b/sc/source/ui/inc/namedlg.hxx
@@ -106,7 +106,7 @@ private:
DECL_LINK_TYPED( RemoveBtnHdl, Button*, void );
DECL_LINK( EdModifyHdl, void * );
DECL_LINK_TYPED( EdModifyCheckBoxHdl, CheckBox&, void );
- DECL_LINK( AssignGetFocusHdl, void * );
+ DECL_LINK_TYPED( AssignGetFocusHdl, Control&, void );
DECL_LINK_TYPED( SelectionChangedHdl_Impl, SvTreeListBox*, void );
DECL_LINK( ScopeChangedHdl, void* );
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 77062131d0c4..6bdb0dd1b64d 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -191,8 +191,8 @@ private:
DECL_LINK_TYPED( BtnHdl, Button*, void );
DECL_LINK_TYPED( DelBtnHdl, Button*, void );
- DECL_LINK( GetFocusHdl, Control* );
- DECL_LINK( LoseFocusHdl, void* );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
DECL_LINK_TYPED( ScrollHdl, ScrollBar*, void);
DECL_LINK_TYPED( CursorUpHdl, ScCursorRefEdit&, void );
DECL_LINK_TYPED( CursorDownHdl, ScCursorRefEdit&, void );
diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx
index f937d8fecaf3..828dbb2f1777 100644
--- a/sc/source/ui/inc/solvrdlg.hxx
+++ b/sc/source/ui/inc/solvrdlg.hxx
@@ -81,8 +81,8 @@ private:
void RaiseError( ScSolverErr eError );
DECL_LINK_TYPED( BtnHdl, Button*, void );
- DECL_LINK( GetFocusHdl, Control* );
- DECL_LINK( LoseFocusHdl, void* );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
};
#endif // INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX
diff --git a/sc/source/ui/inc/tabopdlg.hxx b/sc/source/ui/inc/tabopdlg.hxx
index fb1e1d2081a4..e9eac1f2e2a1 100644
--- a/sc/source/ui/inc/tabopdlg.hxx
+++ b/sc/source/ui/inc/tabopdlg.hxx
@@ -88,8 +88,8 @@ private:
void RaiseError( ScTabOpErr eError );
DECL_LINK_TYPED( BtnHdl, Button*, void );
- DECL_LINK( GetFocusHdl, Control* );
- DECL_LINK( LoseFocusHdl, void* );
+ DECL_LINK_TYPED( GetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
};
#endif // INCLUDED_SC_SOURCE_UI_INC_TABOPDLG_HXX
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index deb267368baa..0cc0371f8e33 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -37,7 +37,7 @@ private:
DECL_LINK(NumModifiedHdl, void *);
DECL_LINK( PrefixModifiedHdl, Edit* );
- DECL_LINK( PrefixEditOnFocusHdl, Edit* );
+ DECL_LINK_TYPED( PrefixEditOnFocusHdl, Control&, void );
private:
VclPtr<NumericField> m_pEdNSheets;
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 1024c7dcb878..35e5a70b9cf3 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -54,7 +54,7 @@ private:
DECL_LINK_TYPED( ButtonHdl, Button*, void );
DECL_LINK( SepModifyHdl, Edit* );
- DECL_LINK( SepEditOnFocusHdl, Edit* );
+ DECL_LINK_TYPED( SepEditOnFocusHdl, Control&, void );
private:
VclPtr<ListBox> mpLbFormulaSyntax;
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 00a66ac50927..9251a899771f 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -124,8 +124,8 @@ private:
OUString maStrList;
sal_Unicode mcFmlaSep; /// List separator in formulas.
- DECL_LINK(EditSetFocusHdl, void *);
- DECL_LINK( KillFocusHdl, vcl::Window *);
+ DECL_LINK_TYPED( EditSetFocusHdl, Control&, void );
+ DECL_LINK_TYPED( KillFocusHdl, Control&, void );
void OnClick( Button *pBtn );
VclPtr<formula::RefEdit> m_pRefEdit;
public:
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index 6c5e4f0aed33..b9e50fc41f46 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -94,7 +94,7 @@ private:
void CancelPressed();
void RefEditModified();
- DECL_LINK(GetFocusHdl, Control*);
+ DECL_LINK_TYPED(GetFocusHdl, Control&, void);
DECL_LINK_TYPED(BtnPressedHdl, Button*, void);
DECL_LINK_TYPED(TreeItemSelectHdl, SvTreeListBox*, void);
DECL_LINK(RefModifiedHdl, void*);
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 54faeabe0fab..5cd874c5e8f1 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -107,7 +107,7 @@ void ScColRowNameRangesDlg::Init()
pBtnRowHead->SetClickHdl ( LINK( this, ScColRowNameRangesDlg, RowClickHdl ) );
pEdAssign2->SetModifyHdl ( LINK( this, ScColRowNameRangesDlg, Range2DataModifyHdl ) );
- Link<> aLink = LINK( this, ScColRowNameRangesDlg, GetFocusHdl );
+ Link<Control&,void> aLink = LINK( this, ScColRowNameRangesDlg, GetFocusHdl );
pEdAssign->SetGetFocusHdl( aLink );
pRbAssign->SetGetFocusHdl( aLink );
pEdAssign2->SetGetFocusHdl( aLink );
@@ -802,25 +802,22 @@ IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, RowClickHdl, Button*, void)
}
}
-IMPL_LINK( ScColRowNameRangesDlg, GetFocusHdl, Control*, pCtrl )
+IMPL_LINK_TYPED( ScColRowNameRangesDlg, GetFocusHdl, Control&, rCtrl, void )
{
- if( (pCtrl == static_cast<Control*>(pEdAssign)) || (pCtrl == static_cast<Control*>(pRbAssign)) )
+ if( (&rCtrl == static_cast<Control*>(pEdAssign)) || (&rCtrl == static_cast<Control*>(pRbAssign)) )
pEdActive = pEdAssign;
- else if( (pCtrl == static_cast<Control*>(pEdAssign2)) || (pCtrl == static_cast<Control*>(pRbAssign2)) )
+ else if( (&rCtrl == static_cast<Control*>(pEdAssign2)) || (&rCtrl == static_cast<Control*>(pRbAssign2)) )
pEdActive = pEdAssign2;
else
pEdActive = NULL;
if( pEdActive )
pEdActive->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG(ScColRowNameRangesDlg, LoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, LoseFocusHdl, Control&, void)
{
bDlgLostFocus = !IsActive();
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index ace5271850ed..35286f880f73 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -376,7 +376,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
m_pBtnCancel->SetClickHdl( LINK( this, ScOptSolverDlg, BtnHdl ) );
m_pBtnSolve->SetClickHdl( LINK( this, ScOptSolverDlg, BtnHdl ) );
- Link<> aLink = LINK( this, ScOptSolverDlg, GetFocusHdl );
+ Link<Control&,void> aLink = LINK( this, ScOptSolverDlg, GetFocusHdl );
m_pEdObjectiveCell->SetGetFocusHdl( aLink );
m_pRBObjectiveCell->SetGetFocusHdl( aLink );
m_pEdTargetValue->SetGetFocusHdl( aLink );
@@ -641,39 +641,36 @@ IMPL_LINK_TYPED( ScOptSolverDlg, BtnHdl, Button*, pBtn, void )
}
}
-IMPL_LINK( ScOptSolverDlg, GetFocusHdl, Control*, pCtrl )
+IMPL_LINK_TYPED( ScOptSolverDlg, GetFocusHdl, Control&, rCtrl, void )
{
Edit* pEdit = NULL;
mpEdActive = NULL;
- if( pCtrl == m_pEdObjectiveCell || pCtrl == m_pRBObjectiveCell )
+ if( &rCtrl == m_pEdObjectiveCell || &rCtrl == m_pRBObjectiveCell )
pEdit = mpEdActive = m_pEdObjectiveCell;
- else if( pCtrl == m_pEdTargetValue || pCtrl == m_pRBTargetValue )
+ else if( &rCtrl == m_pEdTargetValue || &rCtrl == m_pRBTargetValue )
pEdit = mpEdActive = m_pEdTargetValue;
- else if( pCtrl == m_pEdVariableCells || pCtrl == m_pRBVariableCells )
+ else if( &rCtrl == m_pEdVariableCells || &rCtrl == m_pRBVariableCells )
pEdit = mpEdActive = m_pEdVariableCells;
for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow )
{
- if( pCtrl == mpLeftEdit[nRow] || pCtrl == mpLeftButton[nRow] )
+ if( &rCtrl == mpLeftEdit[nRow] || &rCtrl == mpLeftButton[nRow] )
pEdit = mpEdActive = mpLeftEdit[nRow].get();
- else if( pCtrl == mpRightEdit[nRow] || pCtrl == mpRightButton[nRow] )
+ else if( &rCtrl == mpRightEdit[nRow] || &rCtrl == mpRightButton[nRow] )
pEdit = mpEdActive = mpRightEdit[nRow].get();
- else if( pCtrl == mpOperator[nRow] ) // focus on "operator" list box
+ else if( &rCtrl == mpOperator[nRow] ) // focus on "operator" list box
mpEdActive = mpRightEdit[nRow].get(); // use right edit for ref input, but don't change selection
}
- if( pCtrl == m_pRbValue ) // focus on "Value of" radio button
+ if( &rCtrl == m_pRbValue ) // focus on "Value of" radio button
mpEdActive = m_pEdTargetValue; // use value edit for ref input, but don't change selection
if( pEdit )
pEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG(ScOptSolverDlg, LoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScOptSolverDlg, LoseFocusHdl, Control&, void)
{
mbDlgLostFocus = !IsActive();
- return 0;
}
IMPL_LINK_TYPED( ScOptSolverDlg, DelBtnHdl, Button*, pBtn, void )
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index ff37302b9658..bf775e7233de 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -96,7 +96,7 @@ void ScSolverDlg::Init()
m_pBtnOk->SetClickHdl( LINK( this, ScSolverDlg, BtnHdl ) );
m_pBtnCancel->SetClickHdl( LINK( this, ScSolverDlg, BtnHdl ) );
- Link<> aLink = LINK( this, ScSolverDlg, GetFocusHdl );
+ Link<Control&,void> aLink = LINK( this, ScSolverDlg, GetFocusHdl );
m_pEdFormulaCell->SetGetFocusHdl( aLink );
m_pRBFormulaCell->SetGetFocusHdl( aLink );
m_pEdVariableCell->SetGetFocusHdl( aLink );
@@ -255,28 +255,25 @@ IMPL_LINK_TYPED( ScSolverDlg, BtnHdl, Button*, pBtn, void )
}
}
-IMPL_LINK( ScSolverDlg, GetFocusHdl, Control*, pCtrl )
+IMPL_LINK_TYPED( ScSolverDlg, GetFocusHdl, Control&, rCtrl, void )
{
Edit* pEdit = NULL;
pEdActive = NULL;
- if( (pCtrl == static_cast<Control*>(m_pEdFormulaCell)) || (pCtrl == static_cast<Control*>(m_pRBFormulaCell)) )
+ if( (&rCtrl == static_cast<Control*>(m_pEdFormulaCell)) || (&rCtrl == static_cast<Control*>(m_pRBFormulaCell)) )
pEdit = pEdActive = m_pEdFormulaCell;
- else if( (pCtrl == static_cast<Control*>(m_pEdVariableCell)) || (pCtrl == static_cast<Control*>(m_pRBVariableCell)) )
+ else if( (&rCtrl == static_cast<Control*>(m_pEdVariableCell)) || (&rCtrl == static_cast<Control*>(m_pRBVariableCell)) )
pEdit = pEdActive = m_pEdVariableCell;
- else if( pCtrl == static_cast<Control*>(m_pEdTargetVal) )
+ else if( &rCtrl == static_cast<Control*>(m_pEdTargetVal) )
pEdit = m_pEdTargetVal;
if( pEdit )
pEdit->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG(ScSolverDlg, LoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScSolverDlg, LoseFocusHdl, Control&, void)
{
bDlgLostFocus = !IsActive();
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index dd74ab0e431a..50d46e222422 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -103,7 +103,7 @@ void ScTabOpDlg::Init()
m_pBtnOk->SetClickHdl ( LINK( this, ScTabOpDlg, BtnHdl ) );
m_pBtnCancel->SetClickHdl ( LINK( this, ScTabOpDlg, BtnHdl ) );
- Link<> aLink = LINK( this, ScTabOpDlg, GetFocusHdl );
+ Link<Control&,void> aLink = LINK( this, ScTabOpDlg, GetFocusHdl );
m_pEdFormulaRange->SetGetFocusHdl( aLink );
m_pRBFormulaRange->SetGetFocusHdl( aLink );
m_pEdRowCell->SetGetFocusHdl( aLink );
@@ -322,27 +322,24 @@ IMPL_LINK_TYPED( ScTabOpDlg, BtnHdl, Button*, pBtn, void )
Close();
}
-IMPL_LINK( ScTabOpDlg, GetFocusHdl, Control*, pCtrl )
+IMPL_LINK_TYPED( ScTabOpDlg, GetFocusHdl, Control&, rCtrl, void )
{
- if( (pCtrl == static_cast<Control*>(m_pEdFormulaRange)) || (pCtrl == static_cast<Control*>(m_pRBFormulaRange)) )
+ if( (&rCtrl == static_cast<Control*>(m_pEdFormulaRange)) || (&rCtrl == static_cast<Control*>(m_pRBFormulaRange)) )
pEdActive = m_pEdFormulaRange;
- else if( (pCtrl == static_cast<Control*>(m_pEdRowCell)) || (pCtrl == static_cast<Control*>(m_pRBRowCell)) )
+ else if( (&rCtrl == static_cast<Control*>(m_pEdRowCell)) || (&rCtrl == static_cast<Control*>(m_pRBRowCell)) )
pEdActive = m_pEdRowCell;
- else if( (pCtrl == static_cast<Control*>(m_pEdColCell)) || (pCtrl == static_cast<Control*>(m_pRBColCell)) )
+ else if( (&rCtrl == static_cast<Control*>(m_pEdColCell)) || (&rCtrl == static_cast<Control*>(m_pRBColCell)) )
pEdActive = m_pEdColCell;
else
pEdActive = NULL;
if( pEdActive )
pEdActive->SetSelection( Selection( 0, SELECTION_MAX ) );
-
- return 0;
}
-IMPL_LINK_NOARG(ScTabOpDlg, LoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScTabOpDlg, LoseFocusHdl, Control&, void)
{
bDlgLostFocus = !IsActive();
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index 9eafd5f40209..ac516d4a1390 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -343,10 +343,9 @@ IMPL_LINK_NOARG(ScNameDefDlg, NameModifyHdl)
return 0;
}
-IMPL_LINK_NOARG(ScNameDefDlg, AssignGetFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScNameDefDlg, AssignGetFocusHdl, Control&, void)
{
IsNameValid();
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 1a103ede8c0c..be5178409d9f 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -514,10 +514,9 @@ IMPL_LINK_NOARG(ScNameDlg, EdModifyHdl)
return 0;
}
-IMPL_LINK_NOARG(ScNameDlg, AssignGetFocusHdl)
+IMPL_LINK_NOARG_TYPED(ScNameDlg, AssignGetFocusHdl, Control&, void)
{
EdModifyHdl(m_pEdAssign);
- return 0;
}
IMPL_LINK_NOARG_TYPED(ScNameDlg, SelectionChangedHdl_Impl, SvTreeListBox*, void)
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index a2929f77eb3a..ceb39672d224 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -134,10 +134,9 @@ IMPL_LINK( ScTpDefaultsOptions, PrefixModifiedHdl, Edit*, pEdit )
return 0;
}
-IMPL_LINK( ScTpDefaultsOptions, PrefixEditOnFocusHdl, Edit*, pEdit )
+IMPL_LINK_TYPED( ScTpDefaultsOptions, PrefixEditOnFocusHdl, Control&, rControl, void )
{
- OnFocusPrefixInput(pEdit);
- return 0;
+ OnFocusPrefixInput(static_cast<Edit*>(&rControl));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 7201fb855306..c78e1afa8845 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -69,10 +69,10 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r
mpEdSepArrayCol->SetModifyHdl(aLink);
mpEdSepArrayRow->SetModifyHdl(aLink);
- aLink = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl );
- mpEdSepFuncArg->SetGetFocusHdl(aLink);
- mpEdSepArrayCol->SetGetFocusHdl(aLink);
- mpEdSepArrayRow->SetGetFocusHdl(aLink);
+ Link<Control&,void> aLink3 = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl );
+ mpEdSepFuncArg->SetGetFocusHdl(aLink3);
+ mpEdSepArrayCol->SetGetFocusHdl(aLink3);
+ mpEdSepArrayRow->SetGetFocusHdl(aLink3);
// Get the decimal separator for current locale.
OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
@@ -229,10 +229,9 @@ IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, Edit*, pEdit )
return 0;
}
-IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit )
+IMPL_LINK_TYPED( ScTpFormulaOptions, SepEditOnFocusHdl, Control&, rControl, void )
{
- OnFocusSeparatorInput(pEdit);
- return 0;
+ OnFocusSeparatorInput(static_cast<Edit*>(&rControl));
}
VclPtr<SfxTabPage> ScTpFormulaOptions::Create(vcl::Window* pParent, const SfxItemSet* rCoreSet)
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index 3b20cd717f20..9db2934591f8 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -517,28 +517,26 @@ IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_BtnHdl, Button*, pBtn, void )
Close();
}
-IMPL_LINK( ScPrintAreasDlg, Impl_GetFocusHdl, Control*, pCtr )
+IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_GetFocusHdl, Control&, rCtrl, void )
{
- if ( pCtr ==static_cast<Control *>(pEdPrintArea) ||
- pCtr ==static_cast<Control *>(pEdRepeatRow) ||
- pCtr ==static_cast<Control *>(pEdRepeatCol))
+ if ( &rCtrl ==static_cast<Control *>(pEdPrintArea) ||
+ &rCtrl ==static_cast<Control *>(pEdRepeatRow) ||
+ &rCtrl ==static_cast<Control *>(pEdRepeatCol))
{
- pRefInputEdit = static_cast<formula::RefEdit*>(pCtr);
+ pRefInputEdit = static_cast<formula::RefEdit*>(&rCtrl);
}
- else if ( pCtr ==static_cast<Control *>(pLbPrintArea))
+ else if ( &rCtrl ==static_cast<Control *>(pLbPrintArea))
{
pRefInputEdit = pEdPrintArea;
}
- else if ( pCtr ==static_cast<Control *>(pLbRepeatRow))
+ else if ( &rCtrl ==static_cast<Control *>(pLbRepeatRow))
{
pRefInputEdit = pEdRepeatRow;
}
- else if ( pCtr ==static_cast<Control *>(pLbRepeatCol))
+ else if ( &rCtrl ==static_cast<Control *>(pLbRepeatCol))
{
pRefInputEdit = pEdRepeatCol;
}
-
- return 0;
}
IMPL_LINK( ScPrintAreasDlg, Impl_SelectHdl, ListBox*, pLb )
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index deb99aa3dab3..e5e8379d54f9 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -99,13 +99,13 @@ ScXMLSourceDlg::ScXMLSourceDlg(
mpBtnOk->SetClickHdl(aBtnHdl);
mpBtnCancel->SetClickHdl(aBtnHdl);
- Link<> aLink = LINK(this, ScXMLSourceDlg, GetFocusHdl);
- mpRefEdit->SetGetFocusHdl(aLink);
- mpRefBtn->SetGetFocusHdl(aLink);
+ Link<Control&,void> aLink2 = LINK(this, ScXMLSourceDlg, GetFocusHdl);
+ mpRefEdit->SetGetFocusHdl(aLink2);
+ mpRefBtn->SetGetFocusHdl(aLink2);
mpLbTree->SetSelectHdl(LINK(this, ScXMLSourceDlg, TreeItemSelectHdl));
- aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl);
+ Link<> aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl);
mpRefEdit->SetModifyHdl(aLink);
mpBtnOk->Disable();
@@ -662,10 +662,9 @@ void ScXMLSourceDlg::RefEditModified()
mpBtnOk->Enable(bHasLink);
}
-IMPL_LINK(ScXMLSourceDlg, GetFocusHdl, Control*, pCtrl)
+IMPL_LINK_TYPED(ScXMLSourceDlg, GetFocusHdl, Control&, rCtrl, void)
{
- HandleGetFocus(pCtrl);
- return 0;
+ HandleGetFocus(&rCtrl);
}
IMPL_LINK_TYPED(ScXMLSourceDlg, BtnPressedHdl, Button*, pBtn, void)
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 7ed705198b6f..2ca2a22a256c 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -467,7 +467,7 @@ void SdTPAction::OpenFileDialog()
SetEditText( aFile );
}
if( bDocument )
- CheckFileHdl( NULL );
+ CheckFileHdl( *m_pEdtDocument );
}
}
}
@@ -621,7 +621,7 @@ IMPL_LINK_NOARG(SdTPAction, ClickActionHdl)
m_pFtTree->SetText( SD_RESSTR( STR_EFFECTDLG_JUMP ) );
m_pFrame->set_label( SD_RESSTR( STR_EFFECTDLG_DOCUMENT ) );
- CheckFileHdl( NULL );
+ CheckFileHdl( *m_pEdtDocument );
break;
case presentation::ClickAction_VERB:
@@ -656,7 +656,7 @@ IMPL_LINK_NOARG_TYPED(SdTPAction, SelectTreeHdl, SvTreeListBox*, void)
m_pEdtBookmark->SetText( m_pLbTree->GetSelectEntry() );
}
-IMPL_LINK_NOARG(SdTPAction, CheckFileHdl)
+IMPL_LINK_NOARG_TYPED(SdTPAction, CheckFileHdl, Control&, void)
{
OUString aFile( GetEditText() );
@@ -700,8 +700,6 @@ IMPL_LINK_NOARG(SdTPAction, CheckFileHdl)
else
m_pLbTreeDocument->Hide();
}
-
- return 0L;
}
presentation::ClickAction SdTPAction::GetActualClickAction()
diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx
index 72eec7ece054..05b504e6ea60 100644
--- a/sd/source/ui/inc/tpaction.hxx
+++ b/sd/source/ui/inc/tpaction.hxx
@@ -82,7 +82,7 @@ private:
DECL_LINK_TYPED( ClickSearchHdl, Button*, void );
DECL_LINK( ClickActionHdl, void * );
DECL_LINK_TYPED( SelectTreeHdl, SvTreeListBox*, void );
- DECL_LINK( CheckFileHdl, void * );
+ DECL_LINK_TYPED( CheckFileHdl, Control&, void );
void UpdateTree();
void OpenFileDialog();
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 2bb0e711e7b0..8f6e8211f94d 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1569,31 +1569,23 @@ IMPL_LINK_TYPED( CustomPropertiesWindow, RemoveHdl, Button*, pBtn, void )
m_aRemovedHdl.Call(0);
}
-IMPL_LINK( CustomPropertiesWindow, EditLoseFocusHdl, CustomPropertiesEdit*, pEdit )
+IMPL_LINK_TYPED( CustomPropertiesWindow, EditLoseFocusHdl, Control&, rControl, void )
{
- if ( pEdit )
+ CustomPropertiesEdit* pEdit = static_cast<CustomPropertiesEdit*>(&rControl);
+ CustomPropertyLine* pLine = pEdit->GetLine();
+ if ( !pLine->m_bTypeLostFocus )
{
- CustomPropertyLine* pLine = pEdit->GetLine();
- if ( !pLine->m_bTypeLostFocus )
- {
- m_pCurrentLine = pLine;
- m_aEditLoseFocusIdle.Start();
- }
- else
- pLine->m_bTypeLostFocus = false;
+ m_pCurrentLine = pLine;
+ m_aEditLoseFocusIdle.Start();
}
- return 0;
+ else
+ pLine->m_bTypeLostFocus = false;
}
-IMPL_LINK( CustomPropertiesWindow, BoxLoseFocusHdl, CustomPropertiesTypeBox*, pBox )
+IMPL_LINK_TYPED( CustomPropertiesWindow, BoxLoseFocusHdl, Control&, rControl, void )
{
- if ( pBox )
- {
- m_pCurrentLine = pBox->GetLine();
- m_aBoxLoseFocusIdle.Start();
- }
-
- return 0;
+ m_pCurrentLine = static_cast<CustomPropertiesTypeBox*>(&rControl)->GetLine();
+ m_aBoxLoseFocusIdle.Start();
}
IMPL_LINK_NOARG_TYPED(CustomPropertiesWindow, EditTimeoutHdl, Idle *, void)
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index b97ac2df97cc..425cf984dbda 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -256,8 +256,8 @@ SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
void SfxManageStyleSheetPage::dispose()
{
- m_pNameRw->SetGetFocusHdl( Link<>() );
- m_pNameRw->SetLoseFocusHdl( Link<>() );
+ m_pNameRw->SetGetFocusHdl( Link<Control&,void>() );
+ m_pNameRw->SetLoseFocusHdl( Link<Control&,void>() );
delete pFamilies;
pItem = 0;
pStyle = 0;
@@ -414,7 +414,7 @@ bool SfxManageStyleSheetPage::Execute_Impl(
}
-IMPL_LINK( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
+IMPL_LINK_TYPED( SfxManageStyleSheetPage, GetFocusHdl, Control&, rControl, void )
/* [Description]
@@ -422,11 +422,11 @@ IMPL_LINK( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
*/
{
+ Edit* pEdit = static_cast<Edit*>(&rControl);
aBuf = comphelper::string::stripStart(pEdit->GetText(), ' ');
- return 0;
}
-IMPL_LINK( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
+IMPL_LINK_TYPED( SfxManageStyleSheetPage, LoseFocusHdl, Control&, rControl, void )
/* [Description]
@@ -436,12 +436,12 @@ IMPL_LINK( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
*/
{
+ Edit* pEdit = static_cast<Edit*>(&rControl);
const OUString aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
pEdit->SetText( aStr );
// Update the Listbox of the base template if possible
if ( aStr != aBuf )
UpdateName_Impl(m_pFollowLb, aStr);
- return 0;
}
bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet )
@@ -622,7 +622,7 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet
{
// By pressing <Enter> LoseFocus() is not trigged through StarView
if ( m_pNameRw->HasFocus() )
- LoseFocusHdl( m_pNameRw );
+ LoseFocusHdl( *m_pNameRw );
if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
{
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index 9e09118bc91e..d09aabe38042 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -222,7 +222,7 @@ class SmDistanceDialog : public ModalDialog
sal_uInt16 nActiveCategory;
bool bScaleAllBrackets;
- DECL_LINK(GetFocusHdl, Control *);
+ DECL_LINK_TYPED(GetFocusHdl, Control&, void);
DECL_LINK_TYPED(MenuSelectHdl, Menu *, bool);
DECL_LINK_TYPED(DefaultButtonClickHdl, Button *, void);
DECL_LINK_TYPED(CheckBoxClickHdl, Button *, void);
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index ff8ed3a060bf..8ada350c6309 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -689,25 +689,24 @@ SmCategoryDesc::~SmCategoryDesc()
/**************************************************************************/
-IMPL_LINK( SmDistanceDialog, GetFocusHdl, Control *, pControl )
+IMPL_LINK_TYPED( SmDistanceDialog, GetFocusHdl, Control&, rControl, void )
{
if (Categories[nActiveCategory])
{
sal_uInt16 i;
- if (pControl == m_pMetricField1)
+ if (&rControl == m_pMetricField1)
i = 0;
- else if (pControl == m_pMetricField2)
+ else if (&rControl == m_pMetricField2)
i = 1;
- else if (pControl == m_pMetricField3)
+ else if (&rControl == m_pMetricField3)
i = 2;
- else if (pControl == m_pMetricField4)
+ else if (&rControl == m_pMetricField4)
i = 3;
else
- return 0;
+ return;
m_pBitmap->SetImage(*(Categories[nActiveCategory]->GetGraphic(i)));
}
- return 0;
}
IMPL_LINK_TYPED( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu, bool )
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index b39546f6cce5..40a4a4eefcb3 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -1131,16 +1131,16 @@ void AssignmentPersistentData::ImplCommit()
}
- IMPL_STATIC_LINK(
- AddressBookSourceDialog, OnComboGetFocus, ComboBox*, _pBox)
+ IMPL_STATIC_LINK_TYPED(
+ AddressBookSourceDialog, OnComboGetFocus, Control&, _rBox, void)
{
- _pBox->SaveValue();
- return 0L;
+ static_cast<ComboBox&>(_rBox).SaveValue();
}
- IMPL_LINK(AddressBookSourceDialog, OnComboLoseFocus, ComboBox*, _pBox)
+ IMPL_LINK_TYPED(AddressBookSourceDialog, OnComboLoseFocus, Control&, rControl, void)
{
+ ComboBox* _pBox = static_cast<ComboBox*>(&rControl);
if ( _pBox->IsValueChangedFromSaved() )
{
if (_pBox == m_pDatasource)
@@ -1148,7 +1148,6 @@ void AssignmentPersistentData::ImplCommit()
else
resetFields();
}
- return 0L;
}
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 739c1c7dba3a..2b3e3f99a0d6 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -174,7 +174,7 @@ public:
DECL_LINK_TYPED( PipetteHdl, ToolBox*, void );
DECL_LINK_TYPED( CbxHdl, Button*, void);
DECL_LINK_TYPED( CbxTransHdl, Button*, void );
- DECL_LINK( FocusLbHdl, ColorLB* );
+ DECL_LINK_TYPED( FocusLbHdl, Control&, void );
DECL_LINK_TYPED(ExecHdl, Button*, void);
};
@@ -295,15 +295,14 @@ IMPL_LINK_TYPED( MaskData, CbxTransHdl, Button*, pButton, void )
-IMPL_LINK( MaskData, FocusLbHdl, ColorLB*, pLb )
+IMPL_LINK_TYPED( MaskData, FocusLbHdl, Control&, rControl, void )
{
+ ColorLB* pLb = static_cast<ColorLB*>(&rControl);
// MT: bFireFox as API parameter is ugly, find better solution????
pMask->m_pQSet1->SelectItem( pLb == pMask->m_pLbColor1 ? 1 : 0 /* , false */ );
pMask->m_pQSet2->SelectItem( pLb == pMask->m_pLbColor2 ? 1 : 0 /* , false */ );
pMask->m_pQSet3->SelectItem( pLb == pMask->m_pLbColor3 ? 1 : 0 /* , false */ );
pMask->m_pQSet4->SelectItem( pLb == pMask->m_pLbColor4 ? 1 : 0 /* , false */ );
-
- return 0;
}
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index 8d127e518dd3..66ef7d827dd4 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -394,10 +394,14 @@ void DialControl::SetLinkedField( NumericField* pField, sal_Int32 nDecimalPlaces
// remove modify handler from old linked field
ImplSetFieldLink( Link<>() );
+ if( mpImpl->mpLinkField )
+ mpImpl->mpLinkField->SetLoseFocusHdl( Link<Control&,void>() );
// remember the new linked field
mpImpl->mpLinkField = pField;
// set modify handler at new linked field
ImplSetFieldLink( LINK( this, DialControl, LinkedFieldModifyHdl ) );
+ if( mpImpl->mpLinkField )
+ mpImpl->mpLinkField->SetLoseFocusHdl( LINK( this, DialControl, LinkedFieldFocusHdl ) );
}
void DialControl::SaveValue()
@@ -472,7 +476,6 @@ void DialControl::ImplSetFieldLink( const Link<>& rLink )
rField.SetDownHdl( rLink );
rField.SetFirstHdl( rLink );
rField.SetLastHdl( rLink );
- rField.SetLoseFocusHdl( rLink );
}
}
@@ -506,12 +509,20 @@ void DialControl::HandleEscapeEvent()
}
}
-IMPL_LINK( DialControl, LinkedFieldModifyHdl, NumericField*, pField )
+IMPL_LINK( DialControl, LinkedFieldModifyHdl, NumericField*, /*pField*/ )
{
- if( pField )
- SetRotation( static_cast< sal_Int32 >( pField->GetValue() * mpImpl->mnLinkedFieldValueMultiplyer ), false );
+ LinkedFieldModifyHdl();
return 0;
}
+IMPL_LINK_NOARG_TYPED( DialControl, LinkedFieldFocusHdl, Control&, void )
+{
+ LinkedFieldModifyHdl();
+}
+void DialControl::LinkedFieldModifyHdl()
+{
+ if( mpImpl->mpLinkField )
+ SetRotation( static_cast< sal_Int32 >( mpImpl->mpLinkField->GetValue() * mpImpl->mnLinkedFieldValueMultiplyer ), false );
+}
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index f66382d9478c..65326c07a7e2 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -489,15 +489,15 @@ void SvxHFPage::InitHandler()
{
m_pTurnOnBox->SetClickHdl(LINK(this, SvxHFPage, TurnOnHdl));
m_pDistEdit->SetModifyHdl(LINK(this, SvxHFPage, DistModify));
- m_pDistEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeHdl));
+ m_pDistEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeFocusHdl));
m_pHeightEdit->SetModifyHdl(LINK(this, SvxHFPage, HeightModify));
- m_pHeightEdit->SetLoseFocusHdl(LINK(this,SvxHFPage,RangeHdl));
+ m_pHeightEdit->SetLoseFocusHdl(LINK(this,SvxHFPage,RangeFocusHdl));
m_pLMEdit->SetModifyHdl(LINK(this, SvxHFPage, BorderModify));
- m_pLMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeHdl));
+ m_pLMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeFocusHdl));
m_pRMEdit->SetModifyHdl(LINK(this, SvxHFPage, BorderModify));
- m_pRMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeHdl));
+ m_pRMEdit->SetLoseFocusHdl(LINK(this, SvxHFPage, RangeFocusHdl));
m_pBackgroundBtn->SetClickHdl(LINK(this,SvxHFPage, BackgroundHdl));
}
@@ -1062,6 +1062,15 @@ SfxTabPage::sfxpg SvxHFPage::DeactivatePage( SfxItemSet* _pSet )
IMPL_LINK_NOARG(SvxHFPage, RangeHdl)
{
+ RangeHdl();
+ return 0;
+}
+IMPL_LINK_NOARG_TYPED(SvxHFPage, RangeFocusHdl, Control&, void)
+{
+ RangeHdl();
+}
+void SvxHFPage::RangeHdl()
+{
long nHHeight = m_pBspWin->GetHdHeight();
long nHDist = m_pBspWin->GetHdDist();
@@ -1130,7 +1139,6 @@ IMPL_LINK_NOARG(SvxHFPage, RangeHdl)
nMax = nW - nBL - nBR -
static_cast<long>(m_pLMEdit->Denormalize( m_pLMEdit->GetValue( FUNIT_TWIP ) )) - MINBODY;
m_pRMEdit->SetMax( m_pLMEdit->Normalize( nMax ), FUNIT_TWIP );
- return 0;
}
static void lcl_Move(vcl::Window& rWin, sal_Int32 nDiff)
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 686a75997a48..751e40a4229e 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -345,7 +345,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
if(nNewItemId == mnApplyId)
{
- URLLoseFocusHdl( NULL );
+ URLLoseFocusHdl( *m_pURLBox );
SfxBoolItem aBoolItem( SID_IMAP_EXEC, true );
GetBindings().GetDispatcher()->Execute(
SID_IMAP_EXEC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aBoolItem, 0L );
@@ -408,7 +408,7 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
}
else if(nNewItemId == mnActiveId)
{
- URLLoseFocusHdl( NULL );
+ URLLoseFocusHdl( *m_pURLBox );
bool bNewState = !pTbx->IsItemChecked( TBI_ACTIVE );
pTbx->CheckItem( TBI_ACTIVE, bNewState );
pIMapWnd->SetCurrentObjState( !bNewState );
@@ -441,12 +441,12 @@ IMPL_LINK_TYPED( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
}
else if(nNewItemId == mnUndoId)
{
- URLLoseFocusHdl( NULL );
+ URLLoseFocusHdl( *m_pURLBox );
pIMapWnd->GetSdrModel()->Undo();
}
else if(nNewItemId == mnRedoId)
{
- URLLoseFocusHdl( NULL );
+ URLLoseFocusHdl( *m_pURLBox );
pIMapWnd->GetSdrModel()->Redo();
}
}
@@ -695,7 +695,7 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLModifyHdl)
return 0;
}
-IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl)
+IMPL_LINK_NOARG_TYPED(SvxIMapDlg, URLLoseFocusHdl, Control&, void)
{
NotifyInfo aNewInfo;
const OUString aURLText( m_pURLBox->GetText() );
@@ -719,8 +719,6 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl)
aNewInfo.aMarkTarget = aTargetText;
pIMapWnd->ReplaceActualIMapInfo( aNewInfo );
-
- return 0;
}
IMPL_LINK_NOARG_TYPED(SvxIMapDlg, UpdateHdl, Idle *, void)
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index a904015c7576..85028fce0e8f 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -632,7 +632,7 @@ void SvxSearchDialog::InitControls_Impl()
m_pSearchLB->SetModifyHdl( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) );
m_pReplaceLB->SetModifyHdl( LINK( this, SvxSearchDialog, ModifyHdl_Impl ) );
- Link<> aLink = LINK( this, SvxSearchDialog, FocusHdl_Impl );
+ Link<Control&,void> aLink = LINK( this, SvxSearchDialog, FocusHdl_Impl );
m_pSearchLB->SetGetFocusHdl( aLink );
m_pReplaceLB->SetGetFocusHdl( aLink );
@@ -992,7 +992,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
bDisableSearch = m_pSearchLB->GetText().isEmpty() &&
m_pSearchAttrText->GetText().isEmpty();
}
- FocusHdl_Impl(m_pSearchLB);
+ FocusHdl_Impl(*m_pSearchLB);
if ( bDisableSearch )
{
@@ -1511,7 +1511,7 @@ IMPL_LINK_NOARG_TYPED(SvxSearchDialog, TemplateHdl_Impl, Button*, void)
EnableControl_Impl(m_pAttributeBtn);
EnableControl_Impl(m_pSimilarityBox);
- FocusHdl_Impl( bSearch ? m_pSearchLB : m_pReplaceLB );
+ FocusHdl_Impl( bSearch ? *m_pSearchLB : *m_pReplaceLB );
}
bSet = true;
pImpl->bSaveToModule = false;
@@ -1809,10 +1809,10 @@ void SvxSearchDialog::SetItem_Impl( const SvxSearchItem* pItem )
-IMPL_LINK( SvxSearchDialog, FocusHdl_Impl, Control *, pCtrl )
+IMPL_LINK_TYPED( SvxSearchDialog, FocusHdl_Impl, Control&, rControl, void )
{
sal_Int32 nTxtLen = m_pSearchAttrText->GetText().getLength();
-
+ Control* pCtrl = &rControl;
if ( pCtrl == m_pSearchLB )
{
if ( pCtrl->HasChildPathFocus() )
@@ -1865,15 +1865,13 @@ IMPL_LINK( SvxSearchDialog, FocusHdl_Impl, Control *, pCtrl )
m_pLayoutBtn->SetText(aStylesStr);
}
}
- return 0;
}
-IMPL_LINK_NOARG(SvxSearchDialog, LoseFocusHdl_Impl)
+IMPL_LINK_NOARG_TYPED(SvxSearchDialog, LoseFocusHdl_Impl, Control&, void)
{
SaveToModule_Impl();
- return 0;
}
@@ -2127,12 +2125,12 @@ void SvxSearchDialog::PaintAttrText_Impl()
if ( bSearch )
{
m_pSearchAttrText->SetText( aDesc );
- FocusHdl_Impl(m_pSearchLB);
+ FocusHdl_Impl(*m_pSearchLB);
}
else
{
m_pReplaceAttrText->SetText( aDesc );
- FocusHdl_Impl(m_pReplaceLB);
+ FocusHdl_Impl(*m_pReplaceLB);
}
}
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 519bec7b39bc..4b672fb64f51 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -588,7 +588,7 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent,
pListBox ->SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
pLabelBox ->SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
pIdxBox ->SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
- Link<> aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
+ Link<Control&,void> aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
pStandardBox->SetLoseFocusHdl( aFocusLink );
pTitleBox ->SetLoseFocusHdl( aFocusLink );
pListBox ->SetLoseFocusHdl( aFocusLink );
@@ -1061,8 +1061,9 @@ IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox )
return 0;
}
-IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
+IMPL_LINK_TYPED( SwStdFontTabPage, LoseFocusHdl, Control&, rControl, void )
{
+ ComboBox* pBox = static_cast<ComboBox*>(&rControl);
FontSizeBox* pHeightLB = 0;
const OUString sEntry = pBox->GetText();
if(pBox == pStandardBox)
@@ -1087,7 +1088,6 @@ IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
}
vcl::FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) );
pHeightLB->Fill( &aFontInfo, pFontList );
- return 0;
}
void SwStdFontTabPage::PageCreated( const SfxAllItemSet& aSet)
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 6501cae53220..ca48c63f8e5d 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -60,7 +60,7 @@ class SwAddressControl_Impl : public Control
bool m_bNoDataSet;
DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void);
- DECL_LINK(GotFocusHdl_Impl, Edit*);
+ DECL_LINK_TYPED(GotFocusHdl_Impl, Control&, void);
DECL_LINK(EditModifyHdl_Impl, Edit*);
void MakeVisible(const Rectangle& aRect);
@@ -173,7 +173,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MAP_APPFONT).Height();
long nFTYPos = nEDYPos + nEDHeight - nFTHeight;
- Link<> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl);
+ Link<Control&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl);
Link<> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl);
Edit* pLastEdit = 0;
sal_Int32 nVisibleLines = 0;
@@ -267,14 +267,14 @@ IMPL_LINK_TYPED(SwAddressControl_Impl, ScrollHdl_Impl, ScrollBar*, pScroll, void
m_pWindow->SetPosPixel(Point(0, - (m_nLineHeight * nThumb)));
}
-IMPL_LINK(SwAddressControl_Impl, GotFocusHdl_Impl, Edit*, pEdit)
+IMPL_LINK_TYPED(SwAddressControl_Impl, GotFocusHdl_Impl, Control&, rControl, void)
{
+ Edit* pEdit = static_cast<Edit*>(&rControl);
if(GetFocusFlags::Tab & pEdit->GetGetFocusFlags())
{
Rectangle aRect(pEdit->GetPosPixel(), pEdit->GetSizePixel());
MakeVisible(aRect);
}
- return 0;
}
void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect)
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 199617a7512c..d8387c1f8284 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -811,7 +811,7 @@ class SwAssignFieldsControl : public Control
DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void);
DECL_LINK(MatchHdl_Impl, ListBox*);
- DECL_LINK(GotFocusHdl_Impl, ListBox*);
+ DECL_LINK_TYPED(GotFocusHdl_Impl, Control&, void);
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
@@ -882,7 +882,7 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
//if no assignment is available an empty sequence will be returned
uno::Sequence< OUString> aAssignments = rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() );
Link<> aMatchHdl = LINK(this, SwAssignFieldsControl, MatchHdl_Impl);
- Link<> aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl);
+ Link<Control&,void> aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl);
//fill the controls
long nControlWidth = aOutputSize.Width() / 3;
@@ -1133,8 +1133,9 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
return 0;
}
-IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
+IMPL_LINK_TYPED(SwAssignFieldsControl, GotFocusHdl_Impl, Control&, rControl, void)
{
+ ListBox* pBox = static_cast<ListBox*>(&rControl);
if(GetFocusFlags::Tab & pBox->GetGetFocusFlags())
{
sal_Int32 nIndex = 0;
@@ -1147,7 +1148,6 @@ IMPL_LINK(SwAssignFieldsControl, GotFocusHdl_Impl, ListBox*, pBox)
}
}
}
- return 0;
}
SwAssignFieldsDialog::SwAssignFieldsDialog(
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 678db1815b43..719cc59bdd14 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -135,12 +135,13 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
m_pZoomLB->SetSelectHdl(LINK(this, SwMailMergeLayoutPage, ZoomHdl_Impl));
Link<> aFrameHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressHdl_Impl);
+ Link<Control&,void> aFocusHdl = LINK(this, SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl);
m_pLeftMF->SetUpHdl(aFrameHdl);
m_pLeftMF->SetDownHdl(aFrameHdl);
- m_pLeftMF->SetLoseFocusHdl(aFrameHdl);
+ m_pLeftMF->SetLoseFocusHdl(aFocusHdl);
m_pTopMF->SetUpHdl(aFrameHdl);
m_pTopMF->SetDownHdl(aFrameHdl);
- m_pTopMF->SetLoseFocusHdl(aFrameHdl);
+ m_pTopMF->SetLoseFocusHdl(aFocusHdl);
FieldUnit eFieldUnit = ::GetDfltMetric(false);
::SetFieldUnit( *m_pLeftMF, eFieldUnit );
@@ -682,6 +683,10 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox)
return 0;
}
+IMPL_LINK_NOARG_TYPED(SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl, Control&, void)
+{
+ ChangeAddressHdl_Impl(nullptr);
+}
IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl)
{
if(m_pExampleWrtShell && m_pAddressBlockFormat)
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index 2b46221beb7c..7d18971aae26 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -68,6 +68,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
DECL_LINK_TYPED(PreviewLoadedHdl_Impl, SwOneExampleFrame&, void);
DECL_LINK(ZoomHdl_Impl, ListBox*);
DECL_LINK(ChangeAddressHdl_Impl, void *);
+ DECL_LINK_TYPED(ChangeAddressLoseFocusHdl_Impl, Control&, void);
DECL_LINK_TYPED(GreetingsHdl_Impl, Button*, void);
DECL_LINK_TYPED(AlignToTextHdl_Impl, Button*, void);
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index b49ce96b1853..495af4caf296 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -156,12 +156,13 @@ SwEnvFormatPage::SwEnvFormatPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pSizeWidthField->SetDownHdl( aLk );
m_pSizeHeightField->SetDownHdl( aLk );
- m_pAddrLeftField->SetLoseFocusHdl( aLk );
- m_pAddrTopField->SetLoseFocusHdl( aLk );
- m_pSendLeftField->SetLoseFocusHdl( aLk );
- m_pSendTopField->SetLoseFocusHdl( aLk );
- m_pSizeWidthField->SetLoseFocusHdl( aLk );
- m_pSizeHeightField->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK(this, SwEnvFormatPage, LoseFocusHdl);
+ m_pAddrLeftField->SetLoseFocusHdl( aLk3 );
+ m_pAddrTopField->SetLoseFocusHdl( aLk3 );
+ m_pSendLeftField->SetLoseFocusHdl( aLk3 );
+ m_pSendTopField->SetLoseFocusHdl( aLk3 );
+ m_pSizeWidthField->SetLoseFocusHdl( aLk3 );
+ m_pSizeHeightField->SetLoseFocusHdl( aLk3 );
Link<MenuButton *, void> aLk2 = LINK(this, SwEnvFormatPage, EditHdl );
m_pAddrEditButton->SetSelectHdl( aLk2 );
@@ -217,6 +218,10 @@ void SwEnvFormatPage::dispose()
}
+IMPL_LINK_TYPED( SwEnvFormatPage, LoseFocusHdl, Control&, rControl, void )
+{
+ ModifyHdl(static_cast<Edit*>(&rControl));
+}
IMPL_LINK( SwEnvFormatPage, ModifyHdl, Edit *, pEdit )
{
long lWVal = static_cast< long >(GetFieldVal(*m_pSizeWidthField ));
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index ced01862a050..d3a81afdaf86 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -44,6 +44,7 @@ class SwEnvFormatPage : public SfxTabPage
std::vector<sal_uInt16> aIDs;
DECL_LINK( ModifyHdl, Edit * );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
DECL_LINK_TYPED( EditHdl, MenuButton *, void );
DECL_LINK(FormatHdl, void *);
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 4d739aba8eb0..7d721c2cd1dd 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -338,17 +338,17 @@ SwLabFormatPage::SwLabFormatPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pPWidthField->SetModifyHdl( aLk );
m_pPHeightField->SetModifyHdl( aLk );
- aLk = LINK(this, SwLabFormatPage, LoseFocusHdl);
- m_pHDistField->SetLoseFocusHdl( aLk );
- m_pVDistField->SetLoseFocusHdl( aLk );
- m_pWidthField->SetLoseFocusHdl( aLk );
- m_pHeightField->SetLoseFocusHdl( aLk );
- m_pLeftField->SetLoseFocusHdl( aLk );
- m_pUpperField->SetLoseFocusHdl( aLk );
- m_pColsField->SetLoseFocusHdl( aLk );
- m_pRowsField->SetLoseFocusHdl( aLk );
- m_pPWidthField->SetLoseFocusHdl( aLk );
- m_pPHeightField->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk2 = LINK(this, SwLabFormatPage, LoseFocusHdl);
+ m_pHDistField->SetLoseFocusHdl( aLk2 );
+ m_pVDistField->SetLoseFocusHdl( aLk2 );
+ m_pWidthField->SetLoseFocusHdl( aLk2 );
+ m_pHeightField->SetLoseFocusHdl( aLk2 );
+ m_pLeftField->SetLoseFocusHdl( aLk2 );
+ m_pUpperField->SetLoseFocusHdl( aLk2 );
+ m_pColsField->SetLoseFocusHdl( aLk2 );
+ m_pRowsField->SetLoseFocusHdl( aLk2 );
+ m_pPWidthField->SetLoseFocusHdl( aLk2 );
+ m_pPHeightField->SetLoseFocusHdl( aLk2 );
m_pSavePB->SetClickHdl( LINK (this, SwLabFormatPage, SaveHdl));
// Set timer
@@ -399,11 +399,10 @@ IMPL_LINK_NOARG_TYPED(SwLabFormatPage, PreviewHdl, Idle *, void)
}
// LoseFocus-Handler: Update on change
-IMPL_LINK( SwLabFormatPage, LoseFocusHdl, Control *, pControl )
+IMPL_LINK_TYPED( SwLabFormatPage, LoseFocusHdl, Control&, rControl, void )
{
- if (static_cast<Edit*>( pControl)->IsModified())
+ if (static_cast<Edit*>( &rControl)->IsModified())
PreviewHdl(0);
- return 0;
}
void SwLabFormatPage::ChangeMinMax()
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index 67ad694dfbda..74a50574f6b3 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -88,9 +88,9 @@ class SwLabFormatPage : public SfxTabPage
SwLabItem aItem;
DECL_LINK(ModifyHdl, void *);
- DECL_LINK_TYPED(PreviewHdl, Idle *, void);
- DECL_LINK( LoseFocusHdl, Control * );
- DECL_LINK_TYPED(SaveHdl, Button*, void);
+ DECL_LINK_TYPED( PreviewHdl, Idle *, void );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
+ DECL_LINK_TYPED( SaveHdl, Button*, void );
void ChangeMinMax();
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5f272d4f96a7..bc0ae4dc741b 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -677,14 +677,14 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet)
SetExchangeSupport();
- Link<> aLk = LINK(this, SwFrmPage, RangeModifyHdl);
- m_aWidthED.SetLoseFocusHdl( aLk );
- m_aHeightED.SetLoseFocusHdl( aLk );
- m_pAtHorzPosED->SetLoseFocusHdl( aLk );
- m_pAtVertPosED->SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK(this, SwFrmPage, RangeModifyLoseFocusHdl);
+ m_aWidthED.SetLoseFocusHdl( aLk3 );
+ m_aHeightED.SetLoseFocusHdl( aLk3 );
+ m_pAtHorzPosED->SetLoseFocusHdl( aLk3 );
+ m_pAtVertPosED->SetLoseFocusHdl( aLk3 );
m_pFollowTextFlowCB->SetClickHdl( LINK(this, SwFrmPage, RangeModifyClickHdl) );
- aLk = LINK(this, SwFrmPage, ModifyHdl);
+ Link<> aLk = LINK(this, SwFrmPage, ModifyHdl);
m_aWidthED.SetModifyHdl( aLk );
m_aHeightED.SetModifyHdl( aLk );
m_pAtHorzPosED->SetModifyHdl( aLk );
@@ -1047,7 +1047,7 @@ void SwFrmPage::Reset( const SfxItemSet *rSet )
//lock PercentFields
m_aWidthED.LockAutoCalculation(true);
m_aHeightED.LockAutoCalculation(true);
- RangeModifyHdl(&m_aWidthED); // set all maximum values initially
+ RangeModifyHdl(); // set all maximum values initially
m_aHeightED.LockAutoCalculation(false);
m_aWidthED.LockAutoCalculation(false);
@@ -1736,7 +1736,7 @@ void SwFrmPage::ActivatePage(const SfxItemSet& rSet)
//lock PercentFields
m_aWidthED.LockAutoCalculation(true);
m_aHeightED.LockAutoCalculation(true);
- RangeModifyHdl(&m_aWidthED); // set all maximum values initially
+ RangeModifyHdl(); // set all maximum values initially
m_aHeightED.LockAutoCalculation(false);
m_aWidthED.LockAutoCalculation(false);
m_pFollowTextFlowCB->SaveValue();
@@ -1785,7 +1785,7 @@ IMPL_LINK_TYPED( SwFrmPage, RelSizeClickHdl, Button *, p, void )
m_aHeightED.get()->SetMax(MAX_PERCENT_HEIGHT);
}
- RangeModifyHdl(m_aWidthED.get()); // correct the values again
+ RangeModifyHdl(); // correct the values again
if (pBtn == m_pRelWidthCB)
ModifyHdl(m_aWidthED.get());
@@ -1796,12 +1796,16 @@ IMPL_LINK_TYPED( SwFrmPage, RelSizeClickHdl, Button *, p, void )
// range check
IMPL_LINK_NOARG_TYPED(SwFrmPage, RangeModifyClickHdl, Button*, void)
{
- RangeModifyHdl(NULL);
+ RangeModifyHdl();
}
-IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl)
+IMPL_LINK_NOARG_TYPED(SwFrmPage, RangeModifyLoseFocusHdl, Control&, void)
+{
+ RangeModifyHdl();
+}
+void SwFrmPage::RangeModifyHdl()
{
if (bNoModifyHdl)
- return 0;
+ return;
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
: getFrmDlgParentShell();
@@ -1915,8 +1919,6 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl)
m_pAtVertPosED->SetMax(m_pAtVertPosED->Normalize(aVal.nMaxVPos), FUNIT_TWIP);
if ( aVal.nVPos != nAtVertPosVal )
m_pAtVertPosED->SetValue(m_pAtVertPosED->Normalize(aVal.nVPos), FUNIT_TWIP);
-
- return 0;
}
IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void)
@@ -1934,7 +1936,7 @@ IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void)
RndStdIds eId = GetAnchor();
InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX);
- RangeModifyHdl(0);
+ RangeModifyHdl();
if(bHtmlMode)
{
@@ -1969,7 +1971,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
m_pAtVertPosFT->Enable( bEnable );
}
- RangeModifyHdl( 0 );
+ RangeModifyHdl();
sal_Int16 nRel = 0;
if (pLB->GetSelectEntryCount())
@@ -2076,7 +2078,7 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB )
}
}
if (pLB) // Only when Handler was called by changing of the controller
- RangeModifyHdl(0);
+ RangeModifyHdl();
return 0;
}
@@ -2322,7 +2324,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, bool bReset)
}
// switch to percent if applicable
- RangeModifyHdl(&m_aWidthED); // set reference values (for 100%)
+ RangeModifyHdl(); // set reference values (for 100%)
if (rSize.GetWidthPercent() == SwFormatFrmSize::SYNCED || rSize.GetHeightPercent() == SwFormatFrmSize::SYNCED)
m_pFixedRatioCB->Check();
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index f7081b741726..bc3227de5030 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -96,29 +96,30 @@ SwWrapTabPage::SwWrapTabPage(vcl::Window *pParent, const SfxItemSet &rSet)
SetExchangeSupport();
Link<> aLk = LINK(this, SwWrapTabPage, RangeModifyHdl);
+ Link<Control&,void> aLk3 = LINK(this, SwWrapTabPage, RangeLoseFocusHdl);
m_pLeftMarginED->SetUpHdl(aLk);
m_pLeftMarginED->SetDownHdl(aLk);
m_pLeftMarginED->SetFirstHdl(aLk);
m_pLeftMarginED->SetLastHdl(aLk);
- m_pLeftMarginED->SetLoseFocusHdl(aLk);
+ m_pLeftMarginED->SetLoseFocusHdl(aLk3);
m_pRightMarginED->SetUpHdl(aLk);
m_pRightMarginED->SetDownHdl(aLk);
m_pRightMarginED->SetFirstHdl(aLk);
m_pRightMarginED->SetLastHdl(aLk);
- m_pRightMarginED->SetLoseFocusHdl(aLk);
+ m_pRightMarginED->SetLoseFocusHdl(aLk3);
m_pTopMarginED->SetUpHdl(aLk);
m_pTopMarginED->SetDownHdl(aLk);
m_pTopMarginED->SetFirstHdl(aLk);
m_pTopMarginED->SetLastHdl(aLk);
- m_pTopMarginED->SetLoseFocusHdl(aLk);
+ m_pTopMarginED->SetLoseFocusHdl(aLk3);
m_pBottomMarginED->SetUpHdl(aLk);
m_pBottomMarginED->SetDownHdl(aLk);
m_pBottomMarginED->SetFirstHdl(aLk);
m_pBottomMarginED->SetLastHdl(aLk);
- m_pBottomMarginED->SetLoseFocusHdl(aLk);
+ m_pBottomMarginED->SetLoseFocusHdl(aLk3);
Link<Button*,void> aLk2 = LINK(this, SwWrapTabPage, WrapTypeHdl);
m_pNoWrapRB->SetClickHdl(aLk2);
@@ -586,29 +587,32 @@ SfxTabPage::sfxpg SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet)
}
// range check
-IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit )
+IMPL_LINK_TYPED( SwWrapTabPage, RangeLoseFocusHdl, Control&, rControl, void )
{
- sal_Int64 nValue = pEdit->GetValue();
- MetricField *pOpposite = 0;
- if (pEdit == m_pLeftMarginED)
- pOpposite = m_pRightMarginED;
- else if (pEdit == m_pRightMarginED)
- pOpposite = m_pLeftMarginED;
- else if (pEdit == m_pTopMarginED)
- pOpposite = m_pBottomMarginED;
- else if (pEdit == m_pBottomMarginED)
- pOpposite = m_pTopMarginED;
-
- OSL_ASSERT(pOpposite);
-
- if (pOpposite)
- {
- sal_Int64 nOpposite = pOpposite->GetValue();
-
- if (nValue + nOpposite > std::max(pEdit->GetMax(), pOpposite->GetMax()))
- pOpposite->SetValue(pOpposite->GetMax() - nValue);
- }
+ RangeModifyHdl( static_cast<MetricField*>(&rControl) );
+}
+IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField*, pEdit )
+{
+ sal_Int64 nValue = pEdit->GetValue();
+ MetricField *pOpposite = 0;
+ if (pEdit == m_pLeftMarginED)
+ pOpposite = m_pRightMarginED;
+ else if (pEdit == m_pRightMarginED)
+ pOpposite = m_pLeftMarginED;
+ else if (pEdit == m_pTopMarginED)
+ pOpposite = m_pBottomMarginED;
+ else if (pEdit == m_pBottomMarginED)
+ pOpposite = m_pTopMarginED;
+
+ OSL_ASSERT(pOpposite);
+
+ if (pOpposite)
+ {
+ sal_Int64 nOpposite = pOpposite->GetValue();
+ if (nValue + nOpposite > std::max(pEdit->GetMax(), pOpposite->GetMax()))
+ pOpposite->SetValue(pOpposite->GetMax() - nValue);
+ }
return 0;
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 7c32c52d348e..19b39c8fed5d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2751,8 +2751,8 @@ void SwTokenWindow::dispose()
for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
VclPtr<Control> pControl = (*it);
- pControl->SetGetFocusHdl( Link<>() );
- pControl->SetLoseFocusHdl( Link<>() );
+ pControl->SetGetFocusHdl( Link<Control&,void>() );
+ pControl->SetLoseFocusHdl( Link<Control&,void>() );
pControl.disposeAndClear();
}
aControlList.clear();
@@ -3485,8 +3485,9 @@ IMPL_LINK_TYPED(SwTokenWindow, NextItemHdl, SwTOXEdit&, rEdit, void)
}
}
-IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
+IMPL_LINK_TYPED(SwTokenWindow, TbxFocusHdl, Control&, rControl, void)
{
+ SwTOXEdit* pEdit = static_cast<SwTOXEdit*>(&rControl);
for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
Control *pCtrl = *it;
@@ -3496,8 +3497,6 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, SwTOXEdit*, pEdit)
}
SetActiveControl(pEdit);
-
- return 0;
}
IMPL_LINK_TYPED(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void )
@@ -3537,8 +3536,9 @@ IMPL_LINK_TYPED(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void )
}
}
-IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn )
+IMPL_LINK_TYPED(SwTokenWindow, TbxFocusBtnHdl, Control&, rControl, void )
{
+ SwTOXButton* pBtn = static_cast<SwTOXButton*>(&rControl);
for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it)
{
Control *pControl = *it;
@@ -3548,8 +3548,6 @@ IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, SwTOXButton*, pBtn )
}
SetActiveControl(pBtn);
-
- return 0;
}
void SwTokenWindow::GetFocus()
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 59f4935189d3..8636c8e2b144 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -116,15 +116,16 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* pParent,
m_pAlign2FT->SetText( m_pAlignFT->GetText() );
Link<> aLk = LINK(this, SwNumPositionTabPage, DistanceHdl);
+ Link<Control&,void> aLk2 = LINK(this, SwNumPositionTabPage, DistanceLoseFocusHdl);
m_pDistBorderMF->SetUpHdl(aLk);
m_pDistNumMF->SetUpHdl(aLk);
m_pIndentMF->SetUpHdl(aLk);
m_pDistBorderMF->SetDownHdl(aLk);
m_pDistNumMF->SetDownHdl(aLk);
m_pIndentMF->SetDownHdl(aLk);
- m_pDistBorderMF->SetLoseFocusHdl(aLk);
- m_pDistNumMF->SetLoseFocusHdl(aLk);
- m_pIndentMF->SetLoseFocusHdl(aLk);
+ m_pDistBorderMF->SetLoseFocusHdl(aLk2);
+ m_pDistNumMF->SetLoseFocusHdl(aLk2);
+ m_pIndentMF->SetLoseFocusHdl(aLk2);
m_pLabelFollowedByLB->SetDropDownLineCount( m_pLabelFollowedByLB->GetEntryCount() );
m_pLabelFollowedByLB->SetSelectHdl( LINK(this, SwNumPositionTabPage, LabelFollowedByHdl_Impl) );
@@ -132,17 +133,17 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* pParent,
aLk = LINK(this, SwNumPositionTabPage, ListtabPosHdl_Impl);
m_pListtabMF->SetUpHdl(aLk);
m_pListtabMF->SetDownHdl(aLk);
- m_pListtabMF->SetLoseFocusHdl(aLk);
+ m_pListtabMF->SetLoseFocusHdl(aLk2);
aLk = LINK(this, SwNumPositionTabPage, AlignAtHdl_Impl);
m_pAlignedAtMF->SetUpHdl(aLk);
m_pAlignedAtMF->SetDownHdl(aLk);
- m_pAlignedAtMF->SetLoseFocusHdl(aLk);
+ m_pAlignedAtMF->SetLoseFocusHdl(aLk2);
aLk = LINK(this, SwNumPositionTabPage, IndentAtHdl_Impl);
m_pIndentAtMF->SetUpHdl(aLk);
m_pIndentAtMF->SetDownHdl(aLk);
- m_pIndentAtMF->SetLoseFocusHdl(aLk);
+ m_pIndentAtMF->SetLoseFocusHdl(aLk2);
m_pLevelLB->SetSelectHdl(LINK(this, SwNumPositionTabPage, LevelHdl));
m_pRelativeCB->SetClickHdl(LINK(this, SwNumPositionTabPage, RelativeHdl));
@@ -659,6 +660,10 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox )
return 0;
}
+IMPL_LINK_TYPED( SwNumPositionTabPage, DistanceLoseFocusHdl, Control&, rControl, void )
+{
+ DistanceHdl(static_cast<MetricField*>(&rControl));
+}
IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pField )
{
if(bInInintControl)
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index f2b2a07e186c..5801208958d8 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -647,11 +647,10 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
return 0;
}
-IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CollSelectGetFocus)
+IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CollSelectGetFocus, Control&, void)
{
for( sal_uInt8 i = 0; i < MAXLEVEL; ++i)
aSaveCollNames[i] = pCollNames[i];
- return 0;
}
IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBox )
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index d7f627c8d334..fd4e4ba3c20b 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -64,7 +64,7 @@ IMPL_LINK_NOARG_TYPED(SwFootNotePage, HeightMetric, Button*, void)
}
// handler limit values
-IMPL_LINK_NOARG(SwFootNotePage, HeightModify)
+IMPL_LINK_NOARG_TYPED(SwFootNotePage, HeightModify, Control&, void)
{
m_pMaxHeightEdit->SetMax(m_pMaxHeightEdit->Normalize(lMaxHeight -
(m_pDistEdit->Denormalize(m_pDistEdit->GetValue(FUNIT_TWIP)) +
@@ -82,7 +82,6 @@ IMPL_LINK_NOARG(SwFootNotePage, HeightModify)
(m_pMaxHeightEdit->Denormalize(m_pMaxHeightEdit->GetValue(FUNIT_TWIP)) +
m_pDistEdit->Denormalize(m_pDistEdit->GetValue(FUNIT_TWIP)))),
FUNIT_TWIP);
- return 0;
}
IMPL_LINK_NOARG(SwFootNotePage, LineWidthChanged_Impl)
@@ -185,7 +184,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
}
m_pMaxHeightPageBtn->SetClickHdl(LINK(this,SwFootNotePage,HeightPage));
m_pMaxHeightBtn->SetClickHdl(LINK(this,SwFootNotePage,HeightMetric));
- Link<> aLk = LINK(this, SwFootNotePage, HeightModify);
+ Link<Control&,void> aLk = LINK(this, SwFootNotePage, HeightModify);
m_pMaxHeightEdit->SetLoseFocusHdl( aLk );
m_pDistEdit->SetLoseFocusHdl( aLk );
m_pLineDistEdit->SetLoseFocusHdl( aLk );
@@ -359,7 +358,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
lMaxHeight /= 10;
// set maximum values
- HeightModify(0);
+ HeightModify(*m_pMaxHeightEdit);
}
SfxTabPage::sfxpg SwFootNotePage::DeactivatePage( SfxItemSet* _pSet)
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index cdcba665ccbe..1ac0fb2be6fd 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -77,23 +77,25 @@ SwTextGridPage::SwTextGridPage(vcl::Window *pParent, const SfxItemSet &rSet) :
get(m_pColorLB,"listLB_COLOR");
Link<> aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
+ Link<Control&,void> aLink2 = LINK(this, SwTextGridPage, CharorLineLoseFocusdHdl);
m_pCharsPerLineNF->SetUpHdl(aLink);
m_pCharsPerLineNF->SetDownHdl(aLink);
- m_pCharsPerLineNF->SetLoseFocusHdl(aLink);
+ m_pCharsPerLineNF->SetLoseFocusHdl(aLink2);
m_pLinesPerPageNF->SetUpHdl(aLink);
m_pLinesPerPageNF->SetDownHdl(aLink);
- m_pLinesPerPageNF->SetLoseFocusHdl(aLink);
+ m_pLinesPerPageNF->SetLoseFocusHdl(aLink2);
Link<> aSizeLink = LINK(this, SwTextGridPage, TextSizeChangedHdl);
+ Link<Control&,void> aSizeLink2 = LINK(this, SwTextGridPage, TextSizeLoseFocusHdl);
m_pTextSizeMF->SetUpHdl(aSizeLink);
m_pTextSizeMF->SetDownHdl(aSizeLink);
- m_pTextSizeMF->SetLoseFocusHdl(aSizeLink);
+ m_pTextSizeMF->SetLoseFocusHdl(aSizeLink2);
m_pRubySizeMF->SetUpHdl(aSizeLink);
m_pRubySizeMF->SetDownHdl(aSizeLink);
- m_pRubySizeMF->SetLoseFocusHdl(aSizeLink);
+ m_pRubySizeMF->SetLoseFocusHdl(aSizeLink2);
m_pCharWidthMF->SetUpHdl(aSizeLink);
m_pCharWidthMF->SetDownHdl(aSizeLink);
- m_pCharWidthMF->SetLoseFocusHdl(aSizeLink);
+ m_pCharWidthMF->SetLoseFocusHdl(aSizeLink2);
Link<Button*,void> aGridTypeHdl = LINK(this, SwTextGridPage, GridTypeHdl);
m_pNoGridRB->SetClickHdl(aGridTypeHdl);
@@ -385,6 +387,10 @@ const sal_uInt16* SwTextGridPage::GetRanges()
return aPageRg;
}
+IMPL_LINK_TYPED(SwTextGridPage, CharorLineLoseFocusdHdl, Control&, rControl, void)
+{
+ CharorLineChangedHdl(static_cast<SpinField*>(&rControl));
+}
IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
{
//if in squared mode
@@ -432,6 +438,10 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField)
return 0;
}
+IMPL_LINK_TYPED(SwTextGridPage, TextSizeLoseFocusHdl, Control&, rControl, void)
+{
+ TextSizeChangedHdl(static_cast<SpinField*>(&rControl));
+}
IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField)
{
//if in squared mode
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index d16675521945..6402a7dd382d 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -145,7 +145,7 @@ void SwFormatTablePage::Init()
m_pRightBtn->SetClickHdl( aLk2 );
m_pCenterBtn->SetClickHdl( aLk2 );
- Link<> aLk = LINK( this, SwFormatTablePage, UpDownLoseFocusHdl );
+ Link<> aLk = LINK( this, SwFormatTablePage, UpDownHdl );
m_pTopMF->SetUpHdl( aLk );
m_pBottomMF->SetUpHdl( aLk );
m_aRightMF.SetUpHdl( aLk );
@@ -158,11 +158,12 @@ void SwFormatTablePage::Init()
m_aLeftMF.SetDownHdl( aLk );
m_aWidthMF.SetDownHdl( aLk );
- m_pTopMF->SetLoseFocusHdl( aLk );
- m_pBottomMF->SetLoseFocusHdl( aLk );
- m_aRightMF.SetLoseFocusHdl( aLk );
- m_aLeftMF.SetLoseFocusHdl( aLk );
- m_aWidthMF.SetLoseFocusHdl( aLk );
+ Link<Control&,void> aLk3 = LINK( this, SwFormatTablePage, LoseFocusHdl );
+ m_pTopMF->SetLoseFocusHdl( aLk3 );
+ m_pBottomMF->SetLoseFocusHdl( aLk3 );
+ m_aRightMF.SetLoseFocusHdl( aLk3 );
+ m_aLeftMF.SetLoseFocusHdl( aLk3 );
+ m_aWidthMF.SetLoseFocusHdl( aLk3 );
m_pRelWidthCB->SetClickHdl(LINK( this, SwFormatTablePage, RelWidthClickHdl ));
}
@@ -283,7 +284,11 @@ void SwFormatTablePage::RightModify()
}
}
-IMPL_LINK( SwFormatTablePage, UpDownLoseFocusHdl, MetricField *, pEdit )
+IMPL_LINK_TYPED( SwFormatTablePage, LoseFocusHdl, Control&, rControl, void )
+{
+ UpDownHdl(static_cast<MetricField*>(&rControl));
+}
+IMPL_LINK( SwFormatTablePage, UpDownHdl, MetricField *, pEdit )
{
if( m_aRightMF.get() == pEdit)
RightModify();
@@ -845,7 +850,7 @@ void SwTableColumnPage::Init(bool bWeb)
FieldUnit aMetric = ::GetDfltMetric(bWeb);
Link<> aLkUp = LINK( this, SwTableColumnPage, UpHdl );
Link<> aLkDown = LINK( this, SwTableColumnPage, DownHdl );
- Link<> aLkLF = LINK( this, SwTableColumnPage, LoseFocusHdl );
+ Link<Control&,void> aLkLF = LINK( this, SwTableColumnPage, LoseFocusHdl );
for( sal_uInt16 i = 0; i < MET_FIELDS; i++ )
{
aValueTable[i] = i;
@@ -916,14 +921,14 @@ IMPL_LINK( SwTableColumnPage, DownHdl, MetricField*, pEdit )
return 0;
}
-IMPL_LINK( SwTableColumnPage, LoseFocusHdl, MetricField*, pEdit )
+IMPL_LINK_TYPED( SwTableColumnPage, LoseFocusHdl, Control&, rControl, void )
{
+ MetricField* pEdit = static_cast<MetricField*>(&rControl);
if (pEdit->IsModified())
{
bModified = true;
ModifyHdl( pEdit );
}
- return 0;
}
IMPL_LINK_TYPED( SwTableColumnPage, ModeHdl, Button*, pBox, void )
@@ -943,7 +948,7 @@ bool SwTableColumnPage::FillItemSet( SfxItemSet* )
{
if (m_aFieldArr[i].HasFocus())
{
- LoseFocusHdl(m_aFieldArr[i].get());
+ LoseFocusHdl(*m_aFieldArr[i].get());
break;
}
}
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 37332fb75c1a..97d2a28c70ab 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -130,8 +130,9 @@ class SwFrmPage: public SfxTabPage
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE;
- DECL_LINK(RangeModifyHdl, void *);
+ DECL_LINK_TYPED(RangeModifyLoseFocusHdl, Control&, void);
DECL_LINK_TYPED(RangeModifyClickHdl, Button*, void);
+ void RangeModifyHdl();
DECL_LINK_TYPED(AnchorTypeHdl, Button*, void);
DECL_LINK( PosHdl, ListBox * );
DECL_LINK( RelHdl, ListBox * );
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index 59b6d4c8b19f..4e855ed1df3c 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -106,7 +106,7 @@ class SwNavigationPI : public vcl::Window,
DECL_LINK_TYPED( ToolBoxClickHdl, ToolBox *, void );
DECL_LINK_TYPED( ToolBoxDropdownClickHdl, ToolBox*, void );
DECL_LINK_TYPED( EditAction, NumEditAction&, void );
- DECL_LINK( EditGetFocus, NumEditAction * );
+ DECL_LINK_TYPED( EditGetFocus, Control&, void );
DECL_LINK_TYPED( DoneLink, SfxPoolItem *, void );
DECL_LINK_TYPED( MenuSelectHdl, Menu *, bool );
DECL_LINK_TYPED( ChangePageHdl, Idle*, void );
diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx
index 00c198be33bf..355eefb0d297 100644
--- a/sw/source/uibase/inc/num.hxx
+++ b/sw/source/uibase/inc/num.hxx
@@ -94,6 +94,7 @@ class SwNumPositionTabPage : public SfxTabPage
DECL_LINK( LevelHdl, ListBox * );
DECL_LINK(EditModifyHdl, void *);
DECL_LINK( DistanceHdl, MetricField * );
+ DECL_LINK_TYPED( DistanceLoseFocusHdl, Control&, void );
DECL_LINK_TYPED( RelativeHdl, Button*, void );
DECL_LINK_TYPED(StandardHdl, Button*, void);
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index e6b6a89a50e1..8a7a1280705c 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -176,7 +176,7 @@ class SwStdFontTabPage : public SfxTabPage
DECL_LINK_TYPED(StandardHdl, Button*, void);
DECL_LINK(ModifyHdl, ComboBox * );
DECL_LINK(ModifyHeightHdl, FontSizeBox * );
- DECL_LINK(LoseFocusHdl, ComboBox * );
+ DECL_LINK_TYPED(LoseFocusHdl, Control&, void );
SwStdFontTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
virtual ~SwStdFontTabPage();
diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx
index b72edb4ab0fd..aed1139d5ebb 100644
--- a/sw/source/uibase/inc/outline.hxx
+++ b/sw/source/uibase/inc/outline.hxx
@@ -105,7 +105,7 @@ class SwOutlineSettingsTabPage : public SfxTabPage
DECL_LINK( LevelHdl, ListBox * );
DECL_LINK( ToggleComplete, NumericField * );
DECL_LINK( CollSelect, ListBox * );
- DECL_LINK(CollSelectGetFocus, void *);
+ DECL_LINK_TYPED(CollSelectGetFocus, Control&, void);
DECL_LINK( NumberSelect, SwNumberingTypeListBox * );
DECL_LINK(DelimModify, void *);
DECL_LINK( StartModified, NumericField * );
diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx
index dfc2227327d7..ca1ff21b3f8f 100644
--- a/sw/source/uibase/inc/pgfnote.hxx
+++ b/sw/source/uibase/inc/pgfnote.hxx
@@ -59,7 +59,7 @@ private:
DECL_LINK_TYPED(HeightPage, Button*, void);
DECL_LINK_TYPED(HeightMetric, Button*, void);
- DECL_LINK(HeightModify, void *);
+ DECL_LINK_TYPED(HeightModify, Control&, void);
DECL_LINK( LineWidthChanged_Impl, void * );
DECL_LINK( LineColorSelected_Impl, void * );
diff --git a/sw/source/uibase/inc/pggrid.hxx b/sw/source/uibase/inc/pggrid.hxx
index 0274619df91b..e6548e01f1d2 100644
--- a/sw/source/uibase/inc/pggrid.hxx
+++ b/sw/source/uibase/inc/pggrid.hxx
@@ -73,7 +73,9 @@ class SwTextGridPage: public SfxTabPage
DECL_LINK_TYPED(GridTypeHdl, Button*, void);
DECL_LINK(CharorLineChangedHdl, SpinField*);
+ DECL_LINK_TYPED(CharorLineLoseFocusdHdl, Control&, void);
DECL_LINK(TextSizeChangedHdl, SpinField*);
+ DECL_LINK_TYPED(TextSizeLoseFocusHdl, Control&, void);
DECL_LINK(GridModifyHdl, void*);
DECL_LINK_TYPED(GridModifyClickHdl, Button*, void);
DECL_LINK_TYPED(DisplayGridHdl, Button*, void);
diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx
index d37c6b4e53c6..0858add6d23b 100644
--- a/sw/source/uibase/inc/prcntfld.hxx
+++ b/sw/source/uibase/inc/prcntfld.hxx
@@ -51,7 +51,7 @@ public:
void SetUpHdl(const Link<>& rLink) { m_pField->SetUpHdl(rLink); }
void SetDownHdl(const Link<>& rLink) { m_pField->SetDownHdl(rLink); }
void SetModifyHdl(const Link<>& rLink) { m_pField->SetModifyHdl(rLink); }
- void SetLoseFocusHdl(const Link<>& rLink) { m_pField->SetLoseFocusHdl(rLink); }
+ void SetLoseFocusHdl(const Link<Control&,void>& rLink) { m_pField->SetLoseFocusHdl(rLink); }
void SetMetric(FieldUnit eUnit) { ::SetMetric(*m_pField, eUnit); }
void Enable(bool bEnable = true, bool bChild = true) { m_pField->Enable(bEnable, bChild); }
void Disable(bool bChild = true) { m_pField->Disable(bChild); }
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index 4dfb1b0c3ab8..009c7a1a7ae0 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -268,11 +268,11 @@ class SwTokenWindow : public VclHBox, public VclBuilderContainer
VclPtr<SwTOXEntryTabPage> m_pParent;
DECL_LINK(EditResize, Edit*);
- DECL_LINK_TYPED(NextItemHdl, SwTOXEdit&, void );
- DECL_LINK(TbxFocusHdl, SwTOXEdit* );
- DECL_LINK_TYPED(NextItemBtnHdl, SwTOXButton&, void );
- DECL_LINK(TbxFocusBtnHdl, SwTOXButton* );
- DECL_LINK_TYPED(ScrollHdl, Button*, void );
+ DECL_LINK_TYPED( NextItemHdl, SwTOXEdit&, void );
+ DECL_LINK_TYPED( TbxFocusHdl, Control&, void );
+ DECL_LINK_TYPED( NextItemBtnHdl, SwTOXButton&, void );
+ DECL_LINK_TYPED( TbxFocusBtnHdl, Control&, void );
+ DECL_LINK_TYPED( ScrollHdl, Button*, void );
void SetActiveControl(Control* pSet);
diff --git a/sw/source/uibase/inc/wrap.hxx b/sw/source/uibase/inc/wrap.hxx
index c38a1cc107ab..dc2720013da5 100644
--- a/sw/source/uibase/inc/wrap.hxx
+++ b/sw/source/uibase/inc/wrap.hxx
@@ -86,6 +86,7 @@ class SwWrapTabPage: public SfxTabPage
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
DECL_LINK( RangeModifyHdl, MetricField * );
+ DECL_LINK_TYPED( RangeLoseFocusHdl, Control&, void );
DECL_LINK_TYPED( WrapTypeHdl, Button *, void );
DECL_LINK_TYPED( ContourHdl, Button *, void);
diff --git a/sw/source/uibase/table/tablepg.hxx b/sw/source/uibase/table/tablepg.hxx
index e75484b138a1..40f5a9314081 100644
--- a/sw/source/uibase/table/tablepg.hxx
+++ b/sw/source/uibase/table/tablepg.hxx
@@ -74,7 +74,8 @@ class SwFormatTablePage : public SfxTabPage
DECL_LINK_TYPED( AutoClickHdl, Button*, void );
DECL_LINK_TYPED( RelWidthClickHdl, Button*, void );
void RightModify();
- DECL_LINK( UpDownLoseFocusHdl, MetricField * );
+ DECL_LINK( UpDownHdl, MetricField * );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
@@ -121,7 +122,7 @@ class SwTableColumnPage : public SfxTabPage
void ModifyHdl( MetricField* pEdit );
DECL_LINK( UpHdl, MetricField * );
DECL_LINK( DownHdl, MetricField * );
- DECL_LINK( LoseFocusHdl, MetricField * );
+ DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
DECL_LINK_TYPED( ModeHdl, Button *, void );
void UpdateCols( sal_uInt16 nAktPos );
SwTwips GetVisibleWidth(sal_uInt16 nPos);
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 83866745c522..073e45c6ede6 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -469,17 +469,17 @@ IMPL_LINK_TYPED( SwNavigationPI, EditAction, NumEditAction&, rEdit, void )
// If the page can be set here, the maximum is set.
-IMPL_LINK( SwNavigationPI, EditGetFocus, NumEditAction *, pEdit )
+IMPL_LINK_TYPED( SwNavigationPI, EditGetFocus, Control&, rControl, void )
{
+ NumEditAction* pEdit = static_cast<NumEditAction*>(&rControl);
SwView *pView = GetCreateView();
if (!pView)
- return 0;
+ return;
SwWrtShell &rSh = pView->GetWrtShell();
const sal_uInt16 nPageCnt = rSh.GetPageCnt();
pEdit->SetMax(nPageCnt);
pEdit->SetLast(nPageCnt);
- return 0;
}
// Setting of an automatic mark
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 4793fdb2cf38..db1af03e1862 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -258,7 +258,7 @@ bool Control::Notify( NotifyEvent& rNEvt )
{
mbHasControlFocus = true;
CompatStateChanged( StateChangedType::ControlFocus );
- if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, [this] () { maGetFocusHdl.Call(this); } ) )
+ if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, [this] () { maGetFocusHdl.Call(*this); } ) )
// been destroyed within the handler
return true;
}
@@ -272,7 +272,7 @@ bool Control::Notify( NotifyEvent& rNEvt )
{
mbHasControlFocus = false;
CompatStateChanged( StateChangedType::ControlFocus );
- if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, [this] () { maLoseFocusHdl.Call(this); } ) )
+ if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, [this] () { maLoseFocusHdl.Call(*this); } ) )
// been destroyed within the handler
return true;
}
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index f09b493469a0..62a331c73adf 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -216,34 +216,12 @@ void Slider::ImplUpdateRects( bool bUpdate )
}
}
-void Slider::ImplSetFieldLink(const Link<>& rLink)
-{
- if (mpLinkedField != nullptr)
- {
- mpLinkedField->SetModifyHdl(rLink);
- mpLinkedField->SetUpHdl(rLink);
- mpLinkedField->SetDownHdl(rLink);
- mpLinkedField->SetFirstHdl(rLink);
- mpLinkedField->SetLastHdl(rLink);
- mpLinkedField->SetLoseFocusHdl(rLink);
- }
-}
-
void Slider::ImplUpdateLinkedField()
{
if (mpLinkedField)
mpLinkedField->SetValue(mnThumbPos);
}
-IMPL_LINK(Slider, LinkedFieldModifyHdl, NumericField*, pField)
-{
- if (pField)
- {
- SetThumbPos(pField->GetValue());
- }
- return 0;
-}
-
long Slider::ImplCalcThumbPos( long nPixPos )
{
// calculate position
@@ -851,8 +829,38 @@ void Slider::Resize()
void Slider::SetLinkedField(VclPtr<NumericField> pField)
{
ImplSetFieldLink(Link<>());
+ if (mpLinkedField)
+ mpLinkedField->SetLoseFocusHdl(Link<Control&,void>());
mpLinkedField = pField;
ImplSetFieldLink(LINK(this, Slider, LinkedFieldModifyHdl));
+ if (mpLinkedField)
+ mpLinkedField->SetLoseFocusHdl(LINK(this, Slider, LinkedFieldLoseFocusHdl));
+}
+
+void Slider::ImplSetFieldLink(const Link<>& rLink)
+{
+ if (mpLinkedField != nullptr)
+ {
+ mpLinkedField->SetModifyHdl(rLink);
+ mpLinkedField->SetUpHdl(rLink);
+ mpLinkedField->SetDownHdl(rLink);
+ mpLinkedField->SetFirstHdl(rLink);
+ mpLinkedField->SetLastHdl(rLink);
+ }
+}
+
+IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldLoseFocusHdl, Control&, void)
+{
+ if (mpLinkedField)
+ SetThumbPos(mpLinkedField->GetValue());
+}
+
+IMPL_LINK(Slider, LinkedFieldModifyHdl, NumericField*, /*pField*/)
+{
+ if (mpLinkedField)
+ SetThumbPos(mpLinkedField->GetValue());
+
+ return 0;
}
void Slider::RequestHelp( const HelpEvent& rHEvt )