diff options
384 files changed, 1558 insertions, 1809 deletions
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx index 81ebd05589fe..0ca7e8e2dc2d 100644 --- a/basctl/source/basicide/brkdlg.cxx +++ b/basctl/source/basicide/brkdlg.cxx @@ -172,17 +172,16 @@ IMPL_LINK_TYPED( BreakPointDialog, ComboBoxHighlightHdl, ComboBox&, rBox, void ) -IMPL_LINK( BreakPointDialog, EditModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( BreakPointDialog, EditModifyHdl, Edit&, rEdit, void ) { - if (pEdit == m_pComboBox) + if (&rEdit == m_pComboBox) CheckButtons(); - else if (pEdit == m_pNumericField) + else if (&rEdit == m_pNumericField) { BreakPoint* pBrk = GetSelectedBreakPoint(); if ( pBrk ) - pBrk->nStopAfter = pEdit->GetText().toInt32(); + pBrk->nStopAfter = rEdit.GetText().toInt32(); } - return 0; } diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx index 9ae8e3678d67..3a0eccf2b963 100644 --- a/basctl/source/basicide/brkdlg.hxx +++ b/basctl/source/basicide/brkdlg.hxx @@ -45,7 +45,7 @@ protected: void CheckButtons(); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); DECL_LINK_TYPED( ComboBoxHighlightHdl, ComboBox&, void ); - DECL_LINK( EditModifyHdl, Edit * ); + DECL_LINK_TYPED( EditModifyHdl, Edit&, void ); DECL_LINK_TYPED( ButtonHdl, Button*, void ); void UpdateFields( BreakPoint* pBrk ); BreakPoint* GetSelectedBreakPoint(); diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 2e417c12e222..97598ff9dff7 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -550,10 +550,8 @@ IMPL_LINK_TYPED( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox, void ) -IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) +IMPL_LINK_NOARG_TYPED( MacroChooser, EditModifyHdl, Edit&, void ) { - (void)pEdit; - // select the module in which the macro is put at Neu (new), // if BasicManager or Lib is selecting SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry(); @@ -606,7 +604,6 @@ IMPL_LINK( MacroChooser, EditModifyHdl, Edit *, pEdit ) } CheckButtons(); - return 0; } diff --git a/basctl/source/basicide/macrodlg.hxx b/basctl/source/basicide/macrodlg.hxx index 96394545d78c..7b446fedf320 100644 --- a/basctl/source/basicide/macrodlg.hxx +++ b/basctl/source/basicide/macrodlg.hxx @@ -70,7 +70,7 @@ private: DECL_LINK_TYPED( MacroSelectHdl, SvTreeListBox *, void ); DECL_LINK_TYPED( MacroDoubleClickHdl, SvTreeListBox*, bool ); DECL_LINK_TYPED( BasicSelectHdl, SvTreeListBox *, void ); - DECL_LINK( EditModifyHdl, Edit * ); + DECL_LINK_TYPED( EditModifyHdl, Edit&, void ); DECL_LINK_TYPED( ButtonHdl, Button *, void ); void CheckButtons(); diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index a039467d1ddb..9a410fd74bc1 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -1227,11 +1227,10 @@ void CombiColumnLineChartDialogController::setTemplateProperties( const uno::Ref } } -IMPL_LINK_NOARG(CombiColumnLineChartDialogController, ChangeLineCountHdl) +IMPL_LINK_NOARG_TYPED(CombiColumnLineChartDialogController, ChangeLineCountHdl, Edit&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); - return 0; } void CombiColumnLineChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter ) { diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx index 60d4dcce3bc9..f3b80ffccc71 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx @@ -278,7 +278,7 @@ public: virtual void setTemplateProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xTemplateProps ) const throw (::com::sun::star::uno::RuntimeException) override; private: - DECL_LINK( ChangeLineCountHdl, void* ); + DECL_LINK_TYPED( ChangeLineCountHdl, Edit&, void ); private: VclPtr<FixedText> m_pFT_NumberOfLines; diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 00f2be300cea..e70242d46213 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -186,8 +186,8 @@ private: Link<SeriesHeaderEdit*,void> m_aChangeLink; void notifyChanges(); - DECL_LINK( SeriesNameChanged, void * ); - DECL_LINK( SeriesNameEdited, void * ); + DECL_LINK_TYPED( SeriesNameChanged, Edit&, void ); + DECL_LINK_TYPED( SeriesNameEdited, Edit&, void ); static Image GetChartTypeImage( const Reference< chart2::XChartType > & xChartType, @@ -326,16 +326,14 @@ void SeriesHeader::SetEditChangedHdl( const Link<SeriesHeaderEdit*,void> & rLink m_aChangeLink = rLink; } -IMPL_LINK_NOARG(SeriesHeader, SeriesNameChanged) +IMPL_LINK_NOARG_TYPED(SeriesHeader, SeriesNameChanged, Edit&, void) { notifyChanges(); - return 0; } -IMPL_LINK_NOARG(SeriesHeader, SeriesNameEdited) +IMPL_LINK_NOARG_TYPED(SeriesHeader, SeriesNameEdited, Edit&, void) { m_bSeriesNameChangePending = true; - return 0; } void SeriesHeader::SetGetFocusHdl( const Link<Control&,void>& rLink ) diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 7f8d9485c294..a77a042eedc9 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -406,10 +406,10 @@ IMPL_LINK_NOARG_TYPED( ErrorBarResources, CategoryChosen, Button*, void ) IMPL_LINK_NOARG_TYPED(ErrorBarResources, SynchronizePosAndNeg, CheckBox&, void) { UpdateControlStates(); - PosValueChanged( 0 ); + PosValueChanged( *m_pMfPositive ); } -IMPL_LINK_NOARG(ErrorBarResources, PosValueChanged) +IMPL_LINK_NOARG_TYPED(ErrorBarResources, PosValueChanged, Edit&, void) { if( m_pCbSyncPosNeg->IsChecked()) { @@ -421,8 +421,6 @@ IMPL_LINK_NOARG(ErrorBarResources, PosValueChanged) else m_pMfNegative->SetValue( m_pMfPositive->GetValue()); } - - return 0; } IMPL_LINK_NOARG_TYPED(ErrorBarResources, IndicatorChanged, Button*, void) @@ -472,21 +470,19 @@ IMPL_LINK_TYPED( ErrorBarResources, ChooseRange, Button*, pButton, void ) m_pCurrentRangeChoosingField = 0; } -IMPL_LINK( ErrorBarResources, RangeChanged, Edit *, pEdit ) +IMPL_LINK_TYPED( ErrorBarResources, RangeChanged, Edit&, rEdit, void ) { - if( pEdit == m_pEdRangePositive ) + if( &rEdit == m_pEdRangePositive ) { m_bRangePosUnique = true; - PosValueChanged( 0 ); + PosValueChanged( *m_pMfPositive ); } else { m_bRangeNegUnique = true; } - isRangeFieldContentValid( *pEdit ); - - return 0; + isRangeFieldContentValid( rEdit ); } void ErrorBarResources::Reset(const SfxItemSet& rInAttrs) @@ -705,7 +701,7 @@ void ErrorBarResources::listeningFinished( { m_pCurrentRangeChoosingField->SetText( aRange ); m_pCurrentRangeChoosingField->GrabFocus(); - PosValueChanged( 0 ); + PosValueChanged( *m_pMfPositive ); } m_pCurrentRangeChoosingField = 0; diff --git a/chart2/source/controller/dialogs/res_Titles.cxx b/chart2/source/controller/dialogs/res_Titles.cxx index 5186acf1ddcd..4998e849fdc6 100644 --- a/chart2/source/controller/dialogs/res_Titles.cxx +++ b/chart2/source/controller/dialogs/res_Titles.cxx @@ -54,7 +54,7 @@ TitleResources::~TitleResources() { } -void TitleResources::SetUpdateDataHdl( const Link<>& rLink ) +void TitleResources::SetUpdateDataHdl( const Link<Edit&,void>& rLink ) { sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT; diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx index 5862f13eea77..c5fcb3c5ab2b 100644 --- a/chart2/source/controller/dialogs/res_Trendline.cxx +++ b/chart2/source/controller/dialogs/res_Trendline.cxx @@ -77,7 +77,7 @@ TrendlineResources::TrendlineResources( vcl::Window * pParent, const SfxItemSet& m_pRB_Polynomial->SetClickHdl( aLink ); m_pRB_MovingAverage->SetClickHdl( aLink ); - Link<> aLink2 = LINK(this, TrendlineResources, ChangeValue ); + Link<Edit&,void> aLink2 = LINK(this, TrendlineResources, ChangeValue ); m_pNF_Degree->SetModifyHdl( aLink2 ); m_pNF_Period->SetModifyHdl( aLink2 ); m_pFmtFld_InterceptValue->SetModifyHdl( aLink2 ); @@ -316,9 +316,9 @@ void TrendlineResources::UpdateControlStates() m_pCB_ShowCorrelationCoeff->Enable( !bMovingAverage ); } -IMPL_LINK( TrendlineResources, ChangeValue, void *, pNumericField) +IMPL_LINK_TYPED( TrendlineResources, ChangeValue, Edit&, rNumericField, void) { - if( pNumericField == m_pNF_Degree ) + if( &rNumericField == m_pNF_Degree ) { if( !m_pRB_Polynomial->IsChecked() ) { @@ -326,7 +326,7 @@ IMPL_LINK( TrendlineResources, ChangeValue, void *, pNumericField) SelectTrendLine(m_pRB_Polynomial); } } - else if( pNumericField == m_pNF_Period ) + else if( &rNumericField == m_pNF_Period ) { if( !m_pRB_MovingAverage->IsChecked() ) { @@ -334,14 +334,12 @@ IMPL_LINK( TrendlineResources, ChangeValue, void *, pNumericField) SelectTrendLine(m_pRB_MovingAverage); } } - else if( pNumericField == m_pFmtFld_InterceptValue ) + else if( &rNumericField == m_pFmtFld_InterceptValue ) { if( !m_pCB_SetIntercept->IsChecked() ) m_pCB_SetIntercept->Check(); } UpdateControlStates(); - - return 0; } void TrendlineResources::SetNumFormatter( SvNumberFormatter* pFormatter ) diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx index d69581cbde4e..9fe50e672023 100644 --- a/chart2/source/controller/dialogs/res_Trendline.hxx +++ b/chart2/source/controller/dialogs/res_Trendline.hxx @@ -79,7 +79,7 @@ private: void UpdateControlStates(); DECL_LINK_TYPED( SelectTrendLine, Button *, void ); - DECL_LINK( ChangeValue, void *); + DECL_LINK_TYPED( ChangeValue, Edit&, void); }; } // namespace chart diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx index f0c9c101f2c8..93f17f3f2de2 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx @@ -100,8 +100,8 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( vcl::Window* pWindow m_pMFZRotation->SetValue(m_nZRotation); const sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT; - Link<> aAngleChangedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged )); - Link<> aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited )); + Link<Edit&,void> aAngleChangedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged )); + Link<Edit&,void> aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited )); m_pMFXRotation->EnableUpdateData( nTimeout ); m_pMFXRotation->SetUpdateDataHdl( aAngleChangedLink ); @@ -197,19 +197,17 @@ void ThreeD_SceneGeometry_TabPage::applyAnglesToModel() m_bAngleChangePending = false; } -IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, AngleEdited) +IMPL_LINK_NOARG_TYPED(ThreeD_SceneGeometry_TabPage, AngleEdited, Edit&, void) { m_nXRotation = m_pMFXRotation->GetValue(); m_nYRotation = m_pMFYRotation->GetValue(); m_bAngleChangePending = true; - return 0; } -IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, AngleChanged) +IMPL_LINK_NOARG_TYPED(ThreeD_SceneGeometry_TabPage, AngleChanged, Edit&, void) { applyAnglesToModel(); - return 0; } void ThreeD_SceneGeometry_TabPage::applyPerspectiveToModel() @@ -233,16 +231,14 @@ void ThreeD_SceneGeometry_TabPage::applyPerspectiveToModel() m_bPerspectiveChangePending = false; } -IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveEdited) +IMPL_LINK_NOARG_TYPED(ThreeD_SceneGeometry_TabPage, PerspectiveEdited, Edit&, void) { m_bPerspectiveChangePending = true; - return 0; } -IMPL_LINK_NOARG(ThreeD_SceneGeometry_TabPage, PerspectiveChanged) +IMPL_LINK_NOARG_TYPED(ThreeD_SceneGeometry_TabPage, PerspectiveChanged, Edit&, void) { applyPerspectiveToModel(); - return 0; } IMPL_LINK_NOARG_TYPED(ThreeD_SceneGeometry_TabPage, PerspectiveToggled, CheckBox&, void) diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx index bae9ba1d9ed2..b9e6eaadb0d6 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx @@ -46,14 +46,14 @@ public: void commitPendingChanges(); // is called by timer to apply changes to model - DECL_LINK( AngleChanged, void* ); + DECL_LINK_TYPED( AngleChanged, Edit&, void ); // is called immediately when a field changes - DECL_LINK( AngleEdited, void* ); + DECL_LINK_TYPED( AngleEdited, Edit&, void ); // is called by timer to apply changes to model - DECL_LINK( PerspectiveChanged, void* ); + DECL_LINK_TYPED( PerspectiveChanged, Edit&, void ); // is called immediately when a field changes - DECL_LINK( PerspectiveEdited, void* ); + DECL_LINK_TYPED( PerspectiveEdited, Edit&, void ); DECL_LINK_TYPED( PerspectiveToggled, CheckBox&, void ); DECL_LINK_TYPED( RightAngledAxesToggled, CheckBox&, void ); diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 7925d7cfeafb..0ef5a70395ba 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -733,14 +733,14 @@ IMPL_LINK_NOARG_TYPED(DataSourceTabPage, DownButtonClickedHdl, Button*, void) } } -IMPL_LINK( DataSourceTabPage, RangeModifiedHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( DataSourceTabPage, RangeModifiedHdl, Edit&, rEdit, void ) { // note: isValid sets the color of the edit field - if( isRangeFieldContentValid( *pEdit )) + if( isRangeFieldContentValid( rEdit )) { setDirty(); - updateModelFromControl( pEdit ); - if( pEdit == m_pEDT_RANGE ) + updateModelFromControl( &rEdit ); + if( &rEdit == m_pEDT_RANGE ) { if( ! lcl_UpdateCurrentSeriesName( *m_pLB_SERIES )) fillSeriesListBox(); @@ -749,18 +749,16 @@ IMPL_LINK( DataSourceTabPage, RangeModifiedHdl, Edit*, pEdit ) // enable/disable OK button isValid(); - - return 0; } -IMPL_LINK( DataSourceTabPage, RangeUpdateDataHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( DataSourceTabPage, RangeUpdateDataHdl, Edit&, rEdit, void ) { // note: isValid sets the color of the edit field - if( isRangeFieldContentValid( *pEdit )) + if( isRangeFieldContentValid( rEdit )) { setDirty(); - updateModelFromControl( pEdit ); - if( pEdit == m_pEDT_RANGE ) + updateModelFromControl( &rEdit ); + if( &rEdit == m_pEDT_RANGE ) { if( ! lcl_UpdateCurrentSeriesName( *m_pLB_SERIES )) fillSeriesListBox(); @@ -768,8 +766,6 @@ IMPL_LINK( DataSourceTabPage, RangeUpdateDataHdl, Edit*, pEdit ) } // enable/disable OK button isValid(); - - return 0; } void DataSourceTabPage::listeningFinished( diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx index 4915e476ea56..672efc3527b0 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.hxx +++ b/chart2/source/controller/dialogs/tp_DataSource.hxx @@ -79,8 +79,8 @@ protected: DECL_LINK_TYPED( CategoriesRangeButtonClickedHdl, Button*, void ); DECL_LINK_TYPED( AddButtonClickedHdl, Button*, void ); DECL_LINK_TYPED( RemoveButtonClickedHdl, Button*, void ); - DECL_LINK( RangeModifiedHdl, Edit* ); - DECL_LINK( RangeUpdateDataHdl, Edit* ); + DECL_LINK_TYPED( RangeModifiedHdl, Edit&, void ); + DECL_LINK_TYPED( RangeUpdateDataHdl, Edit&, void ); DECL_LINK_TYPED( UpButtonClickedHdl, Button*, void ); DECL_LINK_TYPED( DownButtonClickedHdl, Button*, void ); diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx index 7888fb849e78..aeb0e6c5d356 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx @@ -351,29 +351,27 @@ bool RangeChooserTabPage::isValid() return bIsValid; } -IMPL_LINK_NOARG(RangeChooserTabPage, ControlEditedHdl) +IMPL_LINK_NOARG_TYPED(RangeChooserTabPage, ControlEditedHdl, Edit&, void) { setDirty(); isValid(); - return 0; } IMPL_LINK_NOARG_TYPED(RangeChooserTabPage, ControlChangedRadioHdl, RadioButton&, void) { - ControlChangedHdl(NULL); + ControlChangedHdl(*m_pED_Range); } IMPL_LINK_NOARG_TYPED(RangeChooserTabPage, ControlChangedCheckBoxHdl, CheckBox&, void) { - ControlChangedHdl(NULL); + ControlChangedHdl(*m_pED_Range); } -IMPL_LINK_NOARG(RangeChooserTabPage, ControlChangedHdl) +IMPL_LINK_NOARG_TYPED(RangeChooserTabPage, ControlChangedHdl, Edit&, void) { setDirty(); if( isValid()) changeDialogModelAccordingToControls(); - return 0; } IMPL_LINK_NOARG_TYPED(RangeChooserTabPage, ChooseRangeHdl, Button*, void) diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx index 4fb2f594bc1a..cd0804ff0a58 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx @@ -72,10 +72,10 @@ protected: //methods void setDirty(); DECL_LINK_TYPED( ChooseRangeHdl, Button*, void ); - DECL_LINK( ControlChangedHdl, void* ); + DECL_LINK_TYPED( ControlChangedHdl, Edit&, void ); DECL_LINK_TYPED( ControlChangedCheckBoxHdl, CheckBox&, void ); DECL_LINK_TYPED( ControlChangedRadioHdl, RadioButton&, void ); - DECL_LINK( ControlEditedHdl, void* ); + DECL_LINK_TYPED( ControlEditedHdl, Edit&, void ); protected: //member diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index 5206848b4df7..ece435b7d433 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -157,12 +157,11 @@ void ScaleTabPage::dispose() SfxTabPage::dispose(); } -IMPL_STATIC_LINK( - ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied ) +IMPL_STATIC_LINK_TYPED( + ScaleTabPage, FmtFieldModifiedHdl, Edit&, rEdit, void ) { - if( pFmtFied ) - pFmtFied->SetDefaultValue( pFmtFied->GetValue() ); - return 0; + FormattedField& rFmtField = static_cast<FormattedField&>(rEdit); + rFmtField.SetDefaultValue( rFmtField.GetValue() ); } void ScaleTabPage::StateChanged( StateChangedType nType ) diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx index b6f4803151cb..c4d2bc6d8194 100644 --- a/chart2/source/controller/dialogs/tp_Scale.hxx +++ b/chart2/source/controller/dialogs/tp_Scale.hxx @@ -101,7 +101,7 @@ private: DECL_LINK_TYPED( SelectAxisTypeHdl, ListBox&, void ); DECL_LINK_TYPED( EnableValueHdl, Button*, void ); - DECL_STATIC_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField* ); + DECL_STATIC_LINK_TYPED( ScaleTabPage, FmtFieldModifiedHdl, Edit&, void); /** shows a warning window due to an invalid input. diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx index ef5a731cb22c..982bacbf27d1 100644 --- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx +++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx @@ -49,7 +49,7 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage( svt::OWizardMachine* pParent get(m_pCB_Grid_Y, "y"); get(m_pCB_Grid_Z, "z"); - m_xTitleResources->SetUpdateDataHdl( LINK( this, TitlesAndObjectsTabPage, ChangeHdl )); + m_xTitleResources->SetUpdateDataHdl( LINK( this, TitlesAndObjectsTabPage, ChangeEditHdl )); m_xLegendPositionResources->SetChangeHdl( LINK( this, TitlesAndObjectsTabPage, ChangeHdl )); m_pCB_Grid_X->SetToggleHdl( LINK( this, TitlesAndObjectsTabPage, ChangeCheckBoxHdl )); @@ -150,6 +150,10 @@ IMPL_LINK_NOARG_TYPED(TitlesAndObjectsTabPage, ChangeCheckBoxHdl, CheckBox&, voi { ChangeHdl(NULL); } +IMPL_LINK_NOARG_TYPED(TitlesAndObjectsTabPage, ChangeEditHdl, Edit&, void) +{ + ChangeHdl(NULL); +} IMPL_LINK_NOARG(TitlesAndObjectsTabPage, ChangeHdl) { if( m_bCommitToModel ) diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx index ec7bfd9bd1b9..8cf86a570ef4 100644 --- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx +++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx @@ -54,6 +54,7 @@ public: protected: void commitToModel(); DECL_LINK( ChangeHdl, void* ); + DECL_LINK_TYPED( ChangeEditHdl, Edit&, void ); DECL_LINK_TYPED( ChangeCheckBoxHdl, CheckBox&, void ); protected: diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx index 901ef38619f9..8105e92df53e 100644 --- a/chart2/source/controller/inc/res_ErrorBar.hxx +++ b/chart2/source/controller/inc/res_ErrorBar.hxx @@ -125,10 +125,10 @@ private: DECL_LINK_TYPED( CategoryChosen, Button*, void ); DECL_LINK_TYPED( CategoryChosen2, ListBox&, void ); DECL_LINK_TYPED( SynchronizePosAndNeg, CheckBox&, void ); - DECL_LINK( PosValueChanged, void * ); + DECL_LINK_TYPED( PosValueChanged, Edit&, void ); DECL_LINK_TYPED( IndicatorChanged, Button *, void ); DECL_LINK_TYPED( ChooseRange, Button *, void ); - DECL_LINK( RangeChanged, Edit * ); + DECL_LINK_TYPED( RangeChanged, Edit&, void ); void UpdateControlStates(); bool isRangeFieldContentValid( Edit & rEdit ); diff --git a/chart2/source/controller/inc/res_Titles.hxx b/chart2/source/controller/inc/res_Titles.hxx index 05e22efd4e35..79c1ce777142 100644 --- a/chart2/source/controller/inc/res_Titles.hxx +++ b/chart2/source/controller/inc/res_Titles.hxx @@ -35,7 +35,7 @@ public: void writeToResources( const TitleDialogData& rInput ); void readFromResources( TitleDialogData& rOutput ); - void SetUpdateDataHdl( const Link<>& rLink ); + void SetUpdateDataHdl( const Link<Edit&,void>& rLink ); bool IsModified(); void ClearModifyFlag(); diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx index 0777408c85f6..9b44f0d77383 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx @@ -296,7 +296,7 @@ void ChartErrorBarPanel::Initialize() mpLBType->SetSelectHdl(LINK(this, ChartErrorBarPanel, ListBoxHdl)); - Link<> aLink2 = LINK(this, ChartErrorBarPanel, NumericFieldHdl); + Link<Edit&,void> aLink2 = LINK(this, ChartErrorBarPanel, NumericFieldHdl); mpMFPos->SetModifyHdl(aLink2); mpMFNeg->SetModifyHdl(aLink2); } @@ -420,16 +420,14 @@ IMPL_LINK_NOARG_TYPED(ChartErrorBarPanel, ListBoxHdl, ListBox&, void) setTypePos(mxModel, aCID, nPos); } -IMPL_LINK(ChartErrorBarPanel, NumericFieldHdl, NumericField*, pMetricField) +IMPL_LINK_TYPED(ChartErrorBarPanel, NumericFieldHdl, Edit&, rMetricField, void) { OUString aCID = getCID(mxModel); - double nVal = pMetricField->GetValue(); - if (pMetricField == mpMFPos.get()) + double nVal = static_cast<NumericField&>(rMetricField).GetValue(); + if (&rMetricField == mpMFPos.get()) setValue(mxModel, aCID, nVal, true); - else if (pMetricField == mpMFNeg.get()) + else if (&rMetricField == mpMFNeg.get()) setValue(mxModel, aCID, nVal, false); - - return 0; } }} // end of namespace ::chart::sidebar diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx index 9ed600e34193..ed7a0e65cc38 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx @@ -24,6 +24,7 @@ class FixedText; class ListBox; class NumericField; class MetricField; +class Edit; namespace chart { @@ -90,7 +91,7 @@ private: DECL_LINK_TYPED(RadioBtnHdl, RadioButton&, void); DECL_LINK_TYPED(ListBoxHdl, ListBox&, void); - DECL_LINK(NumericFieldHdl, NumericField*); + DECL_LINK_TYPED(NumericFieldHdl, Edit&, void); }; } } // end of namespace ::chart::sidebar diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 5ccc0eca2f63..0d68bfa8ad26 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -2673,14 +2673,12 @@ void SvxMainMenuOrganizerDialog::dispose() ModalDialog::dispose(); } -IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit) +IMPL_LINK_NOARG_TYPED(SvxMainMenuOrganizerDialog, ModifyHdl, Edit&, void) { - (void)pEdit; - // if the Edit control is empty do not change the name if (m_pMenuNameEdit->GetText().isEmpty()) { - return 0; + return; } SvxConfigEntry* pNewEntryData = @@ -2689,8 +2687,6 @@ IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit) pNewEntryData->SetName(m_pMenuNameEdit->GetText()); m_pMenuListBox->SetEntryText( pNewMenuEntry, pNewEntryData->GetName() ); - - return 0; } IMPL_LINK_NOARG_TYPED( SvxMainMenuOrganizerDialog, SelectHdl, SvTreeListBox*, void ) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 54de68e7197f..c263b7e9a2f0 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -954,9 +954,9 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) } -IMPL_LINK(SpellDialog, ModifyHdl, SentenceEditWindow_Impl*, pEd) +IMPL_LINK_TYPED(SpellDialog, ModifyHdl, Edit&, rEd, void) { - if (m_pSentenceED == pEd) + if (m_pSentenceED == &rEd) { bModified = true; m_pSuggestionLB->SetNoSelection(); @@ -976,7 +976,6 @@ IMPL_LINK(SpellDialog, ModifyHdl, SentenceEditWindow_Impl*, pEd) } m_pSentenceED->AddUndoAction(pSpellAction); } - return 0; }; diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index d783e887405b..81d274aefc0e 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -990,6 +990,7 @@ public: void update_color(sal_uInt16 n = UPDATE_ALL); DECL_LINK(ColorModifyHdl, void*); + DECL_LINK_TYPED(ColorModifyEditHdl, Edit&, void); DECL_LINK_TYPED(ModeModifyHdl, RadioButton&, void); sal_Int32 GetColor() const; @@ -1074,20 +1075,21 @@ ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sa mpColorField->SetModifyHdl( aLink ); mpColorSlider->SetModifyHdl( aLink ); - mpMFRed->SetModifyHdl( aLink ); - mpMFGreen->SetModifyHdl( aLink ); - mpMFBlue->SetModifyHdl( aLink ); + Link<Edit&,void> aLink3( LINK( this, ColorPickerDialog, ColorModifyEditHdl ) ); + mpMFRed->SetModifyHdl( aLink3 ); + mpMFGreen->SetModifyHdl( aLink3 ); + mpMFBlue->SetModifyHdl( aLink3 ); - mpMFCyan->SetModifyHdl( aLink ); - mpMFMagenta->SetModifyHdl( aLink ); - mpMFYellow->SetModifyHdl( aLink ); - mpMFKey->SetModifyHdl( aLink ); + mpMFCyan->SetModifyHdl( aLink3 ); + mpMFMagenta->SetModifyHdl( aLink3 ); + mpMFYellow->SetModifyHdl( aLink3 ); + mpMFKey->SetModifyHdl( aLink3 ); - mpMFHue->SetModifyHdl( aLink ); - mpMFSaturation->SetModifyHdl( aLink ); - mpMFBrightness->SetModifyHdl( aLink ); + mpMFHue->SetModifyHdl( aLink3 ); + mpMFSaturation->SetModifyHdl( aLink3 ); + mpMFBrightness->SetModifyHdl( aLink3 ); - mpEDHex->SetModifyHdl( aLink ); + mpEDHex->SetModifyHdl( aLink3 ); Link<RadioButton&,void> aLink2 = LINK( this, ColorPickerDialog, ModeModifyHdl ); mpRBRed->SetToggleHdl( aLink2 ); @@ -1278,6 +1280,10 @@ void ColorPickerDialog::update_color( sal_uInt16 n ) mpColorPreview->SetColor(aColor); } +IMPL_LINK_TYPED(ColorPickerDialog, ColorModifyEditHdl, Edit&, rEdit, void) +{ + ColorModifyHdl(&rEdit); +} IMPL_LINK(ColorPickerDialog, ColorModifyHdl, void *, p) { sal_uInt16 n = 0; diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index e5fd633788f3..268dbe98b054 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -264,7 +264,7 @@ void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sIni OUString sRealSetText = m_pcmbSearchText->GetText(); if (!sRealSetText.equals(sInitialText)) m_pcmbSearchText->SetText(OUString()); - LINK(this, FmSearchDialog, OnSearchTextModified).Call(m_pcmbSearchText); + LINK(this, FmSearchDialog, OnSearchTextModified).Call(*m_pcmbSearchText); // initial m_aDelayedPaint.SetTimeoutHdl(LINK(this, FmSearchDialog, OnDelayedPaint)); @@ -393,7 +393,7 @@ IMPL_LINK_TYPED(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton, void } } -IMPL_LINK_NOARG(FmSearchDialog, OnSearchTextModified) +IMPL_LINK_NOARG_TYPED(FmSearchDialog, OnSearchTextModified, Edit&, void) { if ((!m_pcmbSearchText->GetText().isEmpty()) || !m_prbSearchForText->IsChecked()) m_pbSearchAgain->Enable(); @@ -401,7 +401,6 @@ IMPL_LINK_NOARG(FmSearchDialog, OnSearchTextModified) m_pbSearchAgain->Disable(); m_pSearchEngine->InvalidatePreviousLoc(); - return 0; } IMPL_LINK_NOARG_TYPED(FmSearchDialog, OnFocusGrabbed, Control&, void) diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 73bb4c3d6a70..bdf4c9377d59 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -196,11 +196,11 @@ GraphicFilterMosaic::GraphicFilterMosaic( vcl::Window* pParent, const Graphic& r mpMtrWidth->SetValue( nTileWidth ); mpMtrWidth->SetLast( GetGraphicSizePixel().Width() ); - mpMtrWidth->SetModifyHdl( GetModifyHdl() ); + mpMtrWidth->SetModifyHdl( LINK(this, GraphicFilterMosaic, EditModifyHdl) ); mpMtrHeight->SetValue( nTileHeight ); mpMtrHeight->SetLast( GetGraphicSizePixel().Height() ); - mpMtrHeight->SetModifyHdl( GetModifyHdl() ); + mpMtrHeight->SetModifyHdl( LINK(this, GraphicFilterMosaic, EditModifyHdl) ); mpCbxEdges->Check( bEnhanceEdges ); mpCbxEdges->SetToggleHdl( LINK(this, GraphicFilterMosaic, CheckBoxModifyHdl) ); @@ -213,6 +213,11 @@ IMPL_LINK_TYPED(GraphicFilterMosaic, CheckBoxModifyHdl, CheckBox&, rCheckBox, vo GetModifyHdl().Call(&rCheckBox); } +IMPL_LINK_TYPED(GraphicFilterMosaic, EditModifyHdl, Edit&, rEdit, void) +{ + GetModifyHdl().Call(&rEdit); +} + GraphicFilterMosaic::~GraphicFilterMosaic() { disposeOnce(); @@ -273,10 +278,15 @@ GraphicFilterSmooth::GraphicFilterSmooth( vcl::Window* pParent, const Graphic& r get(mpMtrRadius, "radius"); mpMtrRadius->SetValue( nRadius* 10 ); - mpMtrRadius->SetModifyHdl( GetModifyHdl() ); + mpMtrRadius->SetModifyHdl( LINK(this, GraphicFilterSmooth, EditModifyHdl) ); mpMtrRadius->GrabFocus(); } +IMPL_LINK_TYPED(GraphicFilterSmooth, EditModifyHdl, Edit&, rEdit, void) +{ + GetModifyHdl().Call(&rEdit); +} + GraphicFilterSmooth::~GraphicFilterSmooth() { disposeOnce(); @@ -329,7 +339,7 @@ GraphicFilterSolarize::GraphicFilterSolarize( vcl::Window* pParent, const Graphi get(mpCbxInvert, "invert"); mpMtrThreshold->SetValue( FRound( cGreyThreshold / 2.55 ) ); - mpMtrThreshold->SetModifyHdl( GetModifyHdl() ); + mpMtrThreshold->SetModifyHdl( LINK(this, GraphicFilterSolarize, EditModifyHdl) ); mpCbxInvert->Check( bInvert ); mpCbxInvert->SetToggleHdl( LINK(this, GraphicFilterSolarize, CheckBoxModifyHdl) ); @@ -339,6 +349,10 @@ IMPL_LINK_TYPED(GraphicFilterSolarize, CheckBoxModifyHdl, CheckBox&, rCheckBox, { GetModifyHdl().Call(&rCheckBox); } +IMPL_LINK_TYPED(GraphicFilterSolarize, EditModifyHdl, Edit&, rEdit, void) +{ + GetModifyHdl().Call(&rEdit); +} GraphicFilterSolarize::~GraphicFilterSolarize() { @@ -399,7 +413,12 @@ GraphicFilterSepia::GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGr get(mpMtrSepia, "value"); mpMtrSepia->SetValue( nSepiaPercent ); - mpMtrSepia->SetModifyHdl( GetModifyHdl() ); + mpMtrSepia->SetModifyHdl( LINK(this, GraphicFilterSepia, EditModifyHdl) ); +} + +IMPL_LINK_TYPED(GraphicFilterSepia, EditModifyHdl, Edit&, rEdit, void) +{ + GetModifyHdl().Call(&rEdit); } GraphicFilterSepia::~GraphicFilterSepia() @@ -452,7 +471,12 @@ GraphicFilterPoster::GraphicFilterPoster(vcl::Window* pParent, const Graphic& rG mpNumPoster->SetFirst( 2 ); mpNumPoster->SetLast( rGraphic.GetBitmapEx().GetBitCount() ); mpNumPoster->SetValue( nPosterCount ); - mpNumPoster->SetModifyHdl( GetModifyHdl() ); + mpNumPoster->SetModifyHdl( LINK(this, GraphicFilterPoster, EditModifyHdl) ); +} + +IMPL_LINK_TYPED(GraphicFilterPoster, EditModifyHdl, Edit&, rEdit, void) +{ + GetModifyHdl().Call(&rEdit); } GraphicFilterPoster::~GraphicFilterPoster() diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx index 4a064ebe0135..0ab18c3f19d5 100644 --- a/cui/source/dialogs/dlgname.cxx +++ b/cui/source/dialogs/dlgname.cxx @@ -41,7 +41,7 @@ SvxNameDialog::SvxNameDialog( vcl::Window* pWindow, const OUString& rName, const pFtDescription->SetText( rDesc ); pEdtName->SetText( rName ); pEdtName->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX)); - ModifyHdl(pEdtName.get()); + ModifyHdl(*pEdtName.get()); pEdtName->SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl)); } @@ -58,11 +58,10 @@ void SvxNameDialog::dispose() ModalDialog::dispose(); } -IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SvxNameDialog, ModifyHdl, Edit&, void) { if(aCheckNameHdl.IsSet()) pBtnOK->Enable(aCheckNameHdl.Call(*this)); - return 0; } @@ -82,7 +81,7 @@ SvxObjectNameDialog::SvxObjectNameDialog( // activate name pEdtName->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX)); - ModifyHdl(pEdtName.get()); + ModifyHdl(*pEdtName.get()); pEdtName->SetModifyHdl(LINK(this, SvxObjectNameDialog, ModifyHdl)); } @@ -99,14 +98,12 @@ void SvxObjectNameDialog::dispose() } -IMPL_LINK_NOARG(SvxObjectNameDialog, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SvxObjectNameDialog, ModifyHdl, Edit&, void) { if(aCheckNameHdl.IsSet()) { pBtnOK->Enable(aCheckNameHdl.Call(*this)); } - - return 0; } diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index c11cd43bbf31..c8a1a8d9624e 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -657,7 +657,7 @@ namespace svx } m_pWordInput->SetText( sFirstSuggestion ); m_pWordInput->SaveValue(); - OnSuggestionModified( m_pWordInput ); + OnSuggestionModified( *m_pWordInput ); } @@ -718,19 +718,17 @@ namespace svx IMPL_LINK_NOARG_TYPED( HangulHanjaConversionDialog, OnSuggestionSelected, SuggestionDisplay&, void ) { m_pWordInput->SetText( m_pSuggestions->GetSelectEntry() ); - OnSuggestionModified( NULL ); + OnSuggestionModified( *m_pWordInput ); } - IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnSuggestionModified ) + IMPL_LINK_NOARG_TYPED( HangulHanjaConversionDialog, OnSuggestionModified, Edit&, void ) { m_pFind->Enable( m_pWordInput->IsValueChangedFromSaved() ); bool bSameLen = m_pWordInput->GetText().getLength() == m_pOriginalWord->GetText().getLength(); m_pReplace->Enable( m_bDocumentMode && bSameLen ); m_pReplaceAll->Enable( m_bDocumentMode && bSameLen ); - - return 0L; } @@ -1197,13 +1195,11 @@ namespace svx EndDialog( RET_OK ); } - IMPL_LINK_NOARG(HangulHanjaNewDictDialog, ModifyHdl) + IMPL_LINK_NOARG_TYPED(HangulHanjaNewDictDialog, ModifyHdl, Edit&, void) { OUString aName(comphelper::string::stripEnd(m_pDictNameED->GetText(), ' ')); m_pOkBtn->Enable( !aName.isEmpty() ); - - return 0; } HangulHanjaNewDictDialog::HangulHanjaNewDictDialog(vcl::Window* pParent) @@ -1502,39 +1498,33 @@ namespace svx UpdateScrollbar(); } - IMPL_LINK_NOARG( HangulHanjaEditDictDialog, OriginalModifyHdl ) + IMPL_LINK_NOARG_TYPED( HangulHanjaEditDictDialog, OriginalModifyHdl, Edit&, void ) { m_bModifiedOriginal = true; m_aOriginal = comphelper::string::stripEnd( m_aOriginalLB->GetText(), ' ' ); UpdateSuggestions(); UpdateButtonStates(); - - return 0; } - IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl1, Edit*, pEdit ) + IMPL_LINK_TYPED( HangulHanjaEditDictDialog, EditModifyHdl1, Edit&, rEdit, void ) { - EditModify( pEdit, 0 ); - return 0; + EditModify( &rEdit, 0 ); } - IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl2, Edit*, pEdit ) + IMPL_LINK_TYPED( HangulHanjaEditDictDialog, EditModifyHdl2, Edit&, rEdit, void ) { - EditModify( pEdit, 1 ); - return 0; + EditModify( &rEdit, 1 ); } - IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl3, Edit*, pEdit ) + IMPL_LINK_TYPED( HangulHanjaEditDictDialog, EditModifyHdl3, Edit&, rEdit, void ) { - EditModify( pEdit, 2 ); - return 0; + EditModify( &rEdit, 2 ); } - IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl4, Edit*, pEdit ) + IMPL_LINK_TYPED( HangulHanjaEditDictDialog, EditModifyHdl4, Edit&, rEdit, void ) { - EditModify( pEdit, 3 ); - return 0; + EditModify( &rEdit, 3 ); } IMPL_LINK_NOARG_TYPED( HangulHanjaEditDictDialog, BookLBSelectHdl, ListBox&, void ) diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index f7c27b39e36b..5fc269e2f450 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -104,7 +104,7 @@ void SvxHyperlinkDocTp::FillDlgFields(const OUString& rStrURL) aStrMark = rStrURL.copy( nPos+1 ); m_pEdTarget->SetText ( aStrMark ); - ModifiedPathHdl_Impl ( NULL ); + ModifiedPathHdl_Impl ( *m_pCbbPath ); } /************************************************************************* @@ -216,7 +216,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkDocTp, ClickFileopenHdl_Impl, Button*, void) m_pCbbPath->SetText( aPath ); if ( aOldURL != GetCurrentURL() ) - ModifiedPathHdl_Impl (NULL); + ModifiedPathHdl_Impl(*m_pCbbPath); } } @@ -256,7 +256,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkDocTp, ClickTargetHdl_Impl, Button*, void) |* |************************************************************************/ -IMPL_LINK_NOARG(SvxHyperlinkDocTp, ModifiedPathHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHyperlinkDocTp, ModifiedPathHdl_Impl, Edit&, void) { maStrURL = GetCurrentURL(); @@ -264,8 +264,6 @@ IMPL_LINK_NOARG(SvxHyperlinkDocTp, ModifiedPathHdl_Impl) maTimer.Start(); m_pFtFullURL->SetText( maStrURL ); - - return 0L; } /************************************************************************* @@ -297,7 +295,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkDocTp, TimeoutHdl_Impl, Timer *, void) |* |************************************************************************/ -IMPL_LINK_NOARG(SvxHyperlinkDocTp, ModifiedTargetHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHyperlinkDocTp, ModifiedTargetHdl_Impl, Edit&, void) { maStrURL = GetCurrentURL(); @@ -305,8 +303,6 @@ IMPL_LINK_NOARG(SvxHyperlinkDocTp, ModifiedTargetHdl_Impl) mpMarkWnd->SelectEntry ( m_pEdTarget->GetText() ); m_pFtFullURL->SetText( maStrURL ); - - return 0L; } /************************************************************************* @@ -332,7 +328,7 @@ void SvxHyperlinkDocTp::SetMarkStr ( const OUString& aStrMark ) { m_pEdTarget->SetText ( aStrMark ); - ModifiedTargetHdl_Impl ( NULL ); + ModifiedTargetHdl_Impl ( *m_pEdTarget ); } /************************************************************************* diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx index 094f05e41e61..f73027328ce3 100644 --- a/cui/source/dialogs/hlinettp.cxx +++ b/cui/source/dialogs/hlinettp.cxx @@ -224,7 +224,7 @@ void SvxHyperlinkInternetTp::SetInitFocus() |* |************************************************************************/ -IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ModifiedTargetHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, ModifiedTargetHdl_Impl, Edit&, void) { OUString aScheme = GetSchemeFromURL( m_pCbbTarget->GetText() ); if( !aScheme.isEmpty() ) @@ -233,8 +233,6 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ModifiedTargetHdl_Impl) // start timer maTimer.SetTimeout( 2500 ); maTimer.Start(); - - return 0L; } /************************************************************************* @@ -254,7 +252,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, TimeoutHdl_Impl, Timer *, void) |* |************************************************************************/ -IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl, Edit&, void) { OUString aStrLogin ( m_pEdLogin->GetText() ); if ( aStrLogin.equalsIgnoreAsciiCase( sAnonymous ) ) @@ -262,8 +260,6 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl) m_pCbAnonymous->Check(); ClickAnonymousHdl_Impl(NULL); } - - return 0L; } void SvxHyperlinkInternetTp::SetScheme(const OUString& rScheme) diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx index 26febba904ea..567a47801ba4 100644 --- a/cui/source/dialogs/hlmailtp.cxx +++ b/cui/source/dialogs/hlmailtp.cxx @@ -229,13 +229,11 @@ void SvxHyperlinkMailTp::RemoveImproperProtocol(const OUString& aProperScheme) |* |************************************************************************/ -IMPL_LINK_NOARG(SvxHyperlinkMailTp, ModifiedReceiverHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHyperlinkMailTp, ModifiedReceiverHdl_Impl, Edit&, void) { OUString aScheme = GetSchemeFromURL( m_pCbbReceiver->GetText() ); if(!aScheme.isEmpty()) SetScheme( aScheme ); - - return 0L; } /************************************************************************* diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx index 42c77ea01624..8adf79265833 100644 --- a/cui/source/dialogs/zoom.cxx +++ b/cui/source/dialogs/zoom.cxx @@ -163,7 +163,7 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet ) m_pSingleBtn->SetClickHdl(aViewLayoutLink); m_pColumnsBtn->SetClickHdl(aViewLayoutLink); - Link<> aViewLayoutSpinLink = LINK(this, SvxZoomDialog, ViewLayoutSpinHdl); + Link<Edit&,void> aViewLayoutSpinLink = LINK(this, SvxZoomDialog, ViewLayoutSpinHdl); m_pColumnsEdit->SetModifyHdl(aViewLayoutSpinLink); Link<Button*,void> aViewLayoutCheckLink = LINK(this, SvxZoomDialog, ViewLayoutCheckHdl); @@ -328,13 +328,12 @@ IMPL_LINK_TYPED(SvxZoomDialog, UserHdl, Button *, pButton, void) } } -IMPL_LINK_NOARG(SvxZoomDialog, SpinHdl) +IMPL_LINK_NOARG_TYPED(SvxZoomDialog, SpinHdl, Edit&, void) { if (!m_pUserBtn->IsChecked()) - return 0; + return; mbModified = true; - return 0; } IMPL_LINK_TYPED(SvxZoomDialog, ViewLayoutUserHdl, Button*, pButton, void) @@ -364,10 +363,10 @@ IMPL_LINK_TYPED(SvxZoomDialog, ViewLayoutUserHdl, Button*, pButton, void) } } -IMPL_LINK(SvxZoomDialog, ViewLayoutSpinHdl, NumericField*, pEdit) +IMPL_LINK_TYPED(SvxZoomDialog, ViewLayoutSpinHdl, Edit&, rEdit, void) { - if (pEdit == m_pColumnsEdit && !m_pColumnsBtn->IsChecked()) - return 0; + if (&rEdit == m_pColumnsEdit && !m_pColumnsBtn->IsChecked()) + return; if (m_pColumnsEdit->GetValue() % 2 == 0) { @@ -380,8 +379,6 @@ IMPL_LINK(SvxZoomDialog, ViewLayoutSpinHdl, NumericField*, pEdit) } mbModified = true; - - return 0; } IMPL_LINK_TYPED(SvxZoomDialog, ViewLayoutCheckHdl, Button*, pCheckBox, void) diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 717762349810..40497fbd3fff 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -64,11 +64,11 @@ private: std::set< sal_uInt16 > m_aIgnoreErrorsAt; sal_uInt16 m_nErrorStart; sal_uInt16 m_nErrorEnd; - bool m_bIsUndoEditMode; + bool m_bIsUndoEditMode; - Link<> m_aModifyLink; + Link<Edit&,void> m_aModifyLink; - void CallModifyLink() {m_aModifyLink.Call(this);} + void CallModifyLink() {m_aModifyLink.Call(*this);} inline SpellDialog* GetSpellDialog() const; protected: @@ -77,7 +77,7 @@ protected: public: SentenceEditWindow_Impl(vcl::Window* pParent, WinBits nBits); - void SetModifyHdl(const Link<>& rLink) override { m_aModifyLink = rLink;} + void SetModifyHdl(const Link<Edit&,void>& rLink) override { m_aModifyLink = rLink;} void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd ); void SetText( const OUString& rStr ) override; @@ -179,7 +179,7 @@ private: DECL_LINK_TYPED( CheckGrammarHdl, Button*, void ); DECL_LINK_TYPED( ExtClickHdl, Button*, void ); DECL_LINK_TYPED(CancelHdl, Button*, void); - DECL_LINK( ModifyHdl, SentenceEditWindow_Impl *); + DECL_LINK_TYPED( ModifyHdl, Edit&, void); DECL_LINK_TYPED(UndoHdl, Button*, void); DECL_LINK_TYPED( AddToDictSelectHdl, MenuButton*, void ); DECL_LINK_TYPED( AddToDictClickHdl, Button*, void ); diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 073b728d2845..bf83041a8381 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -255,7 +255,7 @@ private: DECL_LINK_TYPED(SelectHdl, SvTreeListBox*, void); DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, AutoCorrEdit&, bool); - DECL_LINK(ModifyHdl, Edit*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); bool NewDelHdl(void*); void RefillReplaceBox( bool bFromReset, @@ -318,7 +318,7 @@ private: DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, AutoCorrEdit&, bool); DECL_LINK_TYPED(SelectHdl, ListBox&, void); - DECL_LINK(ModifyHdl, Edit*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); bool NewDelHdl(void*); /// Box filled with new language void RefillReplaceBoxes(bool bFromReset, diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index 1817195fd132..3fd76592ffb9 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -122,8 +122,8 @@ private: DECL_LINK_TYPED( SelPreHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( SelSdwHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( LinesChanged_Impl, LinkParamNone*, void ); - DECL_LINK( ModifyDistanceHdl_Impl, MetricField*); - DECL_LINK( ModifyWidthHdl_Impl, void*); + DECL_LINK_TYPED( ModifyDistanceHdl_Impl, Edit&, void); + DECL_LINK_TYPED( ModifyWidthHdl_Impl, Edit&, void); DECL_LINK_TYPED( SyncHdl_Impl, Button*, void); sal_uInt16 GetPresetImageId( sal_uInt16 nValueSetIdx ) const; diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index e768576f1857..a85d6252da00 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -483,7 +483,7 @@ class SvxMainMenuOrganizerDialog : public ModalDialog void UpdateButtonStates(); DECL_LINK_TYPED( MoveHdl, Button *, void ); - DECL_LINK( ModifyHdl, Edit * ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( SelectHdl, SvTreeListBox*, void ); public: diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx index a2e8746772c5..180950612bb6 100644 --- a/cui/source/inc/chardlg.hxx +++ b/cui/source/inc/chardlg.hxx @@ -133,9 +133,10 @@ private: bool FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp ); DECL_LINK_TYPED( UpdateHdl_Impl, Idle *, void ); - DECL_LINK( FontModifyHdl_Impl, void* ); + DECL_LINK_TYPED( FontModifyEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( FontModifyListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( FontModifyComboBoxHdl_Impl, ComboBox&, void ); + void FontModifyHdl_Impl(void*); public: using SfxTabPage::ActivatePage; @@ -297,13 +298,13 @@ private: DECL_LINK_TYPED( PositionHdl_Impl, Button*, void ); DECL_LINK_TYPED( RotationHdl_Impl, Button*, void ); - DECL_LINK( FontModifyHdl_Impl, void *); + DECL_LINK_TYPED( FontModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( AutoPositionHdl_Impl, Button*, void ); DECL_LINK_TYPED( FitToLineHdl_Impl, Button*, void ); - DECL_LINK_TYPED( KerningSelectHdl_Impl, ListBox&, void); - DECL_LINK( KerningModifyHdl_Impl, void *); + DECL_LINK_TYPED( KerningSelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( KerningModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( LoseFocusHdl_Impl, Control&, void ); - DECL_LINK( ScaleWidthModifyHdl_Impl, void *); + DECL_LINK_TYPED( ScaleWidthModifyHdl_Impl, Edit&, void ); public: virtual ~SvxCharPositionPage(); diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx index abf5a02635d8..1b481f92907c 100644 --- a/cui/source/inc/connect.hxx +++ b/cui/source/inc/connect.hxx @@ -57,8 +57,9 @@ private: void FillTypeLB(); - DECL_LINK( ChangeAttrHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeAttrEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ChangeAttrListBoxHdl_Impl, ListBox&, void ); + void ChangeAttrHdl_Impl(void*); public: diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx index da70430e3c6c..a9b537e0c6d2 100644 --- a/cui/source/inc/cuifmsearch.hxx +++ b/cui/source/inc/cuifmsearch.hxx @@ -161,7 +161,7 @@ private: DECL_LINK_TYPED(OnClickedSearchAgain, Button *, void); DECL_LINK_TYPED( OnClickedSpecialSettings, Button*, void ); - DECL_LINK(OnSearchTextModified, void *); + DECL_LINK_TYPED(OnSearchTextModified, Edit&, void); DECL_LINK_TYPED( OnPositionSelected, ListBox&, void ); DECL_LINK_TYPED( OnFieldSelected, ListBox&, void ); diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx index 021e6a348541..9d7be2deeb35 100644 --- a/cui/source/inc/cuigrfflt.hxx +++ b/cui/source/inc/cuigrfflt.hxx @@ -95,6 +95,7 @@ class GraphicFilterSmooth : public GraphicFilterDialog { private: VclPtr<NumericField> mpMtrRadius; + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: @@ -113,6 +114,7 @@ private: VclPtr<MetricField> mpMtrHeight; VclPtr<CheckBox> mpCbxEdges; DECL_LINK_TYPED(CheckBoxModifyHdl, CheckBox&, void); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: GraphicFilterMosaic(vcl::Window* pParent, const Graphic& rGraphic, @@ -132,6 +134,7 @@ private: VclPtr<MetricField> mpMtrThreshold; VclPtr<CheckBox> mpCbxInvert; DECL_LINK_TYPED(CheckBoxModifyHdl, CheckBox&, void); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: @@ -149,6 +152,7 @@ class GraphicFilterSepia : public GraphicFilterDialog { private: VclPtr<MetricField> mpMtrSepia; + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGraphic, sal_uInt16 nSepiaPercent ); @@ -165,6 +169,7 @@ class GraphicFilterPoster : public GraphicFilterDialog { private: VclPtr<NumericField> mpNumPoster; + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: GraphicFilterPoster( vcl::Window* pParent, const Graphic& rGraphic, sal_uInt16 nPosterColorCount ); diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx index 62da72139f40..f7761c9f3d4d 100644 --- a/cui/source/inc/cuioptgenrl.hxx +++ b/cui/source/inc/cuioptgenrl.hxx @@ -50,7 +50,7 @@ private: unsigned nNameRow; unsigned nShortNameField; - DECL_LINK( ModifyHdl_Impl, Edit * ); + DECL_LINK_TYPED( ModifyHdl_Impl, Edit&, void ); bool GetAddress_Impl(); void SetAddress_Impl(); diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 95a7163f9522..671d4220da95 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -143,9 +143,10 @@ class SvxTransparenceTabPage : public SvxTabPage DECL_LINK_TYPED(ClickTransOffHdl_Impl, Button*, void ); DECL_LINK_TYPED(ClickTransLinearHdl_Impl, Button*, void ); DECL_LINK_TYPED(ClickTransGradientHdl_Impl, Button*, void ); - DECL_LINK(ModifyTransparentHdl_Impl, void*); - DECL_LINK(ModifiedTrgrHdl_Impl, void*); + DECL_LINK_TYPED(ModifyTransparentHdl_Impl, Edit&, void); + DECL_LINK_TYPED(ModifiedTrgrEditHdl_Impl, Edit&, void); DECL_LINK_TYPED(ModifiedTrgrListBoxHdl_Impl, ListBox&, void); + void ModifiedTrgrHdl_Impl(void*); void ActivateLinear(bool bActivate); void ActivateGradient(bool bActivate); @@ -271,13 +272,14 @@ private: DECL_LINK_TYPED( ModifyHatchingHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ToggleHatchBckgrdColorHdl_Impl, CheckBox&, void ); DECL_LINK_TYPED( ModifyBitmapHdl_Impl, ListBox&, void ); - DECL_LINK( ModifyStepCountHdl_Impl, void* ); + DECL_LINK_TYPED( ModifyStepCountEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ModifyStepCountClickHdl_Impl, Button*, void ); + void ModifyStepCountHdl_Impl(void*); //UUUU DECL_LINK_TYPED( ClickImportHdl_Impl, Button*, void ); - DECL_LINK( ModifyTileHdl_Impl, void * ); + DECL_LINK_TYPED( ModifyTileHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ModifyTileClickHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickScaleHdl_Impl, Button*, void ); void ClickInvisibleHdl_Impl(); @@ -353,7 +355,7 @@ private: SfxMapUnit m_ePoolUnit; DECL_LINK_TYPED( ClickShadowHdl_Impl, Button*, void ); - DECL_LINK( ModifyShadowHdl_Impl, void * ); + DECL_LINK_TYPED( ModifyShadowHdl_Impl, Edit&, void ); DECL_LINK_TYPED( SelectShadowHdl_Impl, ListBox&, void ); public: @@ -428,10 +430,11 @@ private: DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( ChangeGradientHdl_Impl, ListBox&, void ); - DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); + void ModifiedHdl_Impl(void*); long CheckChanges_Impl(); void SetControlState_Impl( css::awt::GradientStyle eXGS ); @@ -504,8 +507,9 @@ private: SfxMapUnit m_ePoolUnit; DECL_LINK_TYPED( ChangeHatchHdl_Impl, ListBox&, void ); - DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); + void ModifiedHdl_Impl(void*); DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); @@ -729,7 +733,7 @@ private: DECL_LINK_TYPED( SelectValSetHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( SelectColorModelHdl_Impl, ListBox&, void ); void ChangeColor(const Color &rNewColor); - DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedHdl_Impl, Edit&, void ); long CheckChanges_Impl(); diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index 3ad9556d69d4..e25562eef712 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -173,22 +173,22 @@ private: // handler for gallery popup menu button + size DECL_LINK_TYPED( GraphicHdl_Impl, MenuButton *, void ); DECL_LINK_TYPED( MenuCreateHdl_Impl, MenuButton *, void ); - DECL_LINK( SizeHdl_Impl, MetricField * ); + DECL_LINK_TYPED( SizeHdl_Impl, Edit&, void ); DECL_LINK_TYPED( RatioHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickInvisibleHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeStartClickHdl_Impl, Button*, void ); DECL_LINK_TYPED( ChangeStartListBoxHdl_Impl, ListBox&, void ); - DECL_LINK( ChangeStartModifyHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeStartModifyHdl_Impl, Edit&, void ); void ChangeStartHdl_Impl(void*); DECL_LINK_TYPED( ChangeEndListBoxHdl_Impl, ListBox&, void ); - DECL_LINK( ChangeEndModifyHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeEndModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ChangeEndClickHdl_Impl, Button*, void ); void ChangeEndHdl_Impl(void*); DECL_LINK_TYPED( ChangePreviewListBoxHdl_Impl, ListBox&, void ); - DECL_LINK( ChangePreviewModifyHdl_Impl, void* ); + DECL_LINK_TYPED( ChangePreviewModifyHdl_Impl, Edit&, void ); void ChangePreviewHdl_Impl(void*); - DECL_LINK( ChangeTransparentHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeTransparentHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ChangeEdgeStyleHdl_Impl, ListBox&, void ); @@ -293,9 +293,9 @@ private: DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( SelectLinestyleListBoxHdl_Impl, ListBox&, void ); void SelectLinestyleHdl_Impl(ListBox*); - DECL_LINK( ChangePreviewHdl_Impl, void * ); - DECL_LINK( ChangeNumber1Hdl_Impl, void * ); - DECL_LINK( ChangeNumber2Hdl_Impl, void * ); + DECL_LINK_TYPED( ChangePreviewHdl_Impl, Edit&, void ); + DECL_LINK_TYPED( ChangeNumber1Hdl_Impl, Edit&, void ); + DECL_LINK_TYPED( ChangeNumber2Hdl_Impl, Edit&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); DECL_LINK_TYPED( ChangeMetricHdl_Impl, Button*, void ); diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx index 9b5289820ba0..ec765293c2ef 100644 --- a/cui/source/inc/dlgname.hxx +++ b/cui/source/inc/dlgname.hxx @@ -36,7 +36,7 @@ private: Link<SvxNameDialog&,bool> aCheckNameHdl; - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: SvxNameDialog( vcl::Window* pWindow, const OUString& rName, const OUString& rDesc ); @@ -85,7 +85,7 @@ private: // callback link for name uniqueness Link<SvxObjectNameDialog&,bool> aCheckNameHdl; - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: // constructor diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx index 49ad01f2a9fd..d2497117c405 100644 --- a/cui/source/inc/grfpage.hxx +++ b/cui/source/inc/grfpage.hxx @@ -95,13 +95,13 @@ class SvxGrfCropPage : public SfxTabPage virtual ~SvxGrfCropPage(); virtual void dispose() override; - DECL_LINK( ZoomHdl, MetricField * ); - DECL_LINK( SizeHdl, MetricField * ); + DECL_LINK_TYPED( ZoomHdl, Edit&, void ); + DECL_LINK_TYPED( SizeHdl, Edit&, void ); DECL_LINK_TYPED( CropHdl, SpinField&, void ); DECL_LINK_TYPED( CropLoseFocusHdl, Control&, void ); - DECL_LINK( CropModifyHdl, MetricField * ); - DECL_LINK_TYPED(OrigSizeHdl, Button*, void); - DECL_LINK_TYPED(Timeout, Timer *, void); + DECL_LINK_TYPED( CropModifyHdl, Edit&, void ); + DECL_LINK_TYPED( OrigSizeHdl, Button*, void ); + DECL_LINK_TYPED( Timeout, Timer *, void ); void CalcZoom(); void CalcMinMaxBorder(); diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx index da6f675d7110..271d5a0e2834 100644 --- a/cui/source/inc/hangulhanjadlg.hxx +++ b/cui/source/inc/hangulhanjadlg.hxx @@ -183,7 +183,7 @@ namespace svx private: DECL_LINK_TYPED( OnOption, Button*, void ); - DECL_LINK( OnSuggestionModified, void* ); + DECL_LINK_TYPED( OnSuggestionModified, Edit&, void ); DECL_LINK_TYPED( OnSuggestionSelected, SuggestionDisplay&, void ); DECL_LINK_TYPED( OnConversionDirectionClicked, Button*, void ); DECL_LINK_TYPED( ClickByCharacterHdl, Button*, void ); @@ -237,7 +237,7 @@ namespace svx bool m_bEntered; DECL_LINK_TYPED( OKHdl, Button*, void ); - DECL_LINK( ModifyHdl, void* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); public: HangulHanjaNewDictDialog( vcl::Window* _pParent ); virtual ~HangulHanjaNewDictDialog(); @@ -291,12 +291,12 @@ namespace svx bool m_bModifiedSuggestions; bool m_bModifiedOriginal; - DECL_LINK( OriginalModifyHdl, void* ); + DECL_LINK_TYPED( OriginalModifyHdl, Edit&, void ); DECL_LINK_TYPED( ScrollHdl, ScrollBar*, void ); - DECL_LINK( EditModifyHdl1, Edit* ); - DECL_LINK( EditModifyHdl2, Edit* ); - DECL_LINK( EditModifyHdl3, Edit* ); - DECL_LINK( EditModifyHdl4, Edit* ); + DECL_LINK_TYPED( EditModifyHdl1, Edit&, void ); + DECL_LINK_TYPED( EditModifyHdl2, Edit&, void ); + DECL_LINK_TYPED( EditModifyHdl3, Edit&, void ); + DECL_LINK_TYPED( EditModifyHdl4, Edit&, void ); DECL_LINK_TYPED( BookLBSelectHdl, ListBox&, void ); DECL_LINK_TYPED( NewPBPushHdl, Button*, void ); diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx index 0aea2dc4dd5a..4589c46bfb3e 100644 --- a/cui/source/inc/hldoctp.hxx +++ b/cui/source/inc/hldoctp.hxx @@ -44,8 +44,8 @@ private: DECL_LINK_TYPED (ClickFileopenHdl_Impl, Button*, void ); DECL_LINK_TYPED (ClickTargetHdl_Impl , Button*, void ); - DECL_LINK (ModifiedPathHdl_Impl , void * ); ///< Contens of combobox "Path" modified - DECL_LINK (ModifiedTargetHdl_Impl, void * ); ///< Contens of editfield "Target" modified + DECL_LINK_TYPED (ModifiedPathHdl_Impl , Edit&, void ); ///< Contents of combobox "Path" modified + DECL_LINK_TYPED (ModifiedTargetHdl_Impl, Edit&, void ); ///< Contents of editfield "Target" modified DECL_LINK_TYPED( LostFocusPathHdl_Impl, Control&, void ); ///< Combobox "path" lost its focus diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx index d964caea5334..f70b8f7d2d74 100644 --- a/cui/source/inc/hlinettp.hxx +++ b/cui/source/inc/hlinettp.hxx @@ -50,9 +50,9 @@ private: 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_TYPED( ModifiedLoginHdl_Impl , Edit&, void ); ///< Contents of editfield "Login" modified 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( ModifiedTargetHdl_Impl , Edit&, void ); ///< Contents of editfield "Target" modified DECL_LINK_TYPED( TimeoutHdl_Impl, Timer *, void); ///< Handler for timer -timeout diff --git a/cui/source/inc/hlmailtp.hxx b/cui/source/inc/hlmailtp.hxx index 3c128ffd6688..df5235ec8e6a 100644 --- a/cui/source/inc/hlmailtp.hxx +++ b/cui/source/inc/hlmailtp.hxx @@ -37,7 +37,7 @@ private: DECL_STATIC_LINK_TYPED(SvxHyperlinkMailTp, ClickAdrBookHdl_Impl, Button*, void); ///< Button : Address book - DECL_LINK (ModifiedReceiverHdl_Impl, void * ); ///< Combobox "receiver" modified + DECL_LINK_TYPED (ModifiedReceiverHdl_Impl, Edit&, void ); ///< Combobox "receiver" modified void SetScheme(const OUString& rScheme); void RemoveImproperProtocol(const OUString& aProperScheme); diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx index 6e985c33c854..bc1e5ce32a75 100644 --- a/cui/source/inc/measure.hxx +++ b/cui/source/inc/measure.hxx @@ -61,9 +61,10 @@ private: void FillUnitLB(); DECL_LINK_TYPED( ClickAutoPosHdl_Impl, Button*, void ); - DECL_LINK( ChangeAttrHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeAttrEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ChangeAttrListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeAttrClickHdl_Impl, Button*, void ); + void ChangeAttrHdl_Impl(void*); public: diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index 8fa538433390..f936e1f71f9b 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -158,10 +158,12 @@ private: DECL_LINK_TYPED( SelFormatClickHdl_Impl, Button*, void ); void SelFormatHdl_Impl(void*); DECL_LINK_TYPED( ClickHdl_Impl, Button*, void ); - DECL_LINK( EditHdl_Impl, Edit* ); - DECL_LINK( OptHdl_Impl, void * ); + DECL_LINK_TYPED( EditModifyHdl_Impl, Edit&, void ); + DECL_LINK_TYPED( OptEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( OptClickHdl_Impl, Button*, void ); DECL_LINK_TYPED( TimeHdl_Impl, Timer *, void); + void EditHdl_Impl(Edit*); + void OptHdl_Impl(void*); }; #endif diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 8ffba711cc7c..8d83f106dfb4 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -325,17 +325,18 @@ class SvxNumOptionsTabPage : public SfxTabPage DECL_LINK_TYPED( PopupActivateHdl_Impl, Menu *, bool); DECL_LINK_TYPED( GraphicHdl_Impl, MenuButton *, void ); DECL_LINK_TYPED( BulletHdl_Impl, Button*, void); - DECL_LINK( SizeHdl_Impl, MetricField * ); + DECL_LINK_TYPED( SizeHdl_Impl, Edit&, void ); DECL_LINK_TYPED( RatioHdl_Impl, Button*, void ); DECL_LINK_TYPED( CharFmtHdl_Impl, ListBox&, void ); - DECL_LINK( EditModifyHdl_Impl, Edit* ); + DECL_LINK_TYPED( EditModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( EditListBoxHdl_Impl, ListBox&, void ); - DECL_LINK( AllLevelHdl_Impl, NumericField * ); + DECL_LINK_TYPED( AllLevelHdl_Impl, Edit&, void ); DECL_LINK_TYPED( OrientHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SameLevelHdl_Impl, Button*, void ); DECL_LINK_TYPED( BulColorHdl_Impl, ListBox&, void ); - DECL_LINK( BulRelSizeHdl_Impl, MetricField *); + DECL_LINK_TYPED( BulRelSizeHdl_Impl, Edit&, void); DECL_LINK_TYPED( PreviewInvalidateHdl_Impl, Timer *, void); + void EditModifyHdl_Impl(Edit*); public: SvxNumOptionsTabPage(vcl::Window* pParent, diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx index 5d5189f0e74a..d3cb6140365e 100644 --- a/cui/source/inc/optasian.hxx +++ b/cui/source/inc/optasian.hxx @@ -50,7 +50,7 @@ class SvxAsianLayoutPage : public SfxTabPage DECL_LINK_TYPED(LanguageHdl, ListBox&, void); DECL_LINK_TYPED(ChangeStandardHdl, Button*, void); - DECL_LINK(ModifyHdl, Edit*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet ); diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx index d64d80b82dd0..7f4d665e0d83 100644 --- a/cui/source/inc/optdict.hxx +++ b/cui/source/inc/optdict.hxx @@ -60,7 +60,7 @@ private: css::linguistic2::XDictionary > xNewDic; DECL_LINK_TYPED(OKHdl_Impl, Button*, void); - DECL_LINK(ModifyHdl_Impl, void *); + DECL_LINK_TYPED(ModifyHdl_Impl, Edit&, void); public: SvxNewDictionaryDialog( vcl::Window* pParent, @@ -134,7 +134,7 @@ private: DECL_LINK_TYPED(SelectHdl, SvTreeListBox*, void); DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, SvxDictEdit&, bool); - DECL_LINK(ModifyHdl, Edit*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); bool NewDelHdl(void*); diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index 3da4a8955114..be03c3abbc08 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -153,13 +153,13 @@ private: 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_TYPED( BorderModify_Impl, Edit&, void); void InitHeadFoot_Impl( const SfxItemSet& rSet ); DECL_LINK_TYPED( CenterHdl_Impl, Button*, void); void UpdateExample_Impl( bool bResetbackground = false ); DECL_LINK_TYPED( PaperSizeSelect_Impl, ListBox&, void ); - DECL_LINK( PaperSizeModify_Impl, void *); + DECL_LINK_TYPED( PaperSizeModify_Impl, Edit&, void); DECL_LINK_TYPED( FrameDirectionModify_Impl, ListBox&, void ); diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index f71e9f4010d6..df2f87b1ec2c 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -91,7 +91,7 @@ private: void UpdateExample_Impl(); DECL_LINK_TYPED( LineDistHdl_Impl, ListBox&, void ); - DECL_LINK(ModifyHdl_Impl, void *); + DECL_LINK_TYPED( ModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( AutoHdl_Impl, Button*, void ); protected: diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx index 12c686519a81..602dd555ae3f 100644 --- a/cui/source/inc/swpossizetabpage.hxx +++ b/cui/source/inc/swpossizetabpage.hxx @@ -106,7 +106,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage DECL_LINK_TYPED( PosHdl, ListBox&, void ); DECL_LINK_TYPED( RelHdl, ListBox&, void ); DECL_LINK_TYPED(MirrorHdl, Button*, void); - DECL_LINK( ModifyHdl, Edit * ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED(ProtectHdl, Button*, void); void InitPos(short nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel, diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx index 0aede59214a8..82dbb831a9f0 100644 --- a/cui/source/inc/tabstpge.hxx +++ b/cui/source/inc/tabstpge.hxx @@ -108,14 +108,14 @@ private: // Handler DECL_LINK_TYPED( NewHdl_Impl, Button*, void ); - DECL_LINK_TYPED(DelHdl_Impl, Button*, void ); - DECL_LINK_TYPED(DelAllHdl_Impl, Button*, void ); + DECL_LINK_TYPED( DelHdl_Impl, Button*, void ); + DECL_LINK_TYPED( DelAllHdl_Impl, Button*, void ); DECL_LINK_TYPED( FillTypeCheckHdl_Impl, Button*, void ); DECL_LINK_TYPED( TabTypeCheckHdl_Impl, Button*, void ); DECL_LINK_TYPED( SelectHdl_Impl, ComboBox&, void ); - DECL_LINK(ModifyHdl_Impl, void *); + DECL_LINK_TYPED( ModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( GetFillCharHdl_Impl, Control&, void ); DECL_LINK_TYPED( GetDezCharHdl_Impl, Control&, void ); diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx index f79897f94e28..3490963393f5 100644 --- a/cui/source/inc/transfrm.hxx +++ b/cui/source/inc/transfrm.hxx @@ -137,8 +137,8 @@ private: void SetMinMaxPosition(); void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange); - DECL_LINK( ChangeWidthHdl, void * ); - DECL_LINK( ChangeHeightHdl, void * ); + DECL_LINK_TYPED( ChangeWidthHdl, Edit&, void ); + DECL_LINK_TYPED( ChangeHeightHdl, Edit&, void ); DECL_LINK_TYPED( ClickSizeProtectHdl, Button*, void ); DECL_LINK_TYPED( ClickAutoHdl, Button*, void ); diff --git a/cui/source/inc/zoom.hxx b/cui/source/inc/zoom.hxx index 818d381c0a10..6b6000edee3e 100644 --- a/cui/source/inc/zoom.hxx +++ b/cui/source/inc/zoom.hxx @@ -49,9 +49,9 @@ private: bool mbModified; DECL_LINK_TYPED(UserHdl, Button*, void); - DECL_LINK(SpinHdl, void*); + DECL_LINK_TYPED(SpinHdl, Edit&, void); DECL_LINK_TYPED(ViewLayoutUserHdl, Button*, void); - DECL_LINK(ViewLayoutSpinHdl, NumericField*); + DECL_LINK_TYPED(ViewLayoutSpinHdl, Edit&, void); DECL_LINK_TYPED(ViewLayoutCheckHdl, Button*, void); DECL_LINK_TYPED(OKHdl, Button*, void); diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx index 1ed31255d216..5e08c75c447a 100644 --- a/cui/source/options/doclinkdialog.cxx +++ b/cui/source/options/doclinkdialog.cxx @@ -204,10 +204,9 @@ namespace svx } - IMPL_LINK_NOARG(ODocumentLinkDialog, OnTextModified) + IMPL_LINK_NOARG_TYPED(ODocumentLinkDialog, OnTextModified, Edit&, void) { validate( ); - return 0L; } diff --git a/cui/source/options/doclinkdialog.hxx b/cui/source/options/doclinkdialog.hxx index a3f86c803d5c..2ab3a88aacfe 100644 --- a/cui/source/options/doclinkdialog.hxx +++ b/cui/source/options/doclinkdialog.hxx @@ -59,7 +59,7 @@ namespace svx void getLink( OUString& _rName, OUString& _rURL ) const; protected: - DECL_LINK(OnTextModified, void *); + DECL_LINK_TYPED( OnTextModified, Edit&, void ); DECL_LINK_TYPED( OnBrowseFile, Button*, void ); DECL_LINK_TYPED( OnOk, Button*, void ); diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 9b6537236c04..9a9e5ebd82f7 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -88,7 +88,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent, m_pCheckLB->setColSizes(); aTextColor = m_pCheckLB->GetTextColor(); - Link<> aLink(LINK(this, SvxFontSubstTabPage, SelectHdl)); + Link<Edit&,void> aLink(LINK(this, SvxFontSubstTabPage, SelectEditHdl)); Link<ComboBox&,void> aLink2(LINK(this, SvxFontSubstTabPage, SelectComboBoxHdl)); Link<Button*,void> aClickLink(LINK(this, SvxFontSubstTabPage, ClickHdl)); @@ -270,7 +270,11 @@ IMPL_LINK_TYPED(SvxFontSubstTabPage, SelectComboBoxHdl, ComboBox&, rBox, void) { SelectHdl(&rBox); } -IMPL_LINK(SvxFontSubstTabPage, SelectHdl, vcl::Window*, pWin) +IMPL_LINK_TYPED(SvxFontSubstTabPage, SelectEditHdl, Edit&, rBox, void) +{ + SelectHdl(&rBox); +} +void SvxFontSubstTabPage::SelectHdl(vcl::Window* pWin) { if (pWin == m_pApply || pWin == m_pDelete) { @@ -342,8 +346,6 @@ IMPL_LINK(SvxFontSubstTabPage, SelectHdl, vcl::Window*, pWin) } CheckEnable(); - - return 0; } diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx index 7615d9483f97..215cd506406e 100644 --- a/cui/source/options/fontsubs.hxx +++ b/cui/source/options/fontsubs.hxx @@ -81,11 +81,12 @@ class SvxFontSubstTabPage : public SfxTabPage SvLBoxButtonData* pCheckButtonData; - DECL_LINK(SelectHdl, vcl::Window *); + DECL_LINK_TYPED(SelectEditHdl, Edit&, void); DECL_LINK_TYPED(SelectComboBoxHdl, ComboBox&, void); DECL_LINK_TYPED(ClickHdl, Button*, void); DECL_LINK_TYPED(TreeListBoxSelectHdl, SvTreeListBox*, void); DECL_LINK_TYPED(NonPropFontsHdl, Button*, void); + void SelectHdl(vcl::Window*); SvTreeListEntry* CreateEntry(OUString& rFont1, OUString& rFont2); void CheckEnable(); diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 1ccc1ce4af65..4f21f18fe5e6 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -142,7 +142,7 @@ SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& LanguageHdl(*m_pLanguageLB); m_pLanguageLB->SetSelectHdl(LINK(this, SvxAsianLayoutPage, LanguageHdl)); m_pStandardCB->SetClickHdl(LINK(this, SvxAsianLayoutPage, ChangeStandardHdl)); - Link<> aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl)); + Link<Edit&,void> aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl)); m_pStartED->SetModifyHdl(aLk); m_pEndED->SetModifyHdl(aLk); @@ -384,16 +384,16 @@ IMPL_LINK_TYPED(SvxAsianLayoutPage, ChangeStandardHdl, Button*, pBox, void) m_pStartFT->Enable(!bCheck); m_pEndFT->Enable(!bCheck); - ModifyHdl(m_pStartED); + ModifyHdl(*m_pStartED); } -IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED(SvxAsianLayoutPage, ModifyHdl, Edit&, rEdit, void) { LanguageType eSelectLanguage = m_pLanguageLB->GetSelectLanguage(); Locale aLocale( LanguageTag::convertToLocale( eSelectLanguage )); OUString sStart = m_pStartED->GetText(); OUString sEnd = m_pEndED->GetText(); - bool bEnable = pEdit->IsEnabled(); + bool bEnable = rEdit.IsEnabled(); if(pImpl->xForbidden.is()) { try @@ -414,7 +414,6 @@ IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, Edit*, pEdit) } } pImpl->aConfig.SetStartEndChars( aLocale, bEnable ? &sStart : 0, bEnable ? &sEnd : 0); - return 0; } const sal_uInt16* SvxAsianLayoutPage::GetRanges() diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 28535aaaa1d3..d8ddc4e9b0c3 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -206,13 +206,12 @@ IMPL_LINK_NOARG_TYPED(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxNewDictionaryDialog, ModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNewDictionaryDialog, ModifyHdl_Impl, Edit&, void) { if ( !pNameEdit->GetText().isEmpty() ) pOKBtn->Enable(); else pOKBtn->Disable(); - return 0; } // class SvxEditDictionaryDialog ------------------------------------------- @@ -690,15 +689,15 @@ bool SvxEditDictionaryDialog::NewDelHdl(void* pBtn) // which means EndDialog() - has to be evaluated in KeyInput return false; } - ModifyHdl(pWordED); + ModifyHdl(*pWordED); return true; } -IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt) +IMPL_LINK_TYPED(SvxEditDictionaryDialog, ModifyHdl, Edit&, rEdt, void) { - OUString rEntry = pEdt->GetText(); + OUString rEntry = rEdt.GetText(); sal_Int32 nWordLen = rEntry.getLength(); const OUString& rRepString = pReplaceED->GetText(); @@ -707,7 +706,7 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt) bool bEnableDelete = false; OUString aNewReplaceText = sNew; - if(pEdt == pWordED) + if(&rEdt == pWordED) { if(nWordLen>0) { @@ -768,7 +767,7 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt) bDoNothing=false; } } - else if(pEdt == pReplaceED) + else if(&rEdt == pReplaceED) { OUString aReplaceText; OUString aWordText; @@ -791,8 +790,6 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt) pNewReplacePB->SetText( aNewReplaceText ); pNewReplacePB->Enable( bEnableNewReplace && !IsDicReadonly_Impl() ); pDeletePB->Enable( bEnableDelete && !IsDicReadonly_Impl() ); - - return 0; } diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 4c216c9a52c2..6f14ea8c2814 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -411,10 +411,8 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet ) m_pCollectUsageInfo->SaveValue(); } -IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd ) +IMPL_LINK_NOARG_TYPED( OfaMiscTabPage, TwoFigureHdl, Edit&, void ) { - (void)pEd; - OUString aOutput( m_aStrDateInfo ); OUString aStr( m_pYearValueField->GetText() ); OUString sSep( SvtSysLocale().GetLocaleData().getNumThousandSep() ); @@ -430,7 +428,6 @@ IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd ) aOutput += OUString::number( nNum ); } m_pToYearFT->SetText( aOutput ); - return 0; } IMPL_LINK_TYPED( OfaMiscTabPage, TwoFigureConfigFocusHdl, Control&, rControl, void ) @@ -443,7 +440,7 @@ IMPL_LINK_TYPED( OfaMiscTabPage, TwoFigureConfigHdl, SpinField&, rEd, void ) OUString aOutput(OUString::number(nNum)); m_pYearValueField->SetText(aOutput); m_pYearValueField->SetSelection( Selection( 0, aOutput.getLength() ) ); - TwoFigureHdl( static_cast<NumericField*>(&rEd) ); + TwoFigureHdl( static_cast<Edit&>(rEd) ); } class CanvasSettings @@ -1699,9 +1696,9 @@ IMPL_LINK_TYPED( OfaLanguagesTabPage, LocaleSettingHdl, ListBox&, rListBox, void m_pDatePatternsED->SetText( aDatePatternsString); } -IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, pEd ) +IMPL_LINK_TYPED( OfaLanguagesTabPage, DatePatternsHdl, Edit&, rEd, void ) { - const OUString aPatterns( pEd->GetText()); + const OUString aPatterns( rEd.GetText()); OUStringBuffer aBuf( aPatterns); sal_Int32 nChar = 0; bool bValid = true; @@ -1787,26 +1784,25 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, pEd ) // Do not use SetText(...,GetSelection()) because internally the // reference's pointer of the selection is obtained resulting in the // entire text being selected at the end. - Selection aSelection( pEd->GetSelection()); - pEd->SetText( aBuf.makeStringAndClear(), aSelection); + Selection aSelection( rEd.GetSelection()); + rEd.SetText( aBuf.makeStringAndClear(), aSelection); } if (bValid) { - pEd->SetControlForeground(); - pEd->SetControlBackground(); + rEd.SetControlForeground(); + rEd.SetControlBackground(); } else { #if 0 //! Gives white on white!?! instead of white on reddish. - pEd->SetControlBackground( ::Color( RGB_COLORDATA( 0xff, 0x65, 0x63))); - pEd->SetControlForeground( ::Color( COL_WHITE)); + rEd.SetControlBackground( ::Color( RGB_COLORDATA( 0xff, 0x65, 0x63))); + rEd.SetControlForeground( ::Color( COL_WHITE)); #else - pEd->SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0))); + rEd.SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0))); #endif } m_bDatePatternsValid = bValid; - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index 4d803ba3c8dd..695d03c0d100 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -58,7 +58,7 @@ private: VclPtr<CheckBox> m_pCollectUsageInfo; - DECL_LINK( TwoFigureHdl, NumericField* ); + DECL_LINK_TYPED( TwoFigureHdl, Edit&, void ); DECL_LINK_TYPED( TwoFigureConfigHdl, SpinField&, void ); DECL_LINK_TYPED( TwoFigureConfigFocusHdl, Control&, void ); #ifdef WNT @@ -161,7 +161,7 @@ class OfaLanguagesTabPage : public SfxTabPage DECL_LINK_TYPED( SupportHdl, Button*, void ) ; DECL_LINK_TYPED( LocaleSettingHdl, ListBox&, void ) ; - DECL_LINK( DatePatternsHdl, Edit* ) ; + DECL_LINK_TYPED( DatePatternsHdl, Edit&, void ) ; public: OfaLanguagesTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 7903b1cbea20..7de37b318247 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -290,7 +290,7 @@ void SvxGeneralTabPage::InitControls () void SvxGeneralTabPage::SetLinks () { // link for updating the initials - Link<> aLink = LINK( this, SvxGeneralTabPage, ModifyHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxGeneralTabPage, ModifyHdl_Impl ); Row& rNameRow = *vRows[nNameRow]; for (unsigned i = rNameRow.nFirstField; i != rNameRow.nLastField - 1; ++i) vFields[i]->pEdit->SetModifyHdl(aLink); @@ -347,7 +347,7 @@ void SvxGeneralTabPage::Reset( const SfxItemSet* rSet ) // ModifyHdl_Impl() // This handler updates the initials (short name) // when one of the name fields was updated. -IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit ) +IMPL_LINK_TYPED( SvxGeneralTabPage, ModifyHdl_Impl, Edit&, rEdit, void ) { // short name field and row Field& rShortName = *vFields[nShortNameField]; @@ -358,7 +358,7 @@ IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit ) unsigned nField = nInits; for (unsigned i = 0; i != nInits; ++i) { - if (vFields[rNameRow.nFirstField + i]->pEdit == pEdit) + if (vFields[rNameRow.nFirstField + i]->pEdit == &rEdit) nField = i; } // updating the initial @@ -372,12 +372,11 @@ IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit ) } while ((unsigned)sShortName.getLength() < nInits) sShortName += " "; - OUString sName = pEdit->GetText(); + OUString sName = rEdit.GetText(); OUString sLetter = sName.isEmpty() ? OUString(sal_Unicode(' ')) : sName.copy(0, 1); rShortName.pEdit->SetText(sShortName.replaceAt(nField, 1, sLetter).trim()); } - return 0; } diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index c3b6dcfb98d0..8d53c397d4a9 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -815,7 +815,7 @@ SvxJavaParameterDlg::SvxJavaParameterDlg( vcl::Window* pParent ) : m_pAssignedList->SetSelectHdl( LINK( this, SvxJavaParameterDlg, SelectHdl_Impl ) ); m_pAssignedList->SetDoubleClickHdl( LINK( this, SvxJavaParameterDlg, DblClickHdl_Impl ) ); - ModifyHdl_Impl( m_pParameterEdit ); + ModifyHdl_Impl( *m_pParameterEdit ); EnableRemoveButton(); } @@ -834,12 +834,10 @@ void SvxJavaParameterDlg::dispose() } -IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, ModifyHdl_Impl, Edit&, void) { OUString sParam = comphelper::string::strip(m_pParameterEdit->GetText(), ' '); m_pAssignBtn->Enable(!sParam.isEmpty()); - - return 0; } @@ -854,7 +852,7 @@ IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, AssignHdl_Impl, Button*, void) nPos = m_pAssignedList->InsertEntry( sParam ); m_pAssignedList->SelectEntryPos( nPos ); m_pParameterEdit->SetText( OUString() ); - ModifyHdl_Impl( m_pParameterEdit ); + ModifyHdl_Impl( *m_pParameterEdit ); EnableRemoveButton(); } } diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx index 271236dffa8b..84fdfa480e46 100644 --- a/cui/source/options/optjava.hxx +++ b/cui/source/options/optjava.hxx @@ -127,7 +127,7 @@ private: VclPtr<ListBox> m_pAssignedList; VclPtr<PushButton> m_pRemoveBtn; - DECL_LINK(ModifyHdl_Impl, void *); + DECL_LINK_TYPED(ModifyHdl_Impl, Edit&, void); DECL_LINK_TYPED(AssignHdl_Impl, Button*, void); DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); DECL_LINK_TYPED(DblClickHdl_Impl, ListBox&, void); diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx index d9b843126f2e..8cd429800169 100644 --- a/cui/source/options/optmemory.cxx +++ b/cui/source/options/optmemory.cxx @@ -229,7 +229,7 @@ void OfaMemoryOptionsPage::Reset( const SfxItemSet* rSet ) tools::Time aTime( (sal_uInt16)( nTime / 3600 ), (sal_uInt16)( ( nTime % 3600 ) / 60 ), (sal_uInt16)( ( nTime % 3600 ) % 60 ) ); m_pTfGraphicObjectTime->SetTime( aTime ); - GraphicCacheConfigHdl(m_pNfGraphicCache); + GraphicCacheConfigHdl(*m_pNfGraphicCache); // OLECache m_pNfOLECache->SetValue( @@ -252,7 +252,7 @@ void OfaMemoryOptionsPage::Reset( const SfxItemSet* rSet ) -IMPL_LINK_NOARG(OfaMemoryOptionsPage, GraphicCacheConfigHdl) +IMPL_LINK_NOARG_TYPED(OfaMemoryOptionsPage, GraphicCacheConfigHdl, Edit&, void) { sal_Int32 n = GetNfGraphicCacheVal(); SetNfGraphicObjectCacheMax( n ); @@ -260,8 +260,6 @@ IMPL_LINK_NOARG(OfaMemoryOptionsPage, GraphicCacheConfigHdl) if( GetNfGraphicObjectCacheVal() > n ) SetNfGraphicObjectCacheVal( n ); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optmemory.hxx b/cui/source/options/optmemory.hxx index 5a8432d4041f..e7b80b29b484 100644 --- a/cui/source/options/optmemory.hxx +++ b/cui/source/options/optmemory.hxx @@ -41,7 +41,7 @@ private: VclPtr<VclContainer> m_pQuickStarterFrame; VclPtr<CheckBox> m_pQuickLaunchCB; - DECL_LINK(GraphicCacheConfigHdl, void *); + DECL_LINK_TYPED(GraphicCacheConfigHdl, Edit&, void); sal_Int32 GetNfGraphicCacheVal() const; // returns # of Bytes inline void SetNfGraphicCacheVal( long nSizeInBytes ); diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index c6263ff7dafc..db508a2d40dd 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -220,7 +220,7 @@ public: VclPtr<Edit> mpDriverVersion; DECL_LINK_TYPED(OSSelectHdl, ListBox&, void); - DECL_LINK(EditModifiedHdl, Edit*); + DECL_LINK_TYPED(EditModifiedHdl, Edit&, void); ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag); virtual ~ListEntryDialog() { disposeOnce(); } @@ -285,18 +285,16 @@ IMPL_LINK_TYPED(ListEntryDialog, OSSelectHdl, ListBox&, rListBox, void) } } -IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit) +IMPL_LINK_TYPED(ListEntryDialog, EditModifiedHdl, Edit&, rEdit, void) { - if (pEdit == mpOSVersion) - maEntry.maOSVersion = pEdit->GetText(); - else if (pEdit == mpPlatformVendor) - maEntry.maPlatformVendor = pEdit->GetText(); - else if (pEdit == mpDevice) - maEntry.maDevice = pEdit->GetText(); - else if (pEdit == mpDriverVersion) - maEntry.maDriverVersion = pEdit->GetText(); - - return 0; + if (&rEdit == mpOSVersion) + maEntry.maOSVersion = rEdit.GetText(); + else if (&rEdit == mpPlatformVendor) + maEntry.maPlatformVendor = rEdit.GetText(); + else if (&rEdit == mpDevice) + maEntry.maDevice = rEdit.GetText(); + else if (&rEdit == mpDriverVersion) + maEntry.maDriverVersion = rEdit.GetText(); } void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag) diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 545988b6a51e..8292dbf335e5 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1143,7 +1143,7 @@ void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet) pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() ); pCompareClass->loadDefaultCollator( aLanguageTag.getLocale(), 0 ); pCharClass = new CharClass( aLanguageTag ); - ModifyHdl(m_pShortED); + ModifyHdl(*m_pShortED); } } @@ -1256,7 +1256,7 @@ bool OfaAutocorrReplacePage::NewDelHdl(void* pBtn) { DeleteEntry(SvTabListBox::GetEntryText(pEntry, 0), SvTabListBox::GetEntryText(pEntry, 1)); m_pReplaceTLB->GetModel()->Remove(pEntry); - ModifyHdl(m_pShortED); + ModifyHdl(*m_pShortED); return false; } } @@ -1313,15 +1313,15 @@ bool OfaAutocorrReplacePage::NewDelHdl(void* pBtn) // which means EndDialog() - has to be evaluated in KeyInput return false; } - ModifyHdl(m_pShortED); + ModifyHdl(*m_pShortED); return true; } -IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) +IMPL_LINK_TYPED(OfaAutocorrReplacePage, ModifyHdl, Edit&, rEdt, void) { SvTreeListEntry* pFirstSel = m_pReplaceTLB->FirstSelected(); - bool bShort = pEdt == m_pShortED; - const OUString rEntry = pEdt->GetText(); + bool bShort = &rEdt == m_pShortED; + const OUString rEntry = rEdt.GetText(); const OUString rRepString = m_pReplaceED->GetText(); OUString aWordStr( pCharClass->lowercase( rEntry )); @@ -1402,8 +1402,6 @@ IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) } } m_pNewReplacePB->Enable( bEnableNew ); - - return 0; } static bool lcl_FindInArray(std::vector<OUString>& rStrings, const OUString& rString) @@ -1613,8 +1611,8 @@ void OfaAutocorrExceptPage::SetLanguage(LanguageType eSet) delete pCompareClass; pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() ); pCompareClass->loadDefaultCollator( LanguageTag::convertToLocale( eLastDialogLanguage ), 0 ); - ModifyHdl(m_pAbbrevED); - ModifyHdl(m_pDoubleCapsED); + ModifyHdl(*m_pAbbrevED); + ModifyHdl(*m_pDoubleCapsED); } } @@ -1706,23 +1704,23 @@ bool OfaAutocorrExceptPage::NewDelHdl(void* pBtn) && !m_pAbbrevED->GetText().isEmpty()) { m_pAbbrevLB->InsertEntry(m_pAbbrevED->GetText()); - ModifyHdl(m_pAbbrevED); + ModifyHdl(*m_pAbbrevED); } else if(pBtn == m_pDelAbbrevPB) { m_pAbbrevLB->RemoveEntry(m_pAbbrevED->GetText()); - ModifyHdl(m_pAbbrevED); + ModifyHdl(*m_pAbbrevED); } else if((pBtn == m_pNewDoublePB || pBtn == m_pDoubleCapsED.get() ) && !m_pDoubleCapsED->GetText().isEmpty()) { m_pDoubleCapsLB->InsertEntry(m_pDoubleCapsED->GetText()); - ModifyHdl(m_pDoubleCapsED); + ModifyHdl(*m_pDoubleCapsED); } else if(pBtn == m_pDelDoublePB) { m_pDoubleCapsLB->RemoveEntry(m_pDoubleCapsED->GetText()); - ModifyHdl(m_pDoubleCapsED); + ModifyHdl(*m_pDoubleCapsED); } return false; } @@ -1743,16 +1741,16 @@ IMPL_LINK_TYPED(OfaAutocorrExceptPage, SelectHdl, ListBox&, rBox, void) } } -IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt) +IMPL_LINK_TYPED(OfaAutocorrExceptPage, ModifyHdl, Edit&, rEdt, void) { // sal_Bool bSame = pEdt->GetText() == ->GetSelectEntry(); - const OUString& sEntry = pEdt->GetText(); + const OUString& sEntry = rEdt.GetText(); bool bEntryLen = !sEntry.isEmpty(); - if(pEdt == m_pAbbrevED) + if(&rEdt == m_pAbbrevED) { bool bSame = lcl_FindEntry(*m_pAbbrevLB, sEntry, *pCompareClass); if(bSame && sEntry != m_pAbbrevLB->GetSelectEntry()) - pEdt->SetText(m_pAbbrevLB->GetSelectEntry()); + rEdt.SetText(m_pAbbrevLB->GetSelectEntry()); m_pNewAbbrevPB->Enable(!bSame && bEntryLen); m_pDelAbbrevPB->Enable(bSame && bEntryLen); } @@ -1760,11 +1758,10 @@ IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt) { bool bSame = lcl_FindEntry(*m_pDoubleCapsLB, sEntry, *pCompareClass); if(bSame && sEntry != m_pDoubleCapsLB->GetSelectEntry()) - pEdt->SetText(m_pDoubleCapsLB->GetSelectEntry()); + rEdt.SetText(m_pDoubleCapsLB->GetSelectEntry()); m_pNewDoublePB->Enable(!bSame && bEntryLen); m_pDelDoublePB->Enable(bSame && bEntryLen); } - return 0; } VCL_BUILDER_FACTORY(AutoCorrEdit) diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 0dda1cd7af80..c1fb557acdc4 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -870,7 +870,7 @@ IMPL_LINK_TYPED( SvxBorderTabPage, SelColHdl_Impl, ListBox&, rLb, void ) } } -IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, ModifyWidthHdl_Impl, Edit&, void) { sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthMF->GetValue( ), @@ -880,8 +880,6 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl) m_pFrameSel->SetStyleToSelection( nVal, SvxBorderStyle( m_pLbLineStyle->GetSelectEntryStyle() ) ); - - return 0; } @@ -1179,21 +1177,20 @@ IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, LinesChanged_Impl, LinkParamNone*, void) -IMPL_LINK( SvxBorderTabPage, ModifyDistanceHdl_Impl, MetricField*, pField) +IMPL_LINK_TYPED( SvxBorderTabPage, ModifyDistanceHdl_Impl, Edit&, rField, void) { if ( mbSync ) { - sal_Int64 nVal = pField->GetValue(); - if(pField != m_pLeftMF) + sal_Int64 nVal = static_cast<MetricField&>(rField).GetValue(); + if(&rField != m_pLeftMF) m_pLeftMF->SetValue(nVal); - if(pField != m_pRightMF) + if(&rField != m_pRightMF) m_pRightMF->SetValue(nVal); - if(pField != m_pTopMF) + if(&rField != m_pTopMF) m_pTopMF->SetValue(nVal); - if(pField != m_pBottomMF) + if(&rField != m_pBottomMF) m_pBottomMF->SetValue(nVal); } - return 0; } IMPL_LINK_TYPED( SvxBorderTabPage, SyncHdl_Impl, Button*, pBox, void) diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 7efc88e6a102..4fb8d0457b91 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -423,7 +423,7 @@ void SvxCharNamePage::Initialize() // to handle the changes of the other pages SetExchangeSupport(); - Link<> aLink = LINK( this, SvxCharNamePage, FontModifyHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxCharNamePage, FontModifyEditHdl_Impl ); m_pWestFontNameLB->SetModifyHdl( aLink ); m_pWestFontStyleLB->SetModifyHdl( aLink ); m_pWestFontSizeLB->SetModifyHdl( aLink ); @@ -1191,7 +1191,11 @@ IMPL_LINK_TYPED( SvxCharNamePage, FontModifyListBoxHdl_Impl, ListBox&, rBox, voi { FontModifyHdl_Impl(&rBox); } -IMPL_LINK( SvxCharNamePage, FontModifyHdl_Impl, void*, pNameBox ) +IMPL_LINK_TYPED( SvxCharNamePage, FontModifyEditHdl_Impl, Edit&, rBox, void ) +{ + FontModifyHdl_Impl(&rBox); +} +void SvxCharNamePage::FontModifyHdl_Impl(void* pNameBox) { m_pImpl->m_aUpdateIdle.Start(); @@ -1200,7 +1204,6 @@ IMPL_LINK( SvxCharNamePage, FontModifyHdl_Impl, void*, pNameBox ) FillStyleBox_Impl( static_cast<FontNameBox*>(pNameBox) ); FillSizeBox_Impl( static_cast<FontNameBox*>(pNameBox) ); } - return 0; } @@ -2724,7 +2727,7 @@ void SvxCharPositionPage::Initialize() m_p90degRB->SetClickHdl( aLink2 ); m_p270degRB->SetClickHdl( aLink2 ); - Link<> aLink = LINK( this, SvxCharPositionPage, FontModifyHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxCharPositionPage, FontModifyHdl_Impl ); m_pHighLowMF->SetModifyHdl( aLink ); m_pFontSizeMF->SetModifyHdl( aLink ); @@ -2820,13 +2823,12 @@ IMPL_LINK_TYPED( SvxCharPositionPage, RotationHdl_Impl, Button*, pBtn, void ) -IMPL_LINK_NOARG(SvxCharPositionPage, FontModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, FontModifyHdl_Impl, Edit&, void) { sal_uInt8 nEscProp = (sal_uInt8)m_pFontSizeMF->GetValue(); short nEsc = (short)m_pHighLowMF->GetValue(); nEsc *= m_pLowPosBtn->IsChecked() ? -1 : 1; UpdatePreview_Impl( 100, nEscProp, nEsc ); - return 0; } @@ -2889,12 +2891,12 @@ IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, KerningSelectHdl_Impl, ListBox&, void m_pKerningMF->Disable(); } - KerningModifyHdl_Impl( NULL ); + KerningModifyHdl_Impl( *m_pKerningMF ); } -IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, KerningModifyHdl_Impl, Edit&, void) { long nVal = static_cast<long>(m_pKerningMF->GetValue()); nVal = LogicToLogic( nVal, MAP_POINT, MAP_TWIP ); @@ -2912,7 +2914,6 @@ IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl) rCJKFont.SetFixKerning( (short)nKern ); rCTLFont.SetFixKerning( (short)nKern ); m_pPreviewWin->Invalidate(); - return 0; } @@ -2942,11 +2943,9 @@ IMPL_LINK_TYPED( SvxCharPositionPage, LoseFocusHdl_Impl, Control&, rControl, voi -IMPL_LINK_NOARG(SvxCharPositionPage, ScaleWidthModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, ScaleWidthModifyHdl_Impl, Edit&, void) { m_pPreviewWin->SetFontWidthScale( sal_uInt16( m_pScaleWidthMF->GetValue() ) ); - - return 0; } void SvxCharPositionPage::ActivatePage( const SfxItemSet& rSet ) diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index e7fa56d2a6ab..d1696bd52380 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -120,7 +120,7 @@ SvxConnectionPage::SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rI // disable 3D border m_pCtlPreview->SetBorderStyle(WindowBorderStyle::MONO); - Link<> aLink( LINK( this, SvxConnectionPage, ChangeAttrHdl_Impl ) ); + Link<Edit&,void> aLink( LINK( this, SvxConnectionPage, ChangeAttrEditHdl_Impl ) ); m_pMtrFldHorz1->SetModifyHdl( aLink ); m_pMtrFldVert1->SetModifyHdl( aLink ); m_pMtrFldHorz2->SetModifyHdl( aLink ); @@ -400,7 +400,11 @@ IMPL_LINK_TYPED( SvxConnectionPage, ChangeAttrListBoxHdl_Impl, ListBox&, r, void { ChangeAttrHdl_Impl(&r); } -IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxConnectionPage, ChangeAttrEditHdl_Impl, Edit&, r, void ) +{ + ChangeAttrHdl_Impl(&r); +} +void SvxConnectionPage::ChangeAttrHdl_Impl(void* p) { if( p == m_pMtrFldHorz1 ) { @@ -483,8 +487,6 @@ IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p ) m_pMtrFldLine1->SetEmptyFieldValue(); } - - return 0L; } void SvxConnectionPage::FillTypeLB() diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index be6df3cd25a0..b833b5095500 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -87,7 +87,7 @@ SvxGrfCropPage::SvxGrfCropPage ( vcl::Window *pParent, const SfxItemSet &rSet ) SetFieldUnit( *m_pTopMF , eMetric ); SetFieldUnit( *m_pBottomMF, eMetric ); - Link<> aLk = LINK(this, SvxGrfCropPage, SizeHdl); + Link<Edit&,void> aLk = LINK(this, SvxGrfCropPage, SizeHdl); m_pWidthMF->SetModifyHdl( aLk ); m_pHeightMF->SetModifyHdl( aLk ); @@ -414,19 +414,19 @@ SfxTabPage::sfxpg SvxGrfCropPage::DeactivatePage(SfxItemSet *_pSet) description: scale changed, adjust size --------------------------------------------------------------------*/ -IMPL_LINK( SvxGrfCropPage, ZoomHdl, MetricField *, pField ) +IMPL_LINK_TYPED( SvxGrfCropPage, ZoomHdl, Edit&, rField, void ) { SfxItemPool* pPool = GetItemSet().GetPool(); DBG_ASSERT( pPool, "Wo ist der Pool" ); FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( SID_ATTR_GRAF_CROP ) ) ); - if( pField == m_pWidthZoomMF ) + if( &rField == m_pWidthZoomMF ) { long nLRBorders = lcl_GetValue(*m_pLeftMF, eUnit) +lcl_GetValue(*m_pRightMF, eUnit); m_pWidthMF->SetValue( m_pWidthMF->Normalize( - ((aOrigSize.Width() - nLRBorders) * pField->GetValue())/100L), + ((aOrigSize.Width() - nLRBorders) * static_cast<MetricField&>(rField).GetValue())/100L), eUnit); } else @@ -434,18 +434,16 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, MetricField *, pField ) long nULBorders = lcl_GetValue(*m_pTopMF, eUnit) +lcl_GetValue(*m_pBottomMF, eUnit); m_pHeightMF->SetValue( m_pHeightMF->Normalize( - ((aOrigSize.Height() - nULBorders ) * pField->GetValue())/100L) , + ((aOrigSize.Height() - nULBorders ) * static_cast<MetricField&>(rField).GetValue())/100L) , eUnit ); } - - return 0; } /*-------------------------------------------------------------------- description: change size, adjust scale --------------------------------------------------------------------*/ -IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField ) +IMPL_LINK_TYPED( SvxGrfCropPage, SizeHdl, Edit&, rField, void ) { SfxItemPool* pPool = GetItemSet().GetPool(); DBG_ASSERT( pPool, "Wo ist der Pool" ); @@ -455,7 +453,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField ) Size aSize( lcl_GetValue(*m_pWidthMF, eUnit), lcl_GetValue(*m_pHeightMF, eUnit) ); - if(pField == m_pWidthMF) + if(&rField == m_pWidthMF) { long nWidth = aOrigSize.Width() - ( lcl_GetValue(*m_pLeftMF, eUnit) + @@ -475,8 +473,6 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField ) sal_uInt16 nZoom = (sal_uInt16)( aSize.Height() * 100L/ nHeight); m_pHeightZoomMF->SetValue(nZoom); } - - return 0; } /*-------------------------------------------------------------------- @@ -525,7 +521,7 @@ IMPL_LINK_TYPED( SvxGrfCropPage, CropHdl, SpinField&, rField, void ) if(bZoom) { // scale stays, recompute width - ZoomHdl(m_pWidthZoomMF); + ZoomHdl(*m_pWidthZoomMF); } } else @@ -554,7 +550,7 @@ IMPL_LINK_TYPED( SvxGrfCropPage, CropHdl, SpinField&, rField, void ) if(bZoom) { // scale stays, recompute height - ZoomHdl(m_pHeightZoomMF); + ZoomHdl(*m_pHeightZoomMF); } } m_pExampleWN->Invalidate(); @@ -747,11 +743,10 @@ IMPL_LINK_TYPED( SvxGrfCropPage, CropLoseFocusHdl, Control&, rControl, void ) } -IMPL_LINK( SvxGrfCropPage, CropModifyHdl, MetricField *, pField ) +IMPL_LINK_TYPED( SvxGrfCropPage, CropModifyHdl, Edit&, rField, void ) { aTimer.Start(); - pLastCropField = pField; - return 0; + pLastCropField = static_cast<MetricField*>(&rField); } Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 88a859564d61..2ffa6abf46cd 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -135,7 +135,7 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs m_pCtlPreview->SetBackground ( rStyles.GetWindowColor() ); m_pCtlPreview->SetBorderStyle(WindowBorderStyle::MONO); - Link<> aLink( LINK( this, SvxMeasurePage, ChangeAttrHdl_Impl ) ); + Link<Edit&,void> aLink( LINK( this, SvxMeasurePage, ChangeAttrEditHdl_Impl ) ); m_pMtrFldLineDist->SetModifyHdl( aLink ); m_pMtrFldHelplineOverhang->SetModifyHdl( aLink ); m_pMtrFldHelplineDist->SetModifyHdl( aLink ); @@ -668,7 +668,11 @@ IMPL_LINK_TYPED( SvxMeasurePage, ChangeAttrListBoxHdl_Impl, ListBox&, rBox, void { ChangeAttrHdl_Impl(&rBox); } -IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxMeasurePage, ChangeAttrEditHdl_Impl, Edit&, rBox, void ) +{ + ChangeAttrHdl_Impl(&rBox); +} +void SvxMeasurePage::ChangeAttrHdl_Impl( void* p ) { if( p == m_pMtrFldLineDist ) { @@ -794,8 +798,6 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) m_pCtlPreview->SetAttributes( aAttrSet ); m_pCtlPreview->Invalidate(); - - return 0L; } void SvxMeasurePage::FillUnitLB() diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 4e666c9bec2e..aacd985faf56 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -343,14 +343,14 @@ void SvxNumberFormatTabPage::Init_Impl() m_pLbCurrency->SetSelectHdl( aLink2 ); m_pCbSourceFormat->SetClickHdl( LINK( this, SvxNumberFormatTabPage, SelFormatClickHdl_Impl ) ); - Link<> aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxNumberFormatTabPage, OptEditHdl_Impl ); m_pEdDecimals->SetModifyHdl( aLink ); m_pEdLeadZeroes->SetModifyHdl( aLink ); m_pBtnNegRed->SetClickHdl( LINK( this, SvxNumberFormatTabPage, OptClickHdl_Impl ) ); m_pBtnThousand->SetClickHdl( LINK( this, SvxNumberFormatTabPage, OptClickHdl_Impl ) ); m_pLbFormat->SetDoubleClickHdl( HDL( DoubleClickHdl_Impl ) ); - m_pEdFormat->SetModifyHdl( HDL( EditHdl_Impl ) ); + m_pEdFormat->SetModifyHdl( HDL( EditModifyHdl_Impl ) ); m_pIbAdd->SetClickHdl( HDL( ClickHdl_Impl ) ); m_pIbRemove->SetClickHdl( HDL( ClickHdl_Impl ) ); m_pIbInfo->SetClickHdl( HDL( ClickHdl_Impl ) ); @@ -1498,7 +1498,11 @@ bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB) #* #************************************************************************/ -IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat ) +IMPL_LINK_TYPED( SvxNumberFormatTabPage, EditModifyHdl_Impl, Edit&, rEdit, void ) +{ + EditHdl_Impl(&rEdit); +} +void SvxNumberFormatTabPage::EditHdl_Impl( Edit* pEdFormat ) { sal_uInt32 nCurKey = NUMKEY_UNDEFINED; @@ -1551,8 +1555,6 @@ IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat ) pNumFmtShell->SetCurNumFmtKey( nCurKey ); UpdateOptions_Impl( true ); } - - return 0; } @@ -1571,7 +1573,11 @@ IMPL_LINK_TYPED( SvxNumberFormatTabPage, OptClickHdl_Impl, Button*, pOptCtrl, vo { OptHdl_Impl(pOptCtrl); } -IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl ) +IMPL_LINK_TYPED( SvxNumberFormatTabPage, OptEditHdl_Impl, Edit&, rEdit, void ) +{ + OptHdl_Impl(&rEdit); +} +void SvxNumberFormatTabPage::OptHdl_Impl( void* pOptCtrl ) { if ( (pOptCtrl == m_pEdLeadZeroes) || (pOptCtrl == m_pEdDecimals) @@ -1617,7 +1623,6 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl ) m_pLbFormat->SetNoSelection(); } } - return 0; } IMPL_LINK_NOARG_TYPED(SvxNumberFormatTabPage, TimeHdl_Impl, Timer *, void) diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 36e3f71135cc..741b96a47050 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -1847,7 +1847,7 @@ IMPL_LINK_NOARG_TYPED(SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer *, m_pPreviewWIN->Invalidate(); } -IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, NumericField*, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, AllLevelHdl_Impl, Edit&, rBox, void ) { for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) { @@ -1857,14 +1857,13 @@ IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, NumericField*, pBox ) if(nActNumLvl & nMask) { SvxNumberFormat aNumFmt(pActNum->GetLevel(e)); - aNumFmt.SetIncludeUpperLevels((sal_uInt8) std::min(pBox->GetValue(), sal_Int64(e + 1)) ); + aNumFmt.SetIncludeUpperLevels((sal_uInt8) std::min(static_cast<NumericField&>(rBox).GetValue(), sal_Int64(e + 1)) ); pActNum->SetLevel(e, aNumFmt); } nMask <<= 1; } } SetModified(); - return 0; } IMPL_LINK_TYPED( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void ) @@ -1956,7 +1955,7 @@ void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType; m_pStartED->SetMin(bNoZeroAllowed ? 1 : 0); if(bIsNull && bNoZeroAllowed) - m_pStartED->GetModifyHdl().Call(m_pStartED); + m_pStartED->GetModifyHdl().Call(*m_pStartED); } IMPL_LINK_TYPED( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox&, rBox, void ) @@ -2021,9 +2020,9 @@ IMPL_LINK_TYPED( SvxNumOptionsTabPage, BulColorHdl_Impl, ListBox&, rListBox, voi SetModified(); } -IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, MetricField *, pField) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, Edit&, rField, void) { - sal_uInt16 nRelSize = (sal_uInt16)pField->GetValue(); + sal_uInt16 nRelSize = (sal_uInt16)static_cast<MetricField&>(rField).GetValue(); sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) @@ -2037,7 +2036,6 @@ IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, MetricField *, pField) nMask <<= 1; } SetModified(); - return 0; } IMPL_LINK_TYPED( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void ) @@ -2232,9 +2230,9 @@ IMPL_LINK_NOARG_TYPED(SvxNumOptionsTabPage, BulletHdl_Impl, Button*, void) } } -IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, MetricField *, pField) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void) { - bool bWidth = pField == m_pWidthMF; + bool bWidth = &rField == m_pWidthMF; bLastWidthModified = bWidth; bool bRatio = m_pRatioCB->IsChecked(); long nWidthVal = static_cast<long>(m_pWidthMF->Denormalize(m_pWidthMF->GetValue(FUNIT_100TH_MM))); @@ -2297,7 +2295,6 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, MetricField *, pField) nMask <<= 1; } SetModified(bRepaint); - return 0; } IMPL_LINK_TYPED( SvxNumOptionsTabPage, RatioHdl_Impl, Button*, pBox, void ) @@ -2305,9 +2302,9 @@ IMPL_LINK_TYPED( SvxNumOptionsTabPage, RatioHdl_Impl, Button*, pBox, void ) if (static_cast<CheckBox*>(pBox)->IsChecked()) { if (bLastWidthModified) - SizeHdl_Impl(m_pWidthMF); + SizeHdl_Impl(*m_pWidthMF); else - SizeHdl_Impl(m_pHeightMF); + SizeHdl_Impl(*m_pHeightMF); } } @@ -2340,7 +2337,11 @@ IMPL_LINK_NOARG_TYPED( SvxNumOptionsTabPage, EditListBoxHdl_Impl, ListBox&, void { EditModifyHdl_Impl(nullptr); } -IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit *, pEdit ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit&, rEdit, void ) +{ + EditModifyHdl_Impl(&rEdit); +} +void SvxNumOptionsTabPage::EditModifyHdl_Impl( Edit* pEdit ) { bool bPrefix = pEdit == m_pPrefixED; bool bSuffix = pEdit == m_pSuffixED; @@ -2372,8 +2373,6 @@ IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit *, pEdit ) nMask <<= 1; } SetModified(); - - return 0; } static sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, sal_uInt16 nXStart, diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 9310f1642371..5f379daf7280 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -422,7 +422,7 @@ void SvxPageDescPage::Init_Impl() m_pLandscapeBtn->SetClickHdl( LINK( this, SvxPageDescPage, SwapOrientation_Impl ) ); m_pPortraitBtn->SetClickHdl( LINK( this, SvxPageDescPage, SwapOrientation_Impl ) ); - Link<> aLink = LINK( this, SvxPageDescPage, BorderModify_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxPageDescPage, BorderModify_Impl ); m_pLeftMarginEdit->SetModifyHdl( aLink ); m_pRightMarginEdit->SetModifyHdl( aLink ); m_pTopMarginEdit->SetModifyHdl( aLink ); @@ -1057,7 +1057,7 @@ IMPL_LINK_TYPED( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void ) -IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeModify_Impl) +IMPL_LINK_NOARG_TYPED(SvxPageDescPage, PaperSizeModify_Impl, Edit&, void) { sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE ); SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich ); @@ -1077,7 +1077,6 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeModify_Impl) } } UpdateExample_Impl( true ); - return 0; } @@ -1178,12 +1177,11 @@ void SvxPageDescPage::SwapFirstValues_Impl( bool bSet ) -IMPL_LINK_NOARG(SvxPageDescPage, BorderModify_Impl) +IMPL_LINK_NOARG_TYPED(SvxPageDescPage, BorderModify_Impl, Edit&, void) { if ( !bBorderModified ) bBorderModified = true; UpdateExample_Impl(); - return 0; } void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground ) diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 7d9965c57fac..4b0830400560 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -834,10 +834,9 @@ IMPL_LINK_TYPED( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox&, rBox, void UpdateExample_Impl(); } -IMPL_LINK_NOARG(SvxStdParagraphTabPage, ModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxStdParagraphTabPage, ModifyHdl_Impl, Edit&, void) { UpdateExample_Impl(); - return 0; } void SvxStdParagraphTabPage::Init_Impl() @@ -850,7 +849,7 @@ void SvxStdParagraphTabPage::Init_Impl() m_pLeftIndent->SetLoseFocusHdl( aLink2 ); m_pRightIndent->SetLoseFocusHdl( aLink2 ); - Link<> aLink = LINK( this, SvxStdParagraphTabPage, ModifyHdl_Impl ); + Link<Edit&,void> 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 4718180cd14f..5056604dc285 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -564,7 +564,7 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(vcl::Window* pParent, const SfxItemSet& m_pVertByMF->SetLoseFocusHdl( aLk3 ); m_pFollowCB->SetClickHdl( LINK(this, SvxSwPosSizeTabPage, RangeModifyClickHdl) ); - Link<> aLk = LINK(this, SvxSwPosSizeTabPage, ModifyHdl); + Link<Edit&,void> aLk = LINK(this, SvxSwPosSizeTabPage, ModifyHdl); m_pWidthMF->SetModifyHdl( aLk ); m_pHeightMF->SetModifyHdl( aLk ); m_pHoriByMF->SetModifyHdl( aLk ); @@ -1378,18 +1378,18 @@ IMPL_LINK_TYPED( SvxSwPosSizeTabPage, PosHdl, ListBox&, rLB, void ) } } -IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SvxSwPosSizeTabPage, ModifyHdl, Edit&, rEdit, void ) { sal_Int64 nWidth = m_pWidthMF->Denormalize(m_pWidthMF->GetValue(FUNIT_TWIP)); sal_Int64 nHeight = m_pHeightMF->Denormalize(m_pHeightMF->GetValue(FUNIT_TWIP)); if ( m_pKeepRatioCB->IsChecked() ) { - if ( pEdit == m_pWidthMF ) + if ( &rEdit == m_pWidthMF ) { nHeight = sal_Int64((double)nWidth / m_fWidthHeightRatio); m_pHeightMF->SetValue(m_pHeightMF->Normalize(nHeight), FUNIT_TWIP); } - else if(pEdit == m_pHeightMF) + else if(&rEdit == m_pHeightMF) { nWidth = sal_Int64((double)nHeight * m_fWidthHeightRatio); m_pWidthMF->SetValue(m_pWidthMF->Normalize(nWidth), FUNIT_TWIP); @@ -1397,7 +1397,6 @@ IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit *, pEdit ) } m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; UpdateExample(); - return 0; } IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, ProtectHdl, Button*, void) diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 066843953d96..20659bdc7f18 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -668,7 +668,7 @@ IMPL_LINK_NOARG_TYPED(SvxTabulatorTabPage, SelectHdl_Impl, ComboBox&, void) } } -IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxTabulatorTabPage, ModifyHdl_Impl, Edit&, void) { sal_Int32 nPos = m_pTabBox->GetValuePos( m_pTabBox->GetValue( eDefUnit ), eDefUnit ); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) @@ -681,11 +681,10 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl) m_pNewBtn->Disable(); m_pDelBtn->Enable(); - return 0; + return; } m_pNewBtn->Enable(); m_pDelBtn->Disable(); - return 0; } void SvxTabulatorTabPage::PageCreated(const SfxAllItemSet& aSet) diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 31d8f9cdda63..35ff35f36152 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -97,7 +97,7 @@ IMPL_LINK_NOARG_TYPED(SvxTransparenceTabPage, ClickTransLinearHdl_Impl, Button*, // preview rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE); - ModifyTransparentHdl_Impl (NULL); + ModifyTransparentHdl_Impl (*m_pMtrTransparent); } IMPL_LINK_NOARG_TYPED(SvxTransparenceTabPage, ClickTransGradientHdl_Impl, Button*, void) @@ -143,7 +143,7 @@ void SvxTransparenceTabPage::ActivateLinear(bool bActivate) m_pMtrTransparent->Enable(bActivate); } -IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxTransparenceTabPage, ModifyTransparentHdl_Impl, Edit&, void) { sal_uInt16 nPos = (sal_uInt16)m_pMtrTransparent->GetValue(); XFillTransparenceItem aItem(nPos); @@ -151,15 +151,17 @@ IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl) // preview InvalidatePreview(); - - return 0L; } IMPL_LINK_TYPED(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, ListBox&, rListBox, void) { ModifiedTrgrHdl_Impl(&rListBox); } -IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrHdl_Impl, void *, pControl) +IMPL_LINK_TYPED(SvxTransparenceTabPage, ModifiedTrgrEditHdl_Impl, Edit&, rBox, void) +{ + ModifiedTrgrHdl_Impl(&rBox); +} +void SvxTransparenceTabPage::ModifiedTrgrHdl_Impl(void* pControl) { if(pControl == m_pLbTrgrGradientType || pControl == this) { @@ -184,8 +186,6 @@ IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrHdl_Impl, void *, pControl) rXFSet.Put ( aItem ); InvalidatePreview(); - - return 0L; } void SvxTransparenceTabPage::ActivateGradient(bool bActivate) @@ -291,7 +291,7 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt // gradient transparency m_pMtrTrgrEndValue->SetValue( 100 ); m_pMtrTrgrStartValue->SetValue( 0 ); - Link<> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrHdl_Impl); + Link<Edit&,void> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrEditHdl_Impl); m_pLbTrgrGradientType->SetSelectHdl( LINK( this, SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl) ); m_pMtrTrgrCenterX->SetModifyHdl( aLink ); m_pMtrTrgrCenterY->SetModifyHdl( aLink ); @@ -439,7 +439,7 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs) // linear transparence sal_uInt16 nTransp = static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue(); m_pMtrTransparent->SetValue(bLinearActive ? nTransp : 50); - ModifyTransparentHdl_Impl(NULL); + ModifyTransparentHdl_Impl(*m_pMtrTransparent); // select the correct radio button if(bGradActive) @@ -745,9 +745,9 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs m_pLbBitmap->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyBitmapHdl_Impl ) ); m_pTsbStepCount->SetClickHdl( LINK( this, SvxAreaTabPage, ModifyStepCountClickHdl_Impl ) ); - m_pNumFldStepCount->SetModifyHdl( LINK( this, SvxAreaTabPage, ModifyStepCountHdl_Impl ) ); + m_pNumFldStepCount->SetModifyHdl( LINK( this, SvxAreaTabPage, ModifyStepCountEditHdl_Impl ) ); - Link<> aLink( LINK( this, SvxAreaTabPage, ModifyTileHdl_Impl ) ); + Link<Edit&,void> aLink( LINK( this, SvxAreaTabPage, ModifyTileHdl_Impl ) ); Link<Button*,void> aClickLink( LINK( this, SvxAreaTabPage, ModifyTileClickHdl_Impl ) ); m_pTsbTile->SetClickHdl( aClickLink ); m_pTsbStretch->SetClickHdl( aClickLink ); @@ -1740,7 +1740,7 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs ) m_pTsbOriginal->SetState( eOriginal ); // #93372# Setting proper state after changing button - ModifyTileHdl_Impl( NULL ); + ModifyTileHdl_Impl( *m_pMtrFldXSize ); //aRbtRow //aRbtColumn @@ -2135,7 +2135,7 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl() m_pBxBitmap->Show(); ModifyBitmapHdl_Impl( *m_pLbBitmap ); - ModifyTileHdl_Impl( m_pTsbOriginal ); + ModifyTileHdl_Impl( *m_pMtrFldXSize ); } @@ -2175,7 +2175,11 @@ IMPL_LINK_TYPED( SvxAreaTabPage, ModifyStepCountClickHdl_Impl, Button*, p, void { ModifyStepCountHdl_Impl(p); } -IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxAreaTabPage, ModifyStepCountEditHdl_Impl, Edit&, r, void ) +{ + ModifyStepCountHdl_Impl(&r); +} +void SvxAreaTabPage::ModifyStepCountHdl_Impl( void* p ) { if( p == m_pTsbStepCount ) { @@ -2200,8 +2204,6 @@ IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p ) m_rXFSet.Put( XGradientStepCountItem( nValue ) ); m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } IMPL_LINK_NOARG_TYPED( SvxAreaTabPage, ClickImportHdl_Impl, Button*, void ) @@ -2246,9 +2248,9 @@ IMPL_LINK_NOARG_TYPED( SvxAreaTabPage, ClickImportHdl_Impl, Button*, void ) IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyTileClickHdl_Impl, Button*, void) { - ModifyTileHdl_Impl(NULL); + ModifyTileHdl_Impl(*m_pMtrFldXSize); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyTileHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyTileHdl_Impl, Edit&, void) { TriState eState = m_pTsbTile->GetState(); if( eState == TRISTATE_TRUE ) @@ -2395,8 +2397,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyTileHdl_Impl) m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlBitmapPreview->Invalidate(); - - return 0L; } @@ -2432,17 +2432,17 @@ IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ClickScaleHdl_Impl, Button*, void) m_pMtrFldYSize->SetLast( 100000 ); } - ModifyTileHdl_Impl( NULL ); + ModifyTileHdl_Impl( *m_pMtrFldXSize ); } -void SvxAreaTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT eRcPt ) +void SvxAreaTabPage::PointChanged( vcl::Window* , RECT_POINT eRcPt ) { m_eRP = eRcPt; // alignment of the bitmap fill - ModifyTileHdl_Impl( pWindow ); + ModifyTileHdl_Impl( *m_pMtrFldXSize ); } void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet) diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 48455fdd16f6..4096920da5f2 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -382,7 +382,7 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr m_pLbColorModel->SetSelectHdl( LINK( this, SvxColorTabPage, SelectColorModelHdl_Impl ) ); - Link<> aLink = LINK( this, SvxColorTabPage, ModifiedHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxColorTabPage, ModifiedHdl_Impl ); m_pR->SetModifyHdl( aLink ); m_pG->SetModifyHdl( aLink ); m_pB->SetModifyHdl( aLink ); @@ -656,7 +656,7 @@ VclPtr<SfxTabPage> SvxColorTabPage::Create( vcl::Window* pWindow, } // is called when the content of the MtrFields is changed for color values -IMPL_LINK_NOARG(SvxColorTabPage, ModifiedHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ModifiedHdl_Impl, Edit&, void) { if (eCM == CM_RGB) { @@ -679,8 +679,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, ModifiedHdl_Impl) m_pCtlPreviewNew->SetAttributes( aXFillAttr.GetItemSet() ); m_pCtlPreviewNew->Invalidate(); - - return 0; } diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 62f69953475b..ba6e72c8a9c6 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -115,7 +115,7 @@ SvxGradientTabPage::SvxGradientTabPage m_pBtnDelete->SetClickHdl( LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); - Link<> aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxGradientTabPage, ModifiedEditHdl_Impl ); Link<ListBox&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl ); m_pLbGradientType->SetSelectHdl( aLink2 ); m_pMtrCenterX->SetModifyHdl( aLink ); @@ -405,7 +405,11 @@ IMPL_LINK_TYPED( SvxGradientTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox { ModifiedHdl_Impl(&rListBox); } -IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl ) +IMPL_LINK_TYPED( SvxGradientTabPage, ModifiedEditHdl_Impl, Edit&, rBox, void ) +{ + ModifiedHdl_Impl(&rBox); +} +void SvxGradientTabPage::ModifiedHdl_Impl( void* pControl ) { css::awt::GradientStyle eXGS = (css::awt::GradientStyle) m_pLbGradientType->GetSelectEntryPos(); @@ -428,8 +432,6 @@ IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - - return 0L; } diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index 2c6928c46ccc..490be9dbf4d4 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -116,7 +116,7 @@ SvxHatchTabPage::SvxHatchTabPage m_pLbHatchings->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl_Impl ) ); - Link<> aLink = LINK( this, SvxHatchTabPage, ModifiedHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxHatchTabPage, ModifiedEditHdl_Impl ); Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl ); m_pMtrDistance->SetModifyHdl( aLink ); m_pMtrAngle->SetModifyHdl( aLink ); @@ -371,7 +371,11 @@ IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, v { ModifiedHdl_Impl(&rListBox); } -IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedEditHdl_Impl, Edit&, rEdit, void ) +{ + ModifiedHdl_Impl(&rEdit); +} +void SvxHatchTabPage::ModifiedHdl_Impl( void* p ) { if( p == m_pMtrAngle ) { @@ -398,8 +402,6 @@ IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - - return 0L; } diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 640b30bb84ff..c5bc272373be 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -1424,7 +1424,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) { sal_uInt16 nTransp = static_cast<const XLineTransparenceItem&>( rAttrs->Get( XATTR_LINETRANSPARENCE ) ).GetValue(); m_pMtrTransparent->SetValue( nTransp ); - ChangeTransparentHdl_Impl( NULL ); + ChangeTransparentHdl_Impl( *m_pMtrTransparent ); } else m_pMtrTransparent->SetText( "" ); @@ -1526,10 +1526,9 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ListBox&, rListBo { ChangePreviewHdl_Impl(&rListBox); } -IMPL_LINK( SvxLineTabPage, ChangePreviewModifyHdl_Impl, void *, pCntrl ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangePreviewModifyHdl_Impl, Edit&, rEdit, void ) { - ChangePreviewHdl_Impl(pCntrl); - return 0; + ChangePreviewHdl_Impl(&rEdit); } void SvxLineTabPage::ChangePreviewHdl_Impl(void * pCntrl ) { @@ -1600,10 +1599,9 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangeStartListBoxHdl_Impl, ListBox&, rListBox, { ChangeStartHdl_Impl(&rListBox); } -IMPL_LINK( SvxLineTabPage, ChangeStartModifyHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangeStartModifyHdl_Impl, Edit&, rEdit, void ) { - ChangeStartHdl_Impl(p); - return 0; + ChangeStartHdl_Impl(&rEdit); } void SvxLineTabPage::ChangeStartHdl_Impl( void * p ) { @@ -1678,10 +1676,9 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangeEndListBoxHdl_Impl, ListBox&, rListBox, v { ChangeEndHdl_Impl(&rListBox); } -IMPL_LINK( SvxLineTabPage, ChangeEndModifyHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangeEndModifyHdl_Impl, Edit&, rEdit, void ) { - ChangeEndHdl_Impl(p); - return 0; + ChangeEndHdl_Impl(&rEdit); } void SvxLineTabPage::ChangeEndHdl_Impl( void * p ) { @@ -1700,7 +1697,7 @@ void SvxLineTabPage::ChangeEndHdl_Impl( void * p ) -IMPL_LINK_NOARG(SvxLineTabPage, ChangeTransparentHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineTabPage, ChangeTransparentHdl_Impl, Edit&, void) { sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue(); XLineTransparenceItem aItem( nVal ); @@ -1710,8 +1707,6 @@ IMPL_LINK_NOARG(SvxLineTabPage, ChangeTransparentHdl_Impl) FillXLSet_Impl(); m_pCtlPreview->Invalidate(); - - return 0L; } @@ -1747,10 +1742,10 @@ IMPL_LINK_TYPED( SvxLineTabPage, GraphicHdl_Impl, MenuButton *, pButton, void ) SymbolSelected(pButton); } -IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, MetricField *, pField) +IMPL_LINK_TYPED( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void) { m_bNewSize = true; - bool bWidth = pField == m_pSymbolWidthMF; + bool bWidth = &rField == m_pSymbolWidthMF; m_bLastWidthModified = bWidth; bool bRatio = m_pSymbolRatioCB->IsChecked(); long nWidthVal = static_cast<long>(m_pSymbolWidthMF->Denormalize(m_pSymbolWidthMF->GetValue(FUNIT_100TH_MM))); @@ -1792,16 +1787,15 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, MetricField *, pField) } m_pCtlPreview->ResizeSymbol(m_aSymbolSize); m_aSymbolLastSize=m_aSymbolSize; - return 0; } IMPL_LINK_TYPED( SvxLineTabPage, RatioHdl_Impl, Button*, pBox, void ) { if (static_cast<CheckBox*>(pBox)->IsChecked()) { if (m_bLastWidthModified) - SizeHdl_Impl(m_pSymbolWidthMF); + SizeHdl_Impl(*m_pSymbolWidthMF); else - SizeHdl_Impl(m_pSymbolHeightMF); + SizeHdl_Impl(*m_pSymbolHeightMF); } } diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 2107aef63627..4ed6ca472e1a 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -144,7 +144,7 @@ SvxLineDefTabPage::SvxLineDefTabPage Link<ListBox&, void> aLink = LINK( this, SvxLineDefTabPage, SelectTypeListBoxHdl_Impl ); m_pLbType1->SetSelectHdl( aLink ); m_pLbType2->SetSelectHdl( aLink ); - Link<> aLink2 = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); + Link<Edit&,void> aLink2 = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); m_pMtrLength1->SetModifyHdl( aLink2 ); m_pMtrLength2->SetModifyHdl( aLink2 ); m_pMtrDistance->SetModifyHdl( aLink2 ); @@ -393,15 +393,13 @@ void SvxLineDefTabPage::SelectLinestyleHdl_Impl(ListBox* p) -IMPL_LINK_NOARG(SvxLineDefTabPage, ChangePreviewHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ChangePreviewHdl_Impl, Edit&, void) { FillDash_Impl(); m_pCtlPreview->Invalidate(); - - return 0L; } -IMPL_LINK_NOARG(SvxLineDefTabPage, ChangeNumber1Hdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ChangeNumber1Hdl_Impl, Edit&, void) { if( m_pNumFldNumber1->GetValue() == 0L ) { @@ -414,14 +412,12 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ChangeNumber1Hdl_Impl) m_pNumFldNumber2->SetFirst( 0L ); } - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( *m_pMtrLength1 ); } -IMPL_LINK_NOARG(SvxLineDefTabPage, ChangeNumber2Hdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ChangeNumber2Hdl_Impl, Edit&, void) { if( m_pNumFldNumber2->GetValue() == 0L ) { @@ -434,9 +430,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ChangeNumber2Hdl_Impl) m_pNumFldNumber1->SetFirst( 0L ); } - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( *m_pMtrLength1 ); } @@ -544,7 +538,7 @@ void SvxLineDefTabPage::SelectTypeHdl_Impl(ListBox* p) m_pMtrLength2->Reformat(); } } - ChangePreviewHdl_Impl( p ); + ChangePreviewHdl_Impl( *m_pMtrLength1 ); } @@ -728,7 +722,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickDeleteHdl_Impl, Button*, void) *pnDashListState |= ChangeType::MODIFIED; - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( *m_pMtrLength1 ); } } diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 4722406423b8..afb9c9306b12 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -161,7 +161,7 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA m_pTsbShowShadow->SetClickHdl( LINK( this, SvxShadowTabPage, ClickShadowHdl_Impl ) ); m_pLbShadowColor->SetSelectHdl( LINK( this, SvxShadowTabPage, SelectShadowHdl_Impl ) ); - Link<> aLink = LINK( this, SvxShadowTabPage, ModifyShadowHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, SvxShadowTabPage, ModifyShadowHdl_Impl ); m_pMtrTransparent->SetModifyHdl( aLink ); m_pMtrDistance->SetModifyHdl( aLink ); } @@ -248,7 +248,7 @@ void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet ) rAttribs.Put( aItem ); m_pCtlXRectPreview->SetRectangleAttributes( rAttribs ); - ModifyShadowHdl_Impl( this ); + ModifyShadowHdl_Impl( *m_pMtrTransparent ); } m_nPageType = PT_SHADOW; } @@ -478,7 +478,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs ) m_pMtrTransparent->SaveValue(); ClickShadowHdl_Impl( NULL ); - ModifyShadowHdl_Impl( NULL ); + ModifyShadowHdl_Impl( *m_pMtrTransparent ); } } @@ -504,16 +504,16 @@ IMPL_LINK_NOARG_TYPED(SvxShadowTabPage, ClickShadowHdl_Impl, Button*, void) } m_pCtlPosition->Invalidate(); - ModifyShadowHdl_Impl( NULL ); + ModifyShadowHdl_Impl( *m_pMtrTransparent ); } -IMPL_LINK_TYPED(SvxShadowTabPage, SelectShadowHdl_Impl, ListBox&, rListBox, void) +IMPL_LINK_NOARG_TYPED(SvxShadowTabPage, SelectShadowHdl_Impl, ListBox&, void) { - ModifyShadowHdl_Impl(&rListBox); + ModifyShadowHdl_Impl(*m_pMtrTransparent); } -IMPL_LINK_NOARG(SvxShadowTabPage, ModifyShadowHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxShadowTabPage, ModifyShadowHdl_Impl, Edit&, void) { if( m_pTsbShowShadow->GetState() == TRISTATE_TRUE ) m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); @@ -550,18 +550,16 @@ IMPL_LINK_NOARG(SvxShadowTabPage, ModifyShadowHdl_Impl) m_pCtlXRectPreview->SetShadowAttributes(m_aXFillAttr.GetItemSet()); //aCtlXRectPreview.SetFillAttr( aXFillAttr ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } -void SvxShadowTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT eRcPt ) +void SvxShadowTabPage::PointChanged( vcl::Window*, RECT_POINT eRcPt ) { m_eRP = eRcPt; // repaint shadow - ModifyShadowHdl_Impl( pWindow ); + ModifyShadowHdl_Impl( *m_pMtrTransparent ); } void SvxShadowTabPage::PageCreated(const SfxAllItemSet& aSet) diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 9cb7cc69b5fc..f6b1f26af278 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -920,12 +920,12 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) if ( m_pMtrWidth->HasFocus() ) { - ChangeWidthHdl( this ); + ChangeWidthHdl( *m_pMtrWidth ); } if ( m_pMtrHeight->HasFocus() ) { - ChangeHeightHdl( this ); + ChangeHeightHdl( *m_pMtrHeight ); } if( !mbPageDisabled ) @@ -1567,7 +1567,7 @@ void SvxPositionSizeTabPage::DisableProtect() -IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl) +IMPL_LINK_NOARG_TYPED(SvxPositionSizeTabPage, ChangeWidthHdl, Edit&, void) { if( m_pCbxScale->IsChecked() && m_pCbxScale->IsEnabled() ) { @@ -1586,13 +1586,11 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl) m_pMtrWidth->SetUserValue(nWidth, FUNIT_NONE); } } - - return 0L; } -IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl) +IMPL_LINK_NOARG_TYPED(SvxPositionSizeTabPage, ChangeHeightHdl, Edit&, void) { if( m_pCbxScale->IsChecked() && m_pCbxScale->IsEnabled() ) { @@ -1611,8 +1609,6 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl) m_pMtrHeight->SetUserValue(nHeight, FUNIT_NONE); } } - - return 0L; } diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index d61dc10646d1..798c5b22bc76 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -124,10 +124,9 @@ namespace dbmm m_pStartMigration->Show(!m_pSaveAsLocation->GetText().isEmpty()); } - IMPL_LINK( SaveDBDocPage, OnLocationModified, Edit*, /**/ ) + IMPL_LINK_NOARG_TYPED( SaveDBDocPage, OnLocationModified, Edit&, void ) { impl_updateLocationDependentItems(); - return 0L; } void SaveDBDocPage::initializePage() diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx index 09a4229f7bc0..a48be477795a 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx @@ -95,7 +95,7 @@ namespace dbmm virtual bool canAdvance() const override; private: - DECL_LINK( OnLocationModified, Edit* ); + DECL_LINK_TYPED( OnLocationModified, Edit&, void ); void impl_updateLocationDependentItems(); }; diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 554c289031c3..86338bf43bec 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -178,7 +178,7 @@ IMPL_LINK_NOARG_TYPED(OSqlEdit, OnInvalidateTimer, Timer *, void) m_timerInvalidate.Start(); } -IMPL_LINK_NOARG(OSqlEdit, ModifyHdl) +IMPL_LINK_NOARG_TYPED(OSqlEdit, ModifyHdl, Edit&, void) { if (m_timerUndoActionCreation.IsActive()) m_timerUndoActionCreation.Stop(); @@ -191,8 +191,6 @@ IMPL_LINK_NOARG(OSqlEdit, ModifyHdl) rController.InvalidateFeature(SID_SBA_QRY_EXECUTE); rController.InvalidateFeature(SID_CUT); rController.InvalidateFeature(SID_COPY); - - return 0; } void OSqlEdit::SetText(const OUString& rNewText) diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 93ac96e8bf62..d7bf779767a6 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -101,9 +101,9 @@ namespace dbaui get(m_pTestConnection, "connectionButton"); m_pConnectionURL->SetModifyHdl(LINK(this, OConnectionTabPage, OnEditModified)); - m_pJavaDriver->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); + m_pJavaDriver->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); m_pJavaDriver->SetModifyHdl(LINK(this, OConnectionTabPage, OnEditModified)); - m_pUserName->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); + m_pUserName->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); m_pPasswordRequired->SetClickHdl(LINK(this, OGenericAdministrationPage, OnControlModifiedClick)); m_pTestConnection->SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl)); @@ -210,7 +210,6 @@ namespace dbaui break; } - ; AuthenticationMode eAuthMode( DataSourceMetaData::getAuthentication( m_eType ) ); bool bShowUserAuthenfication = ( eAuthMode != AuthNone ); bool bShowUser = ( eAuthMode == AuthUserPwd ); @@ -321,15 +320,14 @@ namespace dbaui m_pTestConnection->Enable(bEnableTestConnection); return true; } - IMPL_LINK(OConnectionTabPage, OnEditModified, Edit*, _pEdit) + IMPL_LINK_TYPED(OConnectionTabPage, OnEditModified, Edit&, _rEdit, void) { - if ( _pEdit == m_pJavaDriver ) + if ( &_rEdit == m_pJavaDriver ) m_pTestJavaDriver->Enable( !m_pJavaDriver->GetText().trim().isEmpty() ); checkTestConnection(); // tell the listener we were modified callModifiedHdl(); - return 0L; } } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx index bd2f3051ac5d..34003c4d51a4 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -53,7 +53,7 @@ namespace dbaui // called when the test connection button was clicked DECL_LINK_TYPED(OnTestJavaClickHdl, Button*, void); - DECL_LINK(OnEditModified, Edit*); + DECL_LINK_TYPED(OnEditModified, Edit&, void); public: virtual ~OConnectionTabPage(); diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index fd82603a2c3d..efb3b9b0c4e1 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -172,11 +172,10 @@ namespace dbaui return !m_pConnectionURL->IsVisible() || !m_pConnectionURL->GetTextNoPrefix().isEmpty(); } - IMPL_LINK(OConnectionTabPageSetup, OnEditModified, Edit*, /*_pEdit*/) + IMPL_LINK_NOARG_TYPED(OConnectionTabPageSetup, OnEditModified, Edit&, void) { SetRoadmapStateValue(checkTestConnection()); callModifiedHdl(); - return 0L; } } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx index 6b9284e65bac..14f5b1a889df 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -44,7 +44,7 @@ namespace dbaui VclPtr<FixedText> m_pHeaderText; // called when the test connection button was clicked - DECL_LINK(OnEditModified,Edit*); + DECL_LINK_TYPED(OnEditModified, Edit&, void); public: virtual ~OConnectionTabPageSetup(); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 0a106c0d541d..45ddce7b195a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -148,9 +148,9 @@ using namespace ::com::sun::star; get(m_pFTDefaultPortNumber, "portNumDefLabel"); get(m_pCBUseSSL, "useSSLCheckbutton"); - m_pETHostServer->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); - m_pETBaseDN->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); - m_pNFPortNumber->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); + m_pETHostServer->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); + m_pETBaseDN->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); + m_pNFPortNumber->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); m_pCBUseSSL->SetToggleHdl( LINK(this, OGenericAdministrationPage, ControlModifiedCheckBoxHdl) ); SetRoadmapStateValue(false); } @@ -405,11 +405,11 @@ using namespace ::com::sun::star; //TODO this code snippet is redundant m_pHeaderText->SetText(ModuleRes(_nHeaderTextResId)); - m_pETDatabasename->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); - m_pETHostname->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); - m_pNFPortNumber->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); + m_pETDatabasename->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); + m_pETHostname->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); + m_pNFPortNumber->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); - m_pETDriverClass->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); + m_pETDriverClass->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); m_pPBTestJavaDriver->SetClickHdl(LINK(this,OGeneralSpecialJDBCConnectionPageSetup,OnTestJavaClickHdl)); SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, true); @@ -679,14 +679,13 @@ using namespace ::com::sun::star; aMsg->Execute(); } - IMPL_LINK(OJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit) + IMPL_LINK_TYPED(OJDBCConnectionPageSetup, OnEditModified, Edit&, _rEdit, void) { - if ( _pEdit == m_pETDriverClass ) + if ( &_rEdit == m_pETDriverClass ) m_pPBTestJavaDriver->Enable( !m_pETDriverClass->GetText().isEmpty() ); SetRoadmapStateValue(checkTestConnection()); // tell the listener we were modified callModifiedHdl(); - return 0L; } VclPtr<OGenericAdministrationPage> OSpreadSheetConnectionPageSetup::CreateSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet ) @@ -750,7 +749,7 @@ using namespace ::com::sun::star; get(m_pETUserName, "generalUserNameEntry"); get(m_pCBPasswordRequired, "passRequiredCheckbutton"); get(m_pPBTestConnection, "testConnectionButton"); - m_pETUserName->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); + m_pETUserName->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); m_pCBPasswordRequired->SetClickHdl(LINK(this,OGenericAdministrationPage,OnControlModifiedClick)); m_pPBTestConnection->SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl)); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index b15356928a3d..684f9bc85ec2 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -189,7 +189,7 @@ namespace dbaui virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) override; DECL_LINK_TYPED(OnTestJavaClickHdl, Button*, void); - DECL_LINK(OnEditModified,Edit*); + DECL_LINK_TYPED(OnEditModified, Edit&, void); VclPtr<FixedText> m_pFTDriverClass; VclPtr<Edit> m_pETDriverClass; VclPtr<PushButton> m_pPBTestJavaDriver; diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index 8c5ea57b9d44..9e13b93c50a7 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -95,16 +95,16 @@ namespace dbaui m_pTextSeparator->InsertEntry(m_aTextNone); // set the modify handlers - m_pFieldSeparator->SetUpdateDataHdl(getControlModifiedLink()); + m_pFieldSeparator->SetUpdateDataHdl(LINK(this, OTextConnectionHelper, OnControlEditModified)); m_pFieldSeparator->SetSelectHdl(LINK(this, OTextConnectionHelper, ComboBoxSelectHdl)); - m_pTextSeparator->SetUpdateDataHdl(getControlModifiedLink()); + m_pTextSeparator->SetUpdateDataHdl(LINK(this, OTextConnectionHelper, OnControlEditModified)); m_pTextSeparator->SetSelectHdl(LINK(this, OTextConnectionHelper, ComboBoxSelectHdl)); m_pCharSet->SetSelectHdl(LINK(this, OTextConnectionHelper, CharsetSelectHdl)); - m_pFieldSeparator->SetModifyHdl(getControlModifiedLink()); - m_pTextSeparator->SetModifyHdl(getControlModifiedLink()); - m_pDecimalSeparator->SetModifyHdl(getControlModifiedLink()); - m_pThousandsSeparator->SetModifyHdl(getControlModifiedLink()); + m_pFieldSeparator->SetModifyHdl(LINK(this, OTextConnectionHelper, OnControlEditModified)); + m_pTextSeparator->SetModifyHdl(LINK(this, OTextConnectionHelper, OnControlEditModified)); + m_pDecimalSeparator->SetModifyHdl(LINK(this, OTextConnectionHelper, OnControlEditModified)); + m_pThousandsSeparator->SetModifyHdl(LINK(this, OTextConnectionHelper, OnControlEditModified)); m_pOwnExtension->SetModifyHdl(LINK(this, OTextConnectionHelper, OnEditModified)); m_pAccessTextFiles->SetToggleHdl(LINK(this, OTextConnectionHelper, OnSetExtensionHdl)); m_pAccessCSVFiles->SetToggleHdl(LINK(this, OTextConnectionHelper, OnSetExtensionHdl)); @@ -161,6 +161,11 @@ namespace dbaui getControlModifiedLink().Call(&rBox); } + IMPL_LINK_TYPED(OTextConnectionHelper, OnControlEditModified, Edit&, rEdit, void) + { + getControlModifiedLink().Call(&rEdit); + } + OTextConnectionHelper::~OTextConnectionHelper() { disposeOnce(); @@ -196,10 +201,9 @@ namespace dbaui return 0L; } - IMPL_LINK(OTextConnectionHelper, OnEditModified, Edit*, /*_pEdit*/) + IMPL_LINK_NOARG_TYPED(OTextConnectionHelper, OnEditModified, Edit&, void) { m_aGetExtensionHandler.Call(this); - return 0L; } IMPL_LINK_NOARG_TYPED(OTextConnectionHelper, OnSetExtensionHdl, RadioButton&, void) diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index 752ccbf22346..625758ba21ce 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -84,7 +84,8 @@ namespace dbaui Link<> getControlModifiedLink() { return LINK(this, OTextConnectionHelper, OnControlModified); } DECL_LINK_TYPED(OnSetExtensionHdl,RadioButton&,void); DECL_LINK(OnControlModified,Control*); - DECL_LINK(OnEditModified,Edit*); + DECL_LINK_TYPED(OnControlEditModified, Edit&, void); + DECL_LINK_TYPED(OnEditModified, Edit&, void); DECL_LINK_TYPED(CharsetSelectHdl,ListBox&,void); DECL_LINK_TYPED(ComboBoxSelectHdl,ComboBox&,void); diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 65febc17a78c..954a530c63fc 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -58,7 +58,7 @@ class OPasswordDialog : public ModalDialog VclPtr<OKButton> m_pOKBtn; DECL_LINK_TYPED( OKHdl_Impl, Button*, void ); - DECL_LINK( ModifiedHdl, Edit * ); + DECL_LINK_TYPED( ModifiedHdl, Edit&, void ); public: OPasswordDialog( vcl::Window* pParent,const OUString& _sUserName); @@ -110,10 +110,9 @@ IMPL_LINK_NOARG_TYPED(OPasswordDialog, OKHdl_Impl, Button*, void) } } -IMPL_LINK( OPasswordDialog, ModifiedHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( OPasswordDialog, ModifiedHdl, Edit&, rEdit, void ) { - m_pOKBtn->Enable(!pEdit->GetText().isEmpty()); - return 0; + m_pOKBtn->Enable(!rEdit.GetText().isEmpty()); } // OUserAdmin diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 88617c12eb55..521c5cccec56 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -143,11 +143,11 @@ namespace dbaui get(m_pSocket, "socket"); get(m_pNamedPipe, "namedpipe"); - m_pDatabaseName->SetModifyHdl( _rControlModificationLink ); - m_pHostName->SetModifyHdl( _rControlModificationLink ); - m_pPort->SetModifyHdl( _rControlModificationLink ); - m_pSocket->SetModifyHdl( _rControlModificationLink ); - m_pNamedPipe->SetModifyHdl( _rControlModificationLink ); + m_pDatabaseName->SetModifyHdl( LINK(this, MySQLNativeSettings, EditModifyHdl) ); + m_pHostName->SetModifyHdl( LINK(this, MySQLNativeSettings, EditModifyHdl) ); + m_pPort->SetModifyHdl( LINK(this, MySQLNativeSettings, EditModifyHdl) ); + m_pSocket->SetModifyHdl( LINK(this, MySQLNativeSettings, EditModifyHdl) ); + m_pNamedPipe->SetModifyHdl( LINK(this, MySQLNativeSettings, EditModifyHdl) ); m_pSocketRadio->SetToggleHdl( LINK(this, MySQLNativeSettings, RadioToggleHdl) ); m_pNamedPipeRadio->SetToggleHdl( LINK(this, MySQLNativeSettings, RadioToggleHdl) ); @@ -174,6 +174,11 @@ namespace dbaui m_aControlModificationLink.Call(&rRadioButton); } + IMPL_LINK_TYPED(MySQLNativeSettings, EditModifyHdl, Edit&, rEdit, void) + { + m_aControlModificationLink.Call(&rEdit); + } + MySQLNativeSettings::~MySQLNativeSettings() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx index b92b3cd56cb0..807ac514fcde 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -51,6 +51,7 @@ namespace dbaui ::svt::ControlDependencyManager m_aControlDependencies; DECL_LINK_TYPED(RadioToggleHdl, RadioButton&, void); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: MySQLNativeSettings( vcl::Window& _rParent, const Link<>& _rControlModificationLink ); diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 8efbeff62cd8..126b90dd31db 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -115,6 +115,10 @@ namespace dbaui { callModifiedHdl(&rCtrl); } + IMPL_LINK_TYPED(OGenericAdministrationPage, OnControlEditModifyHdl, Edit&, rCtrl, void) + { + callModifiedHdl(&rCtrl); + } bool OGenericAdministrationPage::getSelectedDataSource(OUString& _sReturn, OUString& _sCurr) { // collect all ODBC data source names diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index b1247da3910a..7b2585f140b4 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -207,6 +207,7 @@ namespace dbaui is modified. The implementation just calls callModifiedHdl. */ DECL_LINK(OnControlModified, void*); + DECL_LINK_TYPED(OnControlEditModifyHdl, Edit&, void); DECL_LINK_TYPED(OnControlModifiedClick, Button*, void); DECL_LINK_TYPED(ControlModifiedCheckBoxHdl, CheckBox&, void); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 035bdb8f93bb..11caa93aff42 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -129,7 +129,7 @@ namespace dbaui { get(m_pMaxRowScanLabel, "rowsft"); get(m_pMaxRowScan, "rows"); - m_pMaxRowScan->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlModified)); + m_pMaxRowScan->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl)); m_pMaxRowScan->SetUseThousandSep(false); m_pMaxRowScanLabel->Show(); m_pMaxRowScan->Show(); @@ -342,8 +342,8 @@ namespace dbaui get(m_pAutoRetrieving, "query"); m_pAutoRetrievingEnabled->SetClickHdl( LINK(this, OGenericAdministrationPage, OnControlModifiedClick) ); - m_pAutoIncrement->SetModifyHdl( LINK(this, OGenericAdministrationPage, OnControlModified) ); - m_pAutoRetrieving->SetModifyHdl( LINK(this, OGenericAdministrationPage, OnControlModified) ); + m_pAutoIncrement->SetModifyHdl( LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl) ); + m_pAutoRetrieving->SetModifyHdl( LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl) ); m_aControlDependencies.enableOnCheckMark( *m_pAutoRetrievingEnabled, *m_pAutoIncrementLabel, *m_pAutoIncrement, *m_pAutoRetrievingLabel, *m_pAutoRetrieving ); diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 6369172f838b..ffad681b4d6b 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -79,7 +79,7 @@ namespace dbaui m_pOptionsLabel->Show(); m_pOptions = get<Edit>("options"); m_pOptions->Show(); - m_pOptions->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); + m_pOptions->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); } if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) @@ -433,8 +433,8 @@ namespace dbaui } if ( m_sDefaultJdbcDriverName.getLength() ) { - m_pEDDriverClass->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); - m_pEDDriverClass->SetModifyHdl(LINK(this, OGeneralSpecialJDBCDetailsPage, OnEditModified)); + m_pEDDriverClass->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); + m_pEDDriverClass->SetModifyHdl(LINK(this, OGeneralSpecialJDBCDetailsPage, OnControlEditModifyHdl)); m_pTestJavaDriver->SetClickHdl(LINK(this,OGeneralSpecialJDBCDetailsPage,OnTestJavaClickHdl)); } else @@ -448,9 +448,9 @@ namespace dbaui m_pFTSocket->Show(bShowSocket && !m_bUseClass); m_pEDSocket->Show(bShowSocket && !m_bUseClass); - m_pEDHostname->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); - m_pNFPortNumber->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); - m_pEDSocket->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); + m_pEDHostname->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); + m_pNFPortNumber->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); + m_pEDSocket->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); } OGeneralSpecialJDBCDetailsPage::~OGeneralSpecialJDBCDetailsPage() @@ -545,14 +545,13 @@ namespace dbaui ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); aMsg->Execute(); } - IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit) + void OGeneralSpecialJDBCDetailsPage::callModifiedHdl(void* pControl) { - if ( m_bUseClass && _pEdit == m_pEDDriverClass ) + if ( m_bUseClass && pControl == m_pEDDriverClass ) m_pTestJavaDriver->Enable( !m_pEDDriverClass->GetText().trim().isEmpty() ); // tell the listener we were modified - callModifiedHdl(); - return 0L; + OGenericAdministrationPage::callModifiedHdl(); } // MySQLNativePage @@ -566,7 +565,7 @@ namespace dbaui get(m_pUserName, "username"); get(m_pPasswordRequired, "passwordrequired"); - m_pUserName->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); + m_pUserName->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); m_aMySQLSettings->Show(); } @@ -666,10 +665,10 @@ namespace dbaui m_pNFPortNumber->SetUseThousandSep(false); get(m_pNFRowCount, "LDAPRowCountspinbutton"); - m_pETBaseDN->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); + m_pETBaseDN->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); m_pCBUseSSL->SetToggleHdl( LINK(this, OGenericAdministrationPage, ControlModifiedCheckBoxHdl) ); - m_pNFPortNumber->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); - m_pNFRowCount->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlModified)); + m_pNFPortNumber->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); + m_pNFRowCount->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); m_pNFRowCount->SetUseThousandSep(false); m_iNormalPort = 389; diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index b3c0a555a56a..c6a6eb874956 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -175,9 +175,9 @@ namespace dbaui virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override; virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; + virtual void callModifiedHdl(void* pControl) override; DECL_LINK_TYPED(OnTestJavaClickHdl, Button*, void); - DECL_LINK(OnEditModified,Edit*); VclPtr<Edit> m_pEDHostname; VclPtr<NumericField> m_pNFPortNumber; @@ -188,9 +188,9 @@ namespace dbaui VclPtr<Edit> m_pEDDriverClass; VclPtr<PushButton> m_pTestJavaDriver; - OUString m_sDefaultJdbcDriverName; - sal_uInt16 m_nPortId; - bool m_bUseClass; + OUString m_sDefaultJdbcDriverName; + sal_uInt16 m_nPortId; + bool m_bUseClass; }; // MySQLNativePage diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 7647308875a8..9bb7810e4959 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -71,7 +71,7 @@ namespace dbaui startComponentListening(xConnComp); m_pSQL->SetModifyHdl(LINK(this, DirectSQLDialog, OnStatementModified)); - OnStatementModified(m_pSQL); + OnStatementModified(*m_pSQL); } DirectSQLDialog::~DirectSQLDialog() @@ -291,7 +291,7 @@ namespace dbaui // set the text in the statement editor OUString sStatement = m_aStatementHistory[_nHistoryPos]; m_pSQL->SetText(sStatement); - OnStatementModified(m_pSQL); + OnStatementModified(*m_pSQL); if (_bUpdateListBox) { @@ -308,10 +308,9 @@ namespace dbaui OSL_FAIL("DirectSQLDialog::switchToHistory: invalid position!"); } - IMPL_LINK_NOARG( DirectSQLDialog, OnStatementModified ) + IMPL_LINK_NOARG_TYPED( DirectSQLDialog, OnStatementModified, Edit&, void ) { m_pExecute->Enable(!m_pSQL->GetText().isEmpty()); - return 0L; } IMPL_LINK_NOARG_TYPED( DirectSQLDialog, OnCloseClick, Button*, void ) diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 50d2342a1d60..eab7b5f20e6d 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -322,11 +322,10 @@ IMPL_LINK_TYPED(OSaveAsDlg, ButtonClickHdl, Button *, pButton, void) } } -IMPL_LINK(OSaveAsDlg, EditModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED(OSaveAsDlg, EditModifyHdl, Edit&, rEdit, void ) { - if (pEdit == m_pImpl->m_pTitle) + if (&rEdit == m_pImpl->m_pTitle) m_pImpl->m_pPB_OK->Enable(!m_pImpl->m_pTitle->GetText().isEmpty()); - return 0; } void OSaveAsDlg::implInitOnlyTitle(const OUString& _rLabel) diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 6c6edc6964a8..ef8f0cc43a28 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -373,15 +373,13 @@ namespace dbaui } } - IMPL_LINK(OParameterDialog, OnValueModified, Control*, /*pBox*/) + IMPL_LINK_NOARG_TYPED(OParameterDialog, OnValueModified, Edit&, void) { // mark the currently selected entry as dirty OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_DIRTY; m_bNeedErrorOnCurrent = true; - - return 0L; } } // namespace dbaui diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index eae1c5499b9e..fb1fb1080ee3 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -89,7 +89,7 @@ namespace dbaui DECL_LINK_TYPED( OnClose, void*, void ); DECL_LINK_TYPED( OnCloseClick, Button*, void ); DECL_LINK_TYPED( OnListEntrySelected, ListBox&, void ); - DECL_LINK( OnStatementModified, void* ); + DECL_LINK_TYPED( OnStatementModified, Edit&, void ); private: /// adds a statement to the statement history diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx index 2896b68f64ef..5ae14cdf8aa5 100644 --- a/dbaccess/source/ui/inc/dlgsave.hxx +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -73,7 +73,7 @@ namespace dbaui OUString getSchema() const; private: DECL_LINK_TYPED(ButtonClickHdl, Button *, void); - DECL_LINK(EditModifyHdl, Edit * ); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); void implInitOnlyTitle(const OUString& _rLabel); void implInit(); diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index 424191dfae01..79edb77d937e 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -94,7 +94,7 @@ namespace dbaui private: DECL_LINK_TYPED(OnVisitedTimeout, Timer*, void); - DECL_LINK(OnValueModified, Control*); + DECL_LINK_TYPED(OnValueModified, Edit&, void); DECL_LINK_TYPED(OnEntryListBoxSelected, ListBox&, void); DECL_LINK_TYPED(OnButtonClicked, Button*, void); DECL_LINK_TYPED(OnValueLoseFocusHdl, Control&, void); diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index a11d636e817b..624982d28dcc 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -61,7 +61,7 @@ namespace dbaui virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void GetFocus() override; - DECL_LINK(ModifyHdl, void*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER); diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index 3226768e847a..c115698d5031 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -211,10 +211,9 @@ namespace abp } - IMPL_LINK( FinalPage, OnNameModified, Edit*, /**/ ) + IMPL_LINK_NOARG_TYPED( FinalPage, OnNameModified, Edit&, void ) { implCheckName(); - return 0L; } diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx index 7416413a765e..28f2c1954d20 100644 --- a/extensions/source/abpilot/abpfinalpage.hxx +++ b/extensions/source/abpilot/abpfinalpage.hxx @@ -67,7 +67,7 @@ namespace abp virtual bool canAdvance() const override; private: - DECL_LINK( OnNameModified, Edit* ); + DECL_LINK_TYPED( OnNameModified, Edit&, void ); DECL_LINK_TYPED(OnRegister, Button*, void); DECL_LINK_TYPED(OnEmbed, Button*, void); diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 45e08891f02c..35f190f712ac 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -291,10 +291,9 @@ namespace dbp } - IMPL_LINK( ORadioSelectionPage, OnNameModified, Edit*, /*_pList*/ ) + IMPL_LINK_NOARG_TYPED( ORadioSelectionPage, OnNameModified, Edit&, void ) { implCheckMoveButtons(); - return 0L; } diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx index c21b8c2ba99f..ba90a5f8f50c 100644 --- a/extensions/source/dbpilots/groupboxwiz.hxx +++ b/extensions/source/dbpilots/groupboxwiz.hxx @@ -102,7 +102,7 @@ namespace dbp DECL_LINK_TYPED( OnMoveEntry, Button*, void ); DECL_LINK_TYPED( OnEntrySelected, ListBox&, void ); - DECL_LINK( OnNameModified, Edit* ); + DECL_LINK_TYPED( OnNameModified, Edit&, void ); void implCheckMoveButtons(); }; diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 2d888a2dba5f..4db4a39ab177 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -488,10 +488,9 @@ namespace dbp } - IMPL_LINK_NOARG(OLinkFieldsPage, OnSelectionModified) + IMPL_LINK_NOARG_TYPED(OLinkFieldsPage, OnSelectionModified, Edit&, void) { implCheckFinish(); - return 0L; } IMPL_LINK_NOARG_TYPED(OLinkFieldsPage, OnSelectionModifiedCombBox, ComboBox&, void) diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index a65300e8dba3..3e90a01138bc 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -167,7 +167,7 @@ namespace dbp private: void implCheckFinish(); - DECL_LINK(OnSelectionModified, void*); + DECL_LINK_TYPED(OnSelectionModified, Edit&, void); DECL_LINK_TYPED(OnSelectionModifiedCombBox, ComboBox&, void); }; diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx index be90a9be44ac..c591761f5802 100644 --- a/extensions/source/propctrlr/commoncontrol.cxx +++ b/extensions/source/propctrlr/commoncontrol.cxx @@ -95,6 +95,11 @@ namespace pcr } + IMPL_LINK_NOARG_TYPED( CommonBehaviourControlHelper, EditModifiedHdl, Edit&, void ) + { + setModified(); + } + IMPL_LINK_NOARG( CommonBehaviourControlHelper, ModifiedHdl ) { setModified(); diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx index 481ef86f3eb8..fc39aec21412 100644 --- a/extensions/source/propctrlr/commoncontrol.hxx +++ b/extensions/source/propctrlr/commoncontrol.hxx @@ -27,10 +27,12 @@ #include <tools/link.hxx> #include <vcl/window.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <type_traits> class NotifyEvent; class Control; class ListBox; +class Edit; namespace pcr { @@ -88,6 +90,7 @@ namespace pcr /// may be used by derived classes, they forward the event to the PropCtrListener DECL_LINK( ModifiedHdl, void* ); + DECL_LINK_TYPED( EditModifiedHdl, Edit&, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( GetFocusHdl, Control&, void ); DECL_LINK_TYPED( LoseFocusHdl, Control&, void ); @@ -148,27 +151,39 @@ namespace pcr inline void impl_checkDisposed_throw(); private: VclPtr<TControlWindow> m_pControlWindow; + void implSetModifyHandler(std::true_type); + void implSetModifyHandler(std::false_type); }; //= CommonBehaviourControl - implementation - template< class TControlInterface, class TControlWindow > - inline CommonBehaviourControl< TControlInterface, TControlWindow >::CommonBehaviourControl ( sal_Int16 _nControlType, vcl::Window* _pParentWindow, WinBits _nWindowStyle, bool _bDoSetHandlers ) + inline CommonBehaviourControl< TControlInterface, TControlWindow >::CommonBehaviourControl ( sal_Int16 _nControlType, vcl::Window* _pParentWindow, WinBits _nWindowStyle, bool _bDoSetHandlers) :ComponentBaseClass( m_aMutex ) ,CommonBehaviourControlHelper( _nControlType, *this ) ,m_pControlWindow( new TControlWindow( _pParentWindow, _nWindowStyle ) ) { if ( _bDoSetHandlers ) { - m_pControlWindow->SetModifyHdl( LINK( this, CommonBehaviourControlHelper, ModifiedHdl ) ); + implSetModifyHandler(std::is_base_of<::Edit,TControlWindow>()); m_pControlWindow->SetGetFocusHdl( LINK( this, CommonBehaviourControlHelper, GetFocusHdl ) ); m_pControlWindow->SetLoseFocusHdl( LINK( this, CommonBehaviourControlHelper, LoseFocusHdl ) ); } autoSizeWindow(); } + template< class TControlInterface, class TControlWindow > + inline void CommonBehaviourControl< TControlInterface, TControlWindow >::implSetModifyHandler(std::true_type) + { + m_pControlWindow->SetModifyHdl( LINK( this, CommonBehaviourControlHelper, EditModifiedHdl ) ); + } + + template< class TControlInterface, class TControlWindow > + inline void CommonBehaviourControl< TControlInterface, TControlWindow >::implSetModifyHandler(std::false_type) + { + m_pControlWindow->SetModifyHdl( LINK( this, CommonBehaviourControlHelper, ModifiedHdl ) ); + } template< class TControlInterface, class TControlWindow > inline void CommonBehaviourControl< TControlInterface, TControlWindow >::impl_checkDisposed_throw() diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 600bb7208404..127531a557f4 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -92,7 +92,7 @@ namespace pcr void fillList( LinkParticipant _eWhich, const Sequence< OUString >& _rFieldNames ); private: - DECL_LINK( OnFieldNameChanged, ComboBox* ); + DECL_LINK_TYPED( OnFieldNameChanged, Edit&, void ); }; @@ -147,9 +147,9 @@ namespace pcr } - IMPL_LINK( FieldLinkRow, OnFieldNameChanged, ComboBox*, /*_pBox*/ ) + IMPL_LINK_NOARG_TYPED( FieldLinkRow, OnFieldNameChanged, Edit&, void ) { - return m_aLinkChangeHandler.Call( this ); + m_aLinkChangeHandler.Call( this ); } VCL_BUILDER_FACTORY(FieldLinkRow) diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx index c6d76be1433d..64c69c2087ef 100644 --- a/extensions/source/propctrlr/newdatatype.cxx +++ b/extensions/source/propctrlr/newdatatype.cxx @@ -64,7 +64,7 @@ namespace pcr while ( m_aProhibitedNames.find( sInitialName ) != m_aProhibitedNames.end() ); m_pName->SetText( sInitialName ); - OnNameModified( NULL ); + OnNameModified( *m_pName ); } NewDataTypeDialog::~NewDataTypeDialog() @@ -79,15 +79,13 @@ namespace pcr ModalDialog::dispose(); } - IMPL_LINK_NOARG( NewDataTypeDialog, OnNameModified ) + IMPL_LINK_NOARG_TYPED( NewDataTypeDialog, OnNameModified, Edit&, void ) { OUString sCurrentName = GetName(); bool bNameIsOK = ( !sCurrentName.isEmpty() ) && ( m_aProhibitedNames.find( sCurrentName ) == m_aProhibitedNames.end() ); m_pOK->Enable( bNameIsOK ); - - return 0L; } diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx index fd285c096e3c..24358f907fd0 100644 --- a/extensions/source/propctrlr/newdatatype.hxx +++ b/extensions/source/propctrlr/newdatatype.hxx @@ -49,7 +49,7 @@ namespace pcr OUString GetName() const { return m_pName->GetText(); } private: - DECL_LINK( OnNameModified, void* ); + DECL_LINK_TYPED( OnNameModified, Edit&, void ); }; diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 200b0f9e65fb..6d6265294d7b 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -1060,9 +1060,9 @@ namespace pcr void DropDownEditControl::setControlHelper( CommonBehaviourControlHelper& _rControlHelper ) { m_pHelper = &_rControlHelper; - m_pFloatingEdit->getEdit().SetModifyHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, ModifiedHdl ) ); + m_pFloatingEdit->getEdit().SetModifyHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, EditModifiedHdl ) ); m_pImplEdit->SetGetFocusHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, GetFocusHdl ) ); - m_pImplEdit->SetModifyHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, ModifiedHdl ) ); + m_pImplEdit->SetModifyHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, EditModifiedHdl ) ); m_pImplEdit->SetLoseFocusHdl( LINK( &_rControlHelper, CommonBehaviourControlHelper, LoseFocusHdl ) ); } diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 4e92dd1470e4..50a81a66ed2f 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -775,15 +775,15 @@ IMPL_LINK_TYPED( SaneDlg, OptionsBoxSelectHdl, SvTreeListBox*, pBox, void ) } } -IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( SaneDlg, ModifyHdl, Edit&, rEdit, void ) { if( mrSane.IsOpen() ) { - if( pEdit == mpStringEdit ) + if( &rEdit == mpStringEdit ) { mrSane.SetOptionValue( mnCurrentOption, mpStringEdit->GetText() ); } - else if( pEdit == mpReslBox ) + else if( &rEdit == mpReslBox ) { double fRes = (double)mpReslBox->GetValue(); int nOption = mrSane.GetOptionByName( "resolution" ); @@ -813,7 +813,7 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit ) mpReslBox->SetValue( (sal_uLong)fRes ); } } - else if( pEdit == mpNumericEdit ) + else if( &rEdit == mpNumericEdit ) { double fValue; OString aContents(OUStringToOString(mpNumericEdit->GetText(), @@ -831,7 +831,7 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit ) } mrSane.SetOptionValue( mnCurrentOption, fValue, mnCurrentElement ); } - else if( pEdit == mpVectorBox ) + else if( &rEdit == mpVectorBox ) { mnCurrentElement = mpVectorBox->GetValue()-1; double fValue; @@ -844,28 +844,27 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit ) mpQuantumRangeBox->SelectEntry( aValue ); } } - else if( pEdit == mpTopField ) + else if( &rEdit == mpTopField ) { mpPreview->ChangePreviewLogicTopLeftY(mpTopField->GetValue()); mpPreview->Invalidate(); } - else if( pEdit == mpLeftField ) + else if( &rEdit == mpLeftField ) { mpPreview->ChangePreviewLogicTopLeftX(mpLeftField->GetValue()); mpPreview->Invalidate(); } - else if( pEdit == mpBottomField ) + else if( &rEdit == mpBottomField ) { mpPreview->ChangePreviewLogicBottomRightY(mpBottomField->GetValue()); mpPreview->Invalidate(); } - else if( pEdit == mpRightField ) + else if( &rEdit == mpRightField ) { mpPreview->ChangePreviewLogicBottomRightX(mpRightField->GetValue()); mpPreview->Invalidate(); } } - return 0; } IMPL_LINK_NOARG_TYPED( SaneDlg, ReloadSaneOptionsHdl, Sane&, void ) diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx index f3871721b450..bbd46e990243 100644 --- a/extensions/source/scanner/sanedlg.hxx +++ b/extensions/source/scanner/sanedlg.hxx @@ -82,7 +82,7 @@ private: DECL_LINK_TYPED( ClickBtnHdl, Button*, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); - DECL_LINK( ModifyHdl, Edit* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( ReloadSaneOptionsHdl, Sane&, void ); DECL_LINK_TYPED( OptionsBoxSelectHdl, SvTreeListBox*, void ); diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx index 7e875b6bfe7e..62bcfeb43300 100644 --- a/formula/source/ui/dlg/ControlHelper.hxx +++ b/formula/source/ui/dlg/ControlHelper.hxx @@ -100,7 +100,7 @@ private: DECL_LINK_TYPED( FxBtnClickHdl, Button*, void ); DECL_LINK_TYPED( FxBtnFocusHdl, Control&, void ); DECL_LINK_TYPED( EdFocusHdl, Control&, void ); - DECL_LINK( EdModifyHdl,ArgEdit* ); + DECL_LINK_TYPED( EdModifyHdl, Edit&, void ); protected: diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 2e1f4959cf66..a114fac92eda 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -125,7 +125,7 @@ public: DECL_LINK_TYPED( FxHdl, ParaWin&, void ); DECL_LINK_TYPED( MatrixHdl, Button*, void ); - DECL_LINK(FormulaHdl, void *); + DECL_LINK_TYPED( FormulaHdl, Edit&, void); DECL_LINK_TYPED( FormulaCursorHdl, EditBox&, void ); DECL_LINK_TYPED( BtnHdl, Button*, void ); DECL_LINK_TYPED( DblClkHdl, FuncPage&, void ); @@ -1092,7 +1092,7 @@ IMPL_LINK_NOARG_TYPED(FormulaDlg_Impl, DblClkHdl, FuncPage&, void) aSel.Max()=aSel.Max()-1; pMEdit->SetSelection(aSel); - FormulaHdl(pMEdit); + FormulaHdl(*pMEdit); aSel.Min()=aSel.Max(); pMEdit->SetSelection(aSel); @@ -1285,11 +1285,11 @@ IMPL_LINK_TYPED( FormulaDlg_Impl, ModifyHdl, ParaWin&, rPtr, void ) } } -IMPL_LINK_NOARG(FormulaDlg_Impl, FormulaHdl) +IMPL_LINK_NOARG_TYPED(FormulaDlg_Impl, FormulaHdl, Edit&, void) { FormEditData* pData = m_pHelper->getFormEditData(); - if (!pData) return 0; + if (!pData) return; bEditFlag=true; OUString aInputFormula=m_pHelper->getCurrentFormula(); @@ -1347,7 +1347,6 @@ IMPL_LINK_NOARG(FormulaDlg_Impl, FormulaHdl) m_pHelper->setSelection(aSel.Min(), aSel.Max()); bEditFlag=false; - return 0; } IMPL_LINK_NOARG_TYPED(FormulaDlg_Impl, FormulaCursorHdl, EditBox&, void) @@ -1669,7 +1668,7 @@ void FormulaDlg_Impl::SetEdSelection() Selection theSel = m_pEdRef->GetSelection(); // Edit may have the focus -> call ModifyHdl in addition // to what's happening in GetFocus - pEd->GetModifyHdl().Call(pEd); + pEd->GetModifyHdl().Call(*pEd); pEd->GrabFocus(); pEd->SetSelection(theSel); } // if( pEd ) diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index 8cb281f58bc9..15275820983c 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -297,12 +297,10 @@ IMPL_LINK_TYPED( ArgInput, EdFocusHdl, Control&, rControl, void ) EdFocus(); } -IMPL_LINK( ArgInput, EdModifyHdl,ArgEdit*, pEd ) +IMPL_LINK_TYPED( ArgInput, EdModifyHdl, Edit&, rEdit, void ) { - if(pEd == pEdArg) + if(&rEdit == pEdArg) EdModify(); - - return 0; } // class EditBox diff --git a/fpicker/source/office/QueryFolderName.hxx b/fpicker/source/office/QueryFolderName.hxx index 0783b2a86778..4b197f84dbee 100644 --- a/fpicker/source/office/QueryFolderName.hxx +++ b/fpicker/source/office/QueryFolderName.hxx @@ -33,7 +33,7 @@ private: VclPtr<OKButton> m_pOKBtn; DECL_LINK_TYPED( OKHdl, Button*, void ); - DECL_LINK( NameHdl, void * ); + DECL_LINK_TYPED( NameHdl, Edit&, void ); public: QueryFolderNameDialog(vcl::Window* _pParent, const OUString& rTitle, diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 086db2cf916d..e54e16e82914 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -987,13 +987,11 @@ IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, FileNameGetFocusHdl, Control&, void ) m_pFileView->SetNoSelection(); } -IMPL_LINK_NOARG( RemoteFilesDialog, FileNameModifyHdl ) +IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, FileNameModifyHdl, Edit&, void ) { m_pFileView->SetNoSelection(); if( !m_pOk_btn->IsEnabled() ) EnableControls(); - - return 1; } IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, SplitHdl, Splitter*, void ) diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index cf5bdd5d1cd4..f9af46a88da4 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -193,7 +193,7 @@ private: DECL_LINK_TYPED( SelectHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( FileNameGetFocusHdl, Control&, void ); - DECL_LINK( FileNameModifyHdl, void * ); + DECL_LINK_TYPED( FileNameModifyHdl, Edit&, void ); DECL_LINK_TYPED( SplitHdl, Splitter*, void ); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 9e843e97c82b..5eb5f8efedd1 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1318,10 +1318,9 @@ IMPL_LINK_NOARG_TYPED( SvtFileDialog, FileNameGetFocusHdl_Impl, Control&, void ) -IMPL_LINK_NOARG( SvtFileDialog, FileNameModifiedHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SvtFileDialog, FileNameModifiedHdl_Impl, Edit&, void ) { FileNameGetFocusHdl_Impl( *_pImp->_pEdFileName ); - return 0; } @@ -2913,7 +2912,7 @@ IMPL_LINK_NOARG_TYPED(QueryFolderNameDialog, OKHdl, Button*, void) } -IMPL_LINK_NOARG(QueryFolderNameDialog, NameHdl) +IMPL_LINK_NOARG_TYPED(QueryFolderNameDialog, NameHdl, Edit&, void) { // trim the strings OUString aName = comphelper::string::strip(m_pNameEdit->GetText(), ' '); @@ -2927,8 +2926,6 @@ IMPL_LINK_NOARG(QueryFolderNameDialog, NameHdl) if ( m_pOKBtn->IsEnabled() ) m_pOKBtn->Enable( false ); } - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 05f13063b873..9469078c93f9 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -92,7 +92,7 @@ private: DECL_LINK_TYPED( OpenClickHdl_Impl, Button*, void ); DECL_LINK_TYPED( CancelHdl_Impl, Button*, void ); DECL_LINK_TYPED( FileNameGetFocusHdl_Impl, Control&, void ); - DECL_LINK( FileNameModifiedHdl_Impl, void* ); + DECL_LINK_TYPED( FileNameModifiedHdl_Impl, Edit&, void ); DECL_LINK_TYPED( URLBoxModifiedHdl_Impl, SvtURLBox*, void ); DECL_LINK_TYPED( ConnectToServerPressed_Hdl, Button*, void ); diff --git a/include/sfx2/newstyle.hxx b/include/sfx2/newstyle.hxx index 67e50766b6cf..dff6a3119ea4 100644 --- a/include/sfx2/newstyle.hxx +++ b/include/sfx2/newstyle.hxx @@ -41,7 +41,7 @@ private: DECL_DLLPRIVATE_LINK_TYPED( OKHdl, ComboBox&, void ); DECL_DLLPRIVATE_LINK_TYPED( OKClickHdl, Button *, void ); - DECL_DLLPRIVATE_LINK( ModifyHdl, ComboBox * ); + DECL_DLLPRIVATE_LINK_TYPED( ModifyHdl, Edit&, void ); public: SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& ); diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx index 212dc88ae09b..35e15d8b53a0 100644 --- a/include/sfx2/passwd.hxx +++ b/include/sfx2/passwd.hxx @@ -76,8 +76,9 @@ private: SfxShowExtras mnExtras; bool mbAsciiOnly; - DECL_DLLPRIVATE_LINK(EditModifyHdl, Edit*); + DECL_DLLPRIVATE_LINK_TYPED(EditModifyHdl, Edit&, void); DECL_DLLPRIVATE_LINK_TYPED(OKHdl, Button *, void); + void ModifyHdl(Edit*); void SetPasswdText(); diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx index 03638028e4bf..40f0d181d78a 100644 --- a/include/sfx2/templatedlg.hxx +++ b/include/sfx2/templatedlg.hxx @@ -80,7 +80,7 @@ private: DECL_LINK_TYPED(OpenRegionHdl, void*, void); DECL_LINK_TYPED(OpenTemplateHdl, ThumbnailViewItem*, void); - DECL_LINK(SearchUpdateHdl, void*); + DECL_LINK_TYPED(SearchUpdateHdl, Edit&, void); void OnTemplateImport (); void OnTemplateSearch (); diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx index 34fd5968c589..420b3ba21e33 100644 --- a/include/svtools/GraphicExportOptionsDialog.hxx +++ b/include/svtools/GraphicExportOptionsDialog.hxx @@ -56,9 +56,9 @@ private: double getViewWidthInch(); double getViewHeightInch(); - DECL_LINK( widthModifiedHandle, void* ); - DECL_LINK( heightModifiedHandle, void* ); - DECL_LINK( resolutionModifiedHandle, void* ); + DECL_LINK_TYPED( widthModifiedHandle, Edit&, void ); + DECL_LINK_TYPED( heightModifiedHandle, Edit&, void ); + DECL_LINK_TYPED( resolutionModifiedHandle, Edit&, void ); public: GraphicExportOptionsDialog( vcl::Window* pWindow, const css::uno::Reference<css::lang::XComponent>& rxSourceDocument ); diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index 6fcd3c608bc5..f6825808b6de 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -85,10 +85,10 @@ private: DECL_LINK_TYPED ( OKHdl, Button *, void ); DECL_LINK_TYPED ( DelHdl, Button *, void ); DECL_LINK_TYPED ( EditHdl, DetailsContainer*, void ); - DECL_LINK ( ModifyHdl, void* ); + DECL_LINK_TYPED ( ModifyHdl, Edit&, void ); DECL_LINK_TYPED ( SelectTypeHdl, ListBox&, void ); - DECL_LINK ( EditLabelHdl, void * ); - DECL_LINK ( EditUsernameHdl, void * ); + DECL_LINK_TYPED ( EditLabelHdl, Edit&, void ); + DECL_LINK_TYPED ( EditUsernameHdl, Edit&, void ); }; diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 80d9bcc539ee..3e71209d77e4 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -61,7 +61,7 @@ class DetailsContainer protected: void notifyChange( ); - DECL_LINK ( ValueChangeHdl, void * ); + DECL_LINK_TYPED ( ValueChangeHdl, Edit&, void ); }; class HostDetailsContainer : public DetailsContainer diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 991f9b18f990..e1c7c1047b4b 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -147,7 +147,7 @@ namespace svt virtual void SetModified() = 0; virtual bool IsModified() const = 0; virtual void ClearModified() = 0; - virtual void SetModifyHdl( const Link<>& _rLink ) = 0; + virtual void SetModifyHdl( const Link<Edit&,void>& _rLink ) = 0; }; @@ -182,7 +182,7 @@ namespace svt virtual void SetModified() override; virtual bool IsModified() const override; virtual void ClearModified() override; - virtual void SetModifyHdl( const Link<>& _rLink ) override; + virtual void SetModifyHdl( const Link<Edit&,void>& _rLink ) override; }; #include <svtools/editimplementation.hxx> @@ -252,7 +252,7 @@ namespace svt protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; private: - DECL_LINK(ModifyHdl, void*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); }; @@ -273,7 +273,7 @@ namespace svt protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; private: - DECL_LINK(ModifyHdl, void*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); }; @@ -360,7 +360,7 @@ namespace svt protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const override; private: - DECL_LINK(ModifyHdl, void*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); }; @@ -673,10 +673,10 @@ namespace svt SVT_DLLPRIVATE void implActivateCellOnMouseEvent(const BrowserMouseEvent& _rEvt, bool _bUp); SVT_DLLPRIVATE void impl_construct(); - DECL_DLLPRIVATE_LINK_TYPED(ModifyHdl, LinkParamNone*, void ); - DECL_DLLPRIVATE_LINK_TYPED(StartEditHdl, void*, void ); - DECL_DLLPRIVATE_LINK_TYPED(EndEditHdl, void*, void ); - DECL_DLLPRIVATE_LINK_TYPED(CellModifiedHdl, void*, void ); + DECL_DLLPRIVATE_LINK_TYPED( ModifyHdl, LinkParamNone*, void ); + DECL_DLLPRIVATE_LINK_TYPED( StartEditHdl, void*, void ); + DECL_DLLPRIVATE_LINK_TYPED( EndEditHdl, void*, void ); + DECL_DLLPRIVATE_LINK_TYPED( CellModifiedHdl, void*, void ); }; diff --git a/include/svtools/editimplementation.hxx b/include/svtools/editimplementation.hxx index f6a98a6ad80d..c43c44d66db2 100644 --- a/include/svtools/editimplementation.hxx +++ b/include/svtools/editimplementation.hxx @@ -129,7 +129,7 @@ void GenericEditImplementation< EDIT >::ClearModified() template <class EDIT> -void GenericEditImplementation< EDIT >::SetModifyHdl( const Link<>& _rLink ) +void GenericEditImplementation< EDIT >::SetModifyHdl( const Link<Edit&,void>& _rLink ) { m_rEdit.SetModifyHdl( _rLink ); } diff --git a/include/svtools/filectrl.hxx b/include/svtools/filectrl.hxx index 741e3c509409..14fe9466a84f 100644 --- a/include/svtools/filectrl.hxx +++ b/include/svtools/filectrl.hxx @@ -86,7 +86,7 @@ public: void SetText( const OUString& rStr ) override; OUString GetText() const override; - void SetEditModifyHdl( const Link<>& rLink ); + void SetEditModifyHdl( const Link<Edit&,void>& rLink ); }; #endif diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx index eeafb52b0d8c..e7b4897bbe9e 100644 --- a/include/svx/compressgraphicdialog.hxx +++ b/include/svx/compressgraphicdialog.hxx @@ -63,9 +63,9 @@ private: void Initialize(); - DECL_LINK( NewWidthModifiedHdl, void* ); - DECL_LINK( NewHeightModifiedHdl, void* ); - DECL_LINK( ResolutionModifiedHdl, void* ); + DECL_LINK_TYPED( NewWidthModifiedHdl, Edit&, void ); + DECL_LINK_TYPED( NewHeightModifiedHdl, Edit&, void ); + DECL_LINK_TYPED( ResolutionModifiedHdl, Edit&, void ); DECL_LINK_TYPED( ToggleCompressionRB, RadioButton&, void ); DECL_LINK_TYPED( ToggleReduceResolutionRB, CheckBox&, void ); diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index 7a9898cac659..ab9d01ee779d 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -197,9 +197,9 @@ private: DECL_LINK_TYPED( SelDateHdl, ListBox&, void ); DECL_LINK_TYPED( RowEnableHdl, Button*, void ); DECL_LINK_TYPED( TimeHdl, Button*, void ); - DECL_LINK( ModifyHdl, void* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( ModifyListBoxHdl, ListBox&, void ); - DECL_LINK( ModifyDate, void* ); + DECL_LINK_TYPED( ModifyDate, Edit&, void ); DECL_LINK_TYPED( RefHandle, Button*, void ); protected: diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx index 6699557db01d..bcc5c0345268 100644 --- a/include/svx/dialcontrol.hxx +++ b/include/svx/dialcontrol.hxx @@ -159,7 +159,7 @@ private: void ImplSetFieldLink( const Link<>& rLink ); - DECL_LINK( LinkedFieldModifyHdl, NumericField* ); + DECL_LINK_TYPED( LinkedFieldModifyHdl, Edit&, void ); DECL_LINK_TYPED( LinkedFieldFocusHdl, Control&, void ); void LinkedFieldModifyHdl(); DECL_LINK_TYPED(SpinFieldHdl, SpinField&, void); diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx index be0c2db98651..0fff7e1fa168 100644 --- a/include/svx/float3d.hxx +++ b/include/svx/float3d.hxx @@ -195,7 +195,7 @@ private: DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( ClickColorHdl, Button*, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); - DECL_LINK( ModifyHdl, void * ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); void ClickLight(PushButton &rBtn); DECL_LINK_TYPED( ChangeSelectionCallbackHdl, SvxLightCtl3D*, void ); diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx index 86932b20d50f..e56e6226596f 100644 --- a/include/svx/fontwork.hxx +++ b/include/svx/fontwork.hxx @@ -147,7 +147,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontWorkDialog : public SfxDockingWindow DECL_LINK_TYPED( SelectAdjustHdl_Impl, ToolBox *, void ); DECL_LINK_TYPED( SelectShadowHdl_Impl, ToolBox *, void ); - DECL_LINK( ModifyInputHdl_Impl, void * ); + DECL_LINK_TYPED( ModifyInputHdl_Impl, Edit&, void ); DECL_LINK_TYPED( InputTimoutHdl_Impl, Idle *, void ); DECL_LINK_TYPED( ColorSelectHdl_Impl, ListBox&, void ); diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx index 11a911fdeba6..06b2eec8166d 100644 --- a/include/svx/hdft.hxx +++ b/include/svx/hdft.hxx @@ -94,10 +94,10 @@ protected: bool mbEnableDrawingLayerFillStyles : 1; void InitHandler(); - DECL_LINK_TYPED( TurnOnHdl, Button*, void); - DECL_LINK(DistModify, void *); - DECL_LINK(HeightModify, void *); - DECL_LINK(BorderModify, void *); + DECL_LINK_TYPED(TurnOnHdl, Button*, void); + DECL_LINK_TYPED(DistModify, Edit&, void); + DECL_LINK_TYPED(HeightModify, Edit&, void); + DECL_LINK_TYPED(BorderModify, Edit&, void); DECL_LINK_TYPED(BackgroundHdl, Button*, void); void UpdateExample(); diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx index 0a34caef522a..dd8a047be38a 100644 --- a/include/svx/imapdlg.hxx +++ b/include/svx/imapdlg.hxx @@ -122,7 +122,7 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow DECL_LINK_TYPED( InfoHdl, IMapWindow&, void ); DECL_LINK_TYPED( MousePosHdl, GraphCtrl*, void ); DECL_LINK_TYPED( GraphSizeHdl, GraphCtrl*, void ); - DECL_LINK( URLModifyHdl, void* ); + DECL_LINK_TYPED( URLModifyHdl, Edit&, void ); DECL_LINK_TYPED( URLModifyComboBoxHdl, ComboBox&, void ); DECL_LINK_TYPED( URLLoseFocusHdl, Control&, void ); DECL_LINK_TYPED( UpdateHdl, Idle *, void ); diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx index f9dca8c760cc..10591848477c 100644 --- a/include/svx/langbox.hxx +++ b/include/svx/langbox.hxx @@ -181,7 +181,7 @@ private: SVX_DLLPRIVATE virtual void ImplSaveValue() override; SVX_DLLPRIVATE virtual sal_Int32 ImplGetSavedValue() const override; - DECL_LINK( EditModifyHdl, SvxLanguageComboBox* ); + DECL_LINK_TYPED( EditModifyHdl, Edit&, void ); }; #endif diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx index 43b139029ecf..beafc874b897 100644 --- a/include/svx/optgrid.hxx +++ b/include/svx/optgrid.hxx @@ -142,9 +142,9 @@ private: bool bAttrModified; DECL_LINK_TYPED( ClickRotateHdl_Impl, Button*, void ); - DECL_LINK( ChangeDrawHdl_Impl, MetricField * ); + DECL_LINK_TYPED( ChangeDrawHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ChangeGridsnapHdl_Impl, Button*, void ); - DECL_LINK( ChangeDivisionHdl_Impl, NumericField * ); + DECL_LINK_TYPED( ChangeDivisionHdl_Impl, Edit&, void ); }; #endif diff --git a/include/svx/passwd.hxx b/include/svx/passwd.hxx index 109b055b0688..e8dcfe7d9686 100644 --- a/include/svx/passwd.hxx +++ b/include/svx/passwd.hxx @@ -48,7 +48,7 @@ private: bool bEmpty; DECL_LINK_TYPED(ButtonHdl, Button*, void); - DECL_LINK(EditModifyHdl, void *); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); public: SvxPasswordDialog( vcl::Window* pParent, bool bAllowEmptyPasswords = false, bool bDisableOldPassword = false ); diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx index cb1485c8101c..e0ddcf0e2bb6 100644 --- a/include/svx/rubydialog.hxx +++ b/include/svx/rubydialog.hxx @@ -135,7 +135,7 @@ class SvxRubyDialog : public SfxModelessDialog DECL_LINK_TYPED(PositionHdl_Impl, ListBox&, void); DECL_LINK_TYPED(AdjustHdl_Impl, ListBox&, void); DECL_LINK_TYPED(CharStyleHdl_Impl, ListBox&, void); - DECL_LINK(EditModifyHdl_Impl, Edit*); + DECL_LINK_TYPED(EditModifyHdl_Impl, Edit&, void); DECL_LINK_TYPED(EditScrollHdl_Impl, sal_Int32, bool); DECL_LINK_TYPED(EditJumpHdl_Impl, sal_Int32, void); diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 169972679d3b..4c67637756b7 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -162,7 +162,7 @@ protected: DECL_LINK_TYPED(SelectFillTypeHdl, ListBox&, void ); DECL_LINK_TYPED(SelectFillAttrHdl, ListBox&, void ); DECL_LINK_TYPED(ChangeTrgrTypeHdl_Impl, ListBox&, void); - DECL_LINK(ModifyTransparentHdl_Impl, void*); + DECL_LINK_TYPED(ModifyTransparentHdl_Impl, Edit&, void); DECL_LINK_TYPED(ModifyTransSliderHdl, Slider*, void); // for transparency gradient diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx index b2372de1042b..eda36c9d5528 100644 --- a/include/svx/sidebar/LinePropertyPanelBase.hxx +++ b/include/svx/sidebar/LinePropertyPanelBase.hxx @@ -170,7 +170,7 @@ private: DECL_LINK_TYPED(ChangeLineStyleHdl, ListBox&, void); DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void); - DECL_LINK(ChangeTransparentHdl , void *); + DECL_LINK_TYPED(ChangeTransparentHdl, Edit&, void ); DECL_LINK_TYPED(ChangeStartHdl, ListBox&, void); DECL_LINK_TYPED(ChangeEndHdl, ListBox&, void); DECL_LINK_TYPED(ChangeEdgeStyleHdl, ListBox&, void); diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 84f219dfd3a0..b27a0478bf64 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -230,7 +230,7 @@ private: mutable sal_Int32 nTransliterationFlags; - DECL_LINK( ModifyHdl_Impl, ComboBox* ); + DECL_LINK_TYPED( ModifyHdl_Impl, Edit&, void ); DECL_LINK_TYPED( FlagHdl_Impl, Button*, void ); DECL_LINK_TYPED( CommandHdl_Impl, Button*, void ); DECL_LINK_TYPED(TemplateHdl_Impl, Button*, void); diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index 7a6023684860..3f015be0ca85 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -102,8 +102,8 @@ private: mbIsSubEdit:1, mbInMBDown:1, mbActivePopup:1; - Link<> maModifyHdl; - Link<> maUpdateDataHdl; + Link<Edit&,void> maModifyHdl; + Link<Edit&,void> maUpdateDataHdl; css::uno::Reference<css::i18n::XExtendedInputSequenceChecker> mxISC; @@ -246,9 +246,9 @@ public: const OUString& GetSavedValue() const { return maSaveValue; } bool IsValueChangedFromSaved() const { return maSaveValue != GetText(); } - virtual void SetModifyHdl( const Link<>& rLink ) { maModifyHdl = rLink; } - virtual const Link<>& GetModifyHdl() const { return maModifyHdl; } - virtual void SetUpdateDataHdl( const Link<>& rLink ) { maUpdateDataHdl = rLink; } + virtual void SetModifyHdl( const Link<Edit&,void>& rLink ) { maModifyHdl = rLink; } + virtual const Link<Edit&,void>& GetModifyHdl() const { return maModifyHdl; } + virtual void SetUpdateDataHdl( const Link<Edit&,void>& rLink ) { maUpdateDataHdl = rLink; } void SetSubEdit( Edit* pEdit ); Edit* GetSubEdit() const { return mpSubEdit; } diff --git a/include/vcl/slider.hxx b/include/vcl/slider.hxx index 98e93d80f76e..e418357de6d4 100644 --- a/include/vcl/slider.hxx +++ b/include/vcl/slider.hxx @@ -57,7 +57,7 @@ private: Link<Slider*,void> maSlideHdl; Link<Slider*,void> maEndSlideHdl; - DECL_LINK(LinkedFieldModifyHdl, NumericField*); + DECL_LINK_TYPED(LinkedFieldModifyHdl, Edit&, void); DECL_LINK_TYPED(LinkedFieldLoseFocusHdl, Control&, void); DECL_LINK_TYPED(LinkedFieldSpinnerHdl, SpinField&, void); @@ -77,7 +77,6 @@ private: SAL_DLLPRIVATE void ImplDoMouseAction( const Point& rPos, bool bCallAction = true ); SAL_DLLPRIVATE long ImplDoSlide( long nNewPos ); SAL_DLLPRIVATE long ImplDoSlideAction( ScrollType eScrollType ); - SAL_DLLPRIVATE void ImplSetFieldLink(const Link<>& rLink); SAL_DLLPRIVATE void ImplUpdateLinkedField(); public: diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx index 90ddc3a685d0..2d577f7ab05a 100644 --- a/include/vcl/vclmedit.hxx +++ b/include/vcl/vclmedit.hxx @@ -33,13 +33,13 @@ class ExtTextView; class VCL_DLLPUBLIC VclMultiLineEdit : public Edit { private: - ImpVclMEdit* pImpVclMEdit; + ImpVclMEdit* pImpVclMEdit; - OUString aSaveValue; - Link<> aModifyHdlLink; + OUString aSaveValue; + Link<Edit&,void> aModifyHdlLink; - Timer* pUpdateDataTimer; - Link<> aUpdateDataHdlLink; + Timer* pUpdateDataTimer; + Link<Edit&,void> aUpdateDataHdlLink; protected: @@ -109,10 +109,10 @@ public: void SaveValue() { aSaveValue = GetText(); } const OUString& GetSavedValue() const { return aSaveValue; } - void SetModifyHdl( const Link<>& rLink ) override { aModifyHdlLink = rLink; } - const Link<>& GetModifyHdl() const override { return aModifyHdlLink; } + void SetModifyHdl( const Link<Edit&,void>& rLink ) override { aModifyHdlLink = rLink; } + const Link<Edit&,void>& GetModifyHdl() const override { return aModifyHdlLink; } - void SetUpdateDataHdl( const Link<>& rLink ) override { aUpdateDataHdlLink = rLink; } + void SetUpdateDataHdl( const Link<Edit&,void>& rLink ) override { aUpdateDataHdlLink = rLink; } virtual void Resize() override; virtual void GetFocus() override; diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index 72afc4fea95f..3f2c93005b57 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -358,7 +358,7 @@ IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, LoseFocusHandler, Control&, mbDialogLostFocus = !IsActive(); } -IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, InputRangeModified) +IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, InputRangeModified, Edit&, void) { ScRangeList aRangeList; bool bValid = ParseWithNames( aRangeList, mpInputRangeEdit->GetText(), mpDoc); @@ -377,10 +377,9 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, InputRangeModified) mpButtonApply->Disable(); mpButtonOk->Disable(); } - return 0; } -IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter1ValueModified) +IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, Parameter1ValueModified, Edit&, void) { sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos(); sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>( mpDistributionCombo->GetEntryData(aSelectedIndex) ); @@ -394,10 +393,9 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter1ValueModified) mpParameter2Value->SetValue(min); } } - return 0; } -IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter2ValueModified) +IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, Parameter2ValueModified, Edit&, void) { sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos(); sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>( mpDistributionCombo->GetEntryData(aSelectedIndex) ); @@ -411,7 +409,6 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter2ValueModified) mpParameter1Value->SetValue(max); } } - return 0; } IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, CheckChanged, CheckBox&, void) diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index 258f19e8b9ff..2b3d22426173 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -101,7 +101,7 @@ void ScSamplingDialog::Init() mpOutputRangeEdit->SetLoseFocusHdl( aLink ); mpOutputRangeButton->SetLoseFocusHdl( aLink ); - Link<> aLink2 = LINK( this, ScSamplingDialog, RefInputModifyHandler); + Link<Edit&,void> aLink2 = LINK( this, ScSamplingDialog, RefInputModifyHandler); mpInputRangeEdit->SetModifyHdl( aLink2); mpOutputRangeEdit->SetModifyHdl( aLink2); @@ -173,7 +173,7 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument* sal_Int64 aSelectedSampleSize = rReferenceRange.aEnd.Row() - rReferenceRange.aStart.Row() + 1; if (aSelectedSampleSize > 1) mpSampleSize->SetValue(aSelectedSampleSize); - SamplingSizeValueModified(NULL); + SamplingSizeValueModified(*mpSampleSize); } } @@ -312,12 +312,11 @@ IMPL_LINK_NOARG_TYPED(ScSamplingDialog, LoseFocusHandler, Control&, void) mDialogLostFocus = !IsActive(); } -IMPL_LINK_NOARG(ScSamplingDialog, SamplingSizeValueModified) +IMPL_LINK_NOARG_TYPED(ScSamplingDialog, SamplingSizeValueModified, Edit&, void) { sal_Int64 aPopulationSize = mInputRange.aEnd.Row() - mInputRange.aStart.Row() + 1; if (mpSampleSize->GetValue() > aPopulationSize) mpSampleSize->SetValue(aPopulationSize); - return 0; } IMPL_LINK_NOARG_TYPED(ScSamplingDialog, ToggleSamplingMethod, RadioButton&, void) @@ -339,7 +338,7 @@ void ScSamplingDialog::ToggleSamplingMethod() } } -IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler) +IMPL_LINK_NOARG_TYPED(ScSamplingDialog, RefInputModifyHandler, Edit&, void) { if ( mpActiveEdit ) { @@ -380,7 +379,7 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler) sal_Int64 aSelectedSampleSize = pRange->aEnd.Row() - pRange->aStart.Row() + 1; if (aSelectedSampleSize > 1) mpSampleSize->SetValue(aSelectedSampleSize); - SamplingSizeValueModified(NULL); + SamplingSizeValueModified(*mpSampleSize); // Highlight the resulting range. mpOutputRangeEdit->StartUpdateData(); @@ -397,8 +396,6 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler) mpButtonOk->Enable(); else mpButtonOk->Disable(); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index 276f5c1ba2c1..51d36af4d0ba 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -125,7 +125,7 @@ void ScStatisticsInputOutputDialog::Init() mpOutputRangeEdit->SetLoseFocusHdl( aLink ); mpOutputRangeButton->SetLoseFocusHdl( aLink ); - Link<> aLink2 = LINK( this, ScStatisticsInputOutputDialog, RefInputModifyHandler); + Link<Edit&,void> aLink2 = LINK( this, ScStatisticsInputOutputDialog, RefInputModifyHandler); mpInputRangeEdit->SetModifyHdl( aLink2); mpOutputRangeEdit->SetModifyHdl( aLink2); @@ -224,7 +224,7 @@ IMPL_LINK_NOARG_TYPED( ScStatisticsInputOutputDialog, GroupByChanged, RadioButto mGroupedBy = BY_ROW; } -IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, RefInputModifyHandler ) +IMPL_LINK_NOARG_TYPED( ScStatisticsInputOutputDialog, RefInputModifyHandler, Edit&, void ) { if ( mpActiveEdit ) { @@ -276,8 +276,6 @@ IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, RefInputModifyHandler ) mpButtonOk->Enable(); else mpButtonOk->Disable(); - - return 0; } void ScStatisticsInputOutputDialog::CalculateInputAndWriteToOutput() diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx index 16816f5a0f89..b6376a564c1f 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx @@ -111,7 +111,7 @@ void ScStatisticsTwoVariableDialog::Init() mpOutputRangeEdit->SetLoseFocusHdl( aLink ); mpOutputRangeButton->SetLoseFocusHdl( aLink ); - Link<> aLink2 = LINK( this, ScStatisticsTwoVariableDialog, RefInputModifyHandler); + Link<Edit&,void> aLink2 = LINK( this, ScStatisticsTwoVariableDialog, RefInputModifyHandler); mpVariable1RangeEdit->SetModifyHdl( aLink2); mpVariable2RangeEdit->SetModifyHdl( aLink2); mpOutputRangeEdit->SetModifyHdl( aLink2); @@ -247,7 +247,7 @@ IMPL_LINK_NOARG_TYPED( ScStatisticsTwoVariableDialog, GroupByChanged, RadioButto mGroupedBy = BY_ROW; } -IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, RefInputModifyHandler ) +IMPL_LINK_NOARG_TYPED( ScStatisticsTwoVariableDialog, RefInputModifyHandler, Edit&, void ) { if ( mpActiveEdit ) { @@ -315,8 +315,6 @@ IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, RefInputModifyHandler ) mpButtonOk->Enable(); else mpButtonOk->Disable(); - - return 0; } void ScStatisticsTwoVariableDialog::CalculateInputAndWriteToOutput() diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 09e608e38a25..f4c51a2ebd0f 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1215,7 +1215,7 @@ IMPL_LINK_NOARG_TYPED(ScCheckListMenuWindow, TriStateHdl, Button*, void) mePrevToggleAllState = maChkToggleAll->GetState(); } -IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl) +IMPL_LINK_NOARG_TYPED(ScCheckListMenuWindow, EdModifyHdl, Edit&, void) { OUString aSearchText = maEdSearch->GetText(); aSearchText = aSearchText.toAsciiLowerCase(); @@ -1254,8 +1254,6 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl) maChkToggleAll->SetState( TRISTATE_FALSE ); else maChkToggleAll->SetState( TRISTATE_INDET ); - - return 0; } IMPL_LINK_TYPED( ScCheckListMenuWindow, CheckHdl, SvTreeListBox*, pChecks, void ) diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 540bfdea18db..91136716e8bc 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -769,19 +769,18 @@ OUString ScCondFormatDlg::GenerateXmlString(sal_uInt32 nIndex, sal_uInt8 nType, } -IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( ScCondFormatDlg, EdRangeModifyHdl, Edit&, rEdit, void ) { - OUString aRangeStr = pEdit->GetText(); + OUString aRangeStr = rEdit.GetText(); ScRangeList aRange; sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpViewData->GetDocument(), SCA_VALID, mpViewData->GetDocument()->GetAddressConvention()); if(nFlags & SCA_VALID) - pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); + rEdit.SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); else - pEdit->SetControlBackground(COL_LIGHTRED); + rEdit.SetControlBackground(COL_LIGHTRED); updateTitle(); - return 0; } IMPL_LINK_TYPED( ScCondFormatDlg, RangeGetFocusHdl, Control&, rControl, void ) diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 120e1d633a0d..5edd574fd269 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -224,15 +224,15 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pD maEdVal1->Show(); maEdVal1->SetText(pFormatEntry->GetExpression(maPos, 0)); maEdVal2->Hide(); - OnEdChanged(maEdVal1); + OnEdChanged(*maEdVal1); break; case 2: maEdVal1->Show(); maEdVal1->SetText(pFormatEntry->GetExpression(maPos, 0)); - OnEdChanged(maEdVal1); + OnEdChanged(*maEdVal1); maEdVal2->Show(); maEdVal2->SetText(pFormatEntry->GetExpression(maPos, 1)); - OnEdChanged(maEdVal2); + OnEdChanged(*maEdVal2); break; } } @@ -296,14 +296,14 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const return pEntry; } -IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit) +IMPL_LINK_TYPED(ScConditionFrmtEntry, OnEdChanged, Edit&, rEdit, void) { - OUString aFormula = pEdit->GetText(); + OUString aFormula = rEdit.GetText(); if( aFormula.isEmpty() ) { maFtVal->SetText(ScGlobal::GetRscString(STR_ENTER_VALUE)); - return 0; + return; } ScCompiler aComp( mpDoc, maPos ); @@ -313,9 +313,9 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit) // Error, warn the user if( ta->GetCodeError() || ( ta->GetLen() == 0 ) ) { - pEdit->SetControlBackground(COL_LIGHTRED); + rEdit.SetControlBackground(COL_LIGHTRED); maFtVal->SetText(ScGlobal::GetRscString(STR_VALID_DEFERROR)); - return 0; + return; } // Recognized col/row name or string token, warn the user @@ -326,14 +326,13 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit) ( ( op == ocBad ) && ( t == formula::svString ) ) ) { - pEdit->SetControlBackground(COL_YELLOW); + rEdit.SetControlBackground(COL_YELLOW); maFtVal->SetText(ScGlobal::GetRscString(STR_UNQUOTED_STRING)); - return 0; + return; } - pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); + rEdit.SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); maFtVal->SetText(""); - return 0; } void ScConditionFrmtEntry::Select() diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 7ef844199185..447354633405 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -682,10 +682,9 @@ IMPL_LINK_NOARG_TYPED(ScPivotLayoutDialog, SourceListSelected, ListBox&, void) UpdateSourceRange(); } -IMPL_LINK_NOARG(ScPivotLayoutDialog, SourceEditModified) +IMPL_LINK_NOARG_TYPED(ScPivotLayoutDialog, SourceEditModified, Edit&, void) { UpdateSourceRange(); - return 0; } IMPL_LINK_NOARG_TYPED(ScPivotLayoutDialog, ToggleSource, RadioButton&, void) diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 16b2f0c52b06..0d8f58910ae3 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -225,7 +225,7 @@ void ScConsolidateDlg::Init() } FillAreaLists(); - ModifyHdl( pEdDestArea ); + ModifyHdl( *pEdDestArea ); pLbDataArea->SelectEntryPos( 0 ); pEdDataArea->SetText(OUString()); pEdDataArea->GrabFocus(); @@ -280,7 +280,7 @@ void ScConsolidateDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) aStr = rRef.aStart.Format(nFmt, pDocP, eConv); pRefInputEdit->SetRefString( aStr ); - ModifyHdl( pRefInputEdit ); + ModifyHdl( *pRefInputEdit ); } } @@ -298,7 +298,7 @@ void ScConsolidateDlg::SetActive() if ( pRefInputEdit ) { pRefInputEdit->GrabFocus(); - ModifyHdl( pRefInputEdit ); + ModifyHdl( *pRefInputEdit ); } } else @@ -524,11 +524,11 @@ IMPL_LINK_TYPED( ScConsolidateDlg, SelectHdl, ListBox&, rLb, void ) } } -IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit*, pEd ) +IMPL_LINK_TYPED( ScConsolidateDlg, ModifyHdl, Edit&, rEd, void ) { - if ( pEd == pEdDataArea ) + if ( &rEd == pEdDataArea ) { - OUString aAreaStr( pEd->GetText() ); + OUString aAreaStr( rEd.GetText() ); if ( !aAreaStr.isEmpty() ) { pBtnAdd->Enable(); @@ -536,11 +536,10 @@ IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit*, pEd ) else pBtnAdd->Disable(); } - else if ( pEd == pEdDestArea ) + else if ( &rEd == pEdDestArea ) { pLbDestArea->SelectEntryPos(0); } - return 0; } // TODO: generalize! diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index f35e7649b518..211a52216fad 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -266,7 +266,7 @@ void ScDbNameDlg::Init() m_pEdName->GrabFocus(); bSaved = true; pSaveObj->Save(); - NameModifyHdl( 0 ); + NameModifyHdl( *m_pEdName ); } void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData ) @@ -481,7 +481,7 @@ IMPL_LINK_NOARG_TYPED(ScDbNameDlg, AddBtnHdl, Button*, void) theCurArea = ScRange(); bSaved = true; pSaveObj->Save(); - NameModifyHdl( 0 ); + NameModifyHdl( *m_pEdName ); } else { @@ -560,12 +560,12 @@ IMPL_LINK_NOARG_TYPED(ScDbNameDlg, RemoveBtnHdl, Button*, void) SetInfoStrings( NULL ); // leer bSaved=false; pSaveObj->Restore(); - NameModifyHdl( 0 ); + NameModifyHdl( *m_pEdName ); } } } -IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl) +IMPL_LINK_NOARG_TYPED(ScDbNameDlg, NameModifyHdl, Edit&, void) { OUString theName = m_pEdName->GetText(); bool bNameFound = (COMBOBOX_ENTRY_NOTFOUND @@ -626,10 +626,9 @@ IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl) //SFX_APPWINDOW->Enable(); bRefInputMode = true; } - return 0; } -IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl) +IMPL_LINK_NOARG_TYPED(ScDbNameDlg, AssModifyHdl, Edit&, void) { // hier parsen fuer Save() etc. @@ -660,8 +659,6 @@ IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl) m_pFTSource->Disable(); m_pFTOperations->Disable(); } - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 009b84b39bf3..a43f66c08b1d 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -451,7 +451,7 @@ void ScFilterDlg::SetActive() if ( bRefInputMode ) { pEdCopyArea->GrabFocus(); - ((Link<>&)pEdCopyArea->GetModifyHdl()).Call( pEdCopyArea ); + pEdCopyArea->GetModifyHdl().Call( *pEdCopyArea ); } else GrabFocus(); @@ -1051,91 +1051,87 @@ IMPL_LINK_TYPED( ScFilterDlg, CheckBoxHdl, Button*, pBox, void ) } } -IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) +IMPL_LINK_TYPED( ScFilterDlg, ValModifyHdl, Edit&, rEd, void ) { size_t nOffset = GetSliderPos(); size_t i = 0; size_t nQE = i + nOffset; - if ( pEd ) + OUString aStrVal = rEd.GetText(); + ListBox* pLbCond = pLbCond1; + ListBox* pLbField = pLbField1; + if ( &rEd == pEdVal2 ) { - OUString aStrVal = pEd->GetText(); - ListBox* pLbCond = pLbCond1; - ListBox* pLbField = pLbField1; - if ( pEd == pEdVal2 ) - { - pLbCond = pLbCond2; - pLbField = pLbField2; - i=1; - nQE=i+nOffset; - } - if ( pEd == pEdVal3 ) + pLbCond = pLbCond2; + pLbField = pLbField2; + i=1; + nQE=i+nOffset; + } + if ( &rEd == pEdVal3 ) + { + pLbCond = pLbCond3; + pLbField = pLbField3; + i=2; + nQE=i+nOffset; + } + if ( &rEd == pEdVal4 ) + { + pLbCond = pLbCond4; + pLbField = pLbField4; + i=3; + nQE=i+nOffset; + } + + if ( aStrEmpty.equals(aStrVal) || aStrNotEmpty.equals(aStrVal) ) + { + pLbCond->SelectEntry(OUString('=')); + pLbCond->Disable(); + } + else + pLbCond->Enable(); + + if (maHasDates.size() < nQE + 1) + maHasDates.resize(nQE + 1, false); + if (maRefreshExceptQuery.size() < nQE + 1) + maRefreshExceptQuery.resize(nQE + 1, false); + + ScQueryEntry& rEntry = theQueryData.GetEntry( nQE ); + ScQueryEntry::Item& rItem = rEntry.GetQueryItem(); + bool bDoThis = (pLbField->GetSelectEntryPos() != 0); + rEntry.bDoQuery = bDoThis; + + if ( rEntry.bDoQuery || maRefreshExceptQuery[nQE] ) + { + bool bByEmptyOrNotByEmpty = false; + if ( aStrEmpty.equals(aStrVal) ) { - pLbCond = pLbCond3; - pLbField = pLbField3; - i=2; - nQE=i+nOffset; + bByEmptyOrNotByEmpty = true; + rEntry.SetQueryByEmpty(); } - if ( pEd == pEdVal4 ) + else if ( aStrNotEmpty.equals(aStrVal) ) { - pLbCond = pLbCond4; - pLbField = pLbField4; - i=3; - nQE=i+nOffset; - } - - if ( aStrEmpty.equals(aStrVal) || aStrNotEmpty.equals(aStrVal) ) - { - pLbCond->SelectEntry(OUString('=')); - pLbCond->Disable(); + bByEmptyOrNotByEmpty = true; + rEntry.SetQueryByNonEmpty(); } else - pLbCond->Enable(); - - if (maHasDates.size() < nQE + 1) - maHasDates.resize(nQE + 1, false); - if (maRefreshExceptQuery.size() < nQE + 1) - maRefreshExceptQuery.resize(nQE + 1, false); - - ScQueryEntry& rEntry = theQueryData.GetEntry( nQE ); - ScQueryEntry::Item& rItem = rEntry.GetQueryItem(); - bool bDoThis = (pLbField->GetSelectEntryPos() != 0); - rEntry.bDoQuery = bDoThis; - - if ( rEntry.bDoQuery || maRefreshExceptQuery[nQE] ) { - bool bByEmptyOrNotByEmpty = false; - if ( aStrEmpty.equals(aStrVal) ) - { - bByEmptyOrNotByEmpty = true; - rEntry.SetQueryByEmpty(); - } - else if ( aStrNotEmpty.equals(aStrVal) ) - { - bByEmptyOrNotByEmpty = true; - rEntry.SetQueryByNonEmpty(); - } - else - { - rItem.maString = pDoc->GetSharedStringPool().intern(aStrVal); - rItem.mfVal = 0.0; + rItem.maString = pDoc->GetSharedStringPool().intern(aStrVal); + rItem.mfVal = 0.0; - sal_uInt32 nIndex = 0; - bool bNumber = pDoc->GetFormatTable()->IsNumberFormat( - rItem.maString.getString(), nIndex, rItem.mfVal); - rItem.meType = bNumber ? ScQueryEntry::ByValue : ScQueryEntry::ByString; - } + sal_uInt32 nIndex = 0; + bool bNumber = pDoc->GetFormatTable()->IsNumberFormat( + rItem.maString.getString(), nIndex, rItem.mfVal); + rItem.meType = bNumber ? ScQueryEntry::ByValue : ScQueryEntry::ByString; + } - const sal_Int32 nField = pLbField->GetSelectEntryPos(); - rEntry.nField = nField ? (theQueryData.nCol1 + - static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0); + const sal_Int32 nField = pLbField->GetSelectEntryPos(); + rEntry.nField = nField ? (theQueryData.nCol1 + + static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0); - ScQueryOp eOp = (ScQueryOp)pLbCond->GetSelectEntryPos(); - rEntry.eOp = eOp; - if (maHasDates[nQE] && !bByEmptyOrNotByEmpty) - rItem.meType = ScQueryEntry::ByDate; - } + ScQueryOp eOp = (ScQueryOp)pLbCond->GetSelectEntryPos(); + rEntry.eOp = eOp; + if (maHasDates[nQE] && !bByEmptyOrNotByEmpty) + rItem.meType = ScQueryEntry::ByDate; } - return 0; } IMPL_LINK_NOARG_TYPED(ScFilterDlg, ScrollHdl, ScrollBar*, void) diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index 847b5b737b0f..8d3b82a0aa48 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -174,7 +174,7 @@ void ScFilterOptionsMgr::Init() pBtnCopyResult->Check(); pEdCopyArea->SetText( aString ); - EdAreaModifyHdl( pEdCopyArea ); + EdAreaModifyHdl( *pEdCopyArea ); pLbCopyArea->Enable(); pEdCopyArea->Enable(); pRbCopyArea->Enable(); @@ -223,11 +223,11 @@ IMPL_LINK_TYPED( ScFilterOptionsMgr, LbAreaSelHdl, ListBox&, rLb, void ) } } -IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, pEd ) +IMPL_LINK_TYPED( ScFilterOptionsMgr, EdAreaModifyHdl, Edit&, rEd, void ) { - if ( pEd == pEdCopyArea ) + if ( &rEd == pEdCopyArea ) { - OUString theCurPosStr = pEd->GetText(); + OUString theCurPosStr = rEd.GetText(); sal_uInt16 nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); if ( SCA_VALID == (nResult & SCA_VALID) ) @@ -240,15 +240,13 @@ IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, pEd ) if (theCurPosStr == *pStr) { pLbCopyArea->SelectEntryPos( i ); - return 0; + return; } } } pLbCopyArea->SelectEntryPos( 0 ); } - - return 0; } IMPL_LINK_TYPED( ScFilterOptionsMgr, BtnCopyResultHdl, CheckBox&, rBox, void ) diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index 1b3a155a0752..ba3e1ccbb392 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -539,29 +539,24 @@ IMPL_LINK_TYPED( ScPivotFilterDlg, CheckBoxHdl, Button*, pBox, void ) } } -IMPL_LINK( ScPivotFilterDlg, ValModifyHdl, ComboBox*, pEd ) +IMPL_LINK_TYPED( ScPivotFilterDlg, ValModifyHdl, Edit&, rEd, void ) { - if ( pEd ) - { - OUString aStrVal = pEd->GetText(); - ListBox* pLb = m_pLbCond1; + OUString aStrVal = rEd.GetText(); + ListBox* pLb = m_pLbCond1; - if ( pEd == m_pEdVal2 ) pLb = m_pLbCond2; - else if ( pEd == m_pEdVal3 ) pLb = m_pLbCond3; + if ( &rEd == m_pEdVal2 ) pLb = m_pLbCond2; + else if ( &rEd == m_pEdVal3 ) pLb = m_pLbCond3; - // if ond of the special values "empty"/"non-empty" was chosen only the - // =-operand makes sense: + // if ond of the special values "empty"/"non-empty" was chosen only the + // =-operand makes sense: - if ( aStrEmpty.equals(aStrVal) || aStrNotEmpty.equals(aStrVal) ) - { - pLb->SelectEntry(OUString('=')); - pLb->Disable(); - } - else - pLb->Enable(); + if ( aStrEmpty.equals(aStrVal) || aStrNotEmpty.equals(aStrVal) ) + { + pLb->SelectEntry(OUString('=')); + pLb->Disable(); } - - return 0; + else + pLb->Enable(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index cc2635c42cc8..101e6a6e5c43 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -370,7 +370,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, const OUString& aDatNa lcl_FillCombo( *pCbTextSep, aTextSepList, mcTextSep ); pCbTextSep->SetText( sTextSeparators ); - Link<> aSeparatorHdl = LINK( this, ScImportAsciiDlg, SeparatorHdl ); + Link<Edit&,void> aSeparatorHdl = LINK( this, ScImportAsciiDlg, SeparatorEditHdl ); Link<Button*,void> aSeparatorClickHdl =LINK( this, ScImportAsciiDlg, SeparatorClickHdl ); pCbTextSep->SetSelectHdl( LINK( this, ScImportAsciiDlg, SeparatorComboBoxHdl ) ); pCbTextSep->SetModifyHdl( aSeparatorHdl ); @@ -684,7 +684,11 @@ IMPL_LINK_TYPED( ScImportAsciiDlg, SeparatorComboBoxHdl, ComboBox&, rCtrl, void { SeparatorHdl(&rCtrl); } -IMPL_LINK( ScImportAsciiDlg, SeparatorHdl, Control*, pCtrl ) +IMPL_LINK_TYPED( ScImportAsciiDlg, SeparatorEditHdl, Edit&, rEdit, void ) +{ + SeparatorHdl(&rEdit); +} +void ScImportAsciiDlg::SeparatorHdl( Control* pCtrl ) { OSL_ENSURE( pCtrl, "ScImportAsciiDlg::SeparatorHdl - missing sender" ); OSL_ENSURE( !pRbFixed->IsChecked(), "ScImportAsciiDlg::SeparatorHdl - not allowed in fixed width" ); @@ -706,7 +710,6 @@ IMPL_LINK( ScImportAsciiDlg, SeparatorHdl, Control*, pCtrl ) UpdateVertical(); mpTableBox->Execute( CSVCMD_NEWCELLTEXTS ); - return 0; } IMPL_LINK_TYPED( ScImportAsciiDlg, CharSetHdl, ListBox&, rListBox, void ) @@ -726,11 +729,10 @@ IMPL_LINK_TYPED( ScImportAsciiDlg, CharSetHdl, ListBox&, rListBox, void ) } } -IMPL_LINK( ScImportAsciiDlg, FirstRowHdl, NumericField*, pNumField ) +IMPL_LINK_TYPED( ScImportAsciiDlg, FirstRowHdl, Edit&, rEdit, void ) { - OSL_ENSURE( pNumField, "ScImportAsciiDlg::FirstRowHdl - missing sender" ); - mpTableBox->Execute( CSVCMD_SETFIRSTIMPORTLINE, sal::static_int_cast<sal_Int32>( pNumField->GetValue() - 1 ) ); - return 0; + NumericField& rNumField = static_cast<NumericField&>(rEdit); + mpTableBox->Execute( CSVCMD_SETFIRSTIMPORTLINE, sal::static_int_cast<sal_Int32>( rNumField.GetValue() - 1 ) ); } IMPL_LINK_TYPED( ScImportAsciiDlg, LbColTypeHdl, ListBox&, rListBox, void ) diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 560391eb5fa8..45909ce90ecd 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -252,12 +252,12 @@ void ScSpecialFilterDlg::SetActive() if ( pRefInputEdit == pEdCopyArea ) { pEdCopyArea->GrabFocus(); - ((Link<>&)pEdCopyArea->GetModifyHdl()).Call( pEdCopyArea ); + pEdCopyArea->GetModifyHdl().Call( *pEdCopyArea ); } else if ( pRefInputEdit == pEdFilterArea ) { pEdFilterArea->GrabFocus(); - FilterAreaModHdl( pEdFilterArea ); + FilterAreaModHdl( *pEdFilterArea ); } } else @@ -438,13 +438,13 @@ IMPL_LINK_TYPED( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox&, rLb, void ) } } -IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) +IMPL_LINK_TYPED( ScSpecialFilterDlg, FilterAreaModHdl, Edit&, rEd, void ) { - if ( pEd == pEdFilterArea ) + if ( &rEd == pEdFilterArea ) { if ( pDoc && pViewData ) { - OUString theCurAreaStr = pEd->GetText(); + OUString theCurAreaStr = rEd.GetText(); sal_uInt16 nResult = ScRange().Parse( theCurAreaStr, pDoc ); if ( SCA_VALID == (nResult & SCA_VALID) ) @@ -457,7 +457,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) if (theCurAreaStr == *pStr) { pLbFilterArea->SelectEntryPos( i ); - return 0; + return; } } pLbFilterArea->SelectEntryPos( 0 ); @@ -466,8 +466,6 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) else pLbFilterArea->SelectEntryPos( 0 ); } - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx index 779211428774..da95ea9bcac4 100644 --- a/sc/source/ui/inc/PivotLayoutDialog.hxx +++ b/sc/source/ui/inc/PivotLayoutDialog.hxx @@ -95,7 +95,7 @@ private: DECL_LINK_TYPED(ToggleSource, RadioButton&, void); DECL_LINK_TYPED(ToggleDestination, RadioButton&, void); DECL_LINK_TYPED(SourceListSelected, ListBox&, void); - DECL_LINK(SourceEditModified, void*); + DECL_LINK_TYPED(SourceEditModified, Edit&, void); void ToggleSource(); void ToggleDestination(); virtual bool Close() override; diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx index 9aed84462d8d..4dd9c4b10b2a 100644 --- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx +++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx @@ -76,9 +76,9 @@ private: DECL_LINK_TYPED( GetFocusHandler, Control&, void ); DECL_LINK_TYPED( LoseFocusHandler, Control&, void ); - DECL_LINK( InputRangeModified, void* ); - DECL_LINK( Parameter1ValueModified, void* ); - DECL_LINK( Parameter2ValueModified, void* ); + DECL_LINK_TYPED( InputRangeModified, Edit&, void ); + DECL_LINK_TYPED( Parameter1ValueModified, Edit&, void ); + DECL_LINK_TYPED( Parameter2ValueModified, Edit&, void ); DECL_LINK_TYPED( DistributionChanged, ListBox&, void ); DECL_LINK_TYPED( CheckChanged, CheckBox&, void ); diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx index f61c4a6975cb..ea1d698f28e3 100644 --- a/sc/source/ui/inc/SamplingDialog.hxx +++ b/sc/source/ui/inc/SamplingDialog.hxx @@ -75,9 +75,9 @@ private: DECL_LINK_TYPED( OkClicked, Button*, void ); DECL_LINK_TYPED( GetFocusHandler, Control&, void ); DECL_LINK_TYPED( LoseFocusHandler, Control&, void ); - DECL_LINK( SamplingSizeValueModified, void* ); + DECL_LINK_TYPED( SamplingSizeValueModified, Edit&, void ); DECL_LINK_TYPED( ToggleSamplingMethod, RadioButton&, void ); - DECL_LINK( RefInputModifyHandler, void* ); + DECL_LINK_TYPED( RefInputModifyHandler, Edit&, void ); void ToggleSamplingMethod(); }; diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx index 856f5d160574..874358abcb1e 100644 --- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx +++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx @@ -83,7 +83,7 @@ private: DECL_LINK_TYPED( OkClicked, Button*, void ); DECL_LINK_TYPED( GetFocusHandler, Control&, void ); DECL_LINK_TYPED( LoseFocusHandler, Control&, void ); - DECL_LINK( RefInputModifyHandler, void* ); + DECL_LINK_TYPED( RefInputModifyHandler, Edit&, void ); }; #endif diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx index fec0cbc7dfb5..41c0df053447 100644 --- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx +++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx @@ -86,7 +86,7 @@ private: DECL_LINK_TYPED( OkClicked, Button*, void ); DECL_LINK_TYPED( GetFocusHandler, Control&, void ); DECL_LINK_TYPED( LoseFocusHandler, Control&, void ); - DECL_LINK( RefInputModifyHandler, void* ); + DECL_LINK_TYPED( RefInputModifyHandler, Edit&, void ); }; #endif diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx index e7eb5aaf6118..64f9ce094cbf 100644 --- a/sc/source/ui/inc/areasdlg.hxx +++ b/sc/source/ui/inc/areasdlg.hxx @@ -74,7 +74,7 @@ private: // Handler: DECL_LINK_TYPED( Impl_SelectHdl, ListBox&, void ); - DECL_LINK( Impl_ModifyHdl, formula::RefEdit* ); + DECL_LINK_TYPED( Impl_ModifyHdl, Edit&, void ); DECL_LINK_TYPED( Impl_BtnHdl, Button*, void ); DECL_LINK_TYPED( Impl_GetFocusHdl, Control&, void ); }; diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index cc93b4d1a36b..fdfc94a8aeec 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -331,7 +331,7 @@ private: DECL_LINK_TYPED( ButtonHdl, Button*, void ); DECL_LINK_TYPED( TriStateHdl, Button*, void ); DECL_LINK_TYPED( CheckHdl, SvTreeListBox*, void ); - DECL_LINK( EdModifyHdl, void* ); + DECL_LINK_TYPED( EdModifyHdl, Edit&, void ); private: VclPtr<Edit> maEdSearch; diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index be0eaadd0f86..6d9f3aec8c20 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -119,7 +119,7 @@ private: OUString msBaseTitle; void updateTitle(); - DECL_LINK( EdRangeModifyHdl, Edit* ); + DECL_LINK_TYPED( EdRangeModifyHdl, Edit&, void ); protected: virtual void RefInputDone( bool bForced = false ) override; diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx index a5e672b977bb..876faa617d47 100644 --- a/sc/source/ui/inc/condformatdlgentry.hxx +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -102,7 +102,7 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener void Init(ScCondFormatDlg* pDialogParent); DECL_LINK_TYPED( StyleSelectHdl, ListBox&, void ); DECL_LINK_TYPED( ConditionTypeSelectHdl, ListBox&, void ); - DECL_LINK( OnEdChanged, Edit* ); + DECL_LINK_TYPED( OnEdChanged, Edit&, void ); // Searches the lookup table for the entry position, given condition mode static sal_Int32 ConditionModeToEntryPos( ScConditionMode eMode ); diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx index afbc2765a161..52cb7179bcbf 100644 --- a/sc/source/ui/inc/consdlg.hxx +++ b/sc/source/ui/inc/consdlg.hxx @@ -94,7 +94,7 @@ private: DECL_LINK_TYPED( OkHdl, Button*, void ); DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( GetFocusHdl, Control&, void ); - DECL_LINK( ModifyHdl, formula::RefEdit* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); static ScSubTotalFunc LbPosToFunc( sal_Int32 nPos ); diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx index f4ab74404253..a7734c027a69 100644 --- a/sc/source/ui/inc/crnrdlg.hxx +++ b/sc/source/ui/inc/crnrdlg.hxx @@ -82,10 +82,10 @@ private: DECL_LINK_TYPED( AddBtnHdl, Button*, void ); DECL_LINK_TYPED( RemoveBtnHdl, Button*, void ); DECL_LINK_TYPED( Range1SelectHdl, ListBox&, void ); - DECL_LINK( Range1DataModifyHdl, void * ); + DECL_LINK_TYPED( Range1DataModifyHdl, Edit&, void ); DECL_LINK_TYPED( ColClickHdl, Button*, void ); DECL_LINK_TYPED( RowClickHdl, Button*, void ); - DECL_LINK( Range2DataModifyHdl, void * ); + DECL_LINK_TYPED( Range2DataModifyHdl, Edit&, void ); DECL_LINK_TYPED( GetFocusHdl, Control&, void ); DECL_LINK_TYPED( LoseFocusHdl, Control&, void ); }; diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx index 8de53cd4ff99..ca69b539a47b 100644 --- a/sc/source/ui/inc/datafdlg.hxx +++ b/sc/source/ui/inc/datafdlg.hxx @@ -72,7 +72,7 @@ private: DECL_LINK_TYPED(Impl_CloseHdl, Button*, void); DECL_LINK_TYPED(Impl_ScrollHdl, ScrollBar*, void); - DECL_LINK( Impl_DataModifyHdl, Edit* ); + DECL_LINK_TYPED(Impl_DataModifyHdl, Edit&, void); }; #endif // INCLUDED_SC_SOURCE_UI_INC_DATAFDLG_HXX diff --git a/sc/source/ui/inc/datastreamdlg.hxx b/sc/source/ui/inc/datastreamdlg.hxx index 1dc37b0ee05e..6ea9c14436e2 100644 --- a/sc/source/ui/inc/datastreamdlg.hxx +++ b/sc/source/ui/inc/datastreamdlg.hxx @@ -48,7 +48,7 @@ class DataStreamDlg : public ModalDialog VclPtr<VclFrame> m_pVclFrameMove; DECL_LINK_TYPED(UpdateClickHdl, Button*, void); - DECL_LINK(UpdateHdl, void*); + DECL_LINK_TYPED(UpdateHdl, Edit&, void); DECL_LINK_TYPED(UpdateComboBoxHdl, ComboBox&, void); DECL_LINK_TYPED(BrowseHdl, Button*, void); diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx index 96756c891717..0a053c112942 100644 --- a/sc/source/ui/inc/dbnamdlg.hxx +++ b/sc/source/ui/inc/dbnamdlg.hxx @@ -95,8 +95,8 @@ private: DECL_LINK_TYPED( OkBtnHdl, Button*, void ); DECL_LINK_TYPED( AddBtnHdl, Button*, void ); DECL_LINK_TYPED( RemoveBtnHdl, Button*, void ); - DECL_LINK( NameModifyHdl, void * ); - DECL_LINK( AssModifyHdl, void * ); + DECL_LINK_TYPED( NameModifyHdl, Edit&, void ); + DECL_LINK_TYPED( AssModifyHdl, Edit&, void ); }; #endif // INCLUDED_SC_SOURCE_UI_INC_DBNAMDLG_HXX diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx index 0f0c0bcd560b..a2e40146c105 100644 --- a/sc/source/ui/inc/filtdlg.hxx +++ b/sc/source/ui/inc/filtdlg.hxx @@ -146,7 +146,7 @@ private: // Handler: DECL_LINK_TYPED( LbSelectHdl, ListBox&, void ); - DECL_LINK( ValModifyHdl, ComboBox* ); + DECL_LINK_TYPED( ValModifyHdl, Edit&, void ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); DECL_LINK_TYPED( EndDlgHdl, Button*, void ); DECL_LINK_TYPED( ScrollHdl, ScrollBar*, void ); @@ -214,7 +214,7 @@ private: // Handler DECL_LINK_TYPED( FilterAreaSelHdl, ListBox&, void ); - DECL_LINK( FilterAreaModHdl, formula::RefEdit* ); + DECL_LINK_TYPED( FilterAreaModHdl, Edit&, void ); DECL_LINK_TYPED( EndDlgHdl, Button*, void ); // Hack: RefInput control diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx index 4016a5b3df4a..4b6a3cac0e32 100644 --- a/sc/source/ui/inc/foptmgr.hxx +++ b/sc/source/ui/inc/foptmgr.hxx @@ -77,7 +77,7 @@ private: void Init(); // Handler: - DECL_LINK( EdAreaModifyHdl, Edit* ); + DECL_LINK_TYPED( EdAreaModifyHdl, Edit&, void ); DECL_LINK_TYPED( LbAreaSelHdl, ListBox&, void ); DECL_LINK_TYPED( BtnCopyResultHdl, CheckBox&, void ); }; diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx index b797819a1b50..07a96810085e 100644 --- a/sc/source/ui/inc/instbdlg.hxx +++ b/sc/source/ui/inc/instbdlg.hxx @@ -91,12 +91,12 @@ private: void FillTables_Impl( ScDocument* pSrcDoc ); void DoEnable_Impl(); - DECL_LINK_TYPED(BrowseHdl_Impl, Button*, void); - DECL_LINK_TYPED(ChoiceHdl_Impl, Button*, void); - DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); - DECL_LINK(CountHdl_Impl, void *); - DECL_LINK_TYPED(DoEnterHdl, Button*, void); - DECL_LINK_TYPED(BrowseTimeoutHdl, Timer *, void); + DECL_LINK_TYPED( BrowseHdl_Impl, Button*, void ); + DECL_LINK_TYPED( ChoiceHdl_Impl, Button*, void ); + DECL_LINK_TYPED( SelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( CountHdl_Impl, Edit&, void ); + DECL_LINK_TYPED( DoEnterHdl, Button*, void ); + DECL_LINK_TYPED( BrowseTimeoutHdl, Timer *, void ); DECL_LINK_TYPED( DialogClosedHdl, sfx2::FileDialogHelper*, void ); }; diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx index 686ba94351e6..177024db1df2 100644 --- a/sc/source/ui/inc/mtrindlg.hxx +++ b/sc/source/ui/inc/mtrindlg.hxx @@ -50,7 +50,7 @@ private: long nCurrentValue; DECL_LINK_TYPED(SetDefValHdl, Button*, void); - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); }; #endif // INCLUDED_SC_SOURCE_UI_INC_MTRINDLG_HXX diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx index 73b172177a3a..d6fb4fd0f5a2 100644 --- a/sc/source/ui/inc/mvtabdlg.hxx +++ b/sc/source/ui/inc/mvtabdlg.hxx @@ -78,7 +78,7 @@ private: DECL_LINK_TYPED( OkHdl, Button*, void ); DECL_LINK_TYPED( SelHdl, ListBox&, void ); DECL_LINK_TYPED( CheckBtnHdl, RadioButton&, void ); - DECL_LINK( CheckNameHdl, Edit * ); + DECL_LINK_TYPED( CheckNameHdl, Edit&, void ); }; #endif // INCLUDED_SC_SOURCE_UI_INC_MVTABDLG_HXX diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx index d50b9ad7cd2f..91382fbe82ff 100644 --- a/sc/source/ui/inc/namedefdlg.hxx +++ b/sc/source/ui/inc/namedefdlg.hxx @@ -66,7 +66,7 @@ private: DECL_LINK_TYPED( CancelBtnHdl, Button*, void ); DECL_LINK_TYPED( AddBtnHdl, Button*, void ); - DECL_LINK( NameModifyHdl, void* ); + DECL_LINK_TYPED( NameModifyHdl, Edit&, void ); DECL_LINK_TYPED( AssignGetFocusHdl, Control&, void ); protected: diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx index e95aaea9e80e..06fc81606c55 100644 --- a/sc/source/ui/inc/namedlg.hxx +++ b/sc/source/ui/inc/namedlg.hxx @@ -104,7 +104,7 @@ private: DECL_LINK_TYPED( CancelBtnHdl, Button*, void ); DECL_LINK_TYPED( AddBtnHdl, Button*, void ); DECL_LINK_TYPED( RemoveBtnHdl, Button*, void ); - DECL_LINK( EdModifyHdl, void * ); + DECL_LINK_TYPED( EdModifyHdl, Edit&, void ); DECL_LINK_TYPED( EdModifyCheckBoxHdl, CheckBox&, void ); DECL_LINK_TYPED( AssignGetFocusHdl, Control&, void ); DECL_LINK_TYPED( SelectionChangedHdl_Impl, SvTreeListBox*, void ); diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx index 81ec6c60cbf3..c96511cf7660 100644 --- a/sc/source/ui/inc/optsolver.hxx +++ b/sc/source/ui/inc/optsolver.hxx @@ -196,8 +196,8 @@ private: DECL_LINK_TYPED( ScrollHdl, ScrollBar*, void); DECL_LINK_TYPED( CursorUpHdl, ScCursorRefEdit&, void ); DECL_LINK_TYPED( CursorDownHdl, ScCursorRefEdit&, void ); - DECL_LINK( CondModifyHdl, void* ); - DECL_LINK( TargetModifyHdl, void* ); + DECL_LINK_TYPED( CondModifyHdl, Edit&, void ); + DECL_LINK_TYPED( TargetModifyHdl, Edit&, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); }; diff --git a/sc/source/ui/inc/pfiltdlg.hxx b/sc/source/ui/inc/pfiltdlg.hxx index 61c3969fb25c..3165e8e484be 100644 --- a/sc/source/ui/inc/pfiltdlg.hxx +++ b/sc/source/ui/inc/pfiltdlg.hxx @@ -91,7 +91,7 @@ private: // Handler: DECL_LINK_TYPED( LbSelectHdl, ListBox&, void ); - DECL_LINK( ValModifyHdl, ComboBox* ); + DECL_LINK_TYPED( ValModifyHdl, Edit&, void ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); }; diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx index d2f671317d6c..69e8f842eacf 100644 --- a/sc/source/ui/inc/protectiondlg.hxx +++ b/sc/source/ui/inc/protectiondlg.hxx @@ -66,7 +66,7 @@ private: DECL_LINK_TYPED( OKHdl, Button*, void ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); - DECL_LINK( PasswordModifyHdl, void* ); + DECL_LINK_TYPED( PasswordModifyHdl, Edit&, void ); }; #endif diff --git a/sc/source/ui/inc/retypepassdlg.hxx b/sc/source/ui/inc/retypepassdlg.hxx index 729658e54737..03b1882648ff 100644 --- a/sc/source/ui/inc/retypepassdlg.hxx +++ b/sc/source/ui/inc/retypepassdlg.hxx @@ -134,7 +134,7 @@ private: DECL_LINK_TYPED( OKHdl, Button*, void ); DECL_LINK_TYPED( RadioBtnHdl, Button*, void ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); - DECL_LINK( PasswordModifyHdl, void* ); + DECL_LINK_TYPED( PasswordModifyHdl, Edit&, void ); ScPassHashProtectable* mpProtected; }; diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx index 802cc68fff8d..8eada1ac8aee 100644 --- a/sc/source/ui/inc/scuiasciiopt.hxx +++ b/sc/source/ui/inc/scuiasciiopt.hxx @@ -101,11 +101,12 @@ private: inline bool Seek( sal_uLong nPos ); // synced to and from mnStreamPos DECL_LINK_TYPED( CharSetHdl, ListBox&, void ); - DECL_LINK( FirstRowHdl, NumericField* ); + DECL_LINK_TYPED( FirstRowHdl, Edit&, void ); DECL_LINK_TYPED( RbSepFixHdl, Button*, void ); - DECL_LINK( SeparatorHdl, Control* ); + DECL_LINK_TYPED( SeparatorEditHdl, Edit&, void ); DECL_LINK_TYPED( SeparatorClickHdl, Button*, void ); DECL_LINK_TYPED( SeparatorComboBoxHdl, ComboBox&, void ); + void SeparatorHdl(Control*); DECL_LINK_TYPED( LbColTypeHdl, ListBox&, void ); DECL_LINK_TYPED( UpdateTextHdl, ScCsvTableBox&, void ); DECL_LINK_TYPED( ColTypeHdl, ScCsvTableBox&, void ); diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx index 4e7b8ab0e39c..335b1b0b05d8 100644 --- a/sc/source/ui/inc/tpdefaults.hxx +++ b/sc/source/ui/inc/tpdefaults.hxx @@ -35,8 +35,8 @@ private: void CheckPrefix(Edit* pEdit); void OnFocusPrefixInput(Edit* pEdit); - DECL_LINK(NumModifiedHdl, void *); - DECL_LINK( PrefixModifiedHdl, Edit* ); + DECL_LINK_TYPED( NumModifiedHdl, Edit&, void ); + DECL_LINK_TYPED( PrefixModifiedHdl, Edit&, void ); DECL_LINK_TYPED( PrefixEditOnFocusHdl, Control&, void ); private: diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx index 0334ebf51e7c..098a1589fbf2 100644 --- a/sc/source/ui/inc/tpformula.hxx +++ b/sc/source/ui/inc/tpformula.hxx @@ -53,7 +53,7 @@ private: bool IsValidSeparatorSet() const; DECL_LINK_TYPED( ButtonHdl, Button*, void ); - DECL_LINK( SepModifyHdl, Edit* ); + DECL_LINK_TYPED( SepModifyHdl, Edit&, void ); DECL_LINK_TYPED( SepEditOnFocusHdl, Control&, void ); private: diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx index 4f10fd409ea0..3e4a1b8d3c30 100644 --- a/sc/source/ui/inc/tpusrlst.hxx +++ b/sc/source/ui/inc/tpusrlst.hxx @@ -97,7 +97,7 @@ private: // Handler: DECL_LINK_TYPED( LbSelectHdl, ListBox&, void ); DECL_LINK_TYPED( BtnClickHdl, Button*, void ); - DECL_LINK( EdEntriesModHdl, VclMultiLineEdit* ); + DECL_LINK_TYPED( EdEntriesModHdl, Edit&, void); }; #endif // INCLUDED_SC_SOURCE_UI_INC_TPUSRLST_HXX diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx index 4555d02b3680..ab8b859c3e4e 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hxx +++ b/sc/source/ui/inc/xmlsourcedlg.hxx @@ -97,7 +97,7 @@ private: DECL_LINK_TYPED(GetFocusHdl, Control&, void); DECL_LINK_TYPED(BtnPressedHdl, Button*, void); DECL_LINK_TYPED(TreeItemSelectHdl, SvTreeListBox*, void); - DECL_LINK(RefModifiedHdl, void*); + DECL_LINK_TYPED(RefModifiedHdl, Edit&, void); }; #endif diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index 169e4bf05acf..9fde83cf8d42 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -338,9 +338,9 @@ void ScColRowNameRangesDlg::SetActive() GrabFocus(); if( pEdActive == pEdAssign ) - Range1DataModifyHdl( 0 ); + Range1DataModifyHdl( *pEdAssign ); else if( pEdActive == pEdAssign2 ) - Range2DataModifyHdl( 0 ); + Range2DataModifyHdl( *pEdAssign2 ); RefInputDone(); } @@ -705,7 +705,7 @@ IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, Range1SelectHdl, ListBox&, void) } // handler called when the label range has changed -IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1DataModifyHdl) +IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, Range1DataModifyHdl, Edit&, void) { OUString aNewArea( pEdAssign->GetText() ); bool bValid = false; @@ -735,11 +735,10 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1DataModifyHdl) pRbAssign2->Disable(); } pBtnRemove->Disable(); - return 0; } // handler called when the data range has changed -IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range2DataModifyHdl) +IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, Range2DataModifyHdl, Edit&, void) { OUString aNewData( pEdAssign2->GetText() ); if ( !aNewData.isEmpty() ) @@ -757,7 +756,6 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range2DataModifyHdl) { pBtnAdd->Disable(); } - return 0; } // handler for the radio button for columns, adjust ranges diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 8c095bcfa434..32c6dd94504e 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -251,11 +251,10 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) m_pSlider->SetThumbPos(nCurrentRow-nStartRow-1); } -IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED( ScDataFormDlg, Impl_DataModifyHdl, Edit&, rEdit, void) { - if ( pEdit->IsModified() ) + if ( rEdit.IsModified() ) m_pBtnRestore->Enable( true ); - return 0; } IMPL_LINK_NOARG_TYPED(ScDataFormDlg, Impl_NewHdl, Button*, void) diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx index c453f941cc7b..5aa18913cd82 100644 --- a/sc/source/ui/miscdlgs/datastreamdlg.cxx +++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx @@ -97,10 +97,9 @@ IMPL_LINK_NOARG_TYPED(DataStreamDlg, UpdateComboBoxHdl, ComboBox&, void) { UpdateEnable(); } -IMPL_LINK_NOARG(DataStreamDlg, UpdateHdl) +IMPL_LINK_NOARG_TYPED(DataStreamDlg, UpdateHdl, Edit&, void) { UpdateEnable(); - return 0; } void DataStreamDlg::UpdateEnable() diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 683ccd3d9dbb..410b27a8a538 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -246,7 +246,7 @@ const OUString* ScInsertTableDlg::GetNextTable( sal_uInt16* pN ) // Handler: -IMPL_LINK_NOARG(ScInsertTableDlg, CountHdl_Impl) +IMPL_LINK_NOARG_TYPED(ScInsertTableDlg, CountHdl_Impl, Edit&, void) { nTableCount = static_cast<SCTAB>(m_pNfCount->GetValue()); if ( nTableCount==1) @@ -265,7 +265,6 @@ IMPL_LINK_NOARG(ScInsertTableDlg, CountHdl_Impl) } DoEnable_Impl(); - return 0; } IMPL_LINK_NOARG_TYPED(ScInsertTableDlg, ChoiceHdl_Impl, Button*, void) diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx index 92c39f599d66..cedfcbe1e487 100644 --- a/sc/source/ui/miscdlgs/mtrindlg.cxx +++ b/sc/source/ui/miscdlgs/mtrindlg.cxx @@ -107,10 +107,9 @@ IMPL_LINK_NOARG_TYPED(ScMetricInputDlg, SetDefValHdl, Button*, void) m_pEdValue->SetValue( nCurrentValue ); } -IMPL_LINK_NOARG(ScMetricInputDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(ScMetricInputDlg, ModifyHdl, Edit&, void) { m_pBtnDefVal->Check( nDefaultValue == m_pEdValue->GetValue() ); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index cc7f92ebe6f5..3e3ed9951daa 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -319,15 +319,13 @@ IMPL_LINK_TYPED( ScMoveTableDlg, SelHdl, ListBox&, rLb, void ) } } -IMPL_LINK( ScMoveTableDlg, CheckNameHdl, Edit *, pEdt ) +IMPL_LINK_TYPED( ScMoveTableDlg, CheckNameHdl, Edit&, rEdt, void ) { - if ( pEdt == pEdTabName ) + if ( &rEdt == pEdTabName ) { mbEverEdited = true; CheckNewTabName(); } - - 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 77fb82af60cc..01a7d5e3750c 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -410,7 +410,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos) Link<ScCursorRefEdit&,void> aCursorUp = LINK( this, ScOptSolverDlg, CursorUpHdl ); Link<ScCursorRefEdit&,void> aCursorDown = LINK( this, ScOptSolverDlg, CursorDownHdl ); - Link<> aCondModify = LINK( this, ScOptSolverDlg, CondModifyHdl ); + Link<Edit&,void> aCondModify = LINK( this, ScOptSolverDlg, CondModifyHdl ); for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow ) { mpLeftEdit[nRow]->SetCursorLinks( aCursorUp, aCursorDown ); @@ -699,21 +699,19 @@ IMPL_LINK_TYPED( ScOptSolverDlg, DelBtnHdl, Button*, pBtn, void ) } } -IMPL_LINK_NOARG(ScOptSolverDlg, TargetModifyHdl) +IMPL_LINK_NOARG_TYPED(ScOptSolverDlg, TargetModifyHdl, Edit&, void) { // modify handler for the target edit: // select "Value of" if something is input into the edit if ( !m_pEdTargetValue->GetText().isEmpty() ) m_pRbValue->Check(); - return 0; } -IMPL_LINK_NOARG(ScOptSolverDlg, CondModifyHdl) +IMPL_LINK_NOARG_TYPED(ScOptSolverDlg, CondModifyHdl, Edit&, void) { // modify handler for the condition edits, just to enable/disable "delete" buttons ReadConditions(); EnableButtons(); - return 0; } IMPL_LINK_NOARG_TYPED(ScOptSolverDlg, SelectHdl, ListBox&, void) diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx index eac9eac93291..bb0860deaaec 100644 --- a/sc/source/ui/miscdlgs/protectiondlg.cxx +++ b/sc/source/ui/miscdlgs/protectiondlg.cxx @@ -93,7 +93,7 @@ void ScTableProtectionDlg::Init() m_pBtnOk->SetClickHdl(LINK( this, ScTableProtectionDlg, OKHdl )); - Link<> aLink = LINK( this, ScTableProtectionDlg, PasswordModifyHdl ); + Link<Edit&,void> aLink = LINK( this, ScTableProtectionDlg, PasswordModifyHdl ); m_pPassword1Edit->SetModifyHdl(aLink); m_pPassword2Edit->SetModifyHdl(aLink); @@ -135,12 +135,11 @@ IMPL_LINK_NOARG_TYPED(ScTableProtectionDlg, OKHdl, Button*, void) EndDialog(RET_OK); } -IMPL_LINK_NOARG(ScTableProtectionDlg, PasswordModifyHdl) +IMPL_LINK_NOARG_TYPED(ScTableProtectionDlg, PasswordModifyHdl, Edit&, void) { OUString aPass1 = m_pPassword1Edit->GetText(); OUString aPass2 = m_pPassword2Edit->GetText(); m_pBtnOk->Enable(aPass1 == aPass2); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index 639f74744d80..1244b093c6a5 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -368,7 +368,7 @@ void ScRetypePassInputDlg::Init() m_pBtnRemovePassword->SetClickHdl(aLink); aLink = LINK( this, ScRetypePassInputDlg, CheckBoxHdl ); m_pBtnMatchOldPass->SetClickHdl(aLink); - Link<> aLink2 = LINK( this, ScRetypePassInputDlg, PasswordModifyHdl ); + Link<Edit&,void> aLink2 = LINK( this, ScRetypePassInputDlg, PasswordModifyHdl ); m_pPassword1Edit->SetModifyHdl(aLink2); m_pPassword2Edit->SetModifyHdl(aLink2); @@ -440,10 +440,9 @@ IMPL_LINK_NOARG_TYPED(ScRetypePassInputDlg, CheckBoxHdl, Button*, void) CheckPasswordInput(); } -IMPL_LINK_NOARG(ScRetypePassInputDlg, PasswordModifyHdl) +IMPL_LINK_NOARG_TYPED(ScRetypePassInputDlg, PasswordModifyHdl, Edit&, void) { CheckPasswordInput(); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index ac516d4a1390..fee5baaba4ba 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -337,10 +337,9 @@ IMPL_LINK_NOARG_TYPED(ScNameDefDlg, AddBtnHdl, Button*, void) AddPushed(); }; -IMPL_LINK_NOARG(ScNameDefDlg, NameModifyHdl) +IMPL_LINK_NOARG_TYPED(ScNameDefDlg, NameModifyHdl, Edit&, void) { IsNameValid(); - return 0; } IMPL_LINK_NOARG_TYPED(ScNameDefDlg, AssignGetFocusHdl, Control&, void) diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index 7e5fdd9c044b..3138ec047442 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -176,7 +176,7 @@ bool ScNameDlg::IsRefInputMode() const void ScNameDlg::RefInputDone( bool bForced) { ScAnyRefDlg::RefInputDone(bForced); - EdModifyHdl(m_pEdAssign); + EdModifyHdl(*m_pEdAssign); } void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) @@ -508,15 +508,14 @@ IMPL_LINK_NOARG_TYPED(ScNameDlg, EdModifyCheckBoxHdl, CheckBox&, void) NameModified(); } -IMPL_LINK_NOARG(ScNameDlg, EdModifyHdl) +IMPL_LINK_NOARG_TYPED(ScNameDlg, EdModifyHdl, Edit&, void) { NameModified(); - return 0; } IMPL_LINK_NOARG_TYPED(ScNameDlg, AssignGetFocusHdl, Control&, void) { - EdModifyHdl(m_pEdAssign); + EdModifyHdl(*m_pEdAssign); } IMPL_LINK_NOARG_TYPED(ScNameDlg, SelectionChangedHdl_Impl, SvTreeListBox*, void) diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index ee33e899dff9..fb213fcbaac9 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -238,10 +238,9 @@ IMPL_LINK_TYPED(ScCalcOptionsDialog, CBUseOpenCLHdl, Button*, pCheckBox, void) maConfig.mbOpenCLSubsetOnly = static_cast<CheckBox*>(pCheckBox)->IsChecked(); } -IMPL_LINK(ScCalcOptionsDialog, SpinOpenCLMinSizeHdl, NumericField*, pSpin) +IMPL_LINK_TYPED(ScCalcOptionsDialog, SpinOpenCLMinSizeHdl, Edit&, rEdit, void) { - maConfig.mnOpenCLMinimumFormulaGroupSize = pSpin->GetValue(); - return 0; + maConfig.mnOpenCLMinimumFormulaGroupSize = static_cast<NumericField&>(rEdit).GetValue(); } IMPL_LINK_NOARG_TYPED(ScCalcOptionsDialog, BtnAutomaticSelectHdl, RadioButton&, void) @@ -254,10 +253,9 @@ IMPL_LINK_NOARG_TYPED(ScCalcOptionsDialog, DeviceSelHdl, SvTreeListBox*, void) SelectedDeviceChanged(); } -IMPL_LINK(ScCalcOptionsDialog, EditModifiedHdl, Edit*, pCtrl) +IMPL_LINK_TYPED(ScCalcOptionsDialog, EditModifiedHdl, Edit&, rCtrl, void) { - maConfig.mpOpenCLSubsetOpCodes = ScStringToOpCodeSet(pCtrl->GetText()); - return 0; + maConfig.mpOpenCLSubsetOpCodes = ScStringToOpCodeSet(rCtrl.GetText()); } namespace { diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx index b06ab7adb55a..fe810fcef3c8 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.hxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx @@ -40,13 +40,13 @@ public: DECL_LINK_TYPED( BtnAutomaticSelectHdl, RadioButton&, void ); DECL_LINK_TYPED( DeviceSelHdl, SvTreeListBox*, void ); - DECL_LINK( EditModifiedHdl, Edit * ); + DECL_LINK_TYPED( EditModifiedHdl, Edit&, void ); DECL_STATIC_LINK_TYPED( ScCalcOptionsDialog, TestClickHdl, Button*, void ); DECL_LINK_TYPED( AsZeroModifiedHdl, Button*, void); DECL_LINK_TYPED( ConversionModifiedHdl, ListBox&, void); DECL_LINK_TYPED( SyntaxModifiedHdl, ListBox&, void); DECL_LINK_TYPED( CBUseOpenCLHdl, Button*, void); - DECL_LINK( SpinOpenCLMinSizeHdl, NumericField*); + DECL_LINK_TYPED( SpinOpenCLMinSizeHdl, Edit&, void); const ScCalcConfig& GetConfig() const { return maConfig;} diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx index ceb39672d224..078829c159b6 100644 --- a/sc/source/ui/optdlg/tpdefaults.cxx +++ b/sc/source/ui/optdlg/tpdefaults.cxx @@ -122,16 +122,14 @@ void ScTpDefaultsOptions::OnFocusPrefixInput(Edit* pEdit) maOldPrefixValue = pEdit->GetText(); } -IMPL_LINK_NOARG(ScTpDefaultsOptions, NumModifiedHdl) +IMPL_LINK_NOARG_TYPED(ScTpDefaultsOptions, NumModifiedHdl, Edit&, void) { CheckNumSheets(); - return 0; } -IMPL_LINK( ScTpDefaultsOptions, PrefixModifiedHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( ScTpDefaultsOptions, PrefixModifiedHdl, Edit&, rEdit, void ) { - CheckPrefix(pEdit); - return 0; + CheckPrefix(&rEdit); } IMPL_LINK_TYPED( ScTpDefaultsOptions, PrefixEditOnFocusHdl, Control&, rControl, void ) diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index c78e1afa8845..e4817d1d1ff7 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -64,7 +64,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r mpBtnCustomCalcCustom->SetClickHdl(aLink2); mpBtnCustomCalcDetails->SetClickHdl(aLink2); - Link<> aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl ); + Link<Edit&,void> aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl ); mpEdSepFuncArg->SetModifyHdl(aLink); mpEdSepArrayCol->SetModifyHdl(aLink); mpEdSepArrayRow->SetModifyHdl(aLink); @@ -207,26 +207,22 @@ IMPL_LINK_TYPED( ScTpFormulaOptions, ButtonHdl, Button*, pBtn, void ) LaunchCustomCalcSettings(); } -IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( ScTpFormulaOptions, SepModifyHdl, Edit&, rEdit, void ) { - if (!pEdit) - return 0; - - OUString aStr = pEdit->GetText(); + OUString aStr = rEdit.GetText(); if (aStr.getLength() > 1) { // In case the string is more than one character long, only grab the // first character. aStr = aStr.copy(0, 1); - pEdit->SetText(aStr); + rEdit.SetText(aStr); } if ((!IsValidSeparator(aStr) || !IsValidSeparatorSet()) && !maOldSepValue.isEmpty()) // Invalid separator. Restore the old value. - pEdit->SetText(maOldSepValue); + rEdit.SetText(maOldSepValue); - OnFocusSeparatorInput(pEdit); - return 0; + OnFocusSeparatorInput(&rEdit); } IMPL_LINK_TYPED( ScTpFormulaOptions, SepEditOnFocusHdl, Control&, rControl, void ) diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 864b871db90b..47db07a3a697 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -708,10 +708,10 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) } } -IMPL_LINK( ScTpUserLists, EdEntriesModHdl, VclMultiLineEdit*, pEd ) +IMPL_LINK_TYPED( ScTpUserLists, EdEntriesModHdl, Edit&, rEd, void ) { - if ( pEd != mpEdEntries ) - return 0; + if ( &rEd != mpEdEntries ) + return; if ( mpBtnCopy->IsEnabled() ) { @@ -753,8 +753,6 @@ IMPL_LINK( ScTpUserLists, EdEntriesModHdl, VclMultiLineEdit*, pEd ) mpBtnModify->Disable(); } } - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 5d9c573117f6..ec32d3fd4c33 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -209,7 +209,7 @@ void ScPrintAreasDlg::SetReference( const ScRange& rRef, ScDocument* /* pDoc */ lcl_GetRepeatRangeString(&rRef, pDoc, bRow, aStr); pRefInputEdit->SetRefString( aStr ); } - Impl_ModifyHdl( pRefInputEdit ); + Impl_ModifyHdl( *pRefInputEdit ); } } @@ -225,7 +225,7 @@ void ScPrintAreasDlg::AddRefEntry() sal_Int32 nLen = aVal.getLength(); pEdPrintArea->SetSelection( Selection( nLen, nLen ) ); - Impl_ModifyHdl( pEdPrintArea ); + Impl_ModifyHdl( *pEdPrintArea ); } } @@ -243,7 +243,7 @@ void ScPrintAreasDlg::SetActive() if ( pRefInputEdit ) { pRefInputEdit->GrabFocus(); - Impl_ModifyHdl( pRefInputEdit ); + Impl_ModifyHdl( *pRefInputEdit ); } } else @@ -305,9 +305,9 @@ void ScPrintAreasDlg::Impl_Reset() lcl_GetRepeatRangeString(pRepeatColRange, pDoc, false, aStrRange); pEdRepeatCol->SetText( aStrRange ); - Impl_ModifyHdl( pEdPrintArea ); - Impl_ModifyHdl( pEdRepeatRow ); - Impl_ModifyHdl( pEdRepeatCol ); + Impl_ModifyHdl( *pEdPrintArea ); + Impl_ModifyHdl( *pEdRepeatRow ); + Impl_ModifyHdl( *pEdRepeatCol ); if( pDoc->IsPrintEntireSheet( nCurTab ) ) pLbPrintArea->SelectEntryPos( SC_AREASDLG_PR_ENTIRE ); @@ -574,7 +574,7 @@ IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_SelectHdl, ListBox&, rLb, void ) pEd->SetText( *static_cast< OUString* >( pLb->GetEntryData( nSelPos ) ) ); } -IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd ) +IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_ModifyHdl, Edit&, rEd, void ) { ListBox* pLb = NULL; @@ -582,22 +582,22 @@ IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd ) sal_Int32 nUserDefPos = SC_AREASDLG_RR_USER; sal_Int32 nFirstCustomPos = SC_AREASDLG_RR_OFFSET; - if( pEd == pEdPrintArea ) + if( &rEd == pEdPrintArea ) { pLb = pLbPrintArea; nUserDefPos = SC_AREASDLG_PR_USER; nFirstCustomPos = SC_AREASDLG_PR_SELECT; // "Selection" and following } - else if( pEd == pEdRepeatCol ) + else if( &rEd == pEdRepeatCol ) pLb = pLbRepeatCol; - else if( pEd == pEdRepeatRow ) + else if( &rEd == pEdRepeatRow ) pLb = pLbRepeatRow; else - return 0; + return; // set list box selection according to edit field const sal_Int32 nEntryCount = pLb->GetEntryCount(); - OUString aStrEd( pEd->GetText() ); + OUString aStrEd( rEd.GetText() ); OUString aEdUpper = aStrEd.toAsciiUpperCase(); if ( (nEntryCount > nFirstCustomPos) && !aStrEd.isEmpty() ) @@ -615,8 +615,6 @@ IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd ) } else pLb->SelectEntryPos( !aStrEd.isEmpty() ? nUserDefPos : 0 ); - - return 0; } // globale Funktionen: diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index bbe7da3eb5cd..a317ccfda475 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -107,7 +107,7 @@ void AlignmentPropertyPanel::Initialize() mpFTLeftIndent->Disable(); mpMFLeftIndent->Disable(); mpMFLeftIndent->SetAccessibleName(OUString( "Left Indent")); //wj acc - Link<> aLink = LINK(this, AlignmentPropertyPanel, MFLeftIndentMdyHdl); + Link<Edit&,void> aLink = LINK(this, AlignmentPropertyPanel, MFLeftIndentMdyHdl); mpMFLeftIndent->SetModifyHdl ( aLink ); mpCBXMergeCell->SetClickHdl ( LINK(this, AlignmentPropertyPanel, CBOXMergnCellClkHdl) ); @@ -152,21 +152,21 @@ IMPL_LINK_TYPED( AlignmentPropertyPanel, ReferenceEdgeHdl, Button*, pControl, vo GetBindings()->GetDispatcher()->Execute(SID_ATTR_ALIGN_LOCKPOS, SfxCallMode::RECORD, &aItem, 0l); } -IMPL_LINK_NOARG( AlignmentPropertyPanel, AngleModifiedHdl ) +IMPL_LINK_NOARG_TYPED( AlignmentPropertyPanel, AngleModifiedHdl, Edit&, void ) { OUString sTmp = mpMtrAngle->GetText(); if (sTmp.isEmpty()) - return 0; + return; sal_Unicode nChar = sTmp[0]; if( nChar == '-' ) { if (sTmp.getLength() < 2) - return 0; + return; nChar = sTmp[1]; } if( (nChar < '0') || (nChar > '9') ) - return 0; + return; const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0]; @@ -179,7 +179,7 @@ IMPL_LINK_NOARG( AlignmentPropertyPanel, AngleModifiedHdl ) rtl_math_ConversionStatus eStatus; double fTmp = rtl::math::stringToDouble( sTmp, cSep, 0, &eStatus); if (eStatus != rtl_math_ConversionStatus_Ok) - return 0; + return; FormatDegrees(fTmp); @@ -188,7 +188,6 @@ IMPL_LINK_NOARG( AlignmentPropertyPanel, AngleModifiedHdl ) GetBindings()->GetDispatcher()->Execute( SID_ATTR_ALIGN_DEGREES, SfxCallMode::RECORD, &aAngleItem, 0L ); - return 0; } IMPL_LINK_NOARG_TYPED( AlignmentPropertyPanel, ClickStackHdl, Button*, void ) { @@ -197,14 +196,13 @@ IMPL_LINK_NOARG_TYPED( AlignmentPropertyPanel, ClickStackHdl, Button*, void ) GetBindings()->GetDispatcher()->Execute( SID_ATTR_ALIGN_STACKED, SfxCallMode::RECORD, &aStackItem, 0L ); } -IMPL_LINK_NOARG(AlignmentPropertyPanel, MFLeftIndentMdyHdl) +IMPL_LINK_NOARG_TYPED(AlignmentPropertyPanel, MFLeftIndentMdyHdl, Edit&, void) { mpCBXWrapText->EnableTriState(false); sal_uInt16 nVal = (sal_uInt16)mpMFLeftIndent->GetValue(); SfxUInt16Item aItem( SID_ATTR_ALIGN_INDENT, (sal_uInt16)CalcToUnit( nVal, SFX_MAPUNIT_TWIP ) ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_ALIGN_INDENT, SfxCallMode::RECORD, &aItem, 0L); - return 0L; } IMPL_LINK_NOARG_TYPED(AlignmentPropertyPanel, CBOXMergnCellClkHdl, Button*, void) diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx index 3bb6b6e3d75e..0572de89eded 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx @@ -97,10 +97,10 @@ private: ::sfx2::sidebar::EnumContext maContext; SfxBindings* mpBindings; - DECL_LINK( MFLeftIndentMdyHdl, void * ); + DECL_LINK_TYPED( MFLeftIndentMdyHdl, Edit&, void ); DECL_LINK_TYPED( CBOXMergnCellClkHdl, Button*, void ); DECL_LINK_TYPED( CBOXWrapTextClkHdl, Button*, void ); - DECL_LINK( AngleModifiedHdl, void * ); + DECL_LINK_TYPED( AngleModifiedHdl, Edit&, void ); DECL_LINK_TYPED( ClickStackHdl, Button*, void ); DECL_LINK_TYPED( ReferenceEdgeHdl, Button*, void ); diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx index fa97da227d22..747a0b2138f5 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx @@ -92,7 +92,7 @@ void NumberFormatPropertyPanel::Initialize() mpLbCategory->SetAccessibleName(OUString( "Category")); mpLbCategory->SetDropDownLineCount(mpLbCategory->GetEntryCount()); - Link<> aLink = LINK(this, NumberFormatPropertyPanel, NumFormatValueHdl); + Link<Edit&,void> aLink = LINK(this, NumberFormatPropertyPanel, NumFormatValueHdl); mpEdDecimals->SetModifyHdl( aLink ); mpEdLeadZeroes->SetModifyHdl( aLink ); @@ -118,9 +118,9 @@ IMPL_LINK_TYPED( NumberFormatPropertyPanel, NumFormatSelectHdl, ListBox&, rBox, IMPL_LINK_NOARG_TYPED( NumberFormatPropertyPanel, NumFormatValueClickHdl, Button*, void ) { - NumFormatValueHdl(nullptr); + NumFormatValueHdl(*mpEdDecimals); } -IMPL_LINK_NOARG( NumberFormatPropertyPanel, NumFormatValueHdl ) +IMPL_LINK_NOARG_TYPED( NumberFormatPropertyPanel, NumFormatValueHdl, Edit&, void ) { OUString aFormat; OUString sBreak = ","; @@ -151,7 +151,6 @@ IMPL_LINK_NOARG( NumberFormatPropertyPanel, NumFormatValueHdl ) SfxStringItem aItem( SID_NUMBER_FORMAT, aFormat ); GetBindings()->GetDispatcher()->Execute(SID_NUMBER_FORMAT, SfxCallMode::RECORD, &aItem, 0L); - return 0L; } VclPtr<vcl::Window> NumberFormatPropertyPanel::Create ( diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx index e9e9b1eaf60f..31ff2b45745d 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx @@ -26,6 +26,7 @@ class FixedText; class ListBox; class NumericField; +class Edit; namespace sc { namespace sidebar { @@ -84,7 +85,7 @@ private: SfxBindings* mpBindings; DECL_LINK_TYPED(NumFormatSelectHdl, ListBox&, void); - DECL_LINK(NumFormatValueHdl, void*); + DECL_LINK_TYPED(NumFormatValueHdl, Edit&, void); DECL_LINK_TYPED(NumFormatValueClickHdl, Button*, void); void Initialize(); diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 45b75c82ba14..32c30941e2a5 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -105,7 +105,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( mpLbTree->SetSelectHdl(LINK(this, ScXMLSourceDlg, TreeItemSelectHdl)); - Link<> aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl); + Link<Edit&,void> aLink = LINK(this, ScXMLSourceDlg, RefModifiedHdl); mpRefEdit->SetModifyHdl(aLink); mpBtnOk->Disable(); @@ -682,10 +682,9 @@ IMPL_LINK_NOARG_TYPED(ScXMLSourceDlg, TreeItemSelectHdl, SvTreeListBox*, void) TreeItemSelected(); } -IMPL_LINK_NOARG(ScXMLSourceDlg, RefModifiedHdl) +IMPL_LINK_NOARG_TYPED(ScXMLSourceDlg, RefModifiedHdl, Edit&, void) { RefEditModified(); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 18b87a1ea5d2..51c9c3fdf37a 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -355,7 +355,7 @@ public: virtual ~SdDesignNameDlg(); virtual void dispose() override; OUString GetDesignName(); - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); }; // SdPublishingDlg Methods @@ -1628,11 +1628,9 @@ OUString SdDesignNameDlg::GetDesignName() return m_pEdit->GetText(); } -IMPL_LINK_NOARG(SdDesignNameDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SdDesignNameDlg, ModifyHdl, Edit&, void) { m_pBtnOK->Enable(!m_pEdit->GetText().isEmpty()); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 83b9c1af69ca..f0d019b87ce6 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -433,13 +433,15 @@ public: DECL_LINK_TYPED( implMenuSelectHdl, MenuButton*, void ); private: + DECL_LINK_TYPED( EditModifyHdl, Edit&, void ); VclPtr<DropdownMenuBox> mpControl; PopupMenu* mpMenu; VclPtr<MetricField> mpMetric; + Link<> maModifyHdl; }; CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<>& rModifyHdl ) -: PropertySubControl( nControlType ) +: PropertySubControl( nControlType ), maModifyHdl(rModifyHdl) { mpMetric.set( VclPtr<MetricField>::Create( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) ); mpMetric->SetUnit( FUNIT_PERCENT ); @@ -449,7 +451,7 @@ CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Windo mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSIZE_POPUP ) ); mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu ); mpControl->SetMenuSelectHdl( LINK( this, CharHeightPropertyBox, implMenuSelectHdl )); - mpControl->SetModifyHdl( rModifyHdl ); + mpControl->SetModifyHdl( LINK( this, CharHeightPropertyBox, EditModifyHdl ) ); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_CHARHEIGHTPROPERTYBOX ); OUString aPresetId; @@ -461,6 +463,11 @@ CharHeightPropertyBox::~CharHeightPropertyBox() mpControl.disposeAndClear(); } +IMPL_LINK_TYPED( CharHeightPropertyBox, EditModifyHdl, Edit&, rEdit, void ) +{ + maModifyHdl.Call(&rEdit); +} + IMPL_LINK_TYPED( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb, void ) { long nValue = 100; @@ -507,7 +514,7 @@ public: virtual Control* getControl() override; DECL_LINK_TYPED( implMenuSelectHdl, MenuButton*, void ); - DECL_LINK(implModifyHdl, void *); + DECL_LINK_TYPED( implModifyHdl, Edit&, void ); void updateMenu(); @@ -539,7 +546,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W mpControl->SetMenuSelectHdl( LINK( this, TransparencyPropertyBox, implMenuSelectHdl )); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_TRANSPARENCYPROPERTYBOX ); - Link<> aLink( LINK( this, TransparencyPropertyBox, implModifyHdl ) ); + Link<Edit&,void> aLink( LINK( this, TransparencyPropertyBox, implModifyHdl ) ); mpControl->SetModifyHdl( aLink ); OUString aPresetId; @@ -558,12 +565,10 @@ void TransparencyPropertyBox::updateMenu() mpMenu->CheckItem( i, nValue == i ); } -IMPL_LINK_NOARG(TransparencyPropertyBox, implModifyHdl) +IMPL_LINK_NOARG_TYPED(TransparencyPropertyBox, implModifyHdl, Edit&, void) { updateMenu(); maModifyHdl.Call(mpMetric.get()); - - return 0; } IMPL_LINK_TYPED( TransparencyPropertyBox, implMenuSelectHdl, MenuButton*, pPb, void ) @@ -609,7 +614,7 @@ public: virtual Control* getControl() override; DECL_LINK_TYPED( implMenuSelectHdl, MenuButton*, void ); - DECL_LINK(implModifyHdl, void *); + DECL_LINK_TYPED( implModifyHdl, Edit&, void ); void updateMenu(); @@ -635,7 +640,7 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p mpControl->SetMenuSelectHdl( LINK( this, RotationPropertyBox, implMenuSelectHdl )); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_ROTATIONPROPERTYBOX ); - Link<> aLink( LINK( this, RotationPropertyBox, implModifyHdl ) ); + Link<Edit&,void> aLink( LINK( this, RotationPropertyBox, implModifyHdl ) ); mpControl->SetModifyHdl( aLink ); OUString aPresetId; @@ -662,12 +667,10 @@ void RotationPropertyBox::updateMenu() mpMenu->CheckItem( CM_COUNTERCLOCKWISE, !bDirection ); } -IMPL_LINK_NOARG(RotationPropertyBox, implModifyHdl) +IMPL_LINK_NOARG_TYPED(RotationPropertyBox, implModifyHdl, Edit&, void) { updateMenu(); maModifyHdl.Call(mpMetric.get()); - - return 0; } IMPL_LINK_TYPED( RotationPropertyBox, implMenuSelectHdl, MenuButton*, pPb, void ) @@ -732,7 +735,7 @@ public: virtual Control* getControl() override; DECL_LINK_TYPED( implMenuSelectHdl, MenuButton*, void ); - DECL_LINK(implModifyHdl, void *); + DECL_LINK_TYPED( implModifyHdl, Edit&, void ); void updateMenu(); @@ -758,7 +761,7 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent mpControl->SetMenuSelectHdl( LINK( this, ScalePropertyBox, implMenuSelectHdl )); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_SCALEPROPERTYBOX ); - Link<> aLink( LINK( this, ScalePropertyBox, implModifyHdl ) ); + Link<Edit&,void> aLink( LINK( this, ScalePropertyBox, implModifyHdl ) ); mpControl->SetModifyHdl( aLink ); OUString aPresetId; @@ -784,12 +787,10 @@ void ScalePropertyBox::updateMenu() mpMenu->CheckItem( CM_BOTH, mnDirection == 3 ); } -IMPL_LINK_NOARG(ScalePropertyBox, implModifyHdl) +IMPL_LINK_NOARG_TYPED(ScalePropertyBox, implModifyHdl, Edit&, void) { updateMenu(); maModifyHdl.Call(mpMetric.get()); - - return 0; } IMPL_LINK_TYPED( ScalePropertyBox, implMenuSelectHdl, MenuButton*, pPb, void ) diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 233da3af03f9..5493953033f3 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -1009,10 +1009,9 @@ IMPL_LINK_NOARG_TYPED(SlideTransitionPane, AdvanceSlideRadioButtonToggled, Radio applyToSelectedPages(); } -IMPL_LINK_NOARG(SlideTransitionPane, AdvanceTimeModified) +IMPL_LINK_NOARG_TYPED(SlideTransitionPane, AdvanceTimeModified, Edit&, void) { applyToSelectedPages(); - return 0; } IMPL_LINK_NOARG_TYPED(SlideTransitionPane, SpeedListBoxSelected, ListBox&, void) diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx index 5d460a7cf17c..41ac9bd4c603 100644 --- a/sd/source/ui/animations/SlideTransitionPane.hxx +++ b/sd/source/ui/animations/SlideTransitionPane.hxx @@ -91,7 +91,7 @@ private: DECL_LINK_TYPED( TransitionSelected, ListBox&, void ); DECL_LINK_TYPED( AdvanceSlideRadioButtonToggled, RadioButton&, void ); - DECL_LINK( AdvanceTimeModified, void * ); + DECL_LINK_TYPED( AdvanceTimeModified, Edit&, void ); DECL_LINK_TYPED( SpeedListBoxSelected, ListBox&, void ); DECL_LINK_TYPED( SoundListBoxSelected, ListBox&, void ); DECL_LINK_TYPED( LoopSoundBoxChecked, Button*, void ); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 4535372b81e6..9c6ea9e18399 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -497,7 +497,7 @@ IMPL_LINK_NOARG_TYPED(AnimationWindow, ClickCreateGroupHdl, Button*, void) SID_ANIMATOR_CREATE, SfxCallMode::SLOT | SfxCallMode::RECORD, &aItem, 0L ); } -IMPL_LINK_NOARG(AnimationWindow, ModifyBitmapHdl) +IMPL_LINK_NOARG_TYPED(AnimationWindow, ModifyBitmapHdl, Edit&, void) { sal_uLong nBmp = static_cast<sal_uLong>(m_pNumFldBitmap->GetValue()); @@ -509,19 +509,15 @@ IMPL_LINK_NOARG(AnimationWindow, ModifyBitmapHdl) m_nCurrentFrame = nBmp - 1; UpdateControl(); - - return 0L; } -IMPL_LINK_NOARG(AnimationWindow, ModifyTimeHdl) +IMPL_LINK_NOARG_TYPED(AnimationWindow, ModifyTimeHdl, Edit&, void) { sal_uLong nPos = static_cast<sal_uLong>(m_pNumFldBitmap->GetValue() - 1); tools::Time *const pTime = m_FrameList[nPos].second; *pTime = m_pTimeField->GetTime(); - - return 0L; } void AnimationWindow::UpdateControl(bool const bDisableCtrls) diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index b926bdf80193..14fff3034c74 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -297,7 +297,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow, Link<Button*,void> aLink = LINK( this, SdDefineCustomShowDlg, ClickButtonHdl ); m_pBtnAdd->SetClickHdl( aLink ); m_pBtnRemove->SetClickHdl( aLink ); - m_pEdtName->SetModifyHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl2 ) ); + m_pEdtName->SetModifyHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonEditHdl ) ); m_pLbPages->SetSelectHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl4 ) ); // because of status m_pLbCustomPages->SetSelectHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl3 ) ); // because of status @@ -394,8 +394,12 @@ IMPL_LINK_TYPED( SdDefineCustomShowDlg, ClickButtonHdl4, ListBox&, rListBox, voi { ClickButtonHdl2(&rListBox); } +IMPL_LINK_TYPED( SdDefineCustomShowDlg, ClickButtonEditHdl, Edit&, rEdit, void ) +{ + ClickButtonHdl2(&rEdit); +} // ButtonHdl() -IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl2, void *, p ) +void SdDefineCustomShowDlg::ClickButtonHdl2(void* p) { if( p == m_pBtnAdd ) { @@ -441,8 +445,6 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl2, void *, p ) } CheckState(); - - return 0L; } /** diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index d372d55a92c0..47ba9f569bb6 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -239,7 +239,7 @@ public: DECL_LINK_TYPED( SelectLayoutHdl, ListBox&, void ); DECL_LINK_TYPED( PageSelectHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( PresTypeHdl, Button*, void ); - DECL_LINK( UpdateUserDataHdl, void * ); + DECL_LINK_TYPED( UpdateUserDataHdl, Edit&, void ); DECL_LINK_TYPED( SelectEffectHdl, ListBox&, void); DECL_LINK_TYPED( OpenButtonHdl, Button *, void ); @@ -1235,7 +1235,7 @@ IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, PresTypeHdl, Button*, void) mpPage3LogoCB->Enable(bKiosk); } -IMPL_LINK_NOARG(AssistentDlgImpl, UpdateUserDataHdl) +IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, UpdateUserDataHdl, Edit&, void) { mbUserDataDirty = true; OUString aTopic = mpPage4AskTopicEDT->GetText(); @@ -1244,8 +1244,6 @@ IMPL_LINK_NOARG(AssistentDlgImpl, UpdateUserDataHdl) if (aTopic.isEmpty() && aName.isEmpty() && aInfo.isEmpty()) maDocFile.clear(); - - return 0; } // ******************************************************************** diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index 7891916a5e53..472f523f821c 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -147,7 +147,7 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow, ChangeRangeHdl( NULL ); ClickWindowPresentationHdl( NULL ); - ChangePauseHdl( NULL ); + ChangePauseHdl( *aTmfPause ); } SdStartPresentationDlg::~SdStartPresentationDlg() @@ -356,10 +356,9 @@ IMPL_LINK_NOARG_TYPED(SdStartPresentationDlg, ClickWindowPresentationHdl, Button /** * Handler: Enabled/Disabled Checkbox "AlwaysOnTop" */ -IMPL_LINK_NOARG(SdStartPresentationDlg, ChangePauseHdl) +IMPL_LINK_NOARG_TYPED(SdStartPresentationDlg, ChangePauseHdl, Edit&, void) { aCbxAutoLogo->Enable( aRbtAuto->IsChecked() && ( aTmfPause->GetTime().GetMSFromTime() > 0 ) ); - return 0L; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index c856505e005c..3c17bf048c45 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -294,13 +294,12 @@ IMPL_LINK_TYPED( SdVectorizeDlg, ToggleHdl, CheckBox&, rCb, void ) m_pMtFillHoles->Disable(); } - ModifyHdl( NULL ); + m_pBtnPreview->Enable(); } -IMPL_LINK_NOARG(SdVectorizeDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SdVectorizeDlg, ModifyHdl, Edit&, void) { m_pBtnPreview->Enable(); - return 0L; } void SdVectorizeDlg::LoadSettings() diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx index 57901e0519d8..660e739cafa9 100644 --- a/sd/source/ui/inc/animobjs.hxx +++ b/sd/source/ui/inc/animobjs.hxx @@ -141,8 +141,8 @@ private: DECL_LINK_TYPED( ClickRemoveBitmapHdl, Button*, void ); DECL_LINK_TYPED( ClickRbtHdl, Button*, void ); DECL_LINK_TYPED( ClickCreateGroupHdl, Button*, void ); - DECL_LINK( ModifyBitmapHdl, void * ); - DECL_LINK( ModifyTimeHdl, void * ); + DECL_LINK_TYPED( ModifyBitmapHdl, Edit&, void ); + DECL_LINK_TYPED( ModifyTimeHdl, Edit&, void ); void UpdateControl(bool bDisableCtrls = false); void ResetAttrs(); diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx index ce69dc7a75b5..adb694d01c0e 100644 --- a/sd/source/ui/inc/custsdlg.hxx +++ b/sd/source/ui/inc/custsdlg.hxx @@ -85,10 +85,11 @@ private: void CheckCustomShow(); DECL_LINK_TYPED( ClickButtonHdl, Button*, void ); - DECL_LINK( ClickButtonHdl2, void* ); + DECL_LINK_TYPED( ClickButtonEditHdl, Edit&, void ); DECL_LINK_TYPED( ClickButtonHdl3, SvTreeListBox*, void ); DECL_LINK_TYPED( ClickButtonHdl4, ListBox&, void ); DECL_LINK_TYPED( OKHdl, Button*, void ); + void ClickButtonHdl2(void*); public: diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx index 05d8518743f4..6e6a42cab269 100644 --- a/sd/source/ui/inc/present.hxx +++ b/sd/source/ui/inc/present.hxx @@ -71,7 +71,7 @@ private: DECL_LINK_TYPED( ChangeRangeHdl, Button*, void ); DECL_LINK_TYPED( ClickWindowPresentationHdl, Button*, void ); - DECL_LINK( ChangePauseHdl, void * ); + DECL_LINK_TYPED( ChangePauseHdl, Edit&, void ); void InitMonitorSettings(); enum DisplayType { diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx index a9774ce641af..c711ea71ea80 100644 --- a/sd/source/ui/inc/vectdlg.hxx +++ b/sd/source/ui/inc/vectdlg.hxx @@ -75,7 +75,7 @@ class SdVectorizeDlg : public ModalDialog DECL_LINK_TYPED( ClickPreviewHdl, Button*, void ); DECL_LINK_TYPED( ClickOKHdl, Button*, void ); DECL_LINK_TYPED( ToggleHdl, CheckBox&, void ); - DECL_LINK( ModifyHdl, void* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); public: diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 044682214de4..494b730855c7 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -62,7 +62,7 @@ class SvDDELinkEditDialog : public ModalDialog VclPtr<Edit> m_pEdDdeItem; VclPtr<OKButton> m_pOKButton; - DECL_LINK( EditHdl_Impl, Edit* ); + DECL_LINK_TYPED( EditHdl_Impl, Edit&, void ); public: SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink* ); virtual ~SvDDELinkEditDialog(); @@ -113,12 +113,11 @@ OUString SvDDELinkEditDialog::GetCmd() const return sRet; } -IMPL_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit *, ) +IMPL_LINK_NOARG_TYPED( SvDDELinkEditDialog, EditHdl_Impl, Edit&, void) { m_pOKButton->Enable( !m_pEdDdeApp->GetText().isEmpty() && !m_pEdDdeTopic->GetText().isEmpty() && !m_pEdDdeItem->GetText().isEmpty() ); - return 0; } SvDDEObject::SvDDEObject() diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index f7aedbbe8511..aac1f46724fc 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -970,7 +970,7 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_ } } - ModifyHdl(m_pSearchED); + ModifyHdl(*m_pSearchED); } SearchTabPage_Impl::~SearchTabPage_Impl() @@ -1088,11 +1088,10 @@ IMPL_LINK_NOARG_TYPED(SearchTabPage_Impl, OpenHdl, Button*, void) m_pResultsLB->GetDoubleClickHdl().Call(*m_pResultsLB); } -IMPL_LINK_NOARG(SearchTabPage_Impl, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SearchTabPage_Impl, ModifyHdl, Edit&, void) { OUString aSearchText = comphelper::string::strip(m_pSearchED->GetText(), ' '); m_pSearchBtn->Enable(!aSearchText.isEmpty()); - return 0; } void SearchTabPage_Impl::ActivatePage() diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 5540ebc5a25b..660470631c04 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -217,7 +217,7 @@ private: DECL_LINK_TYPED(SearchHdl, LinkParamNone*, void); DECL_LINK_TYPED(ClickHdl, Button*, void); DECL_LINK_TYPED(OpenHdl, Button*, void); - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: SearchTabPage_Impl( vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin ); diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index f39034f93728..29eae5c9070c 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -51,10 +51,9 @@ IMPL_LINK_NOARG_TYPED( SfxNewStyleDlg, OKHdl, ComboBox&, void ) EndDialog( RET_OK ); } -IMPL_LINK( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) +IMPL_LINK_TYPED( SfxNewStyleDlg, ModifyHdl, Edit&, rBox, void ) { - m_pOKBtn->Enable( !comphelper::string::remove(pBox->GetText(), ' ').isEmpty() ); - return 0; + m_pOKBtn->Enable( !comphelper::string::remove(rBox.GetText(), ' ').isEmpty() ); } SfxNewStyleDlg::SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& rInPool ) diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index 96f7c42a6dea..c5397355aebd 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -29,7 +29,12 @@ -IMPL_LINK( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SfxPasswordDialog, EditModifyHdl, Edit&, rEdit, void ) +{ + ModifyHdl(&rEdit); +} + +void SfxPasswordDialog::ModifyHdl(Edit* pEdit) { if (mbAsciiOnly && (pEdit == mpPassword1ED || pEdit == mpPassword2ED)) { @@ -57,7 +62,6 @@ IMPL_LINK( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit ) if( mpPassword2ED->IsVisible() ) bEnable = (bEnable && (mpPassword2ED->GetText().getLength() >= mnMinLen)); mpOKBtn->Enable( bEnable ); - return 0; } IMPL_LINK_NOARG_TYPED(SfxPasswordDialog, OKHdl, Button*, void) @@ -108,7 +112,7 @@ SfxPasswordDialog::SfxPasswordDialog(vcl::Window* pParent, const OUString* pGrou mpPassword1ED->SetAccessibleName(SFX2_RESSTR(STR_PASSWD)); - Link<> aLink = LINK( this, SfxPasswordDialog, EditModifyHdl ); + Link<Edit&,void> aLink = LINK( this, SfxPasswordDialog, EditModifyHdl ); mpPassword1ED->SetModifyHdl( aLink ); mpPassword2ED->SetModifyHdl( aLink ); mpOKBtn->SetClickHdl( LINK( this, SfxPasswordDialog, OKHdl ) ); @@ -168,7 +172,7 @@ void SfxPasswordDialog::SetMinLen( sal_uInt16 nLen ) { mnMinLen = nLen; SetPasswdText(); - EditModifyHdl( NULL ); + ModifyHdl( NULL ); } void SfxPasswordDialog::ShowMinLengthText(bool bShow) diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index c37554d5b9a3..dd6c04590bab 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -389,7 +389,7 @@ IMPL_LINK_NOARG_TYPED(SfxTemplateManagerDlg, ActivatePageHdl, TabControl*, void) mpCurView->showRootRegion(); // fdo#60586 show the root region of the applied filter if (mpSearchView->IsVisible()) - SearchUpdateHdl(NULL); + SearchUpdateHdl(*mpSearchEdit); } void SfxTemplateManagerDlg::readSettings () @@ -708,7 +708,7 @@ IMPL_LINK_TYPED(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pIte } } -IMPL_LINK_NOARG(SfxTemplateManagerDlg, SearchUpdateHdl) +IMPL_LINK_NOARG_TYPED(SfxTemplateManagerDlg, SearchUpdateHdl, Edit&, void) { OUString aKeyword = mpSearchEdit->GetText(); @@ -754,8 +754,6 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, SearchUpdateHdl) mpSearchView->Hide(); mpCurView->Show(); } - - return 0; } void SfxTemplateManagerDlg::OnRegionState (const ThumbnailViewItem *pItem) @@ -1589,7 +1587,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId) // Deselect all items and update search results mpSearchView->deselectItems(); - SearchUpdateHdl(mpSearchEdit); + SearchUpdateHdl(*mpSearchEdit); } void SfxTemplateManagerDlg::loadRepositories() diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 59a8f856584a..16cf98d3857e 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -103,7 +103,7 @@ class SmFontDialog : public ModalDialog vcl::Font maFont; DECL_LINK_TYPED(FontSelectHdl, ComboBox&, void); - DECL_LINK(FontModifyHdl, ComboBox *); + DECL_LINK_TYPED(FontModifyHdl, Edit&, void); DECL_LINK_TYPED(AttrChangeHdl, Button *, void); virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; @@ -436,7 +436,7 @@ class SmSymDefineDialog : public ModalDialog DECL_LINK_TYPED(OldSymbolChangeHdl, ComboBox&, void); DECL_LINK_TYPED(OldSymbolSetChangeHdl, ComboBox&, void); - DECL_LINK(ModifyHdl, ComboBox *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(FontChangeHdl, ListBox&, void); DECL_LINK_TYPED(SubsetChangeHdl, ListBox&, void); DECL_LINK_TYPED(StyleChangeHdl, ComboBox&, void); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b1d0bca9e333..6d58de60e762 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -301,15 +301,15 @@ IMPL_LINK_TYPED( SmFontDialog, FontSelectHdl, ComboBox&, rComboBox, void ) m_pShowFont->SetFont(maFont); } -IMPL_LINK( SmFontDialog, FontModifyHdl, ComboBox *, pComboBox ) +IMPL_LINK_TYPED( SmFontDialog, FontModifyHdl, Edit&, rEdit, void ) { + ComboBox& rComboBox = static_cast<ComboBox&>(rEdit); // if font is available in list then use it - sal_Int32 nPos = pComboBox->GetEntryPos( pComboBox->GetText() ); + sal_Int32 nPos = rComboBox.GetEntryPos( rComboBox.GetText() ); if (COMBOBOX_ENTRY_NOTFOUND != nPos) { - FontSelectHdl( *pComboBox ); + FontSelectHdl( rComboBox ); } - return 0; } IMPL_LINK_NOARG_TYPED( SmFontDialog, AttrChangeHdl, Button*, void ) @@ -1810,35 +1810,33 @@ IMPL_LINK_TYPED( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox&, rComboBox, } -IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) +IMPL_LINK_TYPED( SmSymDefineDialog, ModifyHdl, Edit&, rEdit, void ) { + ComboBox& rComboBox = static_cast<ComboBox&>(rEdit); // remember cursor position for later restoring of it - Selection aSelection (pComboBox->GetSelection()); + Selection aSelection (rComboBox.GetSelection()); - if (pComboBox == pSymbols) + if (&rComboBox == pSymbols) SelectSymbol(*pSymbols, pSymbols->GetText(), false); - else if (pComboBox == pSymbolSets) + else if (&rComboBox == pSymbolSets) SelectSymbolSet(*pSymbolSets, pSymbolSets->GetText(), false); - else if (pComboBox == pOldSymbols) + else if (&rComboBox == pOldSymbols) // allow only names from the list SelectSymbol(*pOldSymbols, pOldSymbols->GetText(), true); - else if (pComboBox == pOldSymbolSets) + else if (&rComboBox == pOldSymbolSets) // allow only names from the list SelectSymbolSet(*pOldSymbolSets, pOldSymbolSets->GetText(), true); - else if (pComboBox == pStyles) + else if (&rComboBox == pStyles) // allow only names from the list (that's the case here anyway) SelectStyle(pStyles->GetText(), true); else SAL_WARN("starmath", "wrong combobox argument"); - pComboBox->SetSelection(aSelection); + rComboBox.SetSelection(aSelection); UpdateButtons(); - - return 0; } - IMPL_LINK_TYPED( SmSymDefineDialog, FontChangeHdl, ListBox&, rListBox, void ) { (void) rListBox; diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index d31eb22cdc34..f16c21e3eea6 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -80,6 +80,11 @@ namespace svt GetComboBox().SetModifyHdl( LINK(this, ComboBoxCellController, ModifyHdl) ); } + IMPL_LINK_NOARG_TYPED(ComboBoxCellController, ModifyHdl, Edit&, void) + { + callModifyHdl(); + } + bool ComboBoxCellController::MoveAllowed(const KeyEvent& rEvt) const { @@ -130,12 +135,6 @@ namespace svt GetComboBox().SaveValue(); } - IMPL_LINK_NOARG(ComboBoxCellController, ModifyHdl) - { - callModifyHdl(); - return 0; - } - //= ListBoxControl ListBoxControl::ListBoxControl(vcl::Window* pParent, WinBits nWinStyle) :ListBox(pParent, nWinStyle|WB_DROPDOWN|WB_NOBORDER) @@ -330,7 +329,8 @@ namespace svt //= CheckBoxCellController - CheckBoxCellController::CheckBoxCellController(CheckBoxControl* pWin):CellController(pWin) + CheckBoxCellController::CheckBoxCellController(CheckBoxControl* pWin) + : CellController(pWin) { static_cast<CheckBoxControl &>(GetWindow()).SetModifyHdl( LINK(this, CheckBoxCellController, ModifyHdl) ); } @@ -365,7 +365,6 @@ namespace svt return 0; } - //= MultiLineEditImplementation @@ -451,13 +450,11 @@ namespace svt } - IMPL_LINK_NOARG(EditCellController, ModifyHdl) + IMPL_LINK_NOARG_TYPED(EditCellController, ModifyHdl, Edit&, void) { callModifyHdl(); - return 0; } - //= SpinCellController @@ -509,14 +506,11 @@ namespace svt return GetSpinWindow().IsModified(); } - - IMPL_LINK_NOARG(SpinCellController, ModifyHdl) + IMPL_LINK_NOARG_TYPED(SpinCellController, ModifyHdl, Edit&, void) { callModifyHdl(); - return 0; } - //= FormattedFieldCellController diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx index 0a64a2d95174..62c6172c60ff 100644 --- a/svtools/source/control/filectrl.cxx +++ b/svtools/source/control/filectrl.cxx @@ -196,7 +196,7 @@ void FileControl::GetFocus() maEdit->GrabFocus(); } -void FileControl::SetEditModifyHdl( const Link<>& rLink ) +void FileControl::SetEditModifyHdl( const Link<Edit&,void>& rLink ) { if (!maEdit || maEdit->IsDisposed()) return; @@ -244,7 +244,7 @@ void FileControl::ImplBrowseFile( ) if ( aObj.GetProtocol() == INetProtocol::File ) aNewText = aObj.PathToFileName(); SetText( aNewText ); - maEdit->GetModifyHdl().Call( maEdit.get() ); + maEdit->GetModifyHdl().Call( *maEdit.get() ); } } } diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index eb0cbd1231b9..02f933cc5876 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -289,21 +289,18 @@ IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditHdl, DetailsContainer*, void ) m_pBTOk->Enable( !sName.isEmpty( ) && !sUrl.isEmpty( ) ); } -IMPL_LINK_NOARG( PlaceEditDialog, ModifyHdl ) +IMPL_LINK_NOARG_TYPED( PlaceEditDialog, ModifyHdl, Edit&, void ) { EditHdl(nullptr); - return 1; } -IMPL_LINK_NOARG( PlaceEditDialog, EditLabelHdl ) +IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditLabelHdl, Edit&, void ) { bLabelChanged = true; EditHdl(NULL); - - return 1; } -IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl ) +IMPL_LINK_NOARG_TYPED( PlaceEditDialog, EditUsernameHdl, Edit&, void ) { for ( std::vector< std::shared_ptr< DetailsContainer > >::iterator it = m_aDetailsContainers.begin( ); it != m_aDetailsContainers.end( ); ++it ) @@ -313,8 +310,6 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl ) } EditHdl(NULL); - - return 1; } IMPL_LINK_NOARG_TYPED( PlaceEditDialog, SelectTypeHdl, ListBox&, void ) diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 7943e65e446a..7e2aa397a622 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -80,10 +80,9 @@ void DetailsContainer::setActive( bool bActive ) m_bIsActive = bActive; } -IMPL_LINK_NOARG( DetailsContainer, ValueChangeHdl ) +IMPL_LINK_NOARG_TYPED( DetailsContainer, ValueChangeHdl, Edit&, void ) { notifyChange( ); - return 0; } HostDetailsContainer::HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme ) : diff --git a/svtools/source/filter/GraphicExportOptionsDialog.cxx b/svtools/source/filter/GraphicExportOptionsDialog.cxx index 8277304d537c..b8a9723218be 100644 --- a/svtools/source/filter/GraphicExportOptionsDialog.cxx +++ b/svtools/source/filter/GraphicExportOptionsDialog.cxx @@ -62,35 +62,29 @@ void GraphicExportOptionsDialog::initialize() mSize100mm = mRenderer.getDocumentSizeIn100mm(mCurrentPage); } -IMPL_LINK_NOARG( GraphicExportOptionsDialog, widthModifiedHandle ) +IMPL_LINK_NOARG_TYPED( GraphicExportOptionsDialog, widthModifiedHandle, Edit&, void ) { mResolution = mpWidth->GetValue() / getViewWidthInch(); updateHeight(); updateResolution(); - - return 0L; } -IMPL_LINK_NOARG( GraphicExportOptionsDialog, heightModifiedHandle ) +IMPL_LINK_NOARG_TYPED( GraphicExportOptionsDialog, heightModifiedHandle, Edit&, void ) { mResolution = mpHeight->GetValue() / getViewHeightInch(); updateWidth(); updateResolution(); - - return 0L; } -IMPL_LINK_NOARG( GraphicExportOptionsDialog, resolutionModifiedHandle ) +IMPL_LINK_NOARG_TYPED( GraphicExportOptionsDialog, resolutionModifiedHandle, Edit&, void ) { mResolution = mpResolution->GetText().toInt32(); updateWidth(); updateHeight(); Update(); - - return 0L; } double GraphicExportOptionsDialog::getViewWidthInch() diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index c1613961cdfd..06ef5f273c80 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -1028,10 +1028,9 @@ void ExportDialog::dispose() |* stores values set in the ini-file |* \************************************************************************/ -IMPL_LINK_NOARG(ExportDialog, SelectHdl) +IMPL_LINK_NOARG_TYPED(ExportDialog, SelectHdl, Edit&, void) { updateControls(); - return 0; } IMPL_LINK_NOARG_TYPED(ExportDialog, SelectListBoxHdl, ListBox&, void) { @@ -1042,7 +1041,7 @@ IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdl, Button*, void) updateControls(); } -IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX) +IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdlMtfSizeX, Edit&, void) { double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width; @@ -1073,10 +1072,9 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX) maSize.Height = aDest.Height(); } updateControls(); - return 0; } -IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY) +IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdlMtfSizeY, Edit&, void) { double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height; @@ -1107,10 +1105,9 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY) maSize.Width = aDest.Width(); } updateControls(); - return 0; } -IMPL_LINK_NOARG(ExportDialog, UpdateHdlNfResolution) +IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdlNfResolution, Edit&, void) { sal_Int32 nResolution = mpNfResolution->GetValue(); if ( mpLbResolution->GetSelectEntryPos() == 0 ) // pixels / cm @@ -1121,7 +1118,6 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlNfResolution) maResolution.Height= nResolution; updateControls(); - return 0; } IMPL_LINK_NOARG_TYPED(ExportDialog, SbCompressionUpdateHdl, ScrollBar*, void) diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx index 603a18f1281c..ef16700632d5 100644 --- a/svtools/source/filter/exportdialog.hxx +++ b/svtools/source/filter/exportdialog.hxx @@ -144,10 +144,10 @@ private: DECL_LINK_TYPED( UpdateHdl, Button*, void ); DECL_LINK_TYPED( SelectListBoxHdl, ListBox&, void ); - DECL_LINK( SelectHdl, void* ); - DECL_LINK( UpdateHdlMtfSizeX, void* ); - DECL_LINK( UpdateHdlMtfSizeY, void* ); - DECL_LINK( UpdateHdlNfResolution, void* ); + DECL_LINK_TYPED( SelectHdl, Edit&, void ); + DECL_LINK_TYPED( UpdateHdlMtfSizeX, Edit&, void ); + DECL_LINK_TYPED( UpdateHdlMtfSizeY, Edit&, void ); + DECL_LINK_TYPED( UpdateHdlNfResolution, Edit&, void ); DECL_LINK_TYPED( SbCompressionUpdateHdl, ScrollBar*, void ); DECL_LINK_TYPED( OK, Button*, void ); diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index 03ee585105f4..eaa53a942657 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -116,7 +116,8 @@ public: class VCLXFileControl : ::com::sun::star::awt::XTextComponent, public ::com::sun::star::awt::XTextLayoutConstrains, public VCLXWindow { protected: - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); + void ModifyHdl(); TextListenerMultiplexer maTextListeners; public: diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index 39e0497e4a04..2859c9b17991 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -545,7 +545,7 @@ VCLXFileControl::~VCLXFileControl() { VclPtr< FileControl > pControl = GetAs< FileControl >(); if ( pControl ) - pControl->GetEdit().SetModifyHdl( Link<>() ); + pControl->GetEdit().SetModifyHdl( Link<Edit&,void>() ); } ::com::sun::star::uno::Any VCLXFileControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) @@ -595,7 +595,7 @@ void VCLXFileControl::SetWindow( const VclPtr< vcl::Window > &pWindow ) { VclPtr< FileControl > pPrevFileControl = GetAsDynamic< FileControl >(); if ( pPrevFileControl ) - pPrevFileControl->SetEditModifyHdl( Link<>() ); + pPrevFileControl->SetEditModifyHdl( Link<Edit&,void>() ); FileControl* pNewFileControl = dynamic_cast<FileControl*>( pWindow.get() ); if ( pNewFileControl ) @@ -625,7 +625,7 @@ void VCLXFileControl::setText( const OUString& aText ) throw(::com::sun::star::u // also in Java a textChanged is triggered, not in VCL. // ::com::sun::star::awt::Toolkit should be JAVA-compliant... - ModifyHdl( NULL ); + ModifyHdl(); } } @@ -722,13 +722,16 @@ sal_Int16 VCLXFileControl::getMaxTextLen() throw(::com::sun::star::uno::RuntimeE } -IMPL_LINK_NOARG(VCLXFileControl, ModifyHdl) +IMPL_LINK_NOARG_TYPED(VCLXFileControl, ModifyHdl, Edit&, void) +{ + ModifyHdl(); +} + +void VCLXFileControl::ModifyHdl() { ::com::sun::star::awt::TextEvent aEvent; aEvent.Source = static_cast<cppu::OWeakObject*>(this); maTextListeners.textChanged( aEvent ); - - return 1; } ::com::sun::star::awt::Size VCLXFileControl::getMinimumSize() throw(::com::sun::star::uno::RuntimeException, std::exception) diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx index 4a22a96ac409..c180023d28a3 100644 --- a/svx/inc/tbunosearchcontrollers.hxx +++ b/svx/inc/tbunosearchcontrollers.hxx @@ -113,7 +113,7 @@ public: // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException, std::exception ) override; - DECL_LINK(EditModifyHdl, void*); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); private: diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 05a379ebd11b..b28055bc173a 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -286,37 +286,31 @@ void CompressGraphicsDialog::Compress(SvStream& aStream) rFilter.ExportGraphic( aScaledGraphic, OUString( "none" ), aStream, nFilterFormat, &aFilterData ); } -IMPL_LINK_NOARG( CompressGraphicsDialog, NewWidthModifiedHdl ) +IMPL_LINK_NOARG_TYPED( CompressGraphicsDialog, NewWidthModifiedHdl, Edit&, void ) { m_dResolution = m_pMFNewWidth->GetValue() / GetViewWidthInch(); UpdateNewHeightMF(); UpdateResolutionLB(); Update(); - - return 0L; } -IMPL_LINK_NOARG( CompressGraphicsDialog, NewHeightModifiedHdl ) +IMPL_LINK_NOARG_TYPED( CompressGraphicsDialog, NewHeightModifiedHdl, Edit&, void ) { m_dResolution = m_pMFNewHeight->GetValue() / GetViewHeightInch(); UpdateNewWidthMF(); UpdateResolutionLB(); Update(); - - return 0L; } -IMPL_LINK_NOARG( CompressGraphicsDialog, ResolutionModifiedHdl ) +IMPL_LINK_NOARG_TYPED( CompressGraphicsDialog, ResolutionModifiedHdl, Edit&, void ) { m_dResolution = (double) m_pResolutionLB->GetText().toInt32(); UpdateNewWidthMF(); UpdateNewHeightMF(); Update(); - - return 0L; } IMPL_LINK_NOARG_TYPED( CompressGraphicsDialog, ToggleCompressionRB, RadioButton&, void ) diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 81c344b22784..6eedfa8e315c 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -577,13 +577,13 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent) m_pCbAction->SetClickHdl(aLink); m_pCbComment->SetClickHdl(aLink); - Link<> a2Link=LINK( this, SvxTPFilter, ModifyDate); + Link<Edit&,void> a2Link=LINK( this, SvxTPFilter, ModifyDate); m_pDfDate->SetModifyHdl(a2Link); m_pTfDate->SetModifyHdl(a2Link); m_pDfDate2->SetModifyHdl(a2Link); m_pTfDate2->SetModifyHdl(a2Link); - Link<> a3Link=LINK( this, SvxTPFilter, ModifyHdl); + Link<Edit&,void> a3Link=LINK( this, SvxTPFilter, ModifyHdl); m_pEdRange->SetModifyHdl(a3Link); m_pEdComment->SetModifyHdl(a3Link); m_pLbAction->SetSelectHdl(LINK( this, SvxTPFilter, ModifyListBoxHdl)); @@ -907,10 +907,10 @@ void SvxTPFilter::ShowAction(bool bShow) } -IMPL_LINK_TYPED( SvxTPFilter, SelDateHdl, ListBox&, rLb, void ) +IMPL_LINK_NOARG_TYPED( SvxTPFilter, SelDateHdl, ListBox&, void ) { ShowDateFields(static_cast<SvxRedlinDateMode>(m_pLbDate->GetSelectEntryPos())); - ModifyHdl(&rLb); + bModified=true; } IMPL_LINK_TYPED( SvxTPFilter, RowEnableHdl, Button*, pButton, void ) @@ -945,7 +945,8 @@ IMPL_LINK_TYPED( SvxTPFilter, RowEnableHdl, Button*, pButton, void ) m_pEdComment->Invalidate(); } - ModifyHdl(pCB); + if(pCB!=NULL) + bModified=true; } IMPL_LINK_TYPED( SvxTPFilter, TimeHdl, Button*, pButton, void ) @@ -963,22 +964,16 @@ IMPL_LINK_TYPED( SvxTPFilter, TimeHdl, Button*, pButton, void ) m_pDfDate2->SetDate(aDate); m_pTfDate2->SetTime(aTime); } - ModifyHdl(m_pDfDate); + bModified=true; } - -IMPL_LINK( SvxTPFilter, ModifyHdl, void*, pCtr) +IMPL_LINK_NOARG_TYPED( SvxTPFilter, ModifyHdl, Edit&, void) { - if(pCtr!=NULL) - { - bModified=true; - } - return 0; + bModified=true; } IMPL_LINK_NOARG_TYPED( SvxTPFilter, ModifyListBoxHdl, ListBox&, void) { bModified=true; } - void SvxTPFilter::DeactivatePage() { if(bModified) @@ -1026,12 +1021,11 @@ void SvxTPFilter::Disable( bool bChild) Enable( false, bChild ); } -IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) +IMPL_LINK_TYPED( SvxTPFilter, ModifyDate, Edit&, rTF, void) { - Date aDate( Date::SYSTEM ); tools::Time aTime(0); - if (m_pDfDate==pTF) + if (m_pDfDate==&rTF) { if(m_pDfDate->GetText().isEmpty()) m_pDfDate->SetDate(aDate); @@ -1039,7 +1033,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) if(pRedlinTable!=nullptr) pRedlinTable->SetFirstDate(m_pDfDate->GetDate()); } - else if (m_pDfDate2==pTF) + else if (m_pDfDate2==&rTF) { if(m_pDfDate2->GetText().isEmpty()) m_pDfDate2->SetDate(aDate); @@ -1047,7 +1041,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) if(pRedlinTable!=nullptr) pRedlinTable->SetLastDate(m_pDfDate2->GetDate()); } - else if (m_pTfDate==pTF) + else if (m_pTfDate==&rTF) { if(m_pTfDate->GetText().isEmpty()) m_pTfDate->SetTime(aTime); @@ -1055,7 +1049,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) if(pRedlinTable!=nullptr) pRedlinTable->SetFirstTime(m_pTfDate->GetTime()); } - else if (m_pTfDate2==pTF) + else if (m_pTfDate2==&rTF) { if(m_pTfDate2->GetText().isEmpty()) m_pTfDate2->SetTime(aTime); @@ -1064,8 +1058,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) pRedlinTable->SetLastTime(m_pTfDate2->GetTime()); } - ModifyHdl(m_pDfDate); - return 0; + ModifyHdl(*m_pDfDate); } IMPL_LINK_TYPED( SvxTPFilter, RefHandle, Button*, pRef, void ) diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 4b2169c02603..e0834a7d873f 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -393,17 +393,52 @@ void DialControl::SetLinkedField( NumericField* pField, sal_Int32 nDecimalPlaces mpImpl->mnLinkedFieldValueMultiplyer = 100 / std::pow(10.0, double(nDecimalPlaces)); // remove modify handler from old linked field - ImplSetFieldLink( Link<>() ); if( mpImpl->mpLinkField ) - mpImpl->mpLinkField->SetLoseFocusHdl( Link<Control&,void>() ); + { + NumericField& rField = *mpImpl->mpLinkField; + rField.SetModifyHdl( Link<Edit&,void>() ); + rField.SetUpHdl( Link<SpinField&,void>() ); + rField.SetDownHdl( Link<SpinField&,void>() ); + rField.SetFirstHdl( Link<SpinField&,void>() ); + rField.SetLastHdl( Link<SpinField&,void>() ); + rField.SetLoseFocusHdl( Link<Control&,void>() ); + } // remember the new linked field mpImpl->mpLinkField = pField; // set modify handler at new linked field - ImplSetFieldLink( LINK( this, DialControl, LinkedFieldModifyHdl ) ); if( mpImpl->mpLinkField ) - mpImpl->mpLinkField->SetLoseFocusHdl( LINK( this, DialControl, LinkedFieldFocusHdl ) ); + { + NumericField& rField = *mpImpl->mpLinkField; + rField.SetModifyHdl( LINK( this, DialControl, LinkedFieldModifyHdl ) ); + rField.SetUpHdl( LINK(this, DialControl, SpinFieldHdl) ); + rField.SetDownHdl( LINK(this, DialControl, SpinFieldHdl) ); + rField.SetFirstHdl( LINK(this, DialControl, SpinFieldHdl) ); + rField.SetLastHdl( LINK(this, DialControl, SpinFieldHdl) ); + rField.SetLoseFocusHdl( LINK( this, DialControl, LinkedFieldFocusHdl ) ); + } +} +IMPL_LINK_NOARG_TYPED( DialControl, LinkedFieldModifyHdl, Edit&, void ) +{ + LinkedFieldModifyHdl(); +} +IMPL_LINK_NOARG_TYPED( DialControl, LinkedFieldFocusHdl, Control&, void ) +{ + LinkedFieldModifyHdl(); +} +IMPL_LINK_NOARG_TYPED(DialControl, SpinFieldHdl, SpinField&, void) +{ + LinkedFieldModifyHdl(); +} + +void DialControl::LinkedFieldModifyHdl() +{ + if( mpImpl->mpLinkField ) + SetRotation( static_cast< sal_Int32 >( mpImpl->mpLinkField->GetValue() * mpImpl->mnLinkedFieldValueMultiplyer ), false ); } + + + void DialControl::SaveValue() { mpImpl->mnInitialAngle = mpImpl->mnAngle; @@ -466,28 +501,6 @@ void DialControl::SetRotation( sal_Int32 nAngle, bool bBroadcast ) } } -void DialControl::ImplSetFieldLink( const Link<>& rLink ) -{ - if( mpImpl->mpLinkField ) - { - NumericField& rField = *mpImpl->mpLinkField; - rField.SetModifyHdl( rLink ); - rField.SetUpHdl( LINK(this, DialControl, SpinFieldHdl) ); - rField.SetDownHdl( LINK(this, DialControl, SpinFieldHdl) ); - rField.SetFirstHdl( LINK(this, DialControl, SpinFieldHdl) ); - rField.SetLastHdl( LINK(this, DialControl, SpinFieldHdl) ); - } -} - -IMPL_LINK_NOARG_TYPED(DialControl, SpinFieldHdl, SpinField&, void) -{ - if( mpImpl->mpLinkField ) - { - NumericField& rField = *mpImpl->mpLinkField; - rField.GetModifyHdl().Call(&rField); - } -} - void DialControl::HandleMouseEvent( const Point& rPos, bool bInitial ) { long nX = rPos.X() - mpImpl->mnCenterX; @@ -518,22 +531,6 @@ void DialControl::HandleEscapeEvent() } } -IMPL_LINK( DialControl, LinkedFieldModifyHdl, NumericField*, /*pField*/ ) -{ - LinkedFieldModifyHdl(); - return 0; -} -IMPL_LINK_NOARG_TYPED( DialControl, LinkedFieldFocusHdl, Control&, void ) -{ - LinkedFieldModifyHdl(); -} -void DialControl::LinkedFieldModifyHdl() -{ - if( mpImpl->mpLinkField ) - SetRotation( static_cast< sal_Int32 >( mpImpl->mpLinkField->GetValue() * mpImpl->mnLinkedFieldValueMultiplyer ), false ); -} - - DialControlWrapper::DialControlWrapper( DialControl& rDial ) : SingleControlWrapperType( rDial ) diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index 28fefa6a8c59..c355e67648b5 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -251,7 +251,7 @@ SvxFontWorkDialog::SvxFontWorkDialog(SfxBindings *pBindinx, m_pTbxShadow->SetSizePixel(aSize); m_pTbxShadow->SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectShadowHdl_Impl) ); - Link<> aLink = LINK(this, SvxFontWorkDialog, ModifyInputHdl_Impl); + Link<Edit&,void> aLink = LINK(this, SvxFontWorkDialog, ModifyInputHdl_Impl); m_pMtrFldDistance->SetModifyHdl( aLink ); m_pMtrFldTextStart->SetModifyHdl( aLink ); m_pMtrFldShadowX->SetModifyHdl( aLink ); @@ -735,10 +735,9 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void) } } -IMPL_LINK_NOARG(SvxFontWorkDialog, ModifyInputHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, ModifyInputHdl_Impl, Edit&, void) { aInputIdle.Start(); - return 0; } IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, InputTimoutHdl_Impl, Idle *, void) diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 4362446bea18..0108bf66dbbe 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -566,23 +566,19 @@ IMPL_LINK_TYPED( SvxHFPage, TurnOnHdl, Button *, pButton, void ) UpdateExample(); } -IMPL_LINK_NOARG(SvxHFPage, DistModify) +IMPL_LINK_NOARG_TYPED(SvxHFPage, DistModify, Edit&, void) { UpdateExample(); - return 0; } -IMPL_LINK_NOARG(SvxHFPage, HeightModify) +IMPL_LINK_NOARG_TYPED(SvxHFPage, HeightModify, Edit&, void) { UpdateExample(); - - return 0; } -IMPL_LINK_NOARG(SvxHFPage, BorderModify) +IMPL_LINK_NOARG_TYPED(SvxHFPage, BorderModify, Edit&, void) { UpdateExample(); - return 0; } IMPL_LINK_NOARG_TYPED(SvxHFPage, BackgroundHdl, Button*, void) diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 9a6f1030d4ca..b689285554f4 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -685,9 +685,9 @@ IMPL_LINK_TYPED( SvxIMapDlg, GraphSizeHdl, GraphCtrl*, pWnd, void ) IMPL_LINK_NOARG_TYPED(SvxIMapDlg, URLModifyComboBoxHdl, ComboBox&, void) { - URLModifyHdl(nullptr); + URLModifyHdl(*m_pURLBox); } -IMPL_LINK_NOARG(SvxIMapDlg, URLModifyHdl) +IMPL_LINK_NOARG_TYPED(SvxIMapDlg, URLModifyHdl, Edit&, void) { NotifyInfo aNewInfo; @@ -696,8 +696,6 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLModifyHdl) aNewInfo.aMarkTarget = m_pCbbTarget->GetText(); pIMapWnd->ReplaceActualIMapInfo( aNewInfo ); - - return 0; } IMPL_LINK_NOARG_TYPED(SvxIMapDlg, URLLoseFocusHdl, Control&, void) diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index ff47bc16f991..27d0b536f187 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -679,7 +679,7 @@ sal_Int32 SvxLanguageComboBox::ImplGetSavedValue() const } -IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ ) +IMPL_LINK_NOARG_TYPED( SvxLanguageComboBox, EditModifyHdl, Edit&, void ) { EditedAndValid eOldState = meEditedAndValid; OUString aStr( vcl::I18nHelper::filterFormattingChars( GetText())); @@ -755,7 +755,6 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ ) SetControlBackground(); } } - return 0; } diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 8340c0c51d29..d40d3b01de23 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -312,17 +312,16 @@ SfxTabPage::sfxpg SvxGridTabPage::DeactivatePage( SfxItemSet* _pSet ) return LEAVE_PAGE; } -IMPL_LINK( SvxGridTabPage, ChangeDrawHdl_Impl, MetricField *, pField ) +IMPL_LINK_TYPED( SvxGridTabPage, ChangeDrawHdl_Impl, Edit&, rField, void ) { bAttrModified = true; if( pCbxSynchronize->IsChecked() ) { - if(pField == pMtrFldDrawX) + if(&rField == pMtrFldDrawX) pMtrFldDrawY->SetValue( pMtrFldDrawX->GetValue() ); else pMtrFldDrawX->SetValue( pMtrFldDrawY->GetValue() ); } - return 0; } @@ -336,17 +335,16 @@ IMPL_LINK_NOARG_TYPED(SvxGridTabPage, ClickRotateHdl_Impl, Button*, void) -IMPL_LINK( SvxGridTabPage, ChangeDivisionHdl_Impl, NumericField *, pField ) +IMPL_LINK_TYPED( SvxGridTabPage, ChangeDivisionHdl_Impl, Edit&, rField, void ) { bAttrModified = true; if( pCbxSynchronize->IsChecked() ) { - if(pNumFldDivisionX == pField) + if(pNumFldDivisionX == &rField) pNumFldDivisionY->SetValue( pNumFldDivisionX->GetValue() ); else pNumFldDivisionX->SetValue( pNumFldDivisionY->GetValue() ); } - return 0; } diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx index bca9ea1bc39c..8455f7fcdb92 100644 --- a/svx/source/dialog/passwd.cxx +++ b/svx/source/dialog/passwd.cxx @@ -51,7 +51,7 @@ IMPL_LINK_NOARG_TYPED(SvxPasswordDialog, ButtonHdl, Button*, void) -IMPL_LINK_NOARG(SvxPasswordDialog, EditModifyHdl) +IMPL_LINK_NOARG_TYPED(SvxPasswordDialog, EditModifyHdl, Edit&, void) { if ( !bEmpty ) { @@ -63,7 +63,6 @@ IMPL_LINK_NOARG(SvxPasswordDialog, EditModifyHdl) } else if ( !m_pOKBtn->IsEnabled() ) m_pOKBtn->Enable(); - return 0; } @@ -83,7 +82,7 @@ SvxPasswordDialog::SvxPasswordDialog(vcl::Window* pParent, bool bAllowEmptyPassw m_pOKBtn->SetClickHdl( LINK( this, SvxPasswordDialog, ButtonHdl ) ); m_pRepeatPasswdED->SetModifyHdl( LINK( this, SvxPasswordDialog, EditModifyHdl ) ); - EditModifyHdl( 0 ); + EditModifyHdl( *m_pRepeatPasswdED ); if ( bDisableOldPassword ) { diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index b3b3272d9ca6..70ecd3a60bc6 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -248,7 +248,7 @@ SvxRubyDialog::SvxRubyDialog(SfxBindings* pBind, SfxChildWindow* pCW, vcl::Windo m_pScrollSB->SetScrollHdl(aScrLk); m_pScrollSB->SetEndScrollHdl(aScrLk); - Link<> aEditLk(LINK(this, SvxRubyDialog, EditModifyHdl_Impl)); + Link<Edit&,void> aEditLk(LINK(this, SvxRubyDialog, EditModifyHdl_Impl)); Link<sal_Int32,bool> aScrollLk(LINK(this, SvxRubyDialog, EditScrollHdl_Impl)); Link<sal_Int32,void> aJumpLk(LINK(this, SvxRubyDialog, EditJumpHdl_Impl)); for (sal_uInt16 i = 0; i < 8; i++) @@ -669,18 +669,17 @@ IMPL_LINK_NOARG_TYPED(SvxRubyDialog, CharStyleHdl_Impl, ListBox&, void) } } -IMPL_LINK(SvxRubyDialog, EditModifyHdl_Impl, Edit*, pEdit) +IMPL_LINK_TYPED(SvxRubyDialog, EditModifyHdl_Impl, Edit&, rEdit, void) { for (sal_uInt16 i = 0; i < 8; i++) { - if (pEdit == aEditArr[i]) + if (&rEdit == aEditArr[i]) { nCurrentEdit = i / 2; break; } } m_pPreviewWin->Invalidate(); - return 0; } IMPL_LINK_TYPED(SvxRubyDialog, EditScrollHdl_Impl, sal_Int32, nParam, bool) @@ -923,7 +922,7 @@ Size RubyPreview::GetOptimalSize() const void RubyEdit::GetFocus() { - GetModifyHdl().Call(this); + GetModifyHdl().Call(*this); Edit::GetFocus(); } diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 726987297703..d378eaf18ccc 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1165,7 +1165,7 @@ void SvxSearchDialog::ClickHdl_Impl(void* pCtrl) else { EnableControl_Impl(m_pLayoutBtn); - ModifyHdl_Impl(m_pSearchLB); + ModifyHdl_Impl(*m_pSearchLB); } } else @@ -1209,14 +1209,14 @@ void SvxSearchDialog::ClickHdl_Impl(void* pCtrl) // Search-string in place? then enable Buttons bSet = true; - ModifyHdl_Impl(m_pSearchLB); + ModifyHdl_Impl(*m_pSearchLB); } } if (pCtrl == m_pAllSheetsCB) { bSet = true; - ModifyHdl_Impl(m_pSearchLB); + ModifyHdl_Impl(*m_pSearchLB); } if (pCtrl == m_pJapOptionsCB) @@ -1396,17 +1396,17 @@ IMPL_LINK_TYPED( SvxSearchDialog, CommandHdl_Impl, Button *, pBtn, void ) -IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) +IMPL_LINK_TYPED( SvxSearchDialog, ModifyHdl_Impl, Edit&, rEd, void ) { if ( !bSet ) - SetModifyFlag_Impl( pEd ); + SetModifyFlag_Impl( &rEd ); else bSet = false; // Calc allows searching for empty cells. bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SvxSearchApp::CALC); - if ( pEd == m_pSearchLB || pEd == m_pReplaceLB ) + if ( &rEd == m_pSearchLB || &rEd == m_pReplaceLB ) { sal_Int32 nSrchTxtLen = m_pSearchLB->GetText().getLength(); sal_Int32 nReplTxtLen = 0; @@ -1433,7 +1433,6 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) m_pReplaceAllBtn->Disable(); } } - return 0; } @@ -1846,7 +1845,7 @@ IMPL_LINK_TYPED( SvxSearchDialog, FocusHdl_Impl, Control&, rControl, void ) static_cast<ComboBox*>(pCtrl)->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); - ModifyHdl_Impl( static_cast<ComboBox*>(pCtrl) ); + ModifyHdl_Impl( static_cast<Edit&>(*pCtrl) ); if (bFormat && nTxtLen) m_pLayoutBtn->SetText(aLayoutStr); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 549e4fc6330a..d22ed7d48b42 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -290,7 +290,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p m_pLbAmbientlight->SetSelectHdl( aLink2 ); m_pLbShademode->SetSelectHdl( aLink2 ); - Link<> aLink3 = LINK( this, Svx3DWin, ModifyHdl ); + Link<Edit&,void> aLink3 = LINK( this, Svx3DWin, ModifyHdl ); m_pMtrMatSpecularIntensity->SetModifyHdl( aLink3 ); m_pNumHorizontal->SetModifyHdl( aLink3 ); m_pNumVertical->SetModifyHdl( aLink3 ); @@ -2567,34 +2567,30 @@ IMPL_LINK_TYPED( Svx3DWin, SelectHdl, ListBox&, rListBox, void ) } -IMPL_LINK( Svx3DWin, ModifyHdl, void*, pField ) +IMPL_LINK_TYPED( Svx3DWin, ModifyHdl, Edit&, rField, void ) { - if( pField ) - { - bool bUpdatePreview = false; - - // Material - if( pField == m_pMtrMatSpecularIntensity ) - { - bUpdatePreview = true; - } - else if (pField == m_pNumHorizontal) - { - bUpdatePreview = true; - } - else if (pField == m_pNumVertical) - { - bUpdatePreview = true; - } - else if (pField == m_pMtrSlant) - { - bUpdatePreview = true; - } + bool bUpdatePreview = false; - if( bUpdatePreview ) - UpdatePreview(); + // Material + if( &rField == m_pMtrMatSpecularIntensity ) + { + bUpdatePreview = true; + } + else if (&rField == m_pNumHorizontal) + { + bUpdatePreview = true; + } + else if (&rField == m_pNumVertical) + { + bUpdatePreview = true; + } + else if (&rField == m_pMtrSlant) + { + bUpdatePreview = true; } - return 0L; + + if( bUpdatePreview ) + UpdatePreview(); } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 9ab92b114d78..52caf084f1dc 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -3621,7 +3621,7 @@ void FmXEditCell::disposing() m_aTextListeners.disposeAndClear(aEvt); m_aChangeListeners.disposeAndClear(aEvt); - m_pEditImplementation->SetModifyHdl( Link<>() ); + m_pEditImplementation->SetModifyHdl( Link<Edit&,void>() ); if ( m_bOwnEditImplementation ) delete m_pEditImplementation; m_pEditImplementation = NULL; diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx index ede20e829949..08c766c22d79 100644 --- a/svx/source/form/databaselocationinput.cxx +++ b/svx/source/form/databaselocationinput.cxx @@ -245,7 +245,7 @@ namespace svx { ::svt::OFileNotation aFileNotation( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); m_rLocationInput.SetText( aFileNotation.get( ::svt::OFileNotation::N_SYSTEM ) ); - m_rLocationInput.GetModifyHdl().Call( &m_rLocationInput ); + m_rLocationInput.GetModifyHdl().Call( m_rLocationInput ); // the dialog already checked for the file's existence, so we don't need to, again m_bNeedExistenceCheck = false; } diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index f3f000109106..b675f7e5ae26 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2871,10 +2871,9 @@ namespace svxform } - IMPL_LINK_NOARG(AddConditionDialog, ModifyHdl) + IMPL_LINK_NOARG_TYPED(AddConditionDialog, ModifyHdl, Edit&, void) { m_aResultIdle.Start(); - return 0; } diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index 15626163fa8d..3cc54053b00b 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -493,7 +493,7 @@ namespace svxform XFormsUIHelper1_ref m_xUIHelper; XPropertySet_ref m_xBinding; - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(ResultHdl, Idle *, void); DECL_LINK_TYPED(EditHdl, Button*, void); DECL_LINK_TYPED(OKHdl, Button*, void); diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 05c68c49778c..4b5b127fe11a 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -1249,7 +1249,7 @@ IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, v setFillFloatTransparence(aGradientItem); } -IMPL_LINK_NOARG(AreaPropertyPanelBase, ModifyTransparentHdl_Impl) +IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ModifyTransparentHdl_Impl, Edit&, void) { const sal_uInt16 nTrans = (sal_uInt16)mpMTRTransparent->GetValue(); mnLastTransSolid = nTrans; @@ -1262,8 +1262,6 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ModifyTransparentHdl_Impl) const XFillTransparenceItem aLinearItem(nTrans); setFillTransparence(aLinearItem); - - return 0L; } XGradient AreaPropertyPanelBase::GetGradient (const css::awt::GradientStyle eStyle) const diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx index 76b2b28869ba..0a5aa89ed37d 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx @@ -71,7 +71,7 @@ AreaTransparencyGradientControl::AreaTransparencyGradientControl ( maRotRight( SVX_RES(IMG_ROT_RIGHT)), mrAreaPropertyPanel(rPanel) { - Link<> aLink = LINK( this, AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl); + Link<Edit&,void> aLink = LINK( this, AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl); maMtrTrgrCenterX->SetModifyHdl( aLink ); maMtrTrgrCenterY->SetModifyHdl( aLink ); maMtrTrgrAngle->SetModifyHdl( aLink ); @@ -291,12 +291,11 @@ void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, s mrAreaPropertyPanel.setFillFloatTransparence(aGradientItem); } -IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl) +IMPL_LINK_NOARG_TYPED(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl, Edit&, void) { sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100); sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100); ExecuteValueModify( nStartCol, nEndCol ); - return 0L; } IMPL_LINK_NOARG_TYPED(AreaTransparencyGradientControl, Left_Click45_Impl, ToolBox *, void) diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx index 0f3af873d695..bf900d9ae56d 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx @@ -67,7 +67,7 @@ private: Image maRotRight; AreaPropertyPanelBase& mrAreaPropertyPanel; - DECL_LINK( ModifiedTrgrHdl_Impl, void* ); + DECL_LINK_TYPED( ModifiedTrgrHdl_Impl, Edit&, void ); DECL_LINK_TYPED( Left_Click45_Impl, ToolBox*, void ); DECL_LINK_TYPED( Right_Click45_Impl, ToolBox*, void ); }; diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx index 8c64a3677ae4..50f3d308fa5d 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx @@ -149,32 +149,29 @@ void GraphicPropertyPanel::Initialize() -IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyBrightnessHdl ) +IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, ModifyBrightnessHdl, Edit&, void ) { const sal_Int16 nBright = mpMtrBrightness->GetValue(); const SfxInt16Item aBrightItem( SID_ATTR_GRAF_LUMINANCE, nBright ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_LUMINANCE, SfxCallMode::RECORD, &aBrightItem, 0L); - return 0L; } -IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyContrastHdl ) +IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, ModifyContrastHdl, Edit&, void ) { const sal_Int16 nContrast = mpMtrContrast->GetValue(); const SfxInt16Item aContrastItem( SID_ATTR_GRAF_CONTRAST, nContrast ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_CONTRAST, SfxCallMode::RECORD, &aContrastItem, 0L); - return 0L; } -IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl ) +IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, ModifyTransHdl, Edit&, void ) { const sal_Int16 nTrans = mpMtrTrans->GetValue(); const SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_TRANSPARENCE, SfxCallMode::RECORD, &aTransItem, 0L); - return 0L; } @@ -188,42 +185,38 @@ IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, ClickColorModeHdl, ListBox&, void ) -IMPL_LINK_NOARG( GraphicPropertyPanel, RedHdl ) +IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, RedHdl, Edit&, void ) { const sal_Int16 nRed = mpMtrRed->GetValue(); const SfxInt16Item aRedItem( SID_ATTR_GRAF_RED, nRed ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_RED, SfxCallMode::RECORD, &aRedItem, 0L); - return 0L; } -IMPL_LINK_NOARG( GraphicPropertyPanel, GreenHdl ) +IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, GreenHdl, Edit&, void ) { const sal_Int16 nGreen = mpMtrGreen->GetValue(); const SfxInt16Item aGreenItem( SID_ATTR_GRAF_GREEN, nGreen ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_GREEN, SfxCallMode::RECORD, &aGreenItem, 0L); - return 0L; } -IMPL_LINK_NOARG(GraphicPropertyPanel, BlueHdl) +IMPL_LINK_NOARG_TYPED(GraphicPropertyPanel, BlueHdl, Edit&, void) { const sal_Int16 nBlue = mpMtrBlue->GetValue(); const SfxInt16Item aBlueItem( SID_ATTR_GRAF_BLUE, nBlue ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_BLUE, SfxCallMode::RECORD, &aBlueItem, 0L); - return 0L; } -IMPL_LINK_NOARG(GraphicPropertyPanel, GammaHdl) +IMPL_LINK_NOARG_TYPED(GraphicPropertyPanel, GammaHdl, Edit&, void) { const sal_Int32 nGamma = mpMtrGamma->GetValue(); const SfxInt32Item nGammaItem( SID_ATTR_GRAF_GAMMA, nGamma ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_GAMMA, SfxCallMode::RECORD, &nGammaItem, 0L); - return 0L; } diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx index a079ccb05953..8a86d4f36ba3 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx @@ -86,14 +86,14 @@ private: css::uno::Reference<css::frame::XFrame> mxFrame; SfxBindings* mpBindings; - DECL_LINK( ModifyBrightnessHdl, void * ); - DECL_LINK( ModifyContrastHdl, void * ); - DECL_LINK( ModifyTransHdl, void * ); + DECL_LINK_TYPED( ModifyBrightnessHdl, Edit&, void ); + DECL_LINK_TYPED( ModifyContrastHdl, Edit&, void ); + DECL_LINK_TYPED( ModifyTransHdl, Edit&, void ); DECL_LINK_TYPED( ClickColorModeHdl, ListBox&, void ); - DECL_LINK( RedHdl, void*); - DECL_LINK( GreenHdl, void*); - DECL_LINK( BlueHdl, void*); - DECL_LINK( GammaHdl, void*); + DECL_LINK_TYPED( RedHdl, Edit&, void ); + DECL_LINK_TYPED( GreenHdl, Edit&, void ); + DECL_LINK_TYPED( BlueHdl, Edit&, void ); + DECL_LINK_TYPED( GammaHdl, Edit&, void ); void Initialize(); }; diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index b288da9e2b10..3e09d8c93e06 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -260,8 +260,7 @@ void LinePropertyPanelBase::Initialize() mpLBEnd->SetAccessibleName(OUString("Ending Style")); //wj acc mpLBEnd->AdaptDropDownLineCountToMaximum(); - Link<> aLink = LINK(this, LinePropertyPanelBase, ChangeTransparentHdl); - mpMFTransparent->SetModifyHdl(aLink); + mpMFTransparent->SetModifyHdl(LINK(this, LinePropertyPanelBase, ChangeTransparentHdl)); mpMFTransparent->SetAccessibleName(OUString("Transparency")); //wj acc mpTBWidth->SetAccessibleRelationLabeledBy(mpFTWidth); @@ -696,13 +695,12 @@ IMPL_LINK_TYPED(LinePropertyPanelBase, ToolboxWidthSelectHdl,ToolBox*, pToolBox, } } -IMPL_LINK_NOARG( LinePropertyPanelBase, ChangeTransparentHdl ) +IMPL_LINK_NOARG_TYPED( LinePropertyPanelBase, ChangeTransparentHdl, Edit&, void ) { sal_uInt16 nVal = (sal_uInt16)mpMFTransparent->GetValue(); XLineTransparenceItem aItem( nVal ); setLineTransparency(aItem); - return 0L; } VclPtr<PopupControl> LinePropertyPanelBase::CreateLineWidthPopupControl (PopupContainer* pParent) diff --git a/svx/source/sidebar/line/LineWidthControl.cxx b/svx/source/sidebar/line/LineWidthControl.cxx index 26685269c7b5..685ed7abe726 100644 --- a/svx/source/sidebar/line/LineWidthControl.cxx +++ b/svx/source/sidebar/line/LineWidthControl.cxx @@ -170,8 +170,7 @@ void LineWidthControl::Initialize() maVSWidth->SetSelItem(0); maVSWidth->SetSelectHdl(LINK( this, LineWidthControl, VSSelectHdl )); - Link<> aLink = LINK(this, LineWidthControl, MFModifyHdl); - maMFWidth->SetModifyHdl(aLink); + maMFWidth->SetModifyHdl(LINK(this, LineWidthControl, MFModifyHdl)); maVSWidth->StartSelection(); maVSWidth->Show(); @@ -296,9 +295,9 @@ IMPL_LINK_TYPED(LineWidthControl, VSSelectHdl, ValueSet*, pControl, void) } } -IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl) +IMPL_LINK_TYPED(LineWidthControl, MFModifyHdl, Edit&, rControl, void) { - if (pControl == maMFWidth.get()) + if (&rControl == maMFWidth.get()) { if(maVSWidth->GetSelItem()) { @@ -317,7 +316,6 @@ IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl) mbCloseByEdit = true; mnTmpCustomWidth = nTmp; } - return 0L; } } } // end of namespace svx::sidebar diff --git a/svx/source/sidebar/line/LineWidthControl.hxx b/svx/source/sidebar/line/LineWidthControl.hxx index 27be0aa6ec34..faad9d751d31 100644 --- a/svx/source/sidebar/line/LineWidthControl.hxx +++ b/svx/source/sidebar/line/LineWidthControl.hxx @@ -72,7 +72,7 @@ private: void Initialize(); DECL_LINK_TYPED(VSSelectHdl, ValueSet*, void); - DECL_LINK(MFModifyHdl, void *); + DECL_LINK_TYPED(MFModifyHdl, Edit&, void); }; } } // end of namespace svx::sidebar diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index ab4f82bae9dd..12128d72f463 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -76,7 +76,7 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) mpLineDist->SetSelectHdl(aLink3); SelectEntryPos(LLINESPACE_1); - Link<> aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); + Link<Edit&,void> aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); mpLineDistAtPercentBox->SetModifyHdl( aLink2 ); mpLineDistAtMetricBox->SetModifyHdl( aLink2 ); @@ -327,10 +327,9 @@ IMPL_LINK_NOARG_TYPED(ParaLineSpacingControl, LineSPDistHdl_Impl, ListBox&, void ExecuteLineSpace(); } -IMPL_LINK_NOARG( ParaLineSpacingControl, LineSPDistAtHdl_Impl ) +IMPL_LINK_NOARG_TYPED( ParaLineSpacingControl, LineSPDistAtHdl_Impl, Edit&, void ) { ExecuteLineSpace(); - return 0L; } void ParaLineSpacingControl::ExecuteLineSpace() diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx index e9f21788858c..1d27c40c69d1 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx @@ -70,7 +70,7 @@ private: void SelectEntryPos(sal_Int32 nPos); DECL_LINK_TYPED(LineSPDistHdl_Impl, ListBox&, void); - DECL_LINK(LineSPDistAtHdl_Impl, void*); + DECL_LINK_TYPED(LineSPDistAtHdl_Impl, Edit&, void); DECL_LINK_TYPED(PredefinedValuesHandler, Button*, void); }; diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index eb44e60cae7e..aed071486bcd 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -168,7 +168,7 @@ void ParaPropertyPanel::ReSize(bool /* bSize */) void ParaPropertyPanel::InitToolBoxIndent() { - Link<> aLink = LINK( this, ParaPropertyPanel, ModifyIndentHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, ParaPropertyPanel, ModifyIndentHdl_Impl ); mpLeftIndent->SetModifyHdl( aLink ); mpRightIndent->SetModifyHdl( aLink ); mpFLineIndent->SetModifyHdl( aLink ); @@ -191,7 +191,7 @@ void ParaPropertyPanel::InitToolBoxIndent() void ParaPropertyPanel::InitToolBoxSpacing() { - Link<> aLink = LINK( this, ParaPropertyPanel, ULSpaceHdl_Impl ); + Link<Edit&,void> aLink = LINK( this, ParaPropertyPanel, ULSpaceHdl_Impl ); mpTopDist->SetModifyHdl(aLink); mpBottomDist->SetModifyHdl( aLink ); @@ -208,7 +208,7 @@ void ParaPropertyPanel::initial() } // for Paragraph Indent -IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl) +IMPL_LINK_NOARG_TYPED( ParaPropertyPanel, ModifyIndentHdl_Impl, Edit&, void) { SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); aMargin.SetTextLeft( (const long)GetCoreValue( *mpLeftIndent, m_eLRSpaceUnit ) ); @@ -217,7 +217,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl) GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, &aMargin, 0L); - return 0; } IMPL_LINK_TYPED(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, void) @@ -300,7 +299,7 @@ IMPL_LINK_TYPED(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pCont } // for Paragraph Spacing -IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl) +IMPL_LINK_NOARG_TYPED( ParaPropertyPanel, ULSpaceHdl_Impl, Edit&, void) { SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); aMargin.SetUpper( (sal_uInt16)GetCoreValue( *mpTopDist, m_eULSpaceUnit ) ); @@ -308,7 +307,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl) GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, &aMargin, 0L); - return 0L; } // for Paragraph State change diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 4182ac883c21..70a2c20fa0f6 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -113,9 +113,9 @@ private: SfxBindings* mpBindings; css::uno::Reference<css::ui::XSidebar> mxSidebar; - DECL_LINK(ModifyIndentHdl_Impl, void*); + DECL_LINK_TYPED(ModifyIndentHdl_Impl, Edit&, void); DECL_LINK_TYPED(ClickIndent_IncDec_Hdl_Impl, ToolBox*, void); - DECL_LINK(ULSpaceHdl_Impl, void*); + DECL_LINK_TYPED(ULSpaceHdl_Impl, Edit&, void); void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 10b95b2bea98..5bb2310a834b 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -408,7 +408,7 @@ void PosSizePropertyPanel::HandleContextChange( -IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthHdl ) +IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, ChangeWidthHdl, Edit&, void ) { if( mpCbxScale->IsChecked() && mpCbxScale->IsEnabled() ) @@ -427,12 +427,11 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthHdl ) } } executeSize(); - return 0; } -IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightHdl ) +IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, ChangeHeightHdl, Edit&, void ) { if( mpCbxScale->IsChecked() && mpCbxScale->IsEnabled() ) @@ -451,23 +450,20 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightHdl ) } } executeSize(); - return 0; } -IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl ) +IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, ChangePosXHdl, Edit&, void ) { executePosX(); - return 0; } -IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl ) +IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, ChangePosYHdl, Edit&, void ) { executePosY(); - return 0; } @@ -487,21 +483,21 @@ IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, ClickAutoHdl, Button*, void ) -IMPL_LINK_NOARG( PosSizePropertyPanel, AngleModifiedHdl ) +IMPL_LINK_NOARG_TYPED( PosSizePropertyPanel, AngleModifiedHdl, Edit&, void ) { OUString sTmp = mpMtrAngle->GetText(); if (sTmp.isEmpty()) - return 0; + return; sal_Unicode nChar = sTmp[0]; if( nChar == '-' ) { if (sTmp.getLength() < 2) - return 0; + return; nChar = sTmp[1]; } if( (nChar < '0') || (nChar > '9') ) - return 0; + return; const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0]; @@ -514,7 +510,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, AngleModifiedHdl ) rtl_math_ConversionStatus eStatus; double fTmp = rtl::math::stringToDouble( sTmp, cSep, 0, &eStatus); if (eStatus != rtl_math_ConversionStatus_Ok) - return 0; + return; while (fTmp < 0) fTmp += 360; @@ -529,8 +525,6 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, AngleModifiedHdl ) GetBindings()->GetDispatcher()->Execute( SID_ATTR_TRANSFORM, SfxCallMode::RECORD, &aAngleItem, &aRotXItem, &aRotYItem, 0L ); - - return 0; } diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 2c1791cb7be4..34a646d10ffc 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -36,6 +36,7 @@ class FixedText; class MetricField; class CheckBox; class MetricBox; +class Edit; namespace svx { class DialControl; @@ -150,12 +151,12 @@ private: css::uno::Reference<css::ui::XSidebar> mxSidebar; - DECL_LINK( ChangePosXHdl, void * ); - DECL_LINK( ChangePosYHdl, void * ); - DECL_LINK( ChangeWidthHdl, void * ); - DECL_LINK( ChangeHeightHdl, void * ); + DECL_LINK_TYPED( ChangePosXHdl, Edit&, void ); + DECL_LINK_TYPED( ChangePosYHdl, Edit&, void ); + DECL_LINK_TYPED( ChangeWidthHdl, Edit&, void ); + DECL_LINK_TYPED( ChangeHeightHdl, Edit&, void ); DECL_LINK_TYPED( ClickAutoHdl, Button*, void ); - DECL_LINK( AngleModifiedHdl, void * ); + DECL_LINK_TYPED( AngleModifiedHdl, Edit&, void ); DECL_LINK_TYPED( RotationHdl, svx::DialControl*, void ); DECL_LINK_TYPED( FlipHdl, ToolBox *, void ); diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx index e606b8b6ee65..36dfb519b9e2 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx @@ -155,13 +155,12 @@ IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ModifyShadowColorHdl, ListBox&, void) GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_COLOR, SfxCallMode::RECORD, &aItem, 0L); } -IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransMetricHdl) +IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ModifyShadowTransMetricHdl, Edit&, void) { sal_uInt16 nVal = mpShadowTransMetric->GetValue(); SetTransparencyValue(nVal); SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_TRANSPARENCE, SfxCallMode::RECORD, &aItem , 0L); - return 0; } IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ModifyShadowTransSliderHdl, Slider*, void) @@ -172,7 +171,7 @@ IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ModifyShadowTransSliderHdl, Slider*, GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_TRANSPARENCE, SfxCallMode::RECORD, &aItem, 0L); } -IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl) +IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ModifyShadowDistanceHdl, Edit&, void) { OUString sAngle = mpShadowAngle->GetText(); nXY = mpShadowDistance->GetValue(FUNIT_100TH_MM); @@ -191,7 +190,6 @@ IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowDistanceHdl) SdrMetricItem aYItem(makeSdrShadowYDistItem(nY)); GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_XDISTANCE, SfxCallMode::RECORD, &aXItem, 0L); GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_YDISTANCE, SfxCallMode::RECORD, &aYItem, 0L); - return 0; } void ShadowPropertyPanel::UpdateControls() diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx index 22c008601602..689a9bdfb95b 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx @@ -82,8 +82,8 @@ private: void UpdateControls(); DECL_LINK_TYPED(ClickShadowHdl, Button*, void); DECL_LINK_TYPED(ModifyShadowColorHdl, ListBox&, void); - DECL_LINK(ModifyShadowTransMetricHdl, void*); - DECL_LINK(ModifyShadowDistanceHdl, void*); + DECL_LINK_TYPED(ModifyShadowTransMetricHdl, Edit&, void); + DECL_LINK_TYPED(ModifyShadowDistanceHdl, Edit&, void); DECL_LINK_TYPED(ModifyShadowTransSliderHdl, Slider*, void); }; } diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx index 0d2fe06d1161..e903a8c38073 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx @@ -400,10 +400,10 @@ IMPL_LINK_NOARG_TYPED(TextCharacterSpacingControl, KerningSelectHdl, ListBox&, v Invalidate(); maVSSpacing->StartSelection(); } - KerningModifyHdl( NULL ); + KerningModifyHdl( *maEditKerning ); } -IMPL_LINK(TextCharacterSpacingControl, KerningModifyHdl, MetricField*,) +IMPL_LINK_NOARG_TYPED(TextCharacterSpacingControl, KerningModifyHdl, Edit&, void) { if ( maVSSpacing->GetSelectItemId() > 0 ) { @@ -450,7 +450,6 @@ IMPL_LINK(TextCharacterSpacingControl, KerningModifyHdl, MetricField*,) } SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING); mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L); - return 0; } }} // end of namespace sidebar diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx index c932fa9f2f3c..b52d2d0d8250 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx @@ -88,7 +88,7 @@ private: void initial(); DECL_LINK_TYPED(VSSelHdl, ValueSet*, void); DECL_LINK_TYPED(KerningSelectHdl, ListBox&, void); - DECL_LINK(KerningModifyHdl, MetricField*); + DECL_LINK_TYPED(KerningModifyHdl, Edit&, void); }; }} diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 0d7e707d5f53..b7e71b5bee98 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -179,7 +179,7 @@ void FindTextFieldControl::SetTextToSelected_Impl() { // If something is selected in the document, prepopulate with this SetText( aString ); - GetModifyHdl().Call(this); // FIXME why SetText doesn't trigger this? + GetModifyHdl().Call(*this); // FIXME why SetText doesn't trigger this? } else if (GetEntryCount() > 0) { @@ -489,7 +489,7 @@ void SAL_CALL FindTextToolbarController::statusChanged( const css::frame::Featur } } -IMPL_LINK_NOARG(FindTextToolbarController, EditModifyHdl) +IMPL_LINK_NOARG_TYPED(FindTextToolbarController, EditModifyHdl, Edit&, void) { // enable or disable item DownSearch/UpSearch of findbar vcl::Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); @@ -511,8 +511,6 @@ IMPL_LINK_NOARG(FindTextToolbarController, EditModifyHdl) pToolBox->EnableItem(m_nUpSearchId, false); } } - - return 0; } UpDownSearchToolboxController::UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType ) diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 882c6921d0e1..7d9ab48f50ce 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -624,10 +624,9 @@ IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, EditFieldsListBoxHdl, ListBox&, v { updateButtons(); } -IMPL_LINK_NOARG(ChineseDictionaryDialog, EditFieldsHdl) +IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, EditFieldsHdl, Edit&, void) { updateButtons(); - return 0; } IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, MappingSelectHdl, SvTreeListBox*, void) { diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index 1a4c80aa5b63..4c048f8c302c 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -124,8 +124,8 @@ public: private: DECL_LINK_TYPED( DirectionHdl, Button*, void ); - DECL_LINK(EditFieldsHdl, void *); - DECL_LINK_TYPED(EditFieldsListBoxHdl, ListBox&, void); + DECL_LINK_TYPED( EditFieldsHdl, Edit&, void ); + DECL_LINK_TYPED( EditFieldsListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( MappingSelectHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( AddHdl, Button*, void ); DECL_LINK_TYPED( ModifyHdl, Button*, void ); diff --git a/sw/inc/colwd.hxx b/sw/inc/colwd.hxx index 98e69ad60302..fed2b5375c78 100644 --- a/sw/inc/colwd.hxx +++ b/sw/inc/colwd.hxx @@ -34,7 +34,7 @@ class SwTableWidthDlg : public SvxStandardDialog protected: virtual void Apply() override; - DECL_LINK(LoseFocusHdl, void * = 0); + DECL_LINK_TYPED(LoseFocusHdl, Edit&, void); public: SwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rFnc ); diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index 1342a77e5909..bdadb73b990f 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -79,10 +79,9 @@ IMPL_LINK_TYPED( SwBreakDlg, PageNumHdl, Button*, pBox, void ) } // By changing the Page number the checkbox is checked. -IMPL_LINK_NOARG(SwBreakDlg, PageNumModifyHdl) +IMPL_LINK_NOARG_TYPED(SwBreakDlg, PageNumModifyHdl, Edit&, void) { m_pPageNumBox->Check(); - return 0; } /* diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 6ee99f411b8a..f6c75f66bd36 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -575,7 +575,7 @@ SwDropCapsPage::SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pPict->SetBorderStyle( WindowBorderStyle::MONO ); // Install handler - Link<> aLk = LINK(this, SwDropCapsPage, ModifyHdl); + Link<Edit&,void> aLk = LINK(this, SwDropCapsPage, ModifyHdl); m_pDropCapsField->SetModifyHdl( aLk ); m_pLinesField->SetModifyHdl( aLk ); m_pDistanceField->SetModifyHdl( aLk ); @@ -698,7 +698,7 @@ IMPL_LINK_NOARG_TYPED(SwDropCapsPage, ClickHdl, Button*, void) if ( bChecked ) { - ModifyHdl(m_pDropCapsField); + ModifyHdl(*m_pDropCapsField); m_pDropCapsField->GrabFocus(); } else @@ -712,17 +712,17 @@ IMPL_LINK_NOARG_TYPED(SwDropCapsPage, WholeWordHdl, Button*, void) m_pDropCapsField->Enable( !m_pWholeWordCB->IsChecked() ); m_pSwitchText->Enable(!m_pWholeWordCB->IsChecked()); - ModifyHdl(m_pDropCapsField); + ModifyHdl(*m_pDropCapsField); bModified = true; } -IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SwDropCapsPage, ModifyHdl, Edit&, rEdit, void ) { OUString sPreview; // set text if applicable - if (pEdit == m_pDropCapsField) + if (&rEdit == m_pDropCapsField) { const sal_Int32 nVal = !m_pWholeWordCB->IsChecked() ? static_cast<sal_Int32>(m_pDropCapsField->GetValue()) @@ -748,7 +748,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) if (bSetText) m_pTextEdit->SetText(sPreview); } - else if (pEdit == m_pTextEdit) // set quantity if applicable + else if (&rEdit == m_pTextEdit) // set quantity if applicable { const sal_Int32 nTmp = m_pTextEdit->GetText().getLength(); m_pDropCapsField->SetValue(std::max<sal_Int32>(1, nTmp)); @@ -756,16 +756,14 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) } // adjust image - if (pEdit == m_pDropCapsField || pEdit == m_pTextEdit) + if (&rEdit == m_pDropCapsField || &rEdit == m_pTextEdit) m_pPict->SetText (sPreview); - else if (pEdit == m_pLinesField) + else if (&rEdit == m_pLinesField) m_pPict->SetLines((sal_uInt8)m_pLinesField->GetValue()); else m_pPict->SetDistance((sal_uInt16)m_pDistanceField->Denormalize(m_pDistanceField->GetValue(FUNIT_TWIP))); bModified = true; - - return 0; } IMPL_LINK_NOARG_TYPED(SwDropCapsPage, SelectHdl, ListBox&, void) diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index e6574716be33..784206bcfa82 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -526,7 +526,7 @@ SwCaptionOptPage::SwCaptionOptPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pLbLevel->SelectEntryPos( nLvl < MAXLEVEL ? nLvl + 1 : 0 ); m_pEdDelim->SetText( sDelim ); - Link<> aLk = LINK( this, SwCaptionOptPage, ModifyHdl ); + Link<Edit&,void> aLk = LINK( this, SwCaptionOptPage, ModifyHdl ); m_pCategoryBox->SetModifyHdl( aLk ); m_pNumberingSeparatorED->SetModifyHdl( aLk ); m_pTextEdit->SetModifyHdl( aLk ); @@ -647,7 +647,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet* rSet) } m_pLbCaptionOrder->SelectEntryPos( SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst() ? 1 : 0); - ModifyHdl(); + ModifyHdl(*m_pCategoryBox); } void SwCaptionOptPage::SetOptions(const sal_uLong nPos, @@ -783,7 +783,7 @@ IMPL_LINK_NOARG_TYPED(SwCaptionOptPage, ShowEntryHdl, SvTreeListBox*, void) m_pApplyBorderCB->Check( pOpt->CopyAttributes() ); } - ModifyHdl(); + ModifyHdl(*m_pCategoryBox); } IMPL_LINK_NOARG_TYPED(SwCaptionOptPage, SaveEntryHdl, SvTreeListBox*, void) @@ -822,7 +822,7 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry) } } -IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwCaptionOptPage, ModifyHdl, Edit&, void) { const OUString sFieldTypeName = m_pCategoryBox->GetText(); @@ -838,7 +838,6 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl) m_pTextEdit->Enable(bEnable); InvalidatePreview(); - return 0; } IMPL_LINK_NOARG_TYPED(SwCaptionOptPage, SelectHdl, ComboBox&, void) diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 54575fc5e718..3e5419f14c21 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -594,7 +594,7 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent, pLabelBox ->SetLoseFocusHdl( aFocusLink ); pIdxBox ->SetLoseFocusHdl( aFocusLink ); - Link<> aModifyHeightLink( LINK( this, SwStdFontTabPage, ModifyHeightHdl)); + Link<Edit&,void> aModifyHeightLink( LINK( this, SwStdFontTabPage, ModifyHeightHdl)); pStandardHeightLB->SetModifyHdl( aModifyHeightLink ); pTitleHeightLB-> SetModifyHdl( aModifyHeightLink ); pListHeightLB-> SetModifyHdl( aModifyHeightLink ); @@ -1006,11 +1006,11 @@ IMPL_LINK_NOARG_TYPED(SwStdFontTabPage, StandardHdl, Button*, void) SFX_MAPUNIT_TWIP, 10 )); } -IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox ) +IMPL_LINK_TYPED( SwStdFontTabPage, ModifyHdl, Edit&, rBox, void ) { - if(pBox == pStandardBox) + if(&rBox == pStandardBox) { - const OUString sEntry = pBox->GetText(); + const OUString sEntry = rBox.GetText(); if(bSetListDefault && bListDefault) pListBox->SetText(sEntry); if(bSetLabelDefault && bLabelDefault) @@ -1018,26 +1018,25 @@ IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox ) if(bSetIdxDefault && bIdxDefault) pIdxBox->SetText(sEntry); } - else if(pBox == pListBox) + else if(&rBox == pListBox) { bSetListDefault = false; } - else if(pBox == pLabelBox) + else if(&rBox == pLabelBox) { bSetLabelDefault = false; } - else if(pBox == pIdxBox) + else if(&rBox == pIdxBox) { bSetIdxDefault = false; } - return 0; } -IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox ) +IMPL_LINK_TYPED( SwStdFontTabPage, ModifyHeightHdl, Edit&, rBox, void ) { - if(pBox == pStandardHeightLB) + if(&rBox == pStandardHeightLB) { - sal_Int64 nValue = pBox->GetValue(FUNIT_TWIP); + sal_Int64 nValue = static_cast<FontSizeBox&>(rBox).GetValue(FUNIT_TWIP); if(bSetListHeightDefault && bListHeightDefault) pListHeightLB->SetValue(nValue, FUNIT_TWIP); if(bSetLabelHeightDefault && bLabelHeightDefault) @@ -1045,19 +1044,18 @@ IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox ) if(bSetIndexHeightDefault && bIndexHeightDefault) pIndexHeightLB->SetValue(nValue, FUNIT_TWIP); } - else if(pBox == pListHeightLB) + else if(&rBox == pListHeightLB) { bSetListHeightDefault = false; } - else if(pBox == pLabelHeightLB) + else if(&rBox == pLabelHeightLB) { bSetLabelHeightDefault = false; } - else if(pBox == pIndexHeightLB) + else if(&rBox == pIndexHeightLB) { bSetIndexHeightDefault = false; } - return 0; } IMPL_LINK_TYPED( SwStdFontTabPage, LoseFocusHdl, Control&, rControl, void ) diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 486fecc93b38..d108103ce461 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -61,7 +61,7 @@ class SwAddressControl_Impl : public Control DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void); DECL_LINK_TYPED(GotFocusHdl_Impl, Control&, void); - DECL_LINK(EditModifyHdl_Impl, Edit*); + DECL_LINK_TYPED(EditModifyHdl_Impl, Edit&, void); void MakeVisible(const Rectangle& aRect); @@ -174,7 +174,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) long nFTYPos = nEDYPos + nEDHeight - nFTHeight; Link<Control&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl); - Link<> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl); + Link<Edit&,void> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl); Edit* pLastEdit = 0; sal_Int32 nVisibleLines = 0; sal_uIntPtr nLines = 0; @@ -299,17 +299,16 @@ void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect) } // copy data changes into database -IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, Edit*, pEdit) +IMPL_LINK_TYPED(SwAddressControl_Impl, EditModifyHdl_Impl, Edit&, rEdit, void) { //get the data element number of the current set - sal_Int32 nIndex = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEdit->GetData()); + sal_Int32 nIndex = (sal_Int32)reinterpret_cast<sal_IntPtr>(rEdit.GetData()); //get the index of the set OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" ); if(m_pData->aDBData.size() > m_nCurrentDataSet) { - m_pData->aDBData[m_nCurrentDataSet][nIndex] = pEdit->GetText(); + m_pData->aDBData[m_nCurrentDataSet][nIndex] = rEdit.GetText(); } - return 0; } void SwAddressControl_Impl::SetCursorTo(sal_uInt32 nElement) @@ -681,15 +680,14 @@ IMPL_LINK_TYPED(SwCreateAddressListDialog, DBCursorHdl_Impl, Button*, pButton, v if(nValue != m_pSetNoNF->GetValue()) { m_pSetNoNF->SetValue(nValue); - DBNumCursorHdl_Impl(m_pSetNoNF); + DBNumCursorHdl_Impl(*m_pSetNoNF); } } -IMPL_LINK_NOARG(SwCreateAddressListDialog, DBNumCursorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwCreateAddressListDialog, DBNumCursorHdl_Impl, Edit&, void) { m_pAddressControl->SetCurrentDataSet( static_cast< sal_uInt32 >(m_pSetNoNF->GetValue() - 1) ); UpdateButtons(); - return 0; } void SwCreateAddressListDialog::UpdateButtons() @@ -788,10 +786,9 @@ IMPL_LINK_NOARG_TYPED(SwFindEntryDialog, FindHdl_Impl, Button*, void) m_pParent->Find(m_pFindED->GetText(), nColumn); } -IMPL_LINK_NOARG(SwFindEntryDialog, FindEnableHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwFindEntryDialog, FindEnableHdl_Impl, Edit&, void) { m_pFindPB->Enable(!m_pFindED->GetText().isEmpty()); - return 0; } IMPL_LINK_NOARG_TYPED(SwFindEntryDialog, CloseHdl_Impl, Button*, void) diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx index 8e291c57261e..0fced148e5fe 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hxx +++ b/sw/source/ui/dbui/createaddresslistdialog.hxx @@ -68,7 +68,7 @@ class SwCreateAddressListDialog : public SfxModalDialog DECL_LINK_TYPED(CustomizeHdl_Impl, Button*, void); DECL_LINK_TYPED(OkHdl_Impl, Button*, void); DECL_LINK_TYPED(DBCursorHdl_Impl, Button*, void); - DECL_LINK(DBNumCursorHdl_Impl, void *); + DECL_LINK_TYPED(DBNumCursorHdl_Impl, Edit&, void); void UpdateButtons(); @@ -94,7 +94,7 @@ class SwFindEntryDialog : public ModelessDialog VclPtr<SwCreateAddressListDialog> m_pParent; DECL_LINK_TYPED(FindHdl_Impl, Button*, void); - DECL_LINK(FindEnableHdl_Impl, void *); + DECL_LINK_TYPED(FindEnableHdl_Impl, Edit&, void); DECL_LINK_TYPED(CloseHdl_Impl, Button*, void); public: diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index b935b6394374..7eb46bd9a09e 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -188,7 +188,7 @@ SwAddRenameEntryDialog::SwAddRenameEntryDialog( get(m_pOK, "ok"); get(m_pFieldNameED, "entry"); m_pFieldNameED->SetModifyHdl(LINK(this, SwAddRenameEntryDialog, ModifyHdl_Impl)); - ModifyHdl_Impl(m_pFieldNameED); + ModifyHdl_Impl(*m_pFieldNameED); } SwAddRenameEntryDialog::~SwAddRenameEntryDialog() @@ -203,9 +203,9 @@ void SwAddRenameEntryDialog::dispose() SfxModalDialog::dispose(); } -IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) +IMPL_LINK_TYPED(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit&, rEdit, void) { - OUString sEntry = pEdit->GetText(); + OUString sEntry = rEdit.GetText(); bool bFound = sEntry.isEmpty(); if(!bFound) @@ -221,7 +221,6 @@ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) } } m_pOK->Enable(!bFound); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx index c242ea43429a..c0d58660b906 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx @@ -60,7 +60,7 @@ class SwAddRenameEntryDialog : public SfxModalDialog VclPtr<OKButton> m_pOK; const std::vector< OUString >& m_rCSVHeader; - DECL_LINK(ModifyHdl_Impl, Edit*); + DECL_LINK_TYPED(ModifyHdl_Impl, Edit&, void); protected: SwAddRenameEntryDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, const std::vector< OUString >& rCSVHeader); diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 4382ec17ff17..3eaf0e8d1bef 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -549,7 +549,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( m_pAddressElementsLB->SetSelectHdl(LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl )); m_pDragED->SetModifyHdl(LINK(this, SwCustomizeAddressBlockDialog, EditModifyHdl_Impl)); m_pDragED->SetSelectionChangedHdl( LINK( this, SwCustomizeAddressBlockDialog, SelectionChangedHdl_Impl)); - Link<> aFieldsLink = LINK(this, SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl); + Link<Edit&,void> aFieldsLink = LINK(this, SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl); m_pFieldCB->SetModifyHdl(aFieldsLink); m_pFieldCB->SetSelectHdl(LINK(this, SwCustomizeAddressBlockDialog, FieldChangeComboBoxHdl_Impl)); Link<Button*,void> aImgButtonHdl = LINK(this, SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl); @@ -598,11 +598,10 @@ IMPL_LINK_TYPED(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, SvTreeList m_pInsertFieldIB->Enable(nUserData >= 0 || !HasItem_Impl(nUserData)); } -IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, EditModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwCustomizeAddressBlockDialog, EditModifyHdl_Impl, Edit&, void) { m_pPreviewWIN->SetAddress(SwAddressPreview::FillData(GetAddress(), m_rConfigItem)); UpdateImageButtons_Impl(); - return 0; } IMPL_LINK_TYPED(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, Button*, pButton, void) @@ -722,9 +721,9 @@ IMPL_LINK_TYPED(SwCustomizeAddressBlockDialog, SelectionChangedHdl_Impl, Address IMPL_LINK_NOARG_TYPED(SwCustomizeAddressBlockDialog, FieldChangeComboBoxHdl_Impl, ComboBox&, void) { - FieldChangeHdl_Impl(nullptr); + FieldChangeHdl_Impl(*m_pFieldCB); } -IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl, Edit&, void) { //changing the field content changes the related members, too sal_Int32 nSelected = GetSelectedItem_Impl(); @@ -743,7 +742,6 @@ IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl) UpdateImageButtons_Impl(); m_pPreviewWIN->SetAddress(GetAddress()); m_pDragED->Modify(); - return 0; } void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl() diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index b4abb2befb2e..f91287a8b667 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -222,10 +222,10 @@ private: DECL_LINK_TYPED(OKHdl_Impl, Button*, void); DECL_LINK_TYPED(ListBoxSelectHdl_Impl, SvTreeListBox*, void); - DECL_LINK(EditModifyHdl_Impl, void *); + DECL_LINK_TYPED(EditModifyHdl_Impl, Edit&, void); DECL_LINK_TYPED(ImageButtonHdl_Impl, Button*, void); DECL_LINK_TYPED(SelectionChangedHdl_Impl, AddressMultiLineEdit&, void); - DECL_LINK(FieldChangeHdl_Impl, void *); + DECL_LINK_TYPED(FieldChangeHdl_Impl, Edit&, void); DECL_LINK_TYPED(FieldChangeComboBoxHdl_Impl, ComboBox&, void); bool HasItem_Impl(sal_Int32 nUserData); diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 7cd8d128175a..87cbd05e3038 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -139,10 +139,9 @@ IMPL_LINK_TYPED(SwMailMergeGreetingsPage, AssignHdl_Impl, Button*, pButton, void } } -IMPL_LINK_NOARG(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl, Edit&, void) { UpdatePreview(); - return 0; } IMPL_LINK_NOARG_TYPED(SwMailMergeGreetingsPage, GreetingSelectListBoxHdl_Impl, ListBox&, void) { @@ -267,7 +266,7 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* _pParent) m_pFemalePB->SetClickHdl(aGreetingLink); m_pMalePB->SetClickHdl(aGreetingLink); m_pAssignPB->SetClickHdl(LINK(this, SwMailMergeGreetingsPage, AssignHdl_Impl)); - Link<> aLBoxLink = LINK(this, SwMailMergeGreetingsPage, GreetingSelectHdl_Impl); + Link<Edit&,void> aLBoxLink = LINK(this, SwMailMergeGreetingsPage, GreetingSelectHdl_Impl); Link<ListBox&,void> aLBoxLink2 = LINK(this, SwMailMergeGreetingsPage, GreetingSelectListBoxHdl_Impl); m_pFemaleLB->SetSelectHdl(aLBoxLink2); m_pMaleLB->SetSelectHdl(aLBoxLink2); diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx index f0edeaaa6d43..95cfd17219fb 100644 --- a/sw/source/ui/dbui/mmgreetingspage.hxx +++ b/sw/source/ui/dbui/mmgreetingspage.hxx @@ -81,7 +81,7 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage, DECL_LINK_TYPED(ContainsHdl_Impl, Button*, void); DECL_LINK_TYPED(InsertDataHdl_Impl, Button*, void); - DECL_LINK(GreetingSelectHdl_Impl, void *); + DECL_LINK_TYPED(GreetingSelectHdl_Impl, Edit&, void); DECL_LINK_TYPED(GreetingSelectComboBoxHdl_Impl, ComboBox&, void); DECL_LINK_TYPED(GreetingSelectListBoxHdl_Impl, ListBox&, void); DECL_LINK_TYPED(AssignHdl_Impl, Button*, void); diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 92ebab67c332..6aad4e4211d8 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -119,7 +119,7 @@ static OUString lcl_GetColumnValueOf(const OUString& rColumn, Reference < contai class SwSaveWarningBox_Impl : public SwMessageAndEditDialog { - DECL_LINK( ModifyHdl, Edit*); + DECL_LINK_TYPED( ModifyHdl, Edit&, void); public: SwSaveWarningBox_Impl(vcl::Window* pParent, const OUString& rFileName); @@ -132,7 +132,7 @@ public: class SwSendQueryBox_Impl : public SwMessageAndEditDialog { bool bIsEmptyAllowed; - DECL_LINK( ModifyHdl, Edit*); + DECL_LINK_TYPED( ModifyHdl, Edit&, void); public: SwSendQueryBox_Impl(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription); @@ -140,7 +140,7 @@ public: void SetValue(const OUString& rSet) { m_pEdit->SetText(rSet); - ModifyHdl(m_pEdit); + ModifyHdl(*m_pEdit); } OUString GetValue() const @@ -151,7 +151,7 @@ public: void SetIsEmptyTextAllowed(bool bSet) { bIsEmptyAllowed = bSet; - ModifyHdl(m_pEdit); + ModifyHdl(*m_pEdit); } }; @@ -166,13 +166,12 @@ SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(vcl::Window* pParent, const OUStrin m_pPrimaryMessage->SetText(m_pPrimaryMessage->GetText().replaceAll("%1", aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET))); - ModifyHdl(m_pEdit); + ModifyHdl(*m_pEdit); } -IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED( SwSaveWarningBox_Impl, ModifyHdl, Edit&, rEdit, void) { - m_pOKPB->Enable(!pEdit->GetText().isEmpty()); - return 0; + m_pOKPB->Enable(!rEdit.GetText().isEmpty()); } SwSendQueryBox_Impl::SwSendQueryBox_Impl(vcl::Window* pParent, const OUString& rID, @@ -182,13 +181,12 @@ SwSendQueryBox_Impl::SwSendQueryBox_Impl(vcl::Window* pParent, const OUString& r { m_pImageIM->SetImage(QueryBox::GetStandardImage()); m_pEdit->SetModifyHdl(LINK(this, SwSendQueryBox_Impl, ModifyHdl)); - ModifyHdl(m_pEdit); + ModifyHdl(*m_pEdit); } -IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED( SwSendQueryBox_Impl, ModifyHdl, Edit&, rEdit, void) { - m_pOKPB->Enable(bIsEmptyAllowed || !pEdit->GetText().isEmpty()); - return 0; + m_pOKPB->Enable(bIsEmptyAllowed || !rEdit.GetText().isEmpty()); } class SwCopyToDialog : public SfxModalDialog diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index cbcf5f8d47f3..7b8d649fc7f5 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -55,7 +55,7 @@ SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pP m_pPrevPB->SetClickHdl( aMoveLink ); m_pNextPB->SetClickHdl( aMoveLink ); m_pLastPB->SetClickHdl( aMoveLink ); - m_pRecordED->SetModifyHdl( LINK( this, SwMailMergePrepareMergePage, MoveHdl_Impl) ); + m_pRecordED->SetModifyHdl( LINK( this, SwMailMergePrepareMergePage, MoveEditHdl_Impl) ); m_pExcludeCB->SetClickHdl(LINK(this, SwMailMergePrepareMergePage, ExcludeHdl_Impl)); MoveHdl_Impl(m_pRecordED); } @@ -88,7 +88,11 @@ IMPL_LINK_TYPED( SwMailMergePrepareMergePage, MoveClickHdl_Impl, Button*, pCtrl, { MoveHdl_Impl(pCtrl); } -IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) +IMPL_LINK_TYPED( SwMailMergePrepareMergePage, MoveEditHdl_Impl, Edit&, rEdit, void) +{ + MoveHdl_Impl(&rEdit); +} +void SwMailMergePrepareMergePage:: MoveHdl_Impl(Control* pCtrl) { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); sal_Int32 nPos = rConfigItem.GetResultSetPosition(); @@ -135,7 +139,6 @@ IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) SwWrtShell& rSh = m_pWizard->GetSwView()->GetWrtShell(); SwMergeDescriptor aMergeDesc( DBMGR_MERGE, rSh, aDescriptor ); rSh.GetDBManager()->MergeNew(aMergeDesc); - return 0; } IMPL_LINK_TYPED( SwMailMergePrepareMergePage, ExcludeHdl_Impl, Button*, pBox, void) diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx index f1b39f4d51d2..89c44752b48c 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.hxx +++ b/sw/source/ui/dbui/mmpreparemergepage.hxx @@ -42,8 +42,9 @@ class SwMailMergePrepareMergePage : public svt::OWizardPage DECL_LINK_TYPED(EditDocumentHdl_Impl, Button*, void); DECL_LINK_TYPED(ExcludeHdl_Impl, Button*, void); - DECL_LINK(MoveHdl_Impl, void*); + DECL_LINK_TYPED(MoveEditHdl_Impl, Edit&, void); DECL_LINK_TYPED(MoveClickHdl_Impl, Button*, void); + void MoveHdl_Impl(Control*); virtual void ActivatePage() override; virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override; diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index ab0a489f1d5a..f4fe433bfeb8 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1131,22 +1131,22 @@ IMPL_LINK_NOARG_TYPED(SwEditRegionDlg, OptionsHdl, Button*, void) } // Applying of the filename or the linked region -IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SwEditRegionDlg, FileNameHdl, Edit&, rEdit, void ) { - Selection aSelect = pEdit->GetSelection(); + Selection aSelect = rEdit.GetSelection(); if(!CheckPasswd()) - return 0; - pEdit->SetSelection(aSelect); + return; + rEdit.SetSelection(aSelect); SvTreeListEntry* pEntry = m_pTree->FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); SectRepr* pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData()); - if (pEdit == m_pFileNameED) + if (&rEdit == m_pFileNameED) { m_bSubRegionsFilled = false; m_pSubRegionED->Clear(); if (m_pDDECB->IsChecked()) { - OUString sLink( SwSectionData::CollapseWhiteSpaces(pEdit->GetText()) ); + OUString sLink( SwSectionData::CollapseWhiteSpaces(rEdit.GetText()) ); sal_Int32 nPos = 0; sLink = sLink.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos ); if (nPos>=0) @@ -1159,7 +1159,7 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) } else { - OUString sTmp(pEdit->GetText()); + OUString sTmp(rEdit.GetText()); if(!sTmp.isEmpty()) { SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium(); @@ -1175,9 +1175,8 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) } else { - pSectRepr->SetSubRegion( pEdit->GetText() ); + pSectRepr->SetSubRegion( rEdit.GetText() ); } - return 0; } IMPL_LINK_TYPED( SwEditRegionDlg, DDEHdl, Button*, pButton, void ) @@ -1283,10 +1282,10 @@ IMPL_LINK_TYPED( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox, void ) // the current region name is being added to the TreeListBox immediately during // editing, with empty string no Ok() -IMPL_LINK_NOARG(SwEditRegionDlg, NameEditHdl) +IMPL_LINK_NOARG_TYPED(SwEditRegionDlg, NameEditHdl, Edit&, void) { if(!CheckPasswd(0)) - return 0; + return; SvTreeListEntry* pEntry = m_pTree->FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); if (pEntry) @@ -1298,24 +1297,22 @@ IMPL_LINK_NOARG(SwEditRegionDlg, NameEditHdl) m_pOK->Enable(!aName.isEmpty()); } - return 0; } -IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SwEditRegionDlg, ConditionEditHdl, Edit&, rEdit, void ) { - Selection aSelect = pEdit->GetSelection(); + Selection aSelect = rEdit.GetSelection(); if(!CheckPasswd(0)) - return 0; - pEdit->SetSelection(aSelect); + return; + rEdit.SetSelection(aSelect); SvTreeListEntry* pEntry = m_pTree->FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { SectRepr* pRepr = static_cast<SectRepr*>(pEntry->GetUserData()); - pRepr->GetSectionData().SetCondition(pEdit->GetText()); + pRepr->GetSectionData().SetCondition(rEdit.GetText()); pEntry = m_pTree->NextSelected(pEntry); } - return 0; } IMPL_LINK_TYPED( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, void ) @@ -1719,12 +1716,11 @@ IMPL_LINK_TYPED( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton, voi m_aNewPasswd.realloc(0); } -IMPL_LINK_NOARG(SwInsertSectionTabPage, NameEditHdl) +IMPL_LINK_NOARG_TYPED(SwInsertSectionTabPage, NameEditHdl, Edit&, void) { const OUString aName = m_pCurName->GetText(); GetTabDialog()->GetOKButton().Enable(!aName.isEmpty() && m_pCurName->GetEntryPos( aName ) == LISTBOX_ENTRY_NOTFOUND); - return 0; } IMPL_LINK_TYPED( SwInsertSectionTabPage, UseFileHdl, Button *, pButton, void ) @@ -2136,7 +2132,7 @@ SwSectionIndentTabPage::SwSectionIndentTabPage(vcl::Window *pParent, const SfxIt get(m_pBeforeMF, "before"); get(m_pAfterMF, "after"); get(m_pPreviewWin, "preview"); - Link<> aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl); + Link<Edit&,void> aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl); m_pBeforeMF->SetModifyHdl(aLk); m_pAfterMF->SetModifyHdl(aLk); } @@ -2190,7 +2186,7 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet) } m_pBeforeMF->SaveValue(); m_pAfterMF->SaveValue(); - IndentModifyHdl(0); + IndentModifyHdl(*m_pBeforeMF); } VclPtr<SfxTabPage> SwSectionIndentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) @@ -2208,12 +2204,11 @@ void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh) m_pPreviewWin->SetSize(aPageSize); } -IMPL_LINK_NOARG(SwSectionIndentTabPage, IndentModifyHdl) +IMPL_LINK_NOARG_TYPED(SwSectionIndentTabPage, IndentModifyHdl, Edit&, void) { m_pPreviewWin->SetLeftMargin( static_cast< long >(m_pBeforeMF->Denormalize(m_pBeforeMF->GetValue(FUNIT_TWIP))) ); m_pPreviewWin->SetRightMargin( static_cast< long >(m_pAfterMF->Denormalize(m_pAfterMF->GetValue(FUNIT_TWIP))) ); m_pPreviewWin->Invalidate(); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 48a4f21b6400..14191095d2a5 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -326,7 +326,7 @@ SwLabFormatPage::SwLabFormatPage(vcl::Window* pParent, const SfxItemSet& rSet) SetMetric(*m_pPHeightField, aMetric); // Install handlers - Link<> aLk = LINK(this, SwLabFormatPage, ModifyHdl); + Link<Edit&,void> aLk = LINK(this, SwLabFormatPage, ModifyHdl); m_pHDistField->SetModifyHdl( aLk ); m_pVDistField->SetModifyHdl( aLk ); m_pWidthField->SetModifyHdl( aLk ); @@ -382,11 +382,10 @@ void SwLabFormatPage::dispose() // Modify-handler of MetricFields. start preview timer -IMPL_LINK_NOARG(SwLabFormatPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwLabFormatPage, ModifyHdl, Edit&, void) { bModified = true; aPreviewIdle.Start(); - return 0; } // Invalidate preview @@ -607,7 +606,7 @@ SwSaveLabelDlg::SwSaveLabelDlg(SwLabFormatPage* pParent, SwLabRec& rRec) get(m_pOKPB, "ok"); m_pOKPB->SetClickHdl(LINK(this, SwSaveLabelDlg, OkHdl)); - Link<> aLk(LINK(this, SwSaveLabelDlg, ModifyHdl)); + Link<Edit&,void> aLk(LINK(this, SwSaveLabelDlg, ModifyHdl)); m_pMakeCB->SetModifyHdl(aLk); m_pTypeED->SetModifyHdl(aLk); @@ -664,10 +663,9 @@ IMPL_LINK_NOARG_TYPED(SwSaveLabelDlg, OkHdl, Button*, void) EndDialog(RET_OK); } -IMPL_LINK_NOARG(SwSaveLabelDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwSaveLabelDlg, ModifyHdl, Edit&, void) { m_pOKPB->Enable(!m_pMakeCB->GetText().isEmpty() && !m_pTypeED->GetText().isEmpty()); - return 0; } bool SwSaveLabelDlg::GetLabel(SwLabItem& rItem) diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 8ef6ed52b86a..1e4675cb13d4 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -87,7 +87,7 @@ class SwLabFormatPage : public SfxTabPage SwLabItem aItem; - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( PreviewHdl, Idle *, void ); DECL_LINK_TYPED( LoseFocusHdl, Control&, void ); DECL_LINK_TYPED( SaveHdl, Button*, void ); @@ -124,7 +124,7 @@ class SwSaveLabelDlg : public ModalDialog SwLabRec& rLabRec; DECL_LINK_TYPED(OkHdl, Button*, void); - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: SwSaveLabelDlg(SwLabFormatPage* pParent, SwLabRec& rRec); diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 8bfa3ef5ee3c..9f872426261d 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -279,7 +279,7 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell, m_pSaveIndividualRB->SetClickHdl( aLk ); aLk.Call( m_pSaveSingleDocRB ); - Link<> aLk2 = LINK(this, SwMailMergeDlg, ModifyHdl); + Link<Edit&,void> aLk2 = LINK(this, SwMailMergeDlg, ModifyHdl); m_pFromNF->SetModifyHdl(aLk2); m_pToNF->SetModifyHdl(aLk2); m_pFromNF->SetMax(SAL_MAX_INT32); @@ -481,10 +481,9 @@ IMPL_LINK_TYPED( SwMailMergeDlg, FilenameHdl, Button*, pBox, void ) m_pFilterLB->Enable( bEnable ); } -IMPL_LINK_NOARG(SwMailMergeDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwMailMergeDlg, ModifyHdl, Edit&, void) { m_pFromRB->Check(); - return 0; } bool SwMailMergeDlg::ExecQryShell() diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 34db853ebcae..3e0c7620ccab 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -485,10 +485,9 @@ IMPL_LINK_NOARG_TYPED(SwFieldDBPage, AddDBHdl, Button*, void) } // Modify -IMPL_LINK_NOARG(SwFieldDBPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwFieldDBPage, ModifyHdl, Edit&, void) { CheckInsert(); - return 0; } void SwFieldDBPage::FillUserData() diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx index 5a5a8fc2b1e4..6fcf77ef559e 100644 --- a/sw/source/ui/fldui/flddb.hxx +++ b/sw/source/ui/fldui/flddb.hxx @@ -57,8 +57,8 @@ class SwFieldDBPage : public SwFieldPage DECL_LINK_TYPED( TypeListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( NumSelectHdl, ListBox&, void ); DECL_LINK_TYPED( TreeSelectHdl, SvTreeListBox*, void ); - DECL_LINK(ModifyHdl, void *); - DECL_LINK_TYPED(AddDBHdl, Button*, void); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); + DECL_LINK_TYPED( AddDBHdl, Button*, void ); void TypeHdl(ListBox*); void CheckInsert(); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 31aae8eb3b05..aa8c6e9523b8 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -174,7 +174,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) m_pListUpPB->SetClickHdl(aListModifyLk); m_pListDownPB->SetClickHdl(aListModifyLk); m_pListItemED->SetReturnActionLink(LINK(this, SwFieldFuncPage, ListModifyReturnActionHdl)); - Link<> aListEnableLk = LINK(this, SwFieldFuncPage, ListEnableHdl); + Link<Edit&,void> aListEnableLk = LINK(this, SwFieldFuncPage, ListEnableHdl); m_pListItemED->SetModifyHdl(aListEnableLk); m_pListItemsLB->SetSelectHdl(LINK(this, SwFieldFuncPage, ListEnableListBoxHdl)); @@ -298,7 +298,7 @@ IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, TypeHdl, ListBox&, void) m_pValueED->SetText(OUString()); } if(bDropDown) - ListEnableHdl(0); + ListEnableHdl(*m_pListItemED); if (m_pNameFT->GetText() != m_sOldNameFT) m_pNameFT->SetText(m_sOldNameFT); @@ -468,14 +468,14 @@ void SwFieldFuncPage::ListModifyHdl(Control* pControl) } bDropDownLBChanged = true; m_pListItemsLB->SetUpdateMode(true); - ListEnableHdl(0); + ListEnableHdl(*m_pListItemED); } IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, ListEnableListBoxHdl, ListBox&, void) { - ListEnableHdl(0); + ListEnableHdl(*m_pListItemED); } -IMPL_LINK_NOARG(SwFieldFuncPage, ListEnableHdl) +IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, ListEnableHdl, Edit&, void) { //enable "Add" button when text is in the Edit that's not already member of the box m_pListAddPB->Enable(!m_pListItemED->GetText().isEmpty() && @@ -485,8 +485,6 @@ IMPL_LINK_NOARG(SwFieldFuncPage, ListEnableHdl) m_pListUpPB->Enable(bEnableButtons && (m_pListItemsLB->GetSelectEntryPos() > 0)); m_pListDownPB->Enable(bEnableButtons && (m_pListItemsLB->GetSelectEntryPos() < (m_pListItemsLB->GetEntryCount() - 1))); - - return 0; } // renew types in SelectionBox @@ -602,7 +600,7 @@ bool SwFieldFuncPage::FillItemSet(SfxItemSet* ) InsertField( nTypeId, nSubType, aName, aVal, nFormat ); } - ModifyHdl(NULL); // enable/disable Insert if applicable + ModifyHdl(*m_pNameED); // enable/disable Insert if applicable return false; } @@ -652,7 +650,7 @@ void SwFieldFuncPage::FillUserData() SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel )); } -IMPL_LINK_NOARG(SwFieldFuncPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, ModifyHdl, Edit&, void) { const sal_Int32 nLen = m_pNameED->GetText().getLength(); @@ -664,8 +662,6 @@ IMPL_LINK_NOARG(SwFieldFuncPage, ModifyHdl) bEnable = false; EnableInsert( bEnable ); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx index 96ce837c8f98..7effcb4d0929 100644 --- a/sw/source/ui/fldui/fldfunc.hxx +++ b/sw/source/ui/fldui/fldfunc.hxx @@ -66,14 +66,14 @@ class SwFieldFuncPage : public SwFieldPage sal_uLong nOldFormat; bool bDropDownLBChanged; - DECL_LINK_TYPED(TypeHdl, ListBox&, void); - DECL_LINK_TYPED(SelectHdl, ListBox&, void); - DECL_LINK_TYPED(InsertMacroHdl, ListBox&, void); - DECL_LINK(ModifyHdl, void *); - DECL_LINK_TYPED(ListModifyReturnActionHdl, ReturnActionEdit&, void); - DECL_LINK_TYPED(ListModifyButtonHdl, Button*, void); - DECL_LINK( ListEnableHdl, void*); - DECL_LINK_TYPED( ListEnableListBoxHdl, ListBox&, void); + DECL_LINK_TYPED( TypeHdl, ListBox&, void ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); + DECL_LINK_TYPED( InsertMacroHdl, ListBox&, void ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); + DECL_LINK_TYPED( ListModifyReturnActionHdl, ReturnActionEdit&, void ); + DECL_LINK_TYPED( ListModifyButtonHdl, Button*, void ); + DECL_LINK_TYPED( ListEnableHdl, Edit&, void ); + DECL_LINK_TYPED( ListEnableListBoxHdl, ListBox&, void ); void ListModifyHdl(Control*); // select Macro diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 1c0bd9f74222..4b38523b2d73 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -408,7 +408,7 @@ IMPL_LINK_NOARG_TYPED(SwFieldRefPage, TypeHdl, ListBox&, void) m_pFormat->Enable(bFormat); SubTypeHdl(); - ModifyHdl(NULL); + ModifyHdl(*m_pNameED); } } @@ -430,7 +430,7 @@ void SwFieldRefPage::SubTypeHdl() if (!IsFieldEdit() || m_pSelectionLB->GetSelectEntryCount()) { m_pNameED->SetText(m_pSelectionLB->GetSelectEntry()); - ModifyHdl(m_pNameED); + ModifyHdl(*m_pNameED); } break; @@ -758,7 +758,7 @@ sal_Int32 SwFieldRefPage::FillFormatLB(sal_uInt16 nTypeId) } // Modify -IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwFieldRefPage, ModifyHdl, Edit&, void) { OUString aName(m_pNameED->GetText()); const bool bEmptyName = aName.isEmpty(); @@ -774,8 +774,6 @@ IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl) EnableInsert(bEnable); m_pSelectionLB->SelectEntry(aName); - - return 0; } bool SwFieldRefPage::FillItemSet(SfxItemSet* ) @@ -954,7 +952,7 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* ) InsertField( nTypeId, nSubType, aName, aVal, nFormat ); } - ModifyHdl(); // enable/disable insert if applicable + ModifyHdl(*m_pNameED); // enable/disable insert if applicable return false; } diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index d59d872758c7..f06f114d6585 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -63,7 +63,7 @@ class SwFieldRefPage : public SwFieldPage DECL_LINK_TYPED(TypeHdl, ListBox&, void); DECL_LINK_TYPED(SubTypeListBoxHdl, ListBox&, void); DECL_LINK_TYPED(SubTypeTreeListBoxHdl, SvTreeListBox*, void); - DECL_LINK(ModifyHdl, void * = 0); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); void SubTypeHdl(); void UpdateSubType(); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index b1366fbbefdb..3dcbf74e2cb6 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -561,7 +561,7 @@ void SwFieldVarPage::SubTypeHdl(ListBox* pBox) m_pChapterFrame->Show(bShowChapterFrame); m_pInvisibleCB->Enable(bInvisible); - ModifyHdl(); // apply/insert/delete status update + ModifyHdl(*m_pNameED); // apply/insert/delete status update m_pNumFormatLB->SetUpdateMode(true); m_pFormatLB->SetUpdateMode(true); @@ -582,7 +582,7 @@ void SwFieldVarPage::SubTypeHdl(ListBox* pBox) if (nSelData != SIZE_MAX && pBox && !bInit) { m_pValueED->ReplaceSelected(m_pSelectionLB->GetSelectEntry()); - ModifyHdl(); + ModifyHdl(*m_pNameED); } } } @@ -831,7 +831,7 @@ sal_Int32 SwFieldVarPage::FillFormatLB(sal_uInt16 nTypeId) } // Modify -IMPL_LINK_NOARG(SwFieldVarPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwFieldVarPage, ModifyHdl, Edit&, void) { OUString sValue(m_pValueED->GetText()); bool bHasValue = !sValue.isEmpty(); @@ -952,8 +952,6 @@ IMPL_LINK_NOARG(SwFieldVarPage, ModifyHdl) m_pNewDelTBX->EnableItem(m_nApplyId, bApply); m_pNewDelTBX->EnableItem(m_nDeleteId, bDelete); EnableInsert(bInsert); - - return 0; } IMPL_LINK_TYPED( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void ) @@ -1106,16 +1104,14 @@ IMPL_LINK_NOARG_TYPED(SwFieldVarPage, ChapterHdl, ListBox&, void) m_pSeparatorED->Enable(bEnable); m_pSeparatorFT->Enable(bEnable); - SeparatorHdl(); + SeparatorHdl(*m_pSeparatorED); } -IMPL_LINK_NOARG(SwFieldVarPage, SeparatorHdl) +IMPL_LINK_NOARG_TYPED(SwFieldVarPage, SeparatorHdl, Edit&, void) { bool bEnable = !m_pSeparatorED->GetText().isEmpty() || m_pChapterLevelLB->GetSelectEntryPos() == 0; EnableInsert(bEnable); - - return 0; } bool SwFieldVarPage::FillItemSet(SfxItemSet* ) diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx index 435fef91c259..853edf348e74 100644 --- a/sw/source/ui/fldui/fldvar.hxx +++ b/sw/source/ui/fldui/fldvar.hxx @@ -76,12 +76,12 @@ class SwFieldVarPage : public SwFieldPage sal_uLong nOldFormat; bool bInit; - DECL_LINK_TYPED(TypeHdl, ListBox&, void); + DECL_LINK_TYPED( TypeHdl, ListBox&, void ); DECL_LINK_TYPED( SubTypeListBoxHdl, ListBox&, void ); - DECL_LINK(ModifyHdl, void * = 0); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( TBClickHdl, ToolBox *, void ); - DECL_LINK_TYPED(ChapterHdl, ListBox&, void); - DECL_LINK(SeparatorHdl, void * = 0); + DECL_LINK_TYPED( ChapterHdl, ListBox&, void ); + DECL_LINK_TYPED( SeparatorHdl, Edit&, void ); void SubTypeHdl(ListBox*); void UpdateSubType(); diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 73874e4ddfdb..4a5d5b4002c9 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -481,9 +481,9 @@ SwColumnPage::SwColumnPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pDefaultVS->SetSelectHdl(LINK(this, SwColumnPage, SetDefaultsHdl)); - Link<> aCLNrLk = LINK(this, SwColumnPage, ColModify); + Link<Edit&,void> aCLNrLk = LINK(this, SwColumnPage, ColModify); m_pCLNrEdt->SetModifyHdl(aCLNrLk); - Link<> aLk = LINK(this, SwColumnPage, GapModify); + Link<Edit&,void> aLk = LINK(this, SwColumnPage, GapModify); aDistEd1.SetModifyHdl(aLk); aDistEd2.SetModifyHdl(aLk); @@ -701,9 +701,9 @@ bool SwColumnPage::FillItemSet(SfxItemSet *rSet) // update ColumnManager IMPL_LINK_NOARG_TYPED( SwColumnPage, UpdateColMgrListBox, ListBox&, void ) { - UpdateColMgr(0); + UpdateColMgr(*m_pLineWidthEdit); } -IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr ) +IMPL_LINK_NOARG_TYPED( SwColumnPage, UpdateColMgr, Edit&, void ) { long nGutterWidth = pColMgr->GetGutterWidth(); if(nCols > 1) @@ -803,8 +803,6 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr ) else m_pPgeExampleWN->Invalidate(); } - - return 0; } void SwColumnPage::Init() @@ -973,7 +971,12 @@ void SwColumnPage::SetLabels( sal_uInt16 nVis ) * the column number overwrites potential user's width settings; all columns * are equally wide. */ -IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF ) +IMPL_LINK_TYPED( SwColumnPage, ColModify, Edit&, rEdit, void ) +{ + ColModify(static_cast<NumericField*>(&rEdit)); +} + +void SwColumnPage::ColModify(NumericField* pNF) { nCols = (sal_uInt16)m_pCLNrEdt->GetValue(); //#107890# the handler is also called from LoseFocus() @@ -995,8 +998,6 @@ IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF ) ResetColWidth(); Update(NULL); } - - return 0; } /* @@ -1005,10 +1006,11 @@ IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF ) * width the automatic calculation of the column width is overruled; only an * alteration of the column number leads back to that default. */ -IMPL_LINK( SwColumnPage, GapModify, MetricField*, pMetricField ) +IMPL_LINK_TYPED( SwColumnPage, GapModify, Edit&, rEdit, void ) { if (nCols < 2) - return 0; + return; + MetricField* pMetricField = static_cast<MetricField*>(&rEdit); PercentField *pField = m_aPercentFieldsMap[pMetricField]; assert(pField); long nActValue = static_cast< long >(pField->DenormalizePercent(pField->GetValue(FUNIT_TWIP))); @@ -1069,16 +1071,15 @@ IMPL_LINK( SwColumnPage, GapModify, MetricField*, pMetricField ) } Update(pMetricField); - return 0; } -IMPL_LINK( SwColumnPage, EdModify, MetricField *, pMetricField ) +IMPL_LINK_TYPED( SwColumnPage, EdModify, Edit&, rEdit, void ) { + MetricField * pMetricField = static_cast<MetricField*>(&rEdit); PercentField *pField = m_aPercentFieldsMap[pMetricField]; assert(pField); pModifiedField = pField; Timeout(); - return 0; } // Handler behind the Checkbox for automatic width. When the box is checked @@ -1219,7 +1220,7 @@ void SwColumnPage::Update(MetricField *pInteractiveField) aDistEd1.SetText(OUString()); aDistEd2.SetText(OUString()); } - UpdateColMgr(0); + UpdateColMgr(*m_pLineWidthEdit); } // Update Bsp @@ -1265,7 +1266,7 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) { pColMgr->SetActualWidth(nActWidth); ColModify( 0 ); - UpdateColMgr( 0 ); + UpdateColMgr( *m_pLineWidthEdit ); } } m_pFrmExampleWN->Hide(); diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index d0435d892927..2008493285b1 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -130,7 +130,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) : xNameAccess = xObjs->getEmbeddedObjects(); } - Link<> aLk = LINK( this, SwCaptionDialog, ModifyHdl ); + Link<Edit&,void> aLk = LINK( this, SwCaptionDialog, ModifyHdl ); m_pCategoryBox->SetModifyHdl( aLk ); m_pTextEdit->SetModifyHdl( aLk ); m_pNumberingSeparatorED->SetModifyHdl ( aLk ); @@ -246,7 +246,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) : } m_pPosBox->SelectEntryPos(1); - m_pCategoryBox->GetModifyHdl().Call(m_pCategoryBox); + m_pCategoryBox->GetModifyHdl().Call(*m_pCategoryBox); m_pSepEdit->SetText(our_aSepTextSave); m_pTextEdit->GrabFocus(); @@ -310,7 +310,7 @@ IMPL_LINK_NOARG_TYPED(SwCaptionDialog, SelectHdl, ComboBox&, void) DrawSample(); } -IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwCaptionDialog, ModifyHdl, Edit&, void) { SwWrtShell &rSh = rView.GetWrtShell(); OUString sFieldTypeName = m_pCategoryBox->GetText(); @@ -330,7 +330,6 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl) m_pSepText->Enable( !bNone ); m_pSepEdit->Enable( !bNone ); DrawSample(); - return 0; } IMPL_LINK_NOARG_TYPED(SwCaptionDialog, CaptionHdl, Button*, void) diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index a2318f5ff99b..63145d2620c1 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -684,7 +684,7 @@ SwFrmPage::SwFrmPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pAtVertPosED->SetLoseFocusHdl( aLk3 ); m_pFollowTextFlowCB->SetClickHdl( LINK(this, SwFrmPage, RangeModifyClickHdl) ); - Link<> aLk = LINK(this, SwFrmPage, ModifyHdl); + Link<Edit&,void> aLk = LINK(this, SwFrmPage, ModifyHdl); m_aWidthED.SetModifyHdl( aLk ); m_aHeightED.SetModifyHdl( aLk ); m_pAtHorzPosED->SetModifyHdl( aLk ); @@ -1788,9 +1788,9 @@ IMPL_LINK_TYPED( SwFrmPage, RelSizeClickHdl, Button *, p, void ) RangeModifyHdl(); // correct the values again if (pBtn == m_pRelWidthCB) - ModifyHdl(m_aWidthED.get()); + ModifyHdl(*m_aWidthED.get()); else // pBtn == m_pRelHeightCB - ModifyHdl(m_aHeightED.get()); + ModifyHdl(*m_aHeightED.get()); } // range check @@ -2099,18 +2099,18 @@ IMPL_LINK_NOARG_TYPED(SwFrmPage, AutoHeightClickHdl, Button*, void) HandleAutoCB( m_pAutoHeightCB->IsChecked(), *m_pHeightFT, *m_pHeightAutoFT, *m_aWidthED.get() ); } -IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SwFrmPage, ModifyHdl, Edit&, rEdit, void ) { SwTwips nWidth = static_cast< SwTwips >(m_aWidthED.DenormalizePercent(m_aWidthED.GetValue(FUNIT_TWIP))); SwTwips nHeight = static_cast< SwTwips >(m_aHeightED.DenormalizePercent(m_aHeightED.GetValue(FUNIT_TWIP))); if ( m_pFixedRatioCB->IsChecked() ) { - if (pEdit == m_aWidthED.get()) + if (&rEdit == m_aWidthED.get()) { nHeight = SwTwips((double)nWidth / fWidthHeightRatio); m_aHeightED.SetPrcntValue(m_aHeightED.NormalizePercent(nHeight), FUNIT_TWIP); } - else if (pEdit == m_aHeightED.get()) + else if (&rEdit == m_aHeightED.get()) { nWidth = SwTwips((double)nHeight * fWidthHeightRatio); m_aWidthED.SetPrcntValue(m_aWidthED.NormalizePercent(nWidth), FUNIT_TWIP); @@ -2118,7 +2118,6 @@ IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit ) } fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; UpdateExample(); - return 0; } void SwFrmPage::UpdateExample() @@ -3192,13 +3191,11 @@ bool SwFrmAddPage::FillItemSet(SfxItemSet *rSet) return bRet; } -IMPL_LINK_NOARG(SwFrmAddPage, EditModifyHdl) +IMPL_LINK_NOARG_TYPED(SwFrmAddPage, EditModifyHdl, Edit&, void) { bool bEnable = !pNameED->GetText().isEmpty(); pAltNameED->Enable(bEnable); pAltNameFT->Enable(bEnable); - - return 0; } void SwFrmAddPage::SetFormatUsed(bool bFormatUsed) diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 282de8c9b02a..08e32af3e8f1 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -884,7 +884,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(vcl::Window* pParent, const SfxItemSet& r m_pInitialCapsCB->SetClickHdl(aLk); m_pKeyAsEntryCB->SetClickHdl(aLk); - Link<> aModifyLk = LINK(this, SwTOXSelectTabPage, ModifyHdl); + Link<Edit&,void> aModifyLk = LINK(this, SwTOXSelectTabPage, ModifyHdl); m_pTitleED->SetModifyHdl(aModifyLk); m_pLevelNF->SetModifyHdl(aModifyLk); m_pSortAlgorithmLB->SetSelectHdl(LINK(this, SwTOXSelectTabPage, ModifyListBoxHdl)); @@ -1379,14 +1379,14 @@ IMPL_LINK_TYPED(SwTOXSelectTabPage, TOXTypeHdl, ListBox&, rBox, void) { ApplyTOXDescription(); } - ModifyHdl(0); + ModifyHdl(*m_pTitleED); } IMPL_LINK_NOARG_TYPED(SwTOXSelectTabPage, ModifyListBoxHdl, ListBox&, void) { - ModifyHdl(0); + ModifyHdl(*m_pTitleED); } -IMPL_LINK_NOARG(SwTOXSelectTabPage, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwTOXSelectTabPage, ModifyHdl, Edit&, void) { if(!m_bWaitingInitialSettings) { @@ -1394,7 +1394,6 @@ IMPL_LINK_NOARG(SwTOXSelectTabPage, ModifyHdl) SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog()); pTOXDlg->CreateOrUpdateExample(pTOXDlg->GetCurrentTOXType().eType, TOX_PAGE_SELECT); } - return 0; } IMPL_LINK_TYPED(SwTOXSelectTabPage, CheckBoxHdl, Button*, pButton, void ) @@ -1423,7 +1422,7 @@ IMPL_LINK_TYPED(SwTOXSelectTabPage, CheckBoxHdl, Button*, pButton, void ) m_pUseDashCB->Enable(m_pCollectSameCB->IsChecked() && !m_pUseFFCB->IsChecked()); m_pCaseSensitiveCB->Enable(m_pCollectSameCB->IsChecked()); } - ModifyHdl(0); + ModifyHdl(*m_pTitleED); }; IMPL_LINK_NOARG_TYPED(SwTOXSelectTabPage, RadioButtonHdl, Button*, void) @@ -1433,7 +1432,7 @@ IMPL_LINK_NOARG_TYPED(SwTOXSelectTabPage, RadioButtonHdl, Button*, void) m_pCaptionSequenceLB->Enable(bEnable); m_pDisplayTypeFT->Enable(bEnable); m_pDisplayTypeLB->Enable(bEnable); - ModifyHdl(0); + ModifyHdl(*m_pTitleED); } IMPL_LINK_TYPED(SwTOXSelectTabPage, LanguageListBoxHdl, ListBox&, rBox, void) @@ -1476,7 +1475,7 @@ void SwTOXSelectTabPage::LanguageHdl( ListBox* pBox ) m_pSortAlgorithmLB->SelectEntryPos( 0 ); if(pBox) - ModifyHdl(0); + ModifyHdl(*m_pTitleED); }; IMPL_LINK_TYPED(SwTOXSelectTabPage, AddStylesHdl, Button*, pButton, void) @@ -1486,7 +1485,7 @@ IMPL_LINK_TYPED(SwTOXSelectTabPage, AddStylesHdl, Button*, pButton, void) aStyleArr); pDlg->Execute(); pDlg.disposeAndClear(); - ModifyHdl(0); + ModifyHdl(*m_pTitleED); } IMPL_LINK_TYPED(SwTOXSelectTabPage, MenuEnableHdl, Menu*, pMenu, bool) @@ -2575,9 +2574,9 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, ChapterInfoHdl, ListBox&, rBox, void) } } -IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField) +IMPL_LINK_TYPED(SwTOXEntryTabPage, ChapterInfoOutlineHdl, Edit&, rEdit, void) { - const sal_uInt16 nLevel = static_cast<sal_uInt8>(pField->GetValue()); + const sal_uInt16 nLevel = static_cast<sal_uInt8>(static_cast<NumericField&>(rEdit).GetValue()); Control* pCtrl = m_pTokenWIN->GetActiveControl(); OSL_ENSURE(pCtrl, "no active control?"); @@ -2585,7 +2584,6 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField) static_cast<SwTOXButton*>(pCtrl)->SetOutlineLevel(nLevel); ModifyHdl(0); - return 0; } IMPL_LINK_TYPED(SwTOXEntryTabPage, NumberFormatHdl, ListBox&, rBox, void) @@ -2604,8 +2602,9 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, NumberFormatHdl, ListBox&, rBox, void) } } -IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField) +IMPL_LINK_TYPED(SwTOXEntryTabPage, TabPosHdl, Edit&, rEdit, void) { + MetricField* pField = static_cast<MetricField*>(&rEdit); Control* pCtrl = m_pTokenWIN->GetActiveControl(); OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() && TOKEN_TAB_STOP == static_cast<SwTOXButton*>(pCtrl)->GetFormToken().eTokenType, @@ -2616,10 +2615,9 @@ IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField) pField->Denormalize( pField->GetValue( FUNIT_TWIP )))); } ModifyHdl(0); - return 0; } -IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox) +IMPL_LINK_TYPED(SwTOXEntryTabPage, FillCharHdl, Edit&, rBox, void) { Control* pCtrl = m_pTokenWIN->GetActiveControl(); OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() && @@ -2628,14 +2626,13 @@ IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox) if(pCtrl && WINDOW_EDIT != pCtrl->GetType()) { sal_Unicode cSet; - if( !pBox->GetText().isEmpty() ) - cSet = pBox->GetText()[0]; + if( !rBox.GetText().isEmpty() ) + cSet = rBox.GetText()[0]; else cSet = ' '; static_cast<SwTOXButton*>(pCtrl)->SetFillChar( cSet ); } ModifyHdl(0); - return 0; } IMPL_LINK_TYPED(SwTOXEntryTabPage, AutoRightHdl, Button*, pBox, void) @@ -3459,12 +3456,11 @@ bool SwTokenWindow::CreateQuickHelp(Control* pCtrl, return bRet; } -IMPL_LINK(SwTokenWindow, EditResize, Edit*, pEdit) +IMPL_LINK_TYPED(SwTokenWindow, EditResize, Edit&, rEdit, void) { - static_cast<SwTOXEdit*>(pEdit)->AdjustSize(); + static_cast<SwTOXEdit*>(&rEdit)->AdjustSize(); AdjustPositions(); aModifyHdl.Call(0); - return 0; } IMPL_LINK_TYPED(SwTokenWindow, NextItemHdl, SwTOXEdit&, rEdit, void) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 331bb63ba67d..7f5108e0c577 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -144,8 +144,8 @@ SwIndexMarkPane::SwIndexMarkPane(Dialog &rDialog, bool bNewDlg, m_pTypeDCB->SetSelectHdl(LINK(this,SwIndexMarkPane, ModifyListBoxHdl)); m_pKey1DCB->SetModifyHdl(LINK(this,SwIndexMarkPane, KeyDCBModifyHdl)); m_pKey2DCB->SetModifyHdl(LINK(this,SwIndexMarkPane, KeyDCBModifyHdl)); - m_pCloseBT->SetClickHdl(LINK(this,SwIndexMarkPane, CloseHdl)); - m_pEntryED->SetModifyHdl(LINK(this,SwIndexMarkPane, ModifyHdl)); + m_pCloseBT->SetClickHdl(LINK(this,SwIndexMarkPane, CloseHdl)); + m_pEntryED->SetModifyHdl(LINK(this,SwIndexMarkPane, ModifyEditHdl)); m_pNewBT->SetClickHdl(LINK(this, SwIndexMarkPane, NewUserIdxHdl)); m_pApplyToAllCB->SetClickHdl(LINK(this, SwIndexMarkPane, SearchTypeHdl)); m_pPhoneticED0->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); @@ -550,7 +550,7 @@ class SwNewUserIdxDlg : public ModalDialog SwIndexMarkPane* m_pDlg; - DECL_LINK( ModifyHdl, Edit*); + DECL_LINK_TYPED( ModifyHdl, Edit&, void); public: explicit SwNewUserIdxDlg(SwIndexMarkPane* pPane) @@ -575,10 +575,9 @@ class SwNewUserIdxDlg : public ModalDialog OUString GetName(){return m_pNameED->GetText();} }; -IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED( SwNewUserIdxDlg, ModifyHdl, Edit&, rEdit, void) { - m_pOKPB->Enable(!pEdit->GetText().isEmpty() && !m_pDlg->IsTOXType(pEdit->GetText())); - return 0; + m_pOKPB->Enable(!rEdit.GetText().isEmpty() && !m_pDlg->IsTOXType(rEdit.GetText())); } IMPL_LINK_NOARG_TYPED(SwIndexMarkPane, NewUserIdxHdl, Button*, void) @@ -627,7 +626,11 @@ IMPL_LINK_TYPED( SwIndexMarkPane, ModifyListBoxHdl, ListBox&, rBox, void ) { ModifyHdl(&rBox); } -IMPL_LINK( SwIndexMarkPane, ModifyHdl, void*, pBox ) +IMPL_LINK_TYPED( SwIndexMarkPane, ModifyEditHdl, Edit&, rEdit, void ) +{ + ModifyHdl(&rEdit); +} +void SwIndexMarkPane::ModifyHdl(Control* pBox) { if (m_pTypeDCB == pBox) { @@ -699,7 +702,6 @@ IMPL_LINK( SwIndexMarkPane, ModifyHdl, void*, pBox ) } m_pOKBT->Enable(!pSh->HasReadonlySel() && (!m_pEntryED->GetText().isEmpty() || pSh->GetCrsrCnt(false))); - return 0; } IMPL_LINK_NOARG_TYPED(SwIndexMarkPane, NextHdl, Button*, void) @@ -848,26 +850,26 @@ void SwIndexMarkPane::UpdateDialog() } // Remind whether the edit boxes for Phonetic reading are changed manually -IMPL_LINK( SwIndexMarkPane, PhoneticEDModifyHdl, Edit *, pEdit ) +IMPL_LINK_TYPED( SwIndexMarkPane, PhoneticEDModifyHdl, Edit&, rEdit, void ) { - if (m_pPhoneticED0 == pEdit) + if (m_pPhoneticED0 == &rEdit) { - bPhoneticED0_ChangedByUser = !pEdit->GetText().isEmpty(); + bPhoneticED0_ChangedByUser = !rEdit.GetText().isEmpty(); } - else if (m_pPhoneticED1 == pEdit) + else if (m_pPhoneticED1 == &rEdit) { - bPhoneticED1_ChangedByUser = !pEdit->GetText().isEmpty(); + bPhoneticED1_ChangedByUser = !rEdit.GetText().isEmpty(); } - else if (m_pPhoneticED2 == pEdit) + else if (m_pPhoneticED2 == &rEdit) { - bPhoneticED2_ChangedByUser = !pEdit->GetText().isEmpty(); + bPhoneticED2_ChangedByUser = !rEdit.GetText().isEmpty(); } - return 0; } // Enable Disable of the 2nd key -IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) +IMPL_LINK_TYPED( SwIndexMarkPane, KeyDCBModifyHdl, Edit&, rEdit, void ) { + ComboBox* pBox = static_cast<ComboBox*>(&rEdit); if (m_pKey1DCB == pBox) { bool bEnable = !pBox->GetText().isEmpty(); @@ -917,8 +919,6 @@ IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) m_pPhoneticED1->Enable(bKey1HasText && bIsPhoneticReadingEnabled); m_pPhoneticFT2->Enable(bKey2HasText && bIsPhoneticReadingEnabled); m_pPhoneticED2->Enable(bKey2HasText && bIsPhoneticReadingEnabled); - - return 0; } SwIndexMarkPane::~SwIndexMarkPane() @@ -993,7 +993,7 @@ class SwCreateAuthEntryDlg_Impl : public ModalDialog bool m_bNameAllowed; DECL_LINK_TYPED(IdentifierHdl, ComboBox&, void); - DECL_LINK(ShortNameHdl, Edit*); + DECL_LINK_TYPED(ShortNameHdl, Edit&, void); DECL_LINK_TYPED(EnableHdl, ListBox&, void); public: @@ -1333,18 +1333,17 @@ IMPL_LINK_TYPED(SwAuthorMarkPane, ChangeSourceHdl, Button*, pButton, void) CompEntryHdl(*m_pEntryLB); } -IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED(SwAuthorMarkPane, EditModifyHdl, Edit&, rEdit, void) { Link<Edit*,bool> aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl); - bool bResult = aAllowed.Call(pEdit); + bool bResult = aAllowed.Call(&rEdit); m_pActionBT->Enable(bResult); if(bResult) { - OUString sEntry(pEdit->GetText()); + OUString sEntry(rEdit.GetText()); m_sFields[AUTH_FIELD_IDENTIFIER] = sEntry; m_sCreatedEntry[AUTH_FIELD_IDENTIFIER] = sEntry; } - return 0; }; IMPL_LINK_TYPED(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit, bool) @@ -1579,15 +1578,14 @@ IMPL_LINK_TYPED(SwCreateAuthEntryDlg_Impl, IdentifierHdl, ComboBox&, rBox, void) } } -IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit) +IMPL_LINK_TYPED(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit&, rEdit, void) { if(aShortNameCheckLink.IsSet()) { - bool bEnable = aShortNameCheckLink.Call(pEdit); + bool bEnable = aShortNameCheckLink.Call(&rEdit); m_bNameAllowed |= bEnable; m_pOKBT->Enable(pTypeListBox->GetSelectEntryCount() && bEnable); } - return 0; } IMPL_LINK_TYPED(SwCreateAuthEntryDlg_Impl, EnableHdl, ListBox&, rBox, void) diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 40a7e6b2db66..3dd6d2e4c3e5 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -33,14 +33,15 @@ const OUString BookmarkCombo::aForbiddenChars("/\\@*?\";,#"); -IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox ) +IMPL_LINK_TYPED( SwInsertBookmarkDlg, ModifyHdl, Edit&, rEdit, void ) { - bool bSelEntries = pBox->GetSelectEntryCount() != 0; + BookmarkCombo& rBox = static_cast<BookmarkCombo&>(rEdit); + bool bSelEntries = rBox.GetSelectEntryCount() != 0; // if a string has been pasted from the clipboard then // there may be illegal characters in the box if(!bSelEntries) { - OUString sTmp = pBox->GetText(); + OUString sTmp = rBox.GetText(); const sal_Int32 nLen = sTmp.getLength(); OUString sMsg; for(sal_Int32 i = 0; i < BookmarkCombo::aForbiddenChars.getLength(); i++) @@ -52,7 +53,7 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox ) } if(sTmp.getLength() != nLen) { - pBox->SetText(sTmp); + rBox.SetText(sTmp); ScopedVclPtr<InfoBox>::Create(this, sRemoveWarning+sMsg)->Execute(); } @@ -60,8 +61,6 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox ) m_pOkBtn->Enable(!bSelEntries); // new text mark m_pDeleteBtn->Enable(bSelEntries); // deletable? - - return 0; } // callback to delete a text mark diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index f14a6b17930d..24cbf3ce654e 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -322,9 +322,9 @@ IMPL_LINK_NOARG_TYPED(SwGlossaryGroupDlg, RenameHdl, Button*, void) IMPL_LINK_NOARG_TYPED(SwGlossaryGroupDlg, ModifyListBoxHdl, ListBox&, void) { - ModifyHdl(0); + ModifyHdl(*m_pNameED); } -IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwGlossaryGroupDlg, ModifyHdl, Edit&, void) { OUString sEntry(m_pNameED->GetText()); bool bEnableNew = true; @@ -373,7 +373,6 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) m_pDelPB->Enable(bEnableDel); m_pNewPB->Enable(bEnableNew); m_pRenamePB->Enable(bEnableNew && pEntry); - return 0; } bool SwGlossaryGroupDlg::IsDeleteAllowed(const OUString &rGroup) diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 95cecccec87b..3ab52b95f415 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -124,7 +124,7 @@ class SwNewGlosNameDlg : public ModalDialog VclPtr<Edit> m_pOldShort; protected: - DECL_LINK( Modify, Edit * ); + DECL_LINK_TYPED( Modify, Edit&, void ); DECL_LINK_TYPED(Rename, Button*, void); public: @@ -305,7 +305,7 @@ IMPL_LINK_TYPED( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox, void ) ShowAutoText("", ""); } // update controls - NameModify(m_pShortNameEdit); + NameModify(*m_pShortNameEdit); if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) ) { SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY ); @@ -370,18 +370,18 @@ SvTreeListEntry* SwGlossaryDlg::DoesBlockExist(const OUString& rBlock, return 0; } -IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit ) +IMPL_LINK_TYPED( SwGlossaryDlg, NameModify, Edit&, rEdit, void ) { const OUString aName(m_pNameED->GetText()); - bool bNameED = pEdit == m_pNameED; + bool bNameED = &rEdit == m_pNameED; if( aName.isEmpty() ) { if(bNameED) m_pShortNameEdit->SetText(aName); m_pInsertBtn->Enable(false); - return 0; + return; } - const bool bNotFound = !DoesBlockExist(aName, bNameED ? OUString() : pEdit->GetText()); + const bool bNotFound = !DoesBlockExist(aName, bNameED ? OUString() : rEdit.GetText()); if(bNameED) { // did the text get in to the Listbbox in the Edit with a click? @@ -407,7 +407,6 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit ) m_pInsertBtn->Enable(bEnable); } } - return 0; } IMPL_LINK_TYPED( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox, bool ) @@ -479,7 +478,7 @@ IMPL_LINK_TYPED( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool ) pChild->SetUserData(new OUString(aShortName)); m_pNameED->SetText(aStr); m_pShortNameEdit->SetText(aShortName); - NameModify(m_pNameED); // for toggling the buttons + NameModify(*m_pNameED); // for toggling the buttons if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) ) { @@ -536,7 +535,7 @@ IMPL_LINK_TYPED( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool ) m_pCategoryBox->GetModel()->Remove(pChild); m_pNameED->SetText(OUString()); - NameModify(m_pNameED); + NameModify(*m_pNameED); } } } @@ -794,18 +793,17 @@ IMPL_LINK_NOARG_TYPED(SwGlossaryDlg, EditHdl, MenuButton *, void) } // KeyInput for ShortName - Edits without Spaces -IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox ) +IMPL_LINK_TYPED( SwNewGlosNameDlg, Modify, Edit&, rBox, void ) { OUString aName(m_pNewName->GetText()); SwGlossaryDlg* pDlg = static_cast<SwGlossaryDlg*>(GetParent()); - if (pBox == m_pNewName) + if (&rBox == m_pNewName) m_pNewShort->SetText( lcl_GetValidShortCut( aName ) ); bool bEnable = !aName.isEmpty() && !m_pNewShort->GetText().isEmpty() && (!pDlg->DoesBlockExist(aName, m_pNewShort->GetText()) || aName == m_pOldName->GetText()); m_pOk->Enable(bEnable); - return 0; } IMPL_LINK_NOARG_TYPED(SwNewGlosNameDlg, Rename, Button*, void) diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 8d81fbb8fc9f..b092ed925ca2 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -88,12 +88,10 @@ IMPL_LINK_NOARG_TYPED(SwInsFootNoteDlg, NumberCharHdl, Button*, void) m_pOkBtn->Enable( !m_pNumberCharEdit->GetText().isEmpty() || bExtCharAvailable ); } -IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberEditHdl) +IMPL_LINK_NOARG_TYPED(SwInsFootNoteDlg, NumberEditHdl, Edit&, void) { m_pNumberCharBtn->Check(); m_pOkBtn->Enable( !m_pNumberCharEdit->GetText().isEmpty() ); - - return 0; } IMPL_LINK_NOARG_TYPED(SwInsFootNoteDlg, NumberAutoBtnHdl, Button*, void) diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index 1eb0e1413f94..2589db7bbb9d 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -161,7 +161,7 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) // Line Numbering m_pNumberingOnCB->SetClickHdl(LINK(this, SwLineNumberingDlg, LineOnOffHdl)); m_pDivisorED->SetModifyHdl(LINK(this, SwLineNumberingDlg, ModifyHdl)); - ModifyHdl(); + ModifyHdl(*m_pDivisorED); LineOnOffHdl(); get<PushButton>("ok")->SetClickHdl(LINK(this, SwLineNumberingDlg, OKHdl)); @@ -255,15 +255,13 @@ IMPL_LINK_NOARG_TYPED(SwLineNumberingDlg, OKHdl, Button*, void) } // modify -IMPL_LINK_NOARG(SwLineNumberingDlg, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwLineNumberingDlg, ModifyHdl, Edit&, void) { bool bEnable = m_pNumberingOnCB->IsChecked() && !m_pDivisorED->GetText().isEmpty(); m_pDivIntervalFT->Enable(bEnable); m_pDivIntervalNF->Enable(bEnable); m_pDivRowsFT->Enable(bEnable); - - return 0; } // On/Off @@ -271,7 +269,7 @@ IMPL_LINK_NOARG_TYPED(SwLineNumberingDlg, LineOnOffHdl, Button*, void) { bool bEnable = m_pNumberingOnCB->IsChecked(); m_pBodyContent->Enable(bEnable); - ModifyHdl(); + ModifyHdl(*m_pDivisorED); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index b44a714553e8..f88b043c5ab9 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -63,7 +63,7 @@ class SwNumNamesDlg : public ModalDialog VclPtr<ListBox> m_pFormBox; VclPtr<OKButton> m_pOKBtn; - DECL_LINK( ModifyHdl, Edit * ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( DoubleClickHdl, ListBox&, void ); @@ -119,10 +119,9 @@ void SwNumNamesDlg::SetUserNames(const OUString *pList[]) } // unlock OK-Button when text is in Edit -IMPL_LINK( SwNumNamesDlg, ModifyHdl, Edit *, pBox ) +IMPL_LINK_TYPED( SwNumNamesDlg, ModifyHdl, Edit&, rBox, void ) { - m_pOKBtn->Enable(!pBox->GetText().isEmpty()); - return 0; + m_pOKBtn->Enable(!rBox.GetText().isEmpty()); } // DoubleClickHdl @@ -583,7 +582,7 @@ IMPL_LINK_TYPED( SwOutlineSettingsTabPage, LevelHdl, ListBox&, rBox, void ) Update(); } -IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pField ) +IMPL_LINK_TYPED( SwOutlineSettingsTabPage, ToggleComplete, Edit&, rEdit, void ) { sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < MAXLEVEL; i++) @@ -591,14 +590,13 @@ IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pField ) if(nActLevel & nMask) { SwNumFormat aNumFormat(pNumRule->Get(i)); - aNumFormat.SetIncludeUpperLevels( std::min( (sal_uInt8)pField->GetValue(), + aNumFormat.SetIncludeUpperLevels( std::min( (sal_uInt8)static_cast<NumericField&>(rEdit).GetValue(), (sal_uInt8)(i + 1)) ); pNumRule->Set(i, aNumFormat); } nMask <<= 1; } SetModified(); - return 0; } IMPL_LINK_TYPED( SwOutlineSettingsTabPage, CollSelect, ListBox&, rBox, void ) @@ -667,7 +665,7 @@ IMPL_LINK_TYPED( SwOutlineSettingsTabPage, NumberSelect, ListBox&, rBox, void ) SetModified(); } -IMPL_LINK_NOARG(SwOutlineSettingsTabPage, DelimModify) +IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, DelimModify, Edit&, void) { sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < MAXLEVEL; i++) @@ -682,10 +680,9 @@ IMPL_LINK_NOARG(SwOutlineSettingsTabPage, DelimModify) nMask <<= 1; } SetModified(); - return 0; } -IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pField ) +IMPL_LINK_TYPED( SwOutlineSettingsTabPage, StartModified, Edit&, rEdit, void ) { sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < MAXLEVEL; i++) @@ -693,13 +690,12 @@ IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pField ) if(nActLevel & nMask) { SwNumFormat aNumFormat(pNumRule->Get(i)); - aNumFormat.SetStart( (sal_uInt16)pField->GetValue() ); + aNumFormat.SetStart( (sal_uInt16)static_cast<NumericField&>(rEdit).GetValue() ); pNumRule->Set(i, aNumFormat); } nMask <<= 1; } SetModified(); - return 0; } IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CharFormatHdl, ListBox&, void) @@ -866,7 +862,7 @@ void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType; m_pStartEdit->SetMin(bNoZeroAllowed ? 1 : 0); if(bIsNull && bNoZeroAllowed) - m_pStartEdit->GetModifyHdl().Call(m_pStartEdit); + m_pStartEdit->GetModifyHdl().Call(*m_pStartEdit); } static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, long nXStart, long nYStart, const Size& rSize) diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 07a77808b10e..cf875f1ce3e6 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -84,15 +84,13 @@ IMPL_LINK_NOARG_TYPED(SwFootNotePage, HeightModify, Control&, void) FUNIT_TWIP); } -IMPL_LINK_NOARG(SwFootNotePage, LineWidthChanged_Impl) +IMPL_LINK_NOARG_TYPED(SwFootNotePage, LineWidthChanged_Impl, Edit&, void) { sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthEdit->GetValue( ), m_pLineWidthEdit->GetDecimalDigits( ), m_pLineWidthEdit->GetUnit(), MAP_TWIP )); m_pLineTypeBox->SetWidth( nVal ); - - return 0; } IMPL_LINK_NOARG_TYPED(SwFootNotePage, LineColorSelected_Impl, ListBox&, void) diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx index bea63ffdec9f..36286e35af1a 100644 --- a/sw/source/ui/table/colwd.cxx +++ b/sw/source/ui/table/colwd.cxx @@ -31,13 +31,12 @@ #include <cmdid.h> #include <table.hrc> -IMPL_LINK_NOARG(SwTableWidthDlg, LoseFocusHdl) +IMPL_LINK_NOARG_TYPED(SwTableWidthDlg, LoseFocusHdl, Edit&, void) { sal_uInt16 nId = (sal_uInt16)m_pColNF->GetValue()-1; const SwTwips lWidth = rFnc.GetColWidth(nId); m_pWidthMF->SetMax(m_pWidthMF->Normalize(rFnc.GetMaxColWidth(nId)), FUNIT_TWIP); m_pWidthMF->SetValue(m_pWidthMF->Normalize(lWidth), FUNIT_TWIP); - return 0; } SwTableWidthDlg::SwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rTableFnc ) @@ -62,7 +61,7 @@ SwTableWidthDlg::SwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rTableFnc ) m_pWidthMF->SetMin(m_pWidthMF->Normalize(rFnc.GetColWidth(0)), FUNIT_TWIP); m_pColNF->SetMax(rFnc.GetColCount() +1 ); m_pColNF->SetModifyHdl(LINK(this,SwTableWidthDlg, LoseFocusHdl)); - LoseFocusHdl(); + LoseFocusHdl(*m_pColNF); } SwTableWidthDlg::~SwTableWidthDlg() diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx index 4543d83df4c6..8b4c845d3af9 100644 --- a/sw/source/ui/table/instable.cxx +++ b/sw/source/ui/table/instable.cxx @@ -156,22 +156,21 @@ void SwInsTableDlg::dispose() SfxModalDialog::dispose(); } -IMPL_LINK( SwInsTableDlg, ModifyName, Edit *, pEdit ) +IMPL_LINK_TYPED( SwInsTableDlg, ModifyName, Edit&, rEdit, void ) { - OUString sTableName = pEdit->GetText(); + OUString sTableName = rEdit.GetText(); if (sTableName.indexOf(' ') != -1) { sTableName = sTableName.replaceAll(" ", ""); - pEdit->SetText(sTableName); + rEdit.SetText(sTableName); } m_pInsertBtn->Enable(pShell->GetTableStyle( sTableName ) == 0); - return 0; } -IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField ) +IMPL_LINK_TYPED( SwInsTableDlg, ModifyRowCol, Edit&, rEdit, void ) { - if(pField == m_pColNF) + if(&rEdit == m_pColNF) { sal_Int64 nCol = m_pColNF->GetValue(); if(!nCol) @@ -196,9 +195,7 @@ IMPL_LINK( SwInsTableDlg, ModifyRowCol, NumericField *, pField ) else if( nActVal < nEnteredValRepeatHeaderNF ) m_pRepeatHeaderNF->SetValue( ( nEnteredValRepeatHeaderNF < nMax )? nEnteredValRepeatHeaderNF : nMax ); } - return 0; } - IMPL_LINK_TYPED( SwInsTableDlg, AutoFormatHdl, Button*, pButton, void ) { SwAbstractDialogFactory* pFact = swui::GetFactory(); @@ -221,10 +218,9 @@ IMPL_LINK_NOARG_TYPED(SwInsTableDlg, ReapeatHeaderCheckBoxHdl, Button*, void) m_pRepeatGroup->Enable(m_pHeaderCB->IsChecked() && m_pRepeatHeaderCB->IsChecked()); } -IMPL_LINK_NOARG(SwInsTableDlg, ModifyRepeatHeaderNF_Hdl) +IMPL_LINK_NOARG_TYPED(SwInsTableDlg, ModifyRepeatHeaderNF_Hdl, Edit&, void) { nEnteredValRepeatHeaderNF = m_pRepeatHeaderNF->GetValue(); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index 4442f018552e..9c05b4ffcad9 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -99,16 +99,15 @@ IMPL_LINK_NOARG_TYPED(SwRenameXNamedDlg, OkHdl, Button*, void) EndDialog(RET_OK); } -IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED(SwRenameXNamedDlg, ModifyHdl, Edit&, rEdit, void) { - OUString sTmp(pEdit->GetText()); + OUString sTmp(rEdit.GetText()); m_pOk->Enable(!sTmp.isEmpty() && !xNameAccess->hasByName(sTmp) && (!xSecondAccess.is() || !xSecondAccess->hasByName(sTmp)) && (!xThirdAccess.is() || !xThirdAccess->hasByName(sTmp)) ); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx index 7bd11cc8d7a1..7a94dc3473eb 100644 --- a/sw/source/uibase/inc/bookmark.hxx +++ b/sw/source/uibase/inc/bookmark.hxx @@ -55,7 +55,7 @@ class SwInsertBookmarkDlg: public SvxStandardDialog SwWrtShell &rSh; SfxRequest& rReq; - DECL_LINK(ModifyHdl, BookmarkCombo *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(DeleteHdl, Button*, void); virtual void Apply() override; diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 9bf6bfd340af..193db7105c78 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -54,7 +54,7 @@ class SwBreakDlg: public SvxStandardDialog DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( PageNumHdl, Button*, void ); - DECL_LINK(PageNumModifyHdl, void *); + DECL_LINK_TYPED(PageNumModifyHdl, Edit&, void); DECL_LINK_TYPED(OkHdl, Button*, void); void CheckEnable(); diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx index 28298d8d8c7e..d956356ba852 100644 --- a/sw/source/uibase/inc/column.hxx +++ b/sw/source/uibase/inc/column.hxx @@ -139,15 +139,16 @@ class SwColumnPage : public SfxTabPage bool bLockUpdate; // Handler - DECL_LINK( ColModify, NumericField * ); - DECL_LINK( GapModify, MetricField * ); - DECL_LINK( EdModify, MetricField * ); + DECL_LINK_TYPED( ColModify, Edit&, void ); + void ColModify(NumericField*); + DECL_LINK_TYPED( GapModify, Edit&, void ); + DECL_LINK_TYPED( EdModify, Edit&, void ); DECL_LINK_TYPED( AutoWidthHdl, Button *, void ); DECL_LINK_TYPED( SetDefaultsHdl, ValueSet *, void ); - DECL_LINK_TYPED(Up, Button *, void); - DECL_LINK_TYPED(Down, Button *, void); - DECL_LINK( UpdateColMgr, void* ); + DECL_LINK_TYPED( Up, Button *, void ); + DECL_LINK_TYPED( Down, Button *, void ); + DECL_LINK_TYPED( UpdateColMgr, Edit&, void ); DECL_LINK_TYPED( UpdateColMgrListBox, ListBox&, void ); void Timeout(); diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx index de5e9b4d0164..53848f34cedb 100644 --- a/sw/source/uibase/inc/cption.hxx +++ b/sw/source/uibase/inc/cption.hxx @@ -96,7 +96,7 @@ class SwCaptionDialog : public SvxStandardDialog DECL_LINK_TYPED(SelectHdl, ComboBox&, void); DECL_LINK_TYPED(SelectListBoxHdl, ListBox&, void); - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(OptionHdl, Button *, void); DECL_LINK_TYPED(CaptionHdl, Button *, void); diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx index 4aee03283fac..66c4ae24c853 100644 --- a/sw/source/uibase/inc/drpcps.hxx +++ b/sw/source/uibase/inc/drpcps.hxx @@ -69,10 +69,10 @@ friend class SwDropCapsPict; virtual sfxpg DeactivatePage(SfxItemSet *pSet) override; void FillSet( SfxItemSet &rSet ); - DECL_LINK_TYPED(ClickHdl, Button*, void); - DECL_LINK( ModifyHdl, Edit * ); - DECL_LINK_TYPED(SelectHdl, ListBox&, void); - DECL_LINK_TYPED(WholeWordHdl, Button*, void); + DECL_LINK_TYPED( ClickHdl, Button*, void ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); + DECL_LINK_TYPED( WholeWordHdl, Button*, void ); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx index b29b2b32ce3e..2f093afe5936 100644 --- a/sw/source/uibase/inc/frmpage.hxx +++ b/sw/source/uibase/inc/frmpage.hxx @@ -149,7 +149,7 @@ class SwFrmPage: public SfxTabPage // update example void UpdateExample(); - DECL_LINK( ModifyHdl, Edit * ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); void Init(const SfxItemSet& rSet, bool bReset = false); // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous @@ -304,7 +304,7 @@ class SwFrmAddPage : public SfxTabPage bool bFormat; bool bNew; - DECL_LINK(EditModifyHdl, void *); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); DECL_LINK_TYPED(ChainModifyHdl, ListBox&, void); static const sal_uInt16 aAddPgRg[]; diff --git a/sw/source/uibase/inc/glosbib.hxx b/sw/source/uibase/inc/glosbib.hxx index 1b14ae803b38..ee2b1812c05d 100644 --- a/sw/source/uibase/inc/glosbib.hxx +++ b/sw/source/uibase/inc/glosbib.hxx @@ -92,11 +92,11 @@ class SwGlossaryGroupDlg : public SvxStandardDialog protected: virtual void Apply() override; DECL_LINK_TYPED( SelectHdl, SvTreeListBox*, void ); - DECL_LINK_TYPED(NewHdl, Button *, void); + DECL_LINK_TYPED( NewHdl, Button *, void ); DECL_LINK_TYPED( DeleteHdl, Button*, void ); - DECL_LINK(ModifyHdl, void *); - DECL_LINK_TYPED(ModifyListBoxHdl, ListBox&, void); - DECL_LINK_TYPED(RenameHdl, Button *, void); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); + DECL_LINK_TYPED( ModifyListBoxHdl, ListBox&, void ); + DECL_LINK_TYPED( RenameHdl, Button *, void ); public: SwGlossaryGroupDlg(vcl::Window * pParent, diff --git a/sw/source/uibase/inc/glossary.hxx b/sw/source/uibase/inc/glossary.hxx index 4092f98be3e8..b41ae52c9be2 100644 --- a/sw/source/uibase/inc/glossary.hxx +++ b/sw/source/uibase/inc/glossary.hxx @@ -123,14 +123,14 @@ class SwGlossaryDlg : public SvxStandardDialog void EnableShortName(bool bOn = true); void ShowPreview(); - DECL_LINK( NameModify, Edit * ); + DECL_LINK_TYPED( NameModify, Edit&, void ); DECL_LINK_TYPED( NameDoubleClick, SvTreeListBox*, bool ); DECL_LINK_TYPED( GrpSelect, SvTreeListBox *, void ); DECL_LINK_TYPED( MenuHdl, Menu *, bool ); DECL_LINK_TYPED( EnableHdl, Menu *, bool ); - DECL_LINK_TYPED(BibHdl, Button *, void); - DECL_LINK_TYPED(EditHdl, MenuButton *, void); - DECL_LINK_TYPED(InsertHdl, Button *, void); + DECL_LINK_TYPED( BibHdl, Button *, void ); + DECL_LINK_TYPED( EditHdl, MenuButton *, void ); + DECL_LINK_TYPED( InsertHdl, Button *, void ); DECL_LINK_TYPED( PathHdl, Button *, void ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); DECL_LINK_TYPED( PreviewLoadedHdl, SwOneExampleFrame&, void ); diff --git a/sw/source/uibase/inc/inputwin.hxx b/sw/source/uibase/inc/inputwin.hxx index de5a236bc508..97fc2594903c 100644 --- a/sw/source/uibase/inc/inputwin.hxx +++ b/sw/source/uibase/inc/inputwin.hxx @@ -66,7 +66,7 @@ friend class InputEdit; void CleanupUglyHackWithUndo(); void DelBoxContent(); - DECL_LINK( ModifyHdl, void* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); using Window::IsActive; diff --git a/sw/source/uibase/inc/insfnote.hxx b/sw/source/uibase/inc/insfnote.hxx index 03acd7eea195..81dd8c12d7ea 100644 --- a/sw/source/uibase/inc/insfnote.hxx +++ b/sw/source/uibase/inc/insfnote.hxx @@ -55,7 +55,7 @@ class SwInsFootNoteDlg: public SvxStandardDialog VclPtr<PushButton> m_pNextBT; DECL_LINK_TYPED(NumberCharHdl, Button *, void); - DECL_LINK(NumberEditHdl, void *); + DECL_LINK_TYPED(NumberEditHdl, Edit&, void); DECL_LINK_TYPED(NumberAutoBtnHdl, Button *, void); DECL_LINK_TYPED(NumberExtCharHdl, Button *, void); DECL_LINK_TYPED(NextPrevHdl, Button *, void); diff --git a/sw/source/uibase/inc/instable.hxx b/sw/source/uibase/inc/instable.hxx index e4bd75c9bcf0..a838a89c1122 100644 --- a/sw/source/uibase/inc/instable.hxx +++ b/sw/source/uibase/inc/instable.hxx @@ -55,13 +55,13 @@ class SwInsTableDlg : public SfxModalDialog SwTableAutoFormat* pTAutoFormat; sal_Int64 nEnteredValRepeatHeaderNF; - DECL_LINK( ModifyName, Edit* ); - DECL_LINK( ModifyRowCol, NumericField* ); + DECL_LINK_TYPED( ModifyName, Edit&, void ); + DECL_LINK_TYPED( ModifyRowCol, Edit&, void ); DECL_LINK_TYPED( AutoFormatHdl, Button*, void ); - DECL_LINK_TYPED(OKHdl, Button*, void); - DECL_LINK_TYPED(CheckBoxHdl, Button* = 0, void); + DECL_LINK_TYPED( OKHdl, Button*, void); + DECL_LINK_TYPED( CheckBoxHdl, Button* = 0, void); DECL_LINK_TYPED( ReapeatHeaderCheckBoxHdl, Button* = 0, void); - DECL_LINK( ModifyRepeatHeaderNF_Hdl, void* ); + DECL_LINK_TYPED( ModifyRepeatHeaderNF_Hdl, Edit&, void ); public: SwInsTableDlg( SwView& rView ); diff --git a/sw/source/uibase/inc/linenum.hxx b/sw/source/uibase/inc/linenum.hxx index 05ac54261850..7db3ed8fdb85 100644 --- a/sw/source/uibase/inc/linenum.hxx +++ b/sw/source/uibase/inc/linenum.hxx @@ -50,7 +50,7 @@ private: VclPtr<CheckBox> m_pNumberingOnFooterHeader; DECL_LINK_TYPED(OKHdl, Button*, void); DECL_LINK_TYPED(LineOnOffHdl, Button* = 0, void); - DECL_LINK(ModifyHdl, void * = 0); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: SwLineNumberingDlg(SwView *pVw); diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx index 75be32484346..fd5777a1a496 100644 --- a/sw/source/uibase/inc/mailmrge.hxx +++ b/sw/source/uibase/inc/mailmrge.hxx @@ -105,10 +105,10 @@ class SwMailMergeDlg : public SvxStandardDialog OUString m_sSaveFilter; DECL_LINK_TYPED( ButtonHdl, Button*, void ); - DECL_LINK_TYPED( InsertPathHdl, Button*, void); + DECL_LINK_TYPED( InsertPathHdl, Button*, void ); DECL_LINK_TYPED( OutputTypeHdl, Button*, void ); DECL_LINK_TYPED( FilenameHdl, Button*, void ); - DECL_LINK(ModifyHdl, void *); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( SaveTypeHdl, Button*, void ); virtual void Apply() override; diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx index 0843e6d6aec9..c05902aeb1e4 100644 --- a/sw/source/uibase/inc/optload.hxx +++ b/sw/source/uibase/inc/optload.hxx @@ -155,7 +155,7 @@ private: DECL_LINK_TYPED(SelectHdl, ComboBox&, void); DECL_LINK_TYPED(SelectListBoxHdl, ListBox&, void); - DECL_LINK(ModifyHdl, void * = 0); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED( OrderHdl, ListBox&, void ); DECL_LINK_TYPED(ShowEntryHdl, SvTreeListBox*, void); DECL_LINK_TYPED(SaveEntryHdl, SvTreeListBox*, void); diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index 95c2e191f78d..bd7117632f5e 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -173,9 +173,9 @@ class SwStdFontTabPage : public SfxTabPage OUString sScriptAsian; OUString sScriptComplex; - DECL_LINK_TYPED(StandardHdl, Button*, void); - DECL_LINK(ModifyHdl, ComboBox * ); - DECL_LINK(ModifyHeightHdl, FontSizeBox * ); + DECL_LINK_TYPED(StandardHdl, Button*, void ); + DECL_LINK_TYPED(ModifyHdl, Edit&, void ); + DECL_LINK_TYPED(ModifyHeightHdl, Edit&, void ); DECL_LINK_TYPED(LoseFocusHdl, Control&, void ); SwStdFontTabPage(vcl::Window* pParent, const SfxItemSet& rSet); diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx index 0856a51c7db0..eff809095055 100644 --- a/sw/source/uibase/inc/outline.hxx +++ b/sw/source/uibase/inc/outline.hxx @@ -103,13 +103,13 @@ class SwOutlineSettingsTabPage : public SfxTabPage sal_uInt16 nActLevel; DECL_LINK_TYPED( LevelHdl, ListBox&, void ); - DECL_LINK( ToggleComplete, NumericField * ); + DECL_LINK_TYPED( ToggleComplete, Edit&, void ); DECL_LINK_TYPED( CollSelect, ListBox&, void ); - DECL_LINK_TYPED(CollSelectGetFocus, Control&, void); + DECL_LINK_TYPED( CollSelectGetFocus, Control&, void ); DECL_LINK_TYPED( NumberSelect, ListBox&, void ); - DECL_LINK(DelimModify, void *); - DECL_LINK( StartModified, NumericField * ); - DECL_LINK_TYPED(CharFormatHdl, ListBox&, void); + DECL_LINK_TYPED( DelimModify, Edit&, void ); + DECL_LINK_TYPED( StartModified, Edit&, void ); + DECL_LINK_TYPED( CharFormatHdl, ListBox&, void ); void Update(); diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx index 666957c39e77..4ea911d56ef2 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -57,11 +57,11 @@ private: VclPtr<MetricField> m_pLineLengthEdit; VclPtr<MetricField> m_pLineDistEdit; - DECL_LINK_TYPED(HeightPage, Button*, void); - DECL_LINK_TYPED(HeightMetric, Button*, void); - DECL_LINK_TYPED(HeightModify, Control&, void); - DECL_LINK( LineWidthChanged_Impl, void * ); - DECL_LINK_TYPED( LineColorSelected_Impl, ListBox&, void); + DECL_LINK_TYPED( HeightPage, Button*, void ); + DECL_LINK_TYPED( HeightMetric, Button*, void ); + DECL_LINK_TYPED( HeightModify, Control&, void ); + DECL_LINK_TYPED( LineWidthChanged_Impl, Edit&, void ); + DECL_LINK_TYPED( LineColorSelected_Impl, ListBox&, void ); long lMaxHeight; diff --git a/sw/source/uibase/inc/prcntfld.hxx b/sw/source/uibase/inc/prcntfld.hxx index 57fc65b0b472..6e69899810a4 100644 --- a/sw/source/uibase/inc/prcntfld.hxx +++ b/sw/source/uibase/inc/prcntfld.hxx @@ -50,7 +50,7 @@ public: MetricField* get() { return m_pField; } void SetUpHdl(const Link<SpinField&,void>& rLink) { m_pField->SetUpHdl(rLink); } void SetDownHdl(const Link<SpinField&,void>& rLink) { m_pField->SetDownHdl(rLink); } - void SetModifyHdl(const Link<>& rLink) { m_pField->SetModifyHdl(rLink); } + void SetModifyHdl(const Link<Edit&,void>& rLink) { m_pField->SetModifyHdl(rLink); } void SetLoseFocusHdl(const Link<Control&,void>& rLink) { m_pField->SetLoseFocusHdl(rLink); } void SetMetric(FieldUnit eUnit) { ::SetMetric(*m_pField, eUnit); } void Enable(bool bEnable = true, bool bChild = true) { m_pField->Enable(bEnable, bChild); } diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx index 0bbb394eddb3..ab1cd78378b6 100644 --- a/sw/source/uibase/inc/regionsw.hxx +++ b/sw/source/uibase/inc/regionsw.hxx @@ -108,20 +108,20 @@ class SwEditRegionDlg : public SfxModalDialog DECL_LINK_TYPED( GetFirstEntryHdl, SvTreeListBox *, void ); DECL_LINK_TYPED( DeselectHdl, SvTreeListBox *, void ); - DECL_LINK_TYPED(OkHdl, Button*, void); - DECL_LINK(NameEditHdl, void *); - DECL_LINK( ConditionEditHdl, Edit * ); + DECL_LINK_TYPED( OkHdl, Button*, void ); + DECL_LINK_TYPED( NameEditHdl, Edit&, void ); + DECL_LINK_TYPED( ConditionEditHdl, Edit&, void ); DECL_LINK_TYPED( ChangePasswdHdl, Button *, void ); DECL_LINK_TYPED( ChangeProtectHdl, Button *, void ); DECL_LINK_TYPED( ChangeHideHdl, Button *, void ); // #114856# edit in readonly sections DECL_LINK_TYPED( ChangeEditInReadonlyHdl, Button *, void ); - DECL_LINK_TYPED(ChangeDismissHdl, Button*, void); + DECL_LINK_TYPED( ChangeDismissHdl, Button*, void); DECL_LINK_TYPED( UseFileHdl, Button*, void ); - DECL_LINK_TYPED(FileSearchHdl, Button*, void); - DECL_LINK_TYPED(OptionsHdl, Button*, void); - DECL_LINK( FileNameHdl, Edit* ); + DECL_LINK_TYPED( FileSearchHdl, Button*, void ); + DECL_LINK_TYPED( OptionsHdl, Button*, void ); + DECL_LINK_TYPED( FileNameHdl, Edit&, void ); DECL_LINK_TYPED( DDEHdl, Button*, void ); DECL_LINK_TYPED( DlgClosedHdl, sfx2::FileDialogHelper*, void ); DECL_LINK_TYPED( SubRegionEventHdl, VclWindowEvent&, void ); @@ -174,9 +174,9 @@ class SwInsertSectionTabPage : public SfxTabPage DECL_LINK_TYPED( ChangeHideHdl, Button *, void ); DECL_LINK_TYPED( ChangeProtectHdl, Button *, void ); DECL_LINK_TYPED( ChangePasswdHdl, Button *, void ); - DECL_LINK(NameEditHdl, void *); + DECL_LINK_TYPED( NameEditHdl, Edit&, void ); DECL_LINK_TYPED( UseFileHdl, Button*, void ); - DECL_LINK_TYPED(FileSearchHdl, Button*, void ); + DECL_LINK_TYPED( FileSearchHdl, Button*, void ); DECL_LINK_TYPED( DDEHdl, Button*, void ); DECL_LINK_TYPED( DlgClosedHdl, sfx2::FileDialogHelper*, void ); @@ -243,7 +243,7 @@ class SwSectionIndentTabPage : public SfxTabPage VclPtr<MetricField> m_pAfterMF; VclPtr<SvxParaPrevWindow> m_pPreviewWin; - DECL_LINK(IndentModifyHdl, void *); + DECL_LINK_TYPED(IndentModifyHdl, Edit&, void); public: SwSectionIndentTabPage( vcl::Window *pParent, const SfxItemSet &rAttrSet ); virtual ~SwSectionIndentTabPage(); diff --git a/sw/source/uibase/inc/swrenamexnameddlg.hxx b/sw/source/uibase/inc/swrenamexnameddlg.hxx index 3661d73b9b8e..87f3085043d5 100644 --- a/sw/source/uibase/inc/swrenamexnameddlg.hxx +++ b/sw/source/uibase/inc/swrenamexnameddlg.hxx @@ -42,7 +42,7 @@ class SwRenameXNamedDlg : public ModalDialog ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xThirdAccess; DECL_LINK_TYPED(OkHdl, Button*, void); - DECL_LINK(ModifyHdl, Edit*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); public: SwRenameXNamedDlg( vcl::Window* pParent, diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index a5e8608f5813..4d51f43b4f79 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -210,7 +210,7 @@ class SwTOXSelectTabPage : public SfxTabPage void LanguageHdl(ListBox*); DECL_LINK_TYPED(CheckBoxHdl, Button*, void ); DECL_LINK_TYPED(RadioButtonHdl, Button*, void); - DECL_LINK(ModifyHdl, void*); + DECL_LINK_TYPED(ModifyHdl, Edit&, void); DECL_LINK_TYPED(ModifyListBoxHdl, ListBox&, void); void ApplyTOXDescription(); @@ -268,7 +268,7 @@ class SwTokenWindow : public VclHBox, public VclBuilderContainer VclPtr<SwTOXEntryTabPage> m_pParent; - DECL_LINK(EditResize, Edit*); + DECL_LINK_TYPED( EditResize, Edit&, void ); DECL_LINK_TYPED( NextItemHdl, SwTOXEdit&, void ); DECL_LINK_TYPED( TbxFocusHdl, Control&, void ); DECL_LINK_TYPED( NextItemBtnHdl, SwTOXButton&, void ); @@ -417,12 +417,12 @@ class SwTOXEntryTabPage : public SfxTabPage DECL_LINK_TYPED(LevelHdl, SvTreeListBox*, void); DECL_LINK_TYPED(AutoRightHdl, Button*, void); DECL_LINK_TYPED(TokenSelectedHdl, SwFormToken&, void); - DECL_LINK(TabPosHdl, MetricField*); - DECL_LINK(FillCharHdl, ComboBox*); + DECL_LINK_TYPED(TabPosHdl, Edit&, void); + DECL_LINK_TYPED(FillCharHdl, Edit&, void); DECL_LINK_TYPED(RemoveInsertAuthHdl, Button*, void); DECL_LINK_TYPED(SortKeyHdl, Button*, void); DECL_LINK_TYPED(ChapterInfoHdl, ListBox&, void); - DECL_LINK(ChapterInfoOutlineHdl, NumericField*); + DECL_LINK_TYPED(ChapterInfoOutlineHdl, Edit&, void); DECL_LINK_TYPED(NumberFormatHdl, ListBox&, void); DECL_LINK_TYPED(AllLevelsHdl, Button*, void); diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx index 9d0cf903c92d..44db42e84b95 100644 --- a/sw/source/uibase/inc/swuiidxmrk.hxx +++ b/sw/source/uibase/inc/swuiidxmrk.hxx @@ -108,18 +108,19 @@ class SwIndexMarkPane void UpdateMark(); DECL_LINK_TYPED( InsertHdl, Button *, void ); - DECL_LINK_TYPED(CloseHdl, Button*, void); - DECL_LINK_TYPED(DelHdl, Button*, void); - DECL_LINK_TYPED(NextHdl, Button*, void); - DECL_LINK_TYPED(NextSameHdl, Button*, void); - DECL_LINK_TYPED(PrevHdl, Button*, void); - DECL_LINK_TYPED(PrevSameHdl, Button*, void); + DECL_LINK_TYPED( CloseHdl, Button*, void ); + DECL_LINK_TYPED( DelHdl, Button*, void ); + DECL_LINK_TYPED( NextHdl, Button*, void ); + DECL_LINK_TYPED( NextSameHdl, Button*, void ); + DECL_LINK_TYPED( PrevHdl, Button*, void ); + DECL_LINK_TYPED( PrevSameHdl, Button*, void ); DECL_LINK_TYPED( ModifyListBoxHdl, ListBox&, void ); - DECL_LINK( ModifyHdl, void* ); - DECL_LINK( KeyDCBModifyHdl, ComboBox * ); - DECL_LINK_TYPED(NewUserIdxHdl, Button*, void); - DECL_LINK_TYPED( SearchTypeHdl, Button*, void); - DECL_LINK( PhoneticEDModifyHdl, Edit * ); + DECL_LINK_TYPED( ModifyEditHdl, Edit&, void ); + void ModifyHdl(Control*); + DECL_LINK_TYPED( KeyDCBModifyHdl, Edit&, void ); + DECL_LINK_TYPED( NewUserIdxHdl, Button*, void ); + DECL_LINK_TYPED( SearchTypeHdl, Button*, void ); + DECL_LINK_TYPED( PhoneticEDModifyHdl, Edit&, void ); //this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled' //it needs to be called ones if this dialog is opened to create a new entry (in InitControls), @@ -212,7 +213,7 @@ class SwAuthorMarkPane DECL_LINK_TYPED(CompEntryHdl, ListBox&, void); DECL_LINK_TYPED(ChangeSourceHdl, Button*, void); DECL_LINK_TYPED(IsEntryAllowedHdl, Edit*, bool); - DECL_LINK(EditModifyHdl, Edit*); + DECL_LINK_TYPED(EditModifyHdl, Edit&, void); void InitControls(); void Activate(); diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 9f0647bf059f..6720fe92210c 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -474,7 +474,7 @@ void SwInputWindow::SetFormula( const OUString& rFormula, bool bDelFlag ) bDelSel = bDelFlag; } -IMPL_LINK_NOARG(SwInputWindow, ModifyHdl) +IMPL_LINK_NOARG_TYPED(SwInputWindow, ModifyHdl, Edit&, void) { if (bIsTable && m_bResetUndo) { @@ -488,7 +488,6 @@ IMPL_LINK_NOARG(SwInputWindow, ModifyHdl) pWrtShell->EndAllAction(); sOldFormula = sNew; } - return 0; } void SwInputWindow::DelBoxContent() diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 7e3a206c63ac..069f3cf1ed72 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -94,7 +94,7 @@ PageMarginControl::PageMarginControl( SelectValueSetItem(); SetFieldUnit( *maLeftMarginEdit.get(), eFUnit ); - Link<> aLinkLR = LINK( this, PageMarginControl, ModifyLRMarginHdl ); + Link<Edit&,void> aLinkLR = LINK( this, PageMarginControl, ModifyLRMarginHdl ); maLeftMarginEdit->SetModifyHdl( aLinkLR ); SetMetricValue( *maLeftMarginEdit.get(), mnPageLeftMargin, meUnit ); @@ -102,7 +102,7 @@ PageMarginControl::PageMarginControl( maRightMarginEdit->SetModifyHdl( aLinkLR ); SetMetricValue( *maRightMarginEdit.get(), mnPageRightMargin, meUnit ); - Link<> aLinkUL = LINK( this, PageMarginControl, ModifyULMarginHdl ); + Link<Edit&,void> aLinkUL = LINK( this, PageMarginControl, ModifyULMarginHdl ); SetFieldUnit( *maTopMarginEdit.get(), eFUnit ); maTopMarginEdit->SetModifyHdl( aLinkUL ); SetMetricValue( *maTopMarginEdit.get(), mnPageTopMargin, meUnit ); @@ -399,7 +399,7 @@ IMPL_LINK_TYPED(PageMarginControl, ImplMarginHdl, ValueSet*, pControl, void) } } -IMPL_LINK( PageMarginControl, ModifyLRMarginHdl, MetricField *, ) +IMPL_LINK_NOARG_TYPED( PageMarginControl, ModifyLRMarginHdl, Edit&, void ) { mpMarginValueSet->SetNoSelection(); mpMarginValueSet->SelectItem(0); @@ -411,10 +411,9 @@ IMPL_LINK( PageMarginControl, ModifyLRMarginHdl, MetricField *, ) mnPageRightMargin = GetCoreValue( *maRightMarginEdit.get(), meUnit ); mrPagePropPanel.ExecuteMarginLRChange( mnPageLeftMargin, mnPageRightMargin ); mbCustomValuesUsed = true; - return 0; } -IMPL_LINK( PageMarginControl, ModifyULMarginHdl, MetricField *, ) +IMPL_LINK_NOARG_TYPED( PageMarginControl, ModifyULMarginHdl, Edit&, void ) { mpMarginValueSet->SetNoSelection(); mpMarginValueSet->SelectItem(0); @@ -426,7 +425,6 @@ IMPL_LINK( PageMarginControl, ModifyULMarginHdl, MetricField *, ) mnPageBottomMargin = GetCoreValue( *maBottomMarginEdit.get(), meUnit ); mrPagePropPanel.ExecuteMarginULChange( mnPageTopMargin, mnPageBottomMargin ); mbCustomValuesUsed = true; - return 0; } bool PageMarginControl::GetUserCustomValues() diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx index 31c226cb47da..b064c849fdd2 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.hxx +++ b/sw/source/uibase/sidebar/PageMarginControl.hxx @@ -102,8 +102,8 @@ private: PagePropertyPanel& mrPagePropPanel; DECL_LINK_TYPED( ImplMarginHdl, ValueSet*, void ); - DECL_LINK( ModifyLRMarginHdl, MetricField* ); - DECL_LINK( ModifyULMarginHdl, MetricField* ); + DECL_LINK_TYPED( ModifyLRMarginHdl, Edit&, void ); + DECL_LINK_TYPED( ModifyULMarginHdl, Edit&, void ); void SetMetricFieldMaxValues(const Size& rPageSize); diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx index 06ded1599cb1..182f82660762 100644 --- a/uui/source/masterpasscrtdlg.cxx +++ b/uui/source/masterpasscrtdlg.cxx @@ -27,10 +27,9 @@ -IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl) +IMPL_LINK_NOARG_TYPED(MasterPasswordCreateDialog, EditHdl_Impl, Edit&, void) { m_pOKBtn->Enable( m_pEDMasterPasswordCrt->GetText().getLength() >= nMinLen ); - return 0; } IMPL_LINK_NOARG_TYPED(MasterPasswordCreateDialog, OKHdl_Impl, Button*, void) diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx index 5174420cec97..689599557b3b 100644 --- a/uui/source/masterpasscrtdlg.hxx +++ b/uui/source/masterpasscrtdlg.hxx @@ -38,7 +38,7 @@ private: DECL_LINK_TYPED(OKHdl_Impl, Button*, void); - DECL_LINK(EditHdl_Impl, void *); + DECL_LINK_TYPED(EditHdl_Impl, Edit&, void); public: MasterPasswordCreateDialog( vcl::Window* pParent, ResMgr * pResMgr ); diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 6ba93da656a5..07ca53878bff 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -441,13 +441,12 @@ sal_uLong RTSDevicePage::getPDFDevice() return -1; //explicitly PS } -IMPL_LINK(RTSDevicePage, ModifyHdl, Edit*, pEdit) +IMPL_LINK_TYPED(RTSDevicePage, ModifyHdl, Edit&, rEdit, void) { if (m_pCustomValue) { - m_pCustomValue->m_aCustomOption = pEdit->GetText(); + m_pCustomValue->m_aCustomOption = rEdit.GetText(); } - return 0; } IMPL_LINK_TYPED( RTSDevicePage, SelectHdl, ListBox&, rBox, void ) diff --git a/vcl/generic/print/prtsetup.hxx b/vcl/generic/print/prtsetup.hxx index 78e4a9e8485f..33499423bc72 100644 --- a/vcl/generic/print/prtsetup.hxx +++ b/vcl/generic/print/prtsetup.hxx @@ -116,7 +116,7 @@ class RTSDevicePage : public TabPage void FillValueBox( const ::psp::PPDKey* ); DECL_LINK_TYPED( SelectHdl, ListBox&, void ); - DECL_LINK( ModifyHdl, Edit* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); public: explicit RTSDevicePage( RTSDialog* ); virtual ~RTSDevicePage(); diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index a34a29977e13..72e6c6a01315 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -244,12 +244,12 @@ namespace vcl DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( ToggleHdl, CheckBox&, void ); DECL_LINK_TYPED( ToggleRadioHdl, RadioButton&, void ); - DECL_LINK( ModifyHdl, Edit* ); + DECL_LINK_TYPED( ModifyHdl, Edit&, void ); DECL_LINK_TYPED( UIOption_CheckHdl, CheckBox&, void ); DECL_LINK_TYPED( UIOption_RadioHdl, RadioButton&, void ); DECL_LINK_TYPED( UIOption_SelectHdl, ListBox&, void ); - DECL_LINK( UIOption_ModifyHdl, Edit* ); + DECL_LINK_TYPED( UIOption_ModifyHdl, Edit&, void ); public: PrintDialog( vcl::Window*, const std::shared_ptr< PrinterController >& ); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 8461583c1413..d287058916a4 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2416,7 +2416,7 @@ void Edit::Modify() if ( mpUpdateDataTimer ) mpUpdateDataTimer->Start(); - if ( ImplCallEventListenersAndHandler( VCLEVENT_EDIT_MODIFY, [this] () { maModifyHdl.Call(this); } ) ) + if ( ImplCallEventListenersAndHandler( VCLEVENT_EDIT_MODIFY, [this] () { maModifyHdl.Call(*this); } ) ) // have been destroyed while calling into the handlers return; @@ -2435,7 +2435,7 @@ void Edit::Modify() void Edit::UpdateData() { - maUpdateDataHdl.Call( this ); + maUpdateDataHdl.Call( *this ); } IMPL_LINK_NOARG_TYPED(Edit, ImplUpdateDataHdl, Timer *, void) diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index dd95df121deb..ef6bd776f40f 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -828,44 +828,41 @@ void Slider::Resize() void Slider::SetLinkedField(VclPtr<NumericField> pField) { - ImplSetFieldLink(Link<>()); if (mpLinkedField) + { + mpLinkedField->SetModifyHdl(Link<Edit&,void>()); + mpLinkedField->SetUpHdl(Link<SpinField&,void>()); + mpLinkedField->SetDownHdl(Link<SpinField&,void>()); + mpLinkedField->SetFirstHdl(Link<SpinField&,void>()); + mpLinkedField->SetLastHdl(Link<SpinField&,void>()); mpLinkedField->SetLoseFocusHdl(Link<Control&,void>()); + } mpLinkedField = pField; - ImplSetFieldLink(LINK(this, Slider, LinkedFieldModifyHdl)); if (mpLinkedField) - mpLinkedField->SetLoseFocusHdl(LINK(this, Slider, LinkedFieldLoseFocusHdl)); -} - -void Slider::ImplSetFieldLink(const Link<>& rLink) -{ - if (mpLinkedField != nullptr) { - mpLinkedField->SetModifyHdl(rLink); + mpLinkedField->SetModifyHdl(LINK(this, Slider, LinkedFieldModifyHdl)); mpLinkedField->SetUpHdl(LINK(this, Slider, LinkedFieldSpinnerHdl)); mpLinkedField->SetDownHdl(LINK(this, Slider, LinkedFieldSpinnerHdl)); mpLinkedField->SetFirstHdl(LINK(this, Slider, LinkedFieldSpinnerHdl)); mpLinkedField->SetLastHdl(LINK(this, Slider, LinkedFieldSpinnerHdl)); + mpLinkedField->SetLoseFocusHdl(LINK(this, Slider, LinkedFieldLoseFocusHdl)); } } IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldSpinnerHdl, SpinField&, void) { if (mpLinkedField) - mpLinkedField->GetModifyHdl().Call(&mpLinkedField); + SetThumbPos(mpLinkedField->GetValue()); } IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldLoseFocusHdl, Control&, void) { if (mpLinkedField) SetThumbPos(mpLinkedField->GetValue()); } - -IMPL_LINK(Slider, LinkedFieldModifyHdl, NumericField*, /*pField*/) +IMPL_LINK_NOARG_TYPED(Slider, LinkedFieldModifyHdl, Edit&, void) { if (mpLinkedField) SetThumbPos(mpLinkedField->GetValue()); - - return 0; } void Slider::RequestHelp( const HelpEvent& rHEvt ) diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index af4eef1a9244..b8ff14c923f3 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1073,7 +1073,7 @@ void VclMultiLineEdit::ImplInitSettings(bool /*bFont*/, bool /*bForeground*/, bo void VclMultiLineEdit::Modify() { - aModifyHdlLink.Call( this ); + aModifyHdlLink.Call( *this ); CallEventListeners( VCLEVENT_EDIT_MODIFY ); @@ -1098,7 +1098,7 @@ IMPL_LINK_NOARG_TYPED(VclMultiLineEdit, ImpUpdateDataHdl, Timer *, void) void VclMultiLineEdit::UpdateData() { - aUpdateDataHdlLink.Call( this ); + aUpdateDataHdlLink.Call( *this ); } void VclMultiLineEdit::SetModifyFlag() diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 2b0996af513b..f11cb96982dd 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1646,28 +1646,27 @@ IMPL_LINK_TYPED( PrintDialog, ClickHdl, Button*, pButton, void ) } } -IMPL_LINK( PrintDialog, ModifyHdl, Edit*, pEdit ) +IMPL_LINK_TYPED( PrintDialog, ModifyHdl, Edit&, rEdit, void ) { checkControlDependencies(); - if( pEdit == maNUpPage.mpNupRowsEdt || pEdit == maNUpPage.mpNupColEdt || - pEdit == maNUpPage.mpSheetMarginEdt || pEdit == maNUpPage.mpPageMarginEdt + if( &rEdit == maNUpPage.mpNupRowsEdt || &rEdit == maNUpPage.mpNupColEdt || + &rEdit == maNUpPage.mpSheetMarginEdt || &rEdit == maNUpPage.mpPageMarginEdt ) { updateNupFromPages(); } - else if( pEdit == mpPageEdit ) + else if( &rEdit == mpPageEdit ) { mnCurPage = sal_Int32( mpPageEdit->GetValue() - 1 ); preparePreview( true, true ); } - else if( pEdit == maJobPage.mpCopyCountField ) + else if( &rEdit == maJobPage.mpCopyCountField ) { maPController->setValue( OUString( "CopyCount" ), makeAny( sal_Int32(maJobPage.mpCopyCountField->GetValue()) ) ); maPController->setValue( OUString( "Collate" ), makeAny( isCollate() ) ); } - return 0; } PropertyValue* PrintDialog::getValueForWindow( vcl::Window* i_pWindow ) const @@ -1819,15 +1818,15 @@ IMPL_LINK_TYPED( PrintDialog, UIOption_SelectHdl, ListBox&, i_rBox, void ) } } -IMPL_LINK( PrintDialog, UIOption_ModifyHdl, Edit*, i_pBox ) +IMPL_LINK_TYPED( PrintDialog, UIOption_ModifyHdl, Edit&, i_rBox, void ) { - PropertyValue* pVal = getValueForWindow( i_pBox ); + PropertyValue* pVal = getValueForWindow( &i_rBox ); if( pVal ) { - makeEnabled( i_pBox ); + makeEnabled( &i_rBox ); - NumericField* pNum = dynamic_cast<NumericField*>(i_pBox); - MetricField* pMetric = dynamic_cast<MetricField*>(i_pBox); + NumericField* pNum = dynamic_cast<NumericField*>(&i_rBox); + MetricField* pMetric = dynamic_cast<MetricField*>(&i_rBox); if( pNum ) { sal_Int64 nVal = pNum->GetValue(); @@ -1840,7 +1839,7 @@ IMPL_LINK( PrintDialog, UIOption_ModifyHdl, Edit*, i_pBox ) } else { - OUString aVal( i_pBox->GetText() ); + OUString aVal( i_rBox.GetText() ); pVal->Value <<= aVal; } @@ -1849,7 +1848,6 @@ IMPL_LINK( PrintDialog, UIOption_ModifyHdl, Edit*, i_pBox ) // update preview and page settings preparePreview(); } - return 0; } void PrintDialog::Command( const CommandEvent& rEvt ) |