basctl/source/basicide/bastype3.hxx | 4 basctl/source/basicide/bastypes.cxx | 6 - chart2/source/controller/dialogs/DataBrowser.cxx | 31 ++--- chart2/source/controller/dialogs/DataBrowser.hxx | 2 cui/source/dialogs/cuifmsearch.cxx | 3 cui/source/dialogs/hangulhanjadlg.cxx | 4 cui/source/dialogs/hldoctp.cxx | 4 cui/source/dialogs/hlinettp.cxx | 3 cui/source/dialogs/hyphen.cxx | 3 cui/source/inc/chardlg.hxx | 2 cui/source/inc/cuifmsearch.hxx | 2 cui/source/inc/grfpage.hxx | 2 cui/source/inc/hldoctp.hxx | 4 cui/source/inc/hlinettp.hxx | 10 - cui/source/inc/hyphen.hxx | 2 cui/source/inc/numfmt.hxx | 2 cui/source/inc/numpages.hxx | 1 cui/source/inc/page.hxx | 12 +- cui/source/inc/paragrph.hxx | 2 cui/source/inc/swpossizetabpage.hxx | 2 cui/source/inc/tabstpge.hxx | 4 cui/source/options/optcolor.cxx | 19 +-- cui/source/options/optgdlg.cxx | 6 - cui/source/options/optgdlg.hxx | 1 cui/source/options/optinet2.cxx | 6 - cui/source/options/optinet2.hxx | 2 cui/source/tabpages/chardlg.cxx | 10 - cui/source/tabpages/grfpage.cxx | 14 +- cui/source/tabpages/numfmt.cxx | 8 - cui/source/tabpages/numpages.cxx | 17 ++- cui/source/tabpages/page.cxx | 31 ++--- cui/source/tabpages/paragrph.cxx | 17 +-- cui/source/tabpages/swpossizetabpage.cxx | 28 ++--- cui/source/tabpages/tabstpge.cxx | 14 +- dbaccess/source/ui/control/FieldDescControl.cxx | 40 +++---- dbaccess/source/ui/dlg/paramdialog.cxx | 25 ++-- dbaccess/source/ui/dlg/queryfilter.cxx | 23 +--- dbaccess/source/ui/inc/FieldDescControl.hxx | 4 dbaccess/source/ui/inc/paramdialog.hxx | 3 dbaccess/source/ui/inc/queryfilter.hxx | 2 extensions/source/propctrlr/browserline.cxx | 3 extensions/source/propctrlr/browserline.hxx | 2 extensions/source/propctrlr/commoncontrol.cxx | 8 - extensions/source/propctrlr/commoncontrol.hxx | 5 extensions/source/propctrlr/standardcontrol.cxx | 2 formula/source/ui/dlg/ControlHelper.hxx | 4 formula/source/ui/dlg/funcutl.cxx | 12 -- formula/source/ui/dlg/parawin.cxx | 2 fpicker/source/office/RemoteFilesDialog.cxx | 3 fpicker/source/office/RemoteFilesDialog.hxx | 2 fpicker/source/office/iodlg.cxx | 5 fpicker/source/office/iodlg.hxx | 2 include/sfx2/dinfdlg.hxx | 4 include/sfx2/mgetempl.hxx | 4 include/svtools/addresstemplate.hxx | 4 include/svx/dialcontrol.hxx | 2 include/svx/hdft.hxx | 2 include/svx/imapdlg.hxx | 2 include/svx/srchdlg.hxx | 4 include/vcl/ctrl.hxx | 10 - include/vcl/slider.hxx | 1 reportdesign/source/ui/dlg/GroupsSorting.cxx | 14 +- reportdesign/source/ui/inc/GroupsSorting.hxx | 4 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 11 -- sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 19 +-- sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 19 +-- sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx | 29 ++--- sc/source/ui/condformat/condformatdlg.cxx | 5 sc/source/ui/dbgui/PivotLayoutDialog.cxx | 19 +-- sc/source/ui/dbgui/consdlg.cxx | 13 +- sc/source/ui/dbgui/validate.cxx | 9 - sc/source/ui/inc/PivotLayoutDialog.hxx | 4 sc/source/ui/inc/RandomNumberGeneratorDialog.hxx | 4 sc/source/ui/inc/SamplingDialog.hxx | 4 sc/source/ui/inc/StatisticsInputOutputDialog.hxx | 4 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx | 4 sc/source/ui/inc/areasdlg.hxx | 2 sc/source/ui/inc/condformatdlg.hxx | 2 sc/source/ui/inc/consdlg.hxx | 2 sc/source/ui/inc/crnrdlg.hxx | 4 sc/source/ui/inc/namedefdlg.hxx | 2 sc/source/ui/inc/namedlg.hxx | 2 sc/source/ui/inc/optsolver.hxx | 4 sc/source/ui/inc/solvrdlg.hxx | 4 sc/source/ui/inc/tabopdlg.hxx | 4 sc/source/ui/inc/tpdefaults.hxx | 2 sc/source/ui/inc/tpformula.hxx | 2 sc/source/ui/inc/validate.hxx | 4 sc/source/ui/inc/xmlsourcedlg.hxx | 2 sc/source/ui/miscdlgs/crnrdlg.cxx | 13 -- sc/source/ui/miscdlgs/optsolver.cxx | 23 +--- sc/source/ui/miscdlgs/solvrdlg.cxx | 15 +- sc/source/ui/miscdlgs/tabopdlg.cxx | 15 +- sc/source/ui/namedlg/namedefdlg.cxx | 3 sc/source/ui/namedlg/namedlg.cxx | 3 sc/source/ui/optdlg/tpdefaults.cxx | 5 sc/source/ui/optdlg/tpformula.cxx | 13 +- sc/source/ui/pagedlg/areasdlg.cxx | 18 +-- sc/source/ui/xmlsource/xmlsourcedlg.cxx | 13 +- sd/source/ui/dlg/tpaction.cxx | 8 - sd/source/ui/inc/tpaction.hxx | 2 sfx2/source/dialog/dinfdlg.cxx | 30 ++--- sfx2/source/dialog/mgetempl.cxx | 14 +- starmath/inc/dialog.hxx | 2 starmath/source/dialog.cxx | 13 +- svtools/source/dialogs/addresstemplate.cxx | 11 -- svx/source/dialog/_bmpmask.cxx | 7 - svx/source/dialog/dialcontrol.cxx | 19 ++- svx/source/dialog/hdft.cxx | 18 ++- svx/source/dialog/imapdlg.cxx | 12 -- svx/source/dialog/srchdlg.cxx | 18 +-- sw/source/ui/config/optpage.cxx | 6 - sw/source/ui/dbui/createaddresslistdialog.cxx | 8 - sw/source/ui/dbui/mmaddressblockpage.cxx | 8 - sw/source/ui/dbui/mmlayoutpage.cxx | 9 + sw/source/ui/dbui/mmlayoutpage.hxx | 1 sw/source/ui/envelp/envfmt.cxx | 17 ++- sw/source/ui/envelp/envfmt.hxx | 1 sw/source/ui/envelp/labfmt.cxx | 27 ++--- sw/source/ui/envelp/labfmt.hxx | 6 - sw/source/ui/frmdlg/frmpage.cxx | 38 +++---- sw/source/ui/frmdlg/wrap.cxx | 54 +++++----- sw/source/ui/index/cnttab.cxx | 14 +- sw/source/ui/misc/num.cxx | 17 ++- sw/source/ui/misc/outline.cxx | 3 sw/source/ui/misc/pgfnote.cxx | 7 - sw/source/ui/misc/pggrid.cxx | 20 ++- sw/source/ui/table/tabledlg.cxx | 27 ++--- sw/source/uibase/inc/frmpage.hxx | 3 sw/source/uibase/inc/navipi.hxx | 2 sw/source/uibase/inc/num.hxx | 1 sw/source/uibase/inc/optpage.hxx | 2 sw/source/uibase/inc/outline.hxx | 2 sw/source/uibase/inc/pgfnote.hxx | 2 sw/source/uibase/inc/pggrid.hxx | 2 sw/source/uibase/inc/prcntfld.hxx | 2 sw/source/uibase/inc/swuicnttab.hxx | 10 - sw/source/uibase/inc/wrap.hxx | 1 sw/source/uibase/table/tablepg.hxx | 5 sw/source/uibase/utlui/navipi.cxx | 6 - vcl/source/control/ctrl.cxx | 4 vcl/source/control/slider.cxx | 52 +++++---- 142 files changed, 640 insertions(+), 648 deletions(-)
New commits: commit e85b2333bce7b1dcae73861df6d90b48b9f4efe5 Author: Noel Grandin <noelgran...@gmail.com> Date: Thu Sep 24 13:53:17 2015 +0200 convert Link<> to typed Change-Id: I59d325c3b051690303a5841907317122fa1ec98b Reviewed-on: https://gerrit.libreoffice.org/18825 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/basctl/source/basicide/bastype3.hxx b/basctl/source/basicide/bastype3.hxx index 3106cf7..5f946ca 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 92f921c..4d98fde 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 f7eaf5d..d318371 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 ad00816..a04101b 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 8b38031..b0d80cf 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 36570b9..0ef8e1f 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 764d5f3..f7c27b3 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 c58df74..3f8a732 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 9b7dd37..5d00a08 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 4d5506e..f750d0e 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 42a9fab..c41ea5c 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 f756d37..6449dfa 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 e65dbae..6a301b6 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 60216f5..e1febf0 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 29cc985..b515ca7 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 3ce1a67..f004a76 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 790915f..5b96a90 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 0c39b83..1d55426 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 12e23f4..fdb840c 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 5c4245f..10f6345 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 c415eab..455caa2 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 830b898..76a2ec3 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 2feda57..5c58291 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 baafb9d..ae66faa 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 4891a45..5c17f39 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 0c5da70..32804fb 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 3127082..9048d44 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 1ef5ae4..9988726 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 2c2a725..e8b45bb 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 fc8e3fd..3877183 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 0fcf338..fc90d1f 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 71bbb4b..d4617e2 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 997e55a..b51ef95 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 7f3fbb8..b0cd52c 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 92a4dc5..fbe4ddc 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 36766be..2a8fedd 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 373b6d0..764ce8f 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 791bcb4..f5fefbd 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 44d3316..58bb7c4 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 32fb47c..d09f690 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 37bf731..a2f2c59 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 c28c7861..7dc1f84 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 1bfeed3..5ac1230 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 7b631a7..b74e985 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 9ffb0da..3d1c199 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 d9e1217..18af2e9 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 50d8b01..5c7d8ad 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 05a0b71..8c9b33a 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 b3a60c8..83cd52c 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 30fff9d..78488cc 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 b684ae9..0f850ea 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 93c4934..19b5d8a 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 5629902..c331208 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 607833f..f719b72 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 be355f3..00b532a 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 b11ec16..8990871 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 7e0b45d..d26ef8d 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 223e5eb..405ab41 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 1403faf..1d12863 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 115d9dd..28bf572 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 46ab0f3..9423936 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 d2f4281..68ce8f2 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 f3f7491..714191c 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 7482da6..fe2fbc0 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 0d71b26..258f19e 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 c676bda..276f5c1 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 44fdfec..16816f5 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 60f1395..27cc8d0 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 85203ca..87eb9c7 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 1977ee8..ab3772c 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 2262955..ae26284 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 a299d3f..e8aeaec 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 a588b50..b9d7934 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 15b54d7..1050737 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 340e5fb..21510d6 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 0a18619..ebe8de0 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 b48233e..7b93cc8 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 62678a1..bac7c36 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 2bdf952..e875010 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 a8f4a71..8e84a04 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 94c3bfc..0cc9c6c 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 9a8329a..332a0d7 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 7706213..6bdb0dd 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 f937d8f..828dbb2 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 fb1e1d2..e9eac1f 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 deb2673..0cc0371 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 1024c7d..35e5a70 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 00a66ac..9251a899 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 6c5e4f0a..b9e50fc 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 54faeab..5cd874c 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 ace5271..35286f8 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 ) ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits