diff options
415 files changed, 1886 insertions, 2078 deletions
diff --git a/avmedia/inc/mediacontrol.hxx b/avmedia/inc/mediacontrol.hxx index 521cd9869942..d2a5685fbbaf 100644 --- a/avmedia/inc/mediacontrol.hxx +++ b/avmedia/inc/mediacontrol.hxx @@ -83,7 +83,7 @@ private: DECL_LINK_TYPED( implTimeEndHdl, Slider*, void ); DECL_LINK_TYPED( implVolumeHdl, Slider*, void ); DECL_LINK_TYPED( implSelectHdl, ToolBox*, void ); - DECL_LINK( implZoomSelectHdl, ListBox* ); + DECL_LINK_TYPED( implZoomSelectHdl, ListBox&, void ); DECL_LINK_TYPED(implTimeoutHdl, Idle *, void); ImageList maImageList; diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index e5b58a8c00b4..d8efcf2a3b03 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -560,30 +560,25 @@ IMPL_LINK_TYPED( MediaControl, implSelectHdl, ToolBox*, p, void ) -IMPL_LINK( MediaControl, implZoomSelectHdl, ListBox*, p ) +IMPL_LINK_TYPED( MediaControl, implZoomSelectHdl, ListBox&, p, void ) { - if( p ) - { - MediaItem aExecItem; - css::media::ZoomLevel eLevel; - - switch( p->GetSelectEntryPos() ) - { - case( AVMEDIA_ZOOMLEVEL_50 ): eLevel = css::media::ZoomLevel_ZOOM_1_TO_2; break; - case( AVMEDIA_ZOOMLEVEL_100 ): eLevel = css::media::ZoomLevel_ORIGINAL; break; - case( AVMEDIA_ZOOMLEVEL_200 ): eLevel = css::media::ZoomLevel_ZOOM_2_TO_1; break; - case( AVMEDIA_ZOOMLEVEL_FIT ): eLevel = css::media::ZoomLevel_FIT_TO_WINDOW_FIXED_ASPECT; break; - case( AVMEDIA_ZOOMLEVEL_SCALED ): eLevel = css::media::ZoomLevel_FIT_TO_WINDOW; break; + MediaItem aExecItem; + css::media::ZoomLevel eLevel; - default: eLevel = css::media::ZoomLevel_NOT_AVAILABLE; break; - } + switch( p.GetSelectEntryPos() ) + { + case( AVMEDIA_ZOOMLEVEL_50 ): eLevel = css::media::ZoomLevel_ZOOM_1_TO_2; break; + case( AVMEDIA_ZOOMLEVEL_100 ): eLevel = css::media::ZoomLevel_ORIGINAL; break; + case( AVMEDIA_ZOOMLEVEL_200 ): eLevel = css::media::ZoomLevel_ZOOM_2_TO_1; break; + case( AVMEDIA_ZOOMLEVEL_FIT ): eLevel = css::media::ZoomLevel_FIT_TO_WINDOW_FIXED_ASPECT; break; + case( AVMEDIA_ZOOMLEVEL_SCALED ): eLevel = css::media::ZoomLevel_FIT_TO_WINDOW; break; - aExecItem.setZoom( eLevel ); - execute( aExecItem ); - update(); + default: eLevel = css::media::ZoomLevel_NOT_AVAILABLE; break; } - return 0; + aExecItem.setZoom( eLevel ); + execute( aExecItem ); + update(); } diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 23a7863cbce5..ca6aa2dfaf8a 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -496,7 +496,7 @@ public: void InsertSelectedEntry(); //insert the selected entry DECL_LINK_TYPED(ImplDoubleClickHdl, ListBox&, void); - DECL_LINK(ImplSelectHdl, void*); + DECL_LINK_TYPED(ImplSelectHdl, ListBox&, void); protected: virtual void KeyInput( const KeyEvent& rKeyEvt ) SAL_OVERRIDE; diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index b060c6248998..4580924d08ab 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2647,10 +2647,9 @@ IMPL_LINK_NOARG_TYPED(CodeCompleteListBox, ImplDoubleClickHdl, ListBox&, void) InsertSelectedEntry(); } -IMPL_LINK_NOARG(CodeCompleteListBox, ImplSelectHdl) +IMPL_LINK_NOARG_TYPED(CodeCompleteListBox, ImplSelectHdl, ListBox&, void) {//give back the focus to the parent pCodeCompleteWindow->pParent->GrabFocus(); - return 0; } ExtTextView* CodeCompleteListBox::GetParentEditView() diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 5d5cecdd96a8..1ddf3d735e89 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -611,11 +611,10 @@ IMPL_LINK_TYPED( LibPage, TreeListHighlightHdl, SvTreeListBox *, pBox, void ) CheckButtons(); } -IMPL_LINK( LibPage, BasicSelectHdl, ListBox *, /*pBox*/ ) +IMPL_LINK_NOARG_TYPED( LibPage, BasicSelectHdl, ListBox&, void ) { SetCurLib(); CheckButtons(); - return 0; } IMPL_LINK_TYPED( LibPage, ButtonHdl, Button *, pButton, void ) diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index d7e16514ad86..e23e6c4f810f 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -230,7 +230,7 @@ protected: LibraryLocation m_eCurLocation; DECL_LINK_TYPED( TreeListHighlightHdl, SvTreeListBox *, void ); - DECL_LINK( BasicSelectHdl, ListBox * ); + DECL_LINK_TYPED( BasicSelectHdl, ListBox&, void ); DECL_LINK_TYPED( ButtonHdl, Button *, void ); DECL_LINK_TYPED( CheckPasswordHdl, SvxPasswordDialog *, bool ); void CheckButtons(); diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index fcc515ac3692..3d4fb1f4f19b 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -70,7 +70,7 @@ ManageLanguageDialog::ManageLanguageDialog(vcl::Window* pParent, std::shared_ptr Init(); FillLanguageBox(); - SelectHdl( NULL ); + SelectHdl( *m_pLanguageLB ); } ManageLanguageDialog::~ManageLanguageDialog() @@ -193,7 +193,7 @@ IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, DeleteHdl, Button*, void) if ( nCount <= nPos ) nPos = nCount - 1; m_pLanguageLB->SelectEntryPos( nPos ); - SelectHdl( NULL ); + SelectHdl( *m_pLanguageLB ); } } @@ -210,11 +210,11 @@ IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, MakeDefHdl, Button*, void) FillLanguageBox(); // reset selection m_pLanguageLB->SelectEntryPos( nPos ); - SelectHdl( NULL ); + SelectHdl( *m_pLanguageLB ); } } -IMPL_LINK_NOARG(ManageLanguageDialog, SelectHdl) +IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, SelectHdl, ListBox&, void) { const sal_Int32 nCount = m_pLanguageLB->GetEntryCount(); bool bEmpty = ( !nCount || @@ -224,8 +224,6 @@ IMPL_LINK_NOARG(ManageLanguageDialog, SelectHdl) m_pDeletePB->Enable(bEnable); m_pMakeDefPB->Enable(bEnable && nCount > 1 && m_pLanguageLB->GetSelectEntryCount() == 1); - - return 1; } // class SetDefaultLanguageDialog ----------------------------------------------- diff --git a/basctl/source/inc/managelang.hxx b/basctl/source/inc/managelang.hxx index 469ee685f5ff..c6017299d7f5 100644 --- a/basctl/source/inc/managelang.hxx +++ b/basctl/source/inc/managelang.hxx @@ -69,7 +69,7 @@ private: DECL_LINK_TYPED(AddHdl, Button*, void); DECL_LINK_TYPED(DeleteHdl, Button*, void); DECL_LINK_TYPED(MakeDefHdl, Button*, void); - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); public: ManageLanguageDialog( vcl::Window* pParent, std::shared_ptr<LocalizationMgr> _pLMgr ); diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx index dd3db5ea65c6..f3602e44b536 100644 --- a/chart2/source/controller/dialogs/res_BarGeometry.cxx +++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx @@ -28,7 +28,7 @@ BarGeometryResources::BarGeometryResources(VclBuilderContainer* pWindow) pWindow->get(m_pLB_Geometry, "shape"); } -void BarGeometryResources::SetSelectHdl( const Link<>& rLink ) +void BarGeometryResources::SetSelectHdl( const Link<ListBox&,void>& rLink ) { m_pLB_Geometry->SetSelectHdl( rLink ); } diff --git a/chart2/source/controller/dialogs/res_BarGeometry.hxx b/chart2/source/controller/dialogs/res_BarGeometry.hxx index 168cd4eb7e87..31936724669f 100644 --- a/chart2/source/controller/dialogs/res_BarGeometry.hxx +++ b/chart2/source/controller/dialogs/res_BarGeometry.hxx @@ -38,7 +38,7 @@ public: sal_Int32 GetSelectEntryPos() const; void SelectEntryPos(sal_Int32 nPos); - void SetSelectHdl( const Link<>& rLink ); + void SetSelectHdl( const Link<ListBox&,void>& rLink ); private: VclPtr<FixedText> m_pFT_Geometry; diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 748dcc15812d..7f8d9485c294 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -340,10 +340,9 @@ void ErrorBarResources::UpdateControlStates() } } -IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen2 ) +IMPL_LINK_NOARG_TYPED( ErrorBarResources, CategoryChosen2, ListBox&, void ) { CategoryChosen(NULL); - return 0; } IMPL_LINK_NOARG_TYPED( ErrorBarResources, CategoryChosen, Button*, void ) diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx index fafa6fc25d1f..ed3a1f3c2ac6 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx @@ -291,10 +291,10 @@ void ThreeD_SceneAppearance_TabPage::updateScheme() } } -IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl) +IMPL_LINK_NOARG_TYPED(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl, ListBox&, void) { if( !m_bUpdateOtherControls ) - return 0; + return; { // locked controllers @@ -314,7 +314,6 @@ IMPL_LINK_NOARG(ThreeD_SceneAppearance_TabPage, SelectSchemeHdl) // update other controls initControlsFromModel(); - return 0; } IMPL_LINK_NOARG_TYPED(ThreeD_SceneAppearance_TabPage, SelectShading, CheckBox&, void) diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx index 6896466a7d23..94e10c99b9b1 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx @@ -44,7 +44,7 @@ public: virtual void ActivatePage() SAL_OVERRIDE; private: - DECL_LINK( SelectSchemeHdl, void* ); + DECL_LINK_TYPED( SelectSchemeHdl, ListBox&, void ); DECL_LINK_TYPED( SelectShading, CheckBox&, void ); DECL_LINK_TYPED( SelectRoundedEdgeOrObjectLines, CheckBox&, void ); diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index 0ee407795f0e..a4796a815175 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -444,12 +444,13 @@ IMPL_LINK_TYPED( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pBut if(pInfo) applyLightSourceToModel( nL ); } - SelectColorHdl( pListBox ); + SelectColorHdl( *pListBox ); } } -IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ColorLB*, pListBox ) +IMPL_LINK_TYPED( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ListBox&, rBox, void ) { + ColorLB* pListBox = static_cast<ColorLB*>(&rBox); if(pListBox==m_pLB_AmbientLight) { m_bInCommitToModel = true; @@ -475,7 +476,6 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ColorLB*, pListBox } } this->updatePreview(); - return 0; } IMPL_LINK_TYPED( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, Button*, pBtn, void ) diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx index f8cec2693c06..03a2684124e9 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -61,7 +61,7 @@ public: private: DECL_LINK_TYPED( ClickLightSourceButtonHdl, Button*, void ); - DECL_LINK( SelectColorHdl, ColorLB* ); + DECL_LINK_TYPED( SelectColorHdl, ListBox&, void ); DECL_LINK_TYPED( ColorDialogHdl, Button*, void ); DECL_LINK_TYPED( PreviewChangeHdl, SvxLightCtl3D*, void ); DECL_LINK_TYPED( PreviewSelectHdl, SvxLightCtl3D*, void ); diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx index 62e6e35719b9..590c7543c4dd 100644 --- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx +++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx @@ -198,7 +198,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs) if( nPos < m_pLB_CrossesAt->GetEntryCount() ) m_pLB_CrossesAt->SelectEntryPos( nPos ); - CrossesAtSelectHdl( nullptr ); + CrossesAtSelectHdl( *m_pLB_CrossesAt ); if( rInAttrs->GetItemState(SCHATTR_AXIS_POSITION_VALUE,true, &pPoolItem)== SfxItemState::SET || bZero ) { @@ -231,7 +231,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs) } else m_pLB_PlaceLabels->SetNoSelection(); - PlaceLabelsSelectHdl( nullptr ); + PlaceLabelsSelectHdl( *m_pLB_PlaceLabels ); // Tick marks long nTicks = 0, nMinorTicks = 0; @@ -313,7 +313,7 @@ void AxisPositionsTabPage::SupportAxisPositioning( bool bSupportAxisPositioning m_bSupportAxisPositioning = bSupportAxisPositioning; } -IMPL_LINK_NOARG(AxisPositionsTabPage, CrossesAtSelectHdl) +IMPL_LINK_NOARG_TYPED(AxisPositionsTabPage, CrossesAtSelectHdl, ListBox&, void) { sal_Int32 nPos = m_pLB_CrossesAt->GetSelectEntryPos(); m_pED_CrossesAt->Show( (2==nPos) && !m_bCrossingAxisIsCategoryAxis ); @@ -324,11 +324,10 @@ IMPL_LINK_NOARG(AxisPositionsTabPage, CrossesAtSelectHdl) if( 0 == m_pED_CrossesAtCategory->GetSelectEntryCount() ) m_pED_CrossesAtCategory->SelectEntryPos(0); - PlaceLabelsSelectHdl( nullptr ); - return 0; + PlaceLabelsSelectHdl( *m_pLB_PlaceLabels ); } -IMPL_LINK_NOARG(AxisPositionsTabPage, PlaceLabelsSelectHdl) +IMPL_LINK_NOARG_TYPED(AxisPositionsTabPage, PlaceLabelsSelectHdl, ListBox&, void) { sal_Int32 nLabelPos = m_pLB_PlaceLabels->GetSelectEntryPos(); @@ -340,8 +339,6 @@ IMPL_LINK_NOARG(AxisPositionsTabPage, PlaceLabelsSelectHdl) bEnableTickmarkPlacement=false; } m_pBxPlaceTicks->Enable(bEnableTickmarkPlacement); - - return 0; } } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.hxx b/chart2/source/controller/dialogs/tp_AxisPositions.hxx index a05ae58aeb49..bb1a6b4b4028 100644 --- a/chart2/source/controller/dialogs/tp_AxisPositions.hxx +++ b/chart2/source/controller/dialogs/tp_AxisPositions.hxx @@ -50,8 +50,8 @@ public: void SupportAxisPositioning( bool bSupportAxisPositioning ); private: //methods: - DECL_LINK( CrossesAtSelectHdl, void* ); - DECL_LINK( PlaceLabelsSelectHdl, void* ); + DECL_LINK_TYPED( CrossesAtSelectHdl, ListBox&, void ); + DECL_LINK_TYPED( PlaceLabelsSelectHdl, ListBox&, void ); private: //member: VclPtr<VclFrame> m_pFL_AxisLine; diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index f356a05b53b9..55feb294811b 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -56,7 +56,7 @@ public: private: DECL_LINK_TYPED( Dim3DLookCheckHdl, CheckBox&, void ); - DECL_LINK( SelectSchemeHdl, void* ); + DECL_LINK_TYPED( SelectSchemeHdl, ListBox&, void ); private: VclPtr<CheckBox> m_pCB_3DLook; @@ -110,11 +110,10 @@ IMPL_LINK_NOARG_TYPED(Dim3DLookResourceGroup, Dim3DLookCheckHdl, CheckBox&, void m_pChangeListener->stateChanged(this); } -IMPL_LINK_NOARG(Dim3DLookResourceGroup, SelectSchemeHdl) +IMPL_LINK_NOARG_TYPED(Dim3DLookResourceGroup, SelectSchemeHdl, ListBox&, void) { if(m_pChangeListener) m_pChangeListener->stateChanged(this); - return 0; } class SortByXValuesResourceGroup : public ChangingResource @@ -320,7 +319,7 @@ public: virtual void StateChanged( StateChangedType nType ) SAL_OVERRIDE; private: - DECL_LINK( SplineTypeListBoxHdl, void* ); + DECL_LINK_TYPED( SplineTypeListBoxHdl, ListBox&, void ); private: VclPtr<ListBox> m_pLB_Spline_Type; @@ -393,11 +392,10 @@ void SplinePropertiesDialog::fillParameter( ChartTypeParameter& rParameter, bool rParameter.nCurveResolution = static_cast< sal_Int32 >( m_pMF_SplineResolution->GetValue()); rParameter.nSplineOrder = static_cast< sal_Int32 >( m_pMF_SplineOrder->GetValue()); } -IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl) +IMPL_LINK_NOARG_TYPED(SplinePropertiesDialog, SplineTypeListBoxHdl, ListBox&, void) { m_pFT_SplineOrder->Enable(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()); m_pMF_SplineOrder->Enable(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()); - return 0; } class SteppedPropertiesDialog : public ModalDialog @@ -493,7 +491,7 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( LineTypeChangeHdl, void* ); + DECL_LINK_TYPED( LineTypeChangeHdl, ListBox&, void ); DECL_LINK_TYPED( SplineDetailsDialogHdl, Button*, void ); DECL_LINK_TYPED( SteppedDetailsDialogHdl, Button*, void ); SplinePropertiesDialog& getSplinePropertiesDialog(); @@ -586,11 +584,10 @@ void SplineResourceGroup::fillParameter( ChartTypeParameter& rParameter ) break; } } -IMPL_LINK_NOARG(SplineResourceGroup, LineTypeChangeHdl) +IMPL_LINK_NOARG_TYPED(SplineResourceGroup, LineTypeChangeHdl, ListBox&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); - return 0; } IMPL_LINK_NOARG_TYPED(SplineResourceGroup, SplineDetailsDialogHdl, Button*, void) { @@ -644,7 +641,7 @@ public: void fillParameter( ChartTypeParameter& rParameter ); private: - DECL_LINK( GeometryChangeHdl, void* ); + DECL_LINK_TYPED( GeometryChangeHdl, ListBox&, void ); private: BarGeometryResources m_aGeometryResources; @@ -676,11 +673,10 @@ void GeometryResourceGroup::fillParameter( ChartTypeParameter& rParameter ) rParameter.nGeometry3D = m_aGeometryResources.GetSelectEntryPos(); } -IMPL_LINK_NOARG(GeometryResourceGroup, GeometryChangeHdl) +IMPL_LINK_NOARG_TYPED(GeometryResourceGroup, GeometryChangeHdl, ListBox&, void) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); - return 0; } ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent @@ -891,10 +887,9 @@ IMPL_LINK_NOARG_TYPED(ChartTypeTabPage, SelectSubTypeHdl, ValueSet*, void) } } -IMPL_LINK_NOARG(ChartTypeTabPage, SelectMainTypeHdl) +IMPL_LINK_NOARG_TYPED(ChartTypeTabPage, SelectMainTypeHdl, ListBox&, void) { selectMainType(); - return 0; } void ChartTypeTabPage::selectMainType() diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx index fb9311403c33..3cf4d7a1a1d1 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.hxx +++ b/chart2/source/controller/dialogs/tp_ChartType.hxx @@ -74,7 +74,7 @@ protected: void commitToModel( const ChartTypeParameter& rParameter ); void selectMainType(); - DECL_LINK( SelectMainTypeHdl, void* ); + DECL_LINK_TYPED( SelectMainTypeHdl, ListBox&, void ); DECL_LINK_TYPED( SelectSubTypeHdl, ValueSet*, void ); protected: diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index 42639c3213b8..5206848b4df7 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -258,7 +258,7 @@ enum AxisTypeListBoxEntry TYPE_DATE=2 }; -IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl) +IMPL_LINK_NOARG_TYPED(ScaleTabPage, SelectAxisTypeHdl, ListBox&, void) { const sal_Int32 nPos = m_pLB_AxisType->GetSelectEntryPos(); if( nPos==TYPE_DATE ) @@ -269,7 +269,6 @@ IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl) m_pCbxLogarithm->Check(false); EnableControls(); SetNumFormat(); - return 0; } VclPtr<SfxTabPage> ScaleTabPage::Create(vcl::Window* pWindow,const SfxItemSet* rOutAttrs) diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx index c1143afab46b..da93b7025f7a 100644 --- a/chart2/source/controller/dialogs/tp_Scale.hxx +++ b/chart2/source/controller/dialogs/tp_Scale.hxx @@ -99,7 +99,7 @@ private: void EnableControls(); - DECL_LINK( SelectAxisTypeHdl, void* ); + DECL_LINK_TYPED( SelectAxisTypeHdl, ListBox&, void ); DECL_LINK_TYPED( EnableValueHdl, Button*, void ); DECL_STATIC_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField* ); diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx index 76a36f2e2175..f19ca18b3e9c 100644 --- a/chart2/source/controller/inc/res_ErrorBar.hxx +++ b/chart2/source/controller/inc/res_ErrorBar.hxx @@ -123,7 +123,7 @@ private: bool m_bEnableDataTableDialog; DECL_LINK_TYPED( CategoryChosen, Button*, void ); - DECL_LINK( CategoryChosen2, void* ); + DECL_LINK_TYPED( CategoryChosen2, ListBox&, void ); DECL_LINK_TYPED( SynchronizePosAndNeg, CheckBox&, void ); DECL_LINK( PosValueChanged, void * ); DECL_LINK_TYPED( IndicatorChanged, Button *, void ); diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx index 572974b38097..11a453340e31 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx @@ -343,14 +343,12 @@ IMPL_LINK_TYPED(ChartAxisPanel, CheckBoxHdl, Button*, pButton, void) setReverse(mxModel, aCID, bChecked); } -IMPL_LINK_NOARG(ChartAxisPanel, ListBoxHdl) +IMPL_LINK_NOARG_TYPED(ChartAxisPanel, ListBoxHdl, ListBox&, void) { OUString aCID = getCID(mxModel); sal_Int32 nPos = mpLBLabelPos->GetSelectEntryPos(); setLabelPosition(mxModel, aCID, nPos); - - return 0; } }} // end of namespace ::chart::sidebar diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.hxx b/chart2/source/controller/sidebar/ChartAxisPanel.hxx index 50c0021c2f26..708610143955 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.hxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.hxx @@ -93,7 +93,7 @@ private: void Initialize(); DECL_LINK_TYPED(CheckBoxHdl, Button*, void); - DECL_LINK(ListBoxHdl, void*); + DECL_LINK_TYPED(ListBoxHdl, ListBox&, void); }; } } // end of namespace ::chart::sidebar diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx index b22570a55823..3d74fd22c654 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx @@ -573,11 +573,10 @@ IMPL_LINK_TYPED(ChartElementsPanel, CheckBoxHdl, Button*, pButton, void) setGridVisible(mxModel, GridType::HOR_MINOR, bChecked); } -IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl) +IMPL_LINK_NOARG_TYPED(ChartElementsPanel, LegendPosHdl, ListBox&, void) { sal_Int32 nPos = mpLBLegendPosition->GetSelectEntryPos(); setLegendPos(mxModel, nPos); - return 0; } void ChartElementsPanel::setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible) diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx index 952c64a02c8a..96a12888bc83 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx @@ -114,7 +114,7 @@ private: void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible); DECL_LINK_TYPED(CheckBoxHdl, Button*, void); - DECL_LINK(LegendPosHdl, void*); + DECL_LINK_TYPED(LegendPosHdl, ListBox&, void); }; } } // end of namespace ::chart::sidebar diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx index 6a455ecf1656..0777408c85f6 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx @@ -412,14 +412,12 @@ IMPL_LINK_NOARG_TYPED(ChartErrorBarPanel, RadioBtnHdl, RadioButton&, void) setShowNegativeError(mxModel, aCID, bNeg); } -IMPL_LINK_NOARG(ChartErrorBarPanel, ListBoxHdl) +IMPL_LINK_NOARG_TYPED(ChartErrorBarPanel, ListBoxHdl, ListBox&, void) { OUString aCID = getCID(mxModel); sal_Int32 nPos = mpLBType->GetSelectEntryPos(); setTypePos(mxModel, aCID, nPos); - - return 0; } IMPL_LINK(ChartErrorBarPanel, NumericFieldHdl, NumericField*, pMetricField) diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx index 2182635dcd9f..57fb90f5fb39 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx @@ -89,7 +89,7 @@ private: void Initialize(); DECL_LINK_TYPED(RadioBtnHdl, RadioButton&, void); - DECL_LINK(ListBoxHdl, void*); + DECL_LINK_TYPED(ListBoxHdl, ListBox&, void); DECL_LINK(NumericFieldHdl, NumericField*); }; diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index e8032f7e9f85..98106e3790af 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -482,14 +482,12 @@ IMPL_LINK_NOARG_TYPED(ChartSeriesPanel, RadioBtnHdl, RadioButton&, void) setAttachedAxisType(mxModel, aCID, bChecked); } -IMPL_LINK_NOARG(ChartSeriesPanel, ListBoxHdl) +IMPL_LINK_NOARG_TYPED(ChartSeriesPanel, ListBoxHdl, ListBox&, void) { OUString aCID = getCID(mxModel); sal_Int32 nPos = mpLBLabelPlacement->GetSelectEntryPos(); setDataLabelPlacement(mxModel, aCID, nPos); - - return 0; } }} // end of namespace ::chart::sidebar diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx index bd3d3e3234c0..f3e3ab6d3d4e 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx @@ -110,7 +110,7 @@ private: DECL_LINK_TYPED(CheckBoxHdl, Button*, void); DECL_LINK_TYPED(RadioBtnHdl, RadioButton&, void); - DECL_LINK(ListBoxHdl, void*); + DECL_LINK_TYPED(ListBoxHdl, ListBox&, void); }; } } // end of namespace ::chart::sidebar diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d70b472df7cb..c6f363c12eee 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1870,15 +1870,12 @@ bool SvxConfigPage::FillItemSet( SfxItemSet* ) return result; } -IMPL_LINK( SvxConfigPage, SelectSaveInLocation, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxConfigPage, SelectSaveInLocation, ListBox&, void ) { - (void)pBox; - pCurrentSaveInData = static_cast<SaveInData*>(m_pSaveInListBox->GetEntryData( m_pSaveInListBox->GetSelectEntryPos())); Init(); - return 1; } void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) @@ -1916,7 +1913,7 @@ void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect ) nSelectionPos : m_pTopLevelListBox->GetEntryCount() - 1; m_pTopLevelListBox->SelectEntryPos( nSelectionPos ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); } void SvxConfigPage::AddSubMenusToUI( @@ -2254,7 +2251,7 @@ void SvxMenuConfigPage::Init() ReloadTopLevelListBox(); m_pTopLevelListBox->SelectEntryPos(0); - m_pTopLevelListBox->GetSelectHdl().Call(this); + m_pTopLevelListBox->GetSelectHdl().Call(*m_pTopLevelListBox); } void SvxMenuConfigPage::dispose() @@ -2388,10 +2385,8 @@ short SvxMenuConfigPage::QueryReset() return qbox->Execute(); } -IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxMenuConfigPage, SelectMenu, ListBox&, void ) { - (void)pBox; - m_pContentsListBox->Clear(); SvxConfigEntry* pMenuData = GetTopLevelSelection(); @@ -2414,8 +2409,6 @@ IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox ) } UpdateButtonStates(); - - return 0; } IMPL_LINK_TYPED( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton, void ) @@ -2969,7 +2962,7 @@ void SvxToolbarConfigPage::DeleteSelectedTopLevel() { m_pTopLevelListBox->SelectEntryPos( nSelectionPos - 1 ); } - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); // and now remove the entry m_pTopLevelListBox->RemoveEntry( nSelectionPos ); @@ -3099,7 +3092,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pSaveInData_->RestoreToolbar( pToolbar ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); } break; @@ -3109,7 +3102,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pToolbar->SetStyle( 0 ); pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 0 ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); break; } @@ -3118,7 +3111,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pToolbar->SetStyle( 1 ); pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 1 ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); break; } @@ -3127,7 +3120,7 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton, pToolbar->SetStyle( 2 ); pSaveInData->SetSystemStyle( m_xFrame, pToolbar->GetCommand(), 2 ); - m_pTopLevelListBox->GetSelectHdl().Call( this ); + m_pTopLevelListBox->GetSelectHdl().Call( *m_pTopLevelListBox ); break; } @@ -3439,7 +3432,7 @@ void SvxToolbarConfigPage::Init() } m_pTopLevelListBox->SelectEntryPos(nPos); - m_pTopLevelListBox->GetSelectHdl().Call(this); + m_pTopLevelListBox->GetSelectHdl().Call(*m_pTopLevelListBox); } SaveInData* SvxToolbarConfigPage::CreateSaveInData( @@ -4319,10 +4312,8 @@ short SvxToolbarConfigPage::QueryReset() return qbox->Execute(); } -IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, SelectToolbar, ListBox&, void ) { - (void)pBox; - m_pContentsListBox->Clear(); SvxConfigEntry* pToolbar = GetTopLevelSelection(); @@ -4332,7 +4323,7 @@ IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) m_pModifyCommandButton->Enable( false ); m_pAddCommandsButton->Enable( false ); - return 0; + return; } m_pModifyTopLevelButton->Enable( true ); @@ -4389,8 +4380,6 @@ IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox ) } UpdateButtonStates(); - - return 0; } IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, NewToolbarHdl, Button *, void ) @@ -4431,7 +4420,7 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, NewToolbarHdl, Button *, void ) if ( GetSaveInData() != pData ) { m_pSaveInListBox->SelectEntryPos( nInsertPos ); - m_pSaveInListBox->GetSelectHdl().Call(this); + m_pSaveInListBox->GetSelectHdl().Call(*m_pSaveInListBox); } SvxConfigEntry* pToolbar = @@ -4445,7 +4434,7 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, NewToolbarHdl, Button *, void ) nInsertPos = m_pTopLevelListBox->InsertEntry( pToolbar->GetName() ); m_pTopLevelListBox->SetEntryData( nInsertPos, pToolbar ); m_pTopLevelListBox->SelectEntryPos( nInsertPos ); - m_pTopLevelListBox->GetSelectHdl().Call(this); + m_pTopLevelListBox->GetSelectHdl().Call(*m_pTopLevelListBox); pData->SetModified(); } diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 347d1ab8e600..ae2ef79d2bd0 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -97,7 +97,7 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra InitAndSetHandler( m_xAppEvents, m_xDocumentEvents, m_xDocumentModifiable ); - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pSaveInListBox ); } SvxEventConfigPage::~SvxEventConfigPage() @@ -167,10 +167,8 @@ void SvxEventConfigPage::ImplInitDocument() } } -IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) +IMPL_LINK_NOARG_TYPED( SvxEventConfigPage, SelectHdl_Impl, ListBox&, void ) { - (void)pBox; - bool* bApp = static_cast<bool*>(m_pSaveInListBox->GetEntryData( m_pSaveInListBox->GetSelectEntryPos())); @@ -209,7 +207,6 @@ IMPL_LINK( SvxEventConfigPage, SelectHdl_Impl, ListBox *, pBox ) } mpImpl->pEventLB->SetUpdateMode( true ); - return sal_IntPtr(true); } bool SvxEventConfigPage::FillItemSet( SfxItemSet* rSet ) diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx index e3b25e6dffbe..c1f283f52b57 100644 --- a/cui/source/customize/eventdlg.hxx +++ b/cui/source/customize/eventdlg.hxx @@ -37,7 +37,7 @@ class SvxEventConfigPage : public _SvxMacroTabPage bool bAppConfig; - DECL_LINK( SelectHdl_Impl, ListBox* ); + DECL_LINK_TYPED( SelectHdl_Impl, ListBox&, void ); SvxEventConfigPage (const SvxEventConfigPage &) SAL_DELETED_FUNCTION; SvxEventConfigPage & operator= (const SvxEventConfigPage &) SAL_DELETED_FUNCTION; diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 02034c5f1763..a64911f25e7a 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -783,7 +783,7 @@ LanguageType SpellDialog::GetSelectedLang_Impl() const } -IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox) +IMPL_LINK_TYPED(SpellDialog, LanguageSelectHdl, ListBox&, rBox, void) { //If selected language changes, then add->list should be regenerated to //match @@ -795,7 +795,7 @@ IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox) m_pSuggestionLB->Clear(); if(!sError.isEmpty()) { - LanguageType eLanguage = pBox->GetSelectLanguage(); + LanguageType eLanguage = static_cast<SvxLanguageBox*>(&rBox)->GetSelectLanguage(); Reference <XSpellAlternatives> xAlt = xSpell->spell( sError, eLanguage, Sequence< PropertyValue >() ); if( xAlt.is() ) @@ -809,7 +809,6 @@ IMPL_LINK(SpellDialog, LanguageSelectHdl, SvxLanguageBox*, pBox) m_pSentenceED->AddUndoAction(new SpellUndoAction_Impl(SPELLUNDO_CHANGE_LANGUAGE, aDialogUndoLink)); } SpellDialog::UpdateBoxes_Impl(); - return 0; } diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index fd605cddbdde..6d83d5536a66 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -359,7 +359,7 @@ void SvxCharacterMap::init() m_pFontLB->SelectEntry( aDefStr ); else if ( m_pFontLB->GetEntryCount() ) m_pFontLB->SelectEntryPos(0); - FontSelectHdl(m_pFontLB); + FontSelectHdl(*m_pFontLB); m_pOKBtn->SetClickHdl( LINK( this, SvxCharacterMap, OKHdl ) ); m_pFontLB->SetSelectHdl( LINK( this, SvxCharacterMap, FontSelectHdl ) ); @@ -388,7 +388,7 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont ) m_pFontLB->SelectEntry( aTmp.GetName() ); aFont = aTmp; - FontSelectHdl(m_pFontLB); + FontSelectHdl(*m_pFontLB); // for compatibility reasons ModalDialog::SetFont( aFont ); @@ -424,7 +424,7 @@ void SvxCharacterMap::fillAllSubsets(ListBox &rListBox) -IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) +IMPL_LINK_NOARG_TYPED(SvxCharacterMap, FontSelectHdl, ListBox&, void) { const sal_Int32 nPos = m_pFontLB->GetSelectEntryPos(); const sal_uInt16 nFont = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFontLB->GetEntryData( nPos )); @@ -473,13 +473,11 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) m_pSubsetText->Enable(bNeedSubset); m_pSubsetLB->Enable(bNeedSubset); - - return 0; } -IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl) +IMPL_LINK_NOARG_TYPED(SvxCharacterMap, SubsetSelectHdl, ListBox&, void) { const sal_Int32 nPos = m_pSubsetLB->GetSelectEntryPos(); const Subset* pSubset = static_cast<const Subset*> (m_pSubsetLB->GetEntryData(nPos)); @@ -489,7 +487,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl) m_pShowSet->SelectCharacter( cFirst ); } m_pSubsetLB->SelectEntryPos( nPos ); - return 0; } diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index cf5b2d1983fb..e5fd633788f3 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -409,19 +409,16 @@ IMPL_LINK_NOARG_TYPED(FmSearchDialog, OnFocusGrabbed, Control&, void) m_pcmbSearchText->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); } -IMPL_LINK(FmSearchDialog, OnPositionSelected, ListBox*, pBox) +IMPL_LINK_TYPED(FmSearchDialog, OnPositionSelected, ListBox&, rBox, void) { - (void) pBox; // avoid warning - DBG_ASSERT(pBox->GetSelectEntryCount() == 1, "FmSearchDialog::OnMethodSelected : unerwartet : nicht genau ein Eintrag selektiert !"); + DBG_ASSERT(rBox.GetSelectEntryCount() == 1, "FmSearchDialog::OnMethodSelected : unerwartet : nicht genau ein Eintrag selektiert !"); m_pSearchEngine->SetPosition(m_plbPosition->GetSelectEntryPos()); - return 0; } -IMPL_LINK(FmSearchDialog, OnFieldSelected, ListBox*, pBox) +IMPL_LINK_TYPED(FmSearchDialog, OnFieldSelected, ListBox&, rBox, void) { - (void) pBox; // avoid warning - DBG_ASSERT(pBox->GetSelectEntryCount() == 1, "FmSearchDialog::OnFieldSelected : unerwartet : nicht genau ein Eintrag selektiert !"); + DBG_ASSERT(rBox.GetSelectEntryCount() == 1, "FmSearchDialog::OnFieldSelected : unerwartet : nicht genau ein Eintrag selektiert !"); m_pSearchEngine->RebuildUsedFields(m_prbAllFields->IsChecked() ? -1 : (sal_Int16)m_plbField->GetSelectEntryPos()); // calls m_pSearchEngine->InvalidatePreviousLoc too @@ -429,7 +426,6 @@ IMPL_LINK(FmSearchDialog, OnFieldSelected, ListBox*, pBox) sal_Int32 nCurrentContext = m_plbForm->GetSelectEntryPos(); if (nCurrentContext != LISTBOX_ENTRY_NOTFOUND) m_arrContextFields[nCurrentContext] = OUString(m_plbField->GetSelectEntry()); - return 0; } IMPL_LINK_TYPED(FmSearchDialog, OnCheckBoxToggled, CheckBox&, rBox, void) @@ -557,10 +553,9 @@ void FmSearchDialog::InitContext(sal_Int16 nContext) m_pftRecord->SetText(OUString::number(fmscContext.xCursor->getRow())); } -IMPL_LINK( FmSearchDialog, OnContextSelection, ListBox*, pBox) +IMPL_LINK_TYPED( FmSearchDialog, OnContextSelection, ListBox&, rBox, void) { - InitContext(pBox->GetSelectEntryPos()); - return 0L; + InitContext(rBox.GetSelectEntryPos()); } void FmSearchDialog::EnableSearchUI(bool bEnable) @@ -776,7 +771,7 @@ void FmSearchDialog::LoadParams() if (nInitialField == LISTBOX_ENTRY_NOTFOUND) nInitialField = 0; m_plbField->SelectEntryPos(nInitialField); - LINK(this, FmSearchDialog, OnFieldSelected).Call(m_plbField); + LINK(this, FmSearchDialog, OnFieldSelected).Call(*m_plbField); // all fields/single field (AFTER selecting the field because OnClickedFieldRadios expects a valid value there) if (aParams.bAllFields) { @@ -793,7 +788,7 @@ void FmSearchDialog::LoadParams() } m_plbPosition->SelectEntryPos(aParams.nPosition); - LINK(this, FmSearchDialog, OnPositionSelected).Call(m_plbPosition); + LINK(this, FmSearchDialog, OnPositionSelected).Call(*m_plbPosition); // field formatting/case sensitivity/direction m_pcbUseFormat->Check(aParams.bUseFormatter); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index bb703c2eb248..f820a620f94a 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -420,7 +420,7 @@ IMPL_LINK_NOARG_TYPED(TakeProgress, CleanUpHdl, void*, void) aRemainingVector.clear(); mpBrowser->m_pLbxFound->SetUpdateMode( true ); - mpBrowser->SelectFoundHdl( NULL ); + mpBrowser->SelectFoundHdl( *mpBrowser->m_pLbxFound ); GetParent()->LeaveWait(); EndDialog( RET_OK ); @@ -1172,7 +1172,7 @@ IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, ClickTakeAllHdl, Button*, void) -IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFoundHdl) +IMPL_LINK_NOARG_TYPED(TPGalleryThemeProperties, SelectFoundHdl, ListBox&, void) { if( bInputAllowed ) { @@ -1199,8 +1199,6 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFoundHdl) if( bPreviewPossible && m_pCbxPreview->IsChecked() ) aPreviewTimer.Start(); } - - return 0; } diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 727042d530fb..92281b85932c 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -370,7 +370,7 @@ namespace svx , m_bInSelectionUpdate( false ) { m_aValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionValueSetHdl ) ); - m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) ); + m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionListBoxHdl ) ); m_aValueSet->SetLineCount( LINE_CNT ); m_aValueSet->SetStyle( m_aValueSet->GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL ); @@ -483,10 +483,14 @@ namespace svx { SelectSuggestionHdl(pControl); } - IMPL_LINK( SuggestionDisplay, SelectSuggestionHdl, Control*, pControl ) + IMPL_LINK_TYPED( SuggestionDisplay, SelectSuggestionListBoxHdl, ListBox&, rControl, void ) + { + SelectSuggestionHdl(&rControl); + } + void SuggestionDisplay::SelectSuggestionHdl( Control* pControl ) { if( m_bInSelectionUpdate ) - return 0L; + return; m_bInSelectionUpdate = true; if( pControl == m_aListBox.get() ) @@ -501,7 +505,6 @@ namespace svx } m_bInSelectionUpdate = false; m_aSelectLink.Call( *this ); - return 0L; } void SuggestionDisplay::SetSelectHdl( const Link<SuggestionDisplay&,void>& rLink ) @@ -1535,10 +1538,9 @@ namespace svx return 0; } - IMPL_LINK_NOARG( HangulHanjaEditDictDialog, BookLBSelectHdl ) + IMPL_LINK_NOARG_TYPED( HangulHanjaEditDictDialog, BookLBSelectHdl, ListBox&, void ) { InitEditDictDialog( m_aBookLB->GetSelectEntryPos() ); - return 0; } IMPL_LINK_NOARG_TYPED( HangulHanjaEditDictDialog, NewPBPushHdl, Button*, void ) diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index d04fd57402c8..dc7300f12d36 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -48,13 +48,12 @@ IMPL_LINK_NOARG_TYPED(SvxMultiPathDialog, SelectHdl_Impl, SvTreeListBox*, void) m_pDelBtn->Enable(bEnable && bIsSelected); } -IMPL_LINK_NOARG(SvxPathSelectDialog, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, SelectHdl_Impl, ListBox&, void) { sal_uLong nCount = m_pPathLB->GetEntryCount(); bool bIsSelected = m_pPathLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND; bool bEnable = nCount > 1; m_pDelBtn->Enable(bEnable && bIsSelected); - return 0; } IMPL_LINK_TYPED( SvxMultiPathDialog, CheckHdl_Impl, SvTreeListBox*, pBox, void ) @@ -125,7 +124,7 @@ IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, AddHdl_Impl, Button*, void) m_pPathLB->SetEntryData( nPos, new OUString( aURL ) ); } - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } } @@ -170,7 +169,7 @@ IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, DelHdl_Impl, Button*, void) m_pPathLB->SelectEntryPos( nPos ); } - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent) @@ -216,7 +215,7 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent) m_pAddBtn->SetClickHdl( LINK( this, SvxPathSelectDialog, AddHdl_Impl ) ); m_pDelBtn->SetClickHdl( LINK( this, SvxPathSelectDialog, DelHdl_Impl ) ); - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } SvxMultiPathDialog::~SvxMultiPathDialog() @@ -354,7 +353,7 @@ void SvxPathSelectDialog::SetPath(const OUString& rPath) while (nIndex >= 0); } - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathLB ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index afec285c61f6..b6f3013f1046 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -69,17 +69,14 @@ void SvPasteObjectDialog::SelectObject() if (m_pLbInsertList->GetEntryCount()) { m_pLbInsertList->SelectEntryPos(0); - SelectHdl(m_pLbInsertList); + SelectHdl(*m_pLbInsertList); } } -IMPL_LINK( SvPasteObjectDialog, SelectHdl, ListBox *, pListBox ) +IMPL_LINK_NOARG_TYPED( SvPasteObjectDialog, SelectHdl, ListBox&, void ) { - (void)pListBox; - if ( !m_pOKButton->IsEnabled() ) m_pOKButton->Enable(); - return 0; } IMPL_LINK_NOARG_TYPED( SvPasteObjectDialog, DoubleClickHdl, ListBox&, void ) diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 4842aff3137e..495d46fd6f81 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -351,16 +351,15 @@ IMPL_LINK_TYPED( SvxThesaurusDialog, LeftBtnHdl_Impl, Button *, pBtn, void ) } } -IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, ListBox*, pLB ) +IMPL_LINK_TYPED( SvxThesaurusDialog, LanguageHdl_Impl, ListBox&, rLB, void ) { - OUString aLangText( pLB->GetSelectEntry() ); + OUString aLangText( rLB.GetSelectEntry() ); LanguageType nLang = SvtLanguageTable::GetLanguageType( aLangText ); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); if (xThesaurus->hasLocale( LanguageTag::convertToLocale( nLang ) )) nLookUpLanguage = nLang; SetWindowTitle( nLang ); LookUp_Impl(); - return 0; } void SvxThesaurusDialog::LookUp_Impl() diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 7509de014371..907beeafff60 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -183,7 +183,7 @@ private: DECL_LINK_TYPED(UndoHdl, Button*, void); DECL_LINK_TYPED( AddToDictSelectHdl, MenuButton*, void ); DECL_LINK_TYPED( AddToDictClickHdl, Button*, void ); - DECL_LINK( LanguageSelectHdl, SvxLanguageBox* ); + DECL_LINK_TYPED( LanguageSelectHdl, ListBox&, void ); DECL_LINK_TYPED( DialogUndoHdl, SpellUndoAction_Impl&, void ); DECL_LINK( HandleHyperlink, FixedHyperlink * ); diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx index b520e48bc031..cc43a7366a16 100644 --- a/cui/source/inc/align.hxx +++ b/cui/source/inc/align.hxx @@ -77,7 +77,7 @@ private: bool HasAlignmentChanged( const SfxItemSet& rNew, sal_uInt16 nWhich ) const; - DECL_LINK( UpdateEnableHdl, void* ); + DECL_LINK_TYPED( UpdateEnableHdl, ListBox&, void ); DECL_LINK_TYPED( UpdateEnableClickHdl, Button*, void ); private: diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index eab62485f02a..011063728a50 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -49,7 +49,7 @@ class OfaAutoCorrDlg : public SfxTabDialog sal_uInt16 m_nReplacePageId; sal_uInt16 m_nExceptionsPageId; - DECL_LINK(SelectLanguageHdl, ListBox*); + DECL_LINK_TYPED(SelectLanguageHdl, ListBox&, void); public: OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet *pSet); @@ -317,7 +317,7 @@ private: DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, AutoCorrEdit&, bool); - DECL_LINK(SelectHdl, ListBox*); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); DECL_LINK(ModifyHdl, Edit*); bool NewDelHdl(void*); /// Box filled with new language diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index 3e2ca3da014e..b42cc67acfff 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -133,12 +133,12 @@ private: void ResetFromWallpaperItem( const SfxItemSet& rSet ); DECL_LINK_TYPED( LoadIdleHdl_Impl, Idle*, void ); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED(BrowseHdl_Impl, Button*, void); DECL_LINK_TYPED( RadioClickHdl_Impl, Button*, void ); DECL_LINK_TYPED( FileClickHdl_Impl, Button*, void ); DECL_LINK_TYPED(BackgroundColorHdl_Impl, ValueSet*, void); - DECL_LINK( TblDestinationHdl_Impl, ListBox* ); + DECL_LINK_TYPED( TblDestinationHdl_Impl, ListBox&, void ); }; #endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index 3192d51df651..245d5bc24a50 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -117,8 +117,8 @@ private: std::set<sal_Int16> maUsedBorderStyles; // Handler - DECL_LINK( SelStyleHdl_Impl, ListBox* ); - DECL_LINK( SelColHdl_Impl, ListBox* ); + DECL_LINK_TYPED( SelStyleHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( SelColHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SelPreHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( SelSdwHdl_Impl, ValueSet*, void ); DECL_LINK_TYPED( LinesChanged_Impl, LinkParamNone*, void ); diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index ff59cf4648cf..c23e1f0af162 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -326,7 +326,7 @@ private: bool bInitialised; SaveInData* pCurrentSaveInData; - DECL_LINK( SelectSaveInLocation, ListBox * ); + DECL_LINK_TYPED( SelectSaveInLocation, ListBox&, void ); DECL_LINK_TYPED( AsyncInfoMsg, void*, void ); protected: @@ -440,7 +440,7 @@ class SvxMenuConfigPage : public SvxConfigPage { private: - DECL_LINK( SelectMenu, ListBox * ); + DECL_LINK_TYPED( SelectMenu, ListBox&, void ); DECL_LINK_TYPED( SelectMenuEntry, SvTreeListBox *, void ); DECL_LINK_TYPED( NewMenuHdl, Button *, void ); DECL_LINK_TYPED( MenuSelectHdl, MenuButton *, void ); @@ -532,7 +532,7 @@ class SvxToolbarConfigPage : public SvxConfigPage { private: - DECL_LINK( SelectToolbar, ListBox * ); + DECL_LINK_TYPED( SelectToolbar, ListBox&, void ); DECL_LINK_TYPED( SelectToolbarEntry, SvTreeListBox*, void ); DECL_LINK_TYPED( ToolbarSelectHdl, MenuButton *, void ); DECL_LINK_TYPED( EntrySelectHdl, MenuButton *, void ); diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx index f750d0eda0b9..b2415cfde7d4 100644 --- a/cui/source/inc/chardlg.hxx +++ b/cui/source/inc/chardlg.hxx @@ -134,6 +134,7 @@ private: DECL_LINK_TYPED(UpdateHdl_Impl, Idle *, void); DECL_LINK( FontModifyHdl_Impl, void* ); + DECL_LINK_TYPED(FontModifyListBoxHdl_Impl, ListBox&, void); public: using SfxTabPage::ActivatePage; @@ -215,11 +216,12 @@ private: void ResetColor_Impl( const SfxItemSet& rSet ); bool FillItemSetColor_Impl( SfxItemSet& rSet ); - DECL_LINK( SelectHdl_Impl, ListBox* ); + void SelectHdl_Impl(ListBox*); + DECL_LINK_TYPED(SelectListBoxHdl_Impl, ListBox&, void); DECL_LINK_TYPED(CbClickHdl_Impl, Button*, void); DECL_LINK_TYPED(TristClickHdl_Impl, Button*, void); - DECL_LINK(UpdatePreview_Impl, void *); - DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* ); + DECL_LINK_TYPED(UpdatePreview_Impl, ListBox&, void); + DECL_LINK_TYPED(ColorBoxSelectHdl_Impl, ListBox&, void); public: virtual ~SvxCharEffectsPage(); @@ -297,7 +299,7 @@ private: DECL_LINK( FontModifyHdl_Impl, void *); DECL_LINK_TYPED( AutoPositionHdl_Impl, Button*, void ); DECL_LINK_TYPED( FitToLineHdl_Impl, Button*, void ); - DECL_LINK( KerningSelectHdl_Impl, void *); + DECL_LINK_TYPED( KerningSelectHdl_Impl, ListBox&, void); DECL_LINK( KerningModifyHdl_Impl, void *); DECL_LINK_TYPED( LoseFocusHdl_Impl, Control&, void ); DECL_LINK( ScaleWidthModifyHdl_Impl, void *); @@ -348,7 +350,7 @@ private: void SetBracket( sal_Unicode cBracket, bool bStart ); DECL_LINK_TYPED(TwoLinesHdl_Impl, Button*, void); - DECL_LINK( CharacterMapHdl_Impl, ListBox* ); + DECL_LINK_TYPED(CharacterMapHdl_Impl, ListBox&, void ); public: virtual ~SvxCharTwoLinesPage(); diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx index 875ff89baf9b..e02333a01197 100644 --- a/cui/source/inc/connect.hxx +++ b/cui/source/inc/connect.hxx @@ -58,6 +58,7 @@ private: void FillTypeLB(); DECL_LINK( ChangeAttrHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeAttrListBoxHdl_Impl, ListBox&, void ); public: diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx index c3967d23e5de..f5708e4b00f9 100644 --- a/cui/source/inc/cuicharmap.hxx +++ b/cui/source/inc/cuicharmap.hxx @@ -82,8 +82,8 @@ private: const SubsetMap* pSubsetMap; DECL_LINK_TYPED(OKHdl, Button*, void); - DECL_LINK(FontSelectHdl, void *); - DECL_LINK(SubsetSelectHdl, void *); + DECL_LINK_TYPED(FontSelectHdl, ListBox&, void); + DECL_LINK_TYPED(SubsetSelectHdl, ListBox&, void); DECL_LINK_TYPED(CharDoubleClickHdl, SvxShowCharSet*,void); DECL_LINK_TYPED(CharSelectHdl, SvxShowCharSet*, void); DECL_LINK_TYPED(CharHighlightHdl, SvxShowCharSet*, void); diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx index eb304a7850ba..e202360e677e 100644 --- a/cui/source/inc/cuifmsearch.hxx +++ b/cui/source/inc/cuifmsearch.hxx @@ -163,13 +163,13 @@ private: DECL_LINK(OnSearchTextModified, void *); - DECL_LINK( OnPositionSelected, ListBox* ); - DECL_LINK( OnFieldSelected, ListBox* ); + DECL_LINK_TYPED( OnPositionSelected, ListBox&, void ); + DECL_LINK_TYPED( OnFieldSelected, ListBox&, void ); DECL_LINK_TYPED( OnFocusGrabbed, Control&, void ); DECL_LINK_TYPED( OnCheckBoxToggled, CheckBox&, void ); - DECL_LINK( OnContextSelection, ListBox* ); + DECL_LINK_TYPED( OnContextSelection, ListBox&, void ); DECL_LINK_TYPED( OnSearchProgress, const FmSearchProgress*, void ); @@ -184,7 +184,7 @@ inline void FmSearchDialog::SetActiveField(const OUString& strField) if (nInitialField == LISTBOX_ENTRY_NOTFOUND) nInitialField = 0; m_plbField->SelectEntryPos(nInitialField); - LINK(this, FmSearchDialog, OnFieldSelected).Call(m_plbField); + LINK(this, FmSearchDialog, OnFieldSelected).Call(*m_plbField); } #endif // INCLUDED_CUI_SOURCE_INC_CUIFMSEARCH_HXX diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx index 2ab6b08e6c04..645c6a973319 100644 --- a/cui/source/inc/cuigaldlg.hxx +++ b/cui/source/inc/cuigaldlg.hxx @@ -282,7 +282,7 @@ class TPGalleryThemeProperties : public SfxTabPage DECL_LINK_TYPED( ClickSearchHdl, Button*, void ); DECL_LINK_TYPED( ClickTakeHdl, Button*, void ); DECL_LINK_TYPED( ClickTakeAllHdl, Button*, void ); - DECL_LINK( SelectFoundHdl, void* ); + DECL_LINK_TYPED( SelectFoundHdl, ListBox&, void ); DECL_LINK( SelectFileTypeHdl, void* ); DECL_LINK_TYPED( DClickFoundHdl, ListBox&, void ); DECL_LINK_TYPED( PreviewTimerHdl, Timer*, void ); diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 4514c2903ab9..e09587c38d49 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -145,6 +145,7 @@ class SvxTransparenceTabPage : public SvxTabPage DECL_LINK_TYPED(ClickTransGradientHdl_Impl, Button*, void ); DECL_LINK(ModifyTransparentHdl_Impl, void*); DECL_LINK(ModifiedTrgrHdl_Impl, void*); + DECL_LINK_TYPED(ModifiedTrgrListBoxHdl_Impl, ListBox&, void); void ActivateLinear(bool bActivate); void ActivateGradient(bool bActivate); @@ -263,13 +264,13 @@ private: OUString maDirectName; VclPtr<PushButton> m_pBtnImport; - DECL_LINK(SelectDialogTypeHdl_Impl, void *); - DECL_LINK( ModifyColorHdl_Impl, void * ); - DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * ); - DECL_LINK( ModifyGradientHdl_Impl, void * ); - DECL_LINK( ModifyHatchingHdl_Impl, void * ); + DECL_LINK_TYPED(SelectDialogTypeHdl_Impl, ListBox&, void); + DECL_LINK_TYPED( ModifyColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ModifyHatchBckgrdColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ModifyGradientHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ModifyHatchingHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ToggleHatchBckgrdColorHdl_Impl, CheckBox&, void ); - DECL_LINK( ModifyBitmapHdl_Impl, void * ); + DECL_LINK_TYPED( ModifyBitmapHdl_Impl, ListBox&, void ); DECL_LINK( ModifyStepCountHdl_Impl, void* ); DECL_LINK_TYPED( ModifyStepCountClickHdl_Impl, Button*, void ); @@ -353,6 +354,7 @@ private: DECL_LINK_TYPED( ClickShadowHdl_Impl, Button*, void ); DECL_LINK( ModifyShadowHdl_Impl, void * ); + DECL_LINK_TYPED( SelectShadowHdl_Impl, ListBox&, void ); public: SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ); @@ -425,8 +427,9 @@ private: DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK( ChangeGradientHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeGradientHdl_Impl, ListBox&, void ); DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); @@ -500,8 +503,9 @@ private: SfxMapUnit m_ePoolUnit; - DECL_LINK( ChangeHatchHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeHatchHdl_Impl, ListBox&, void ); DECL_LINK( ModifiedHdl_Impl, void * ); + DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); @@ -588,9 +592,9 @@ private: DECL_LINK_TYPED( ClickImportHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK( ChangeBitmapHdl_Impl, void * ); - DECL_LINK( ChangePixelColorHdl_Impl, void * ); - DECL_LINK( ChangeBackgrndColorHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeBitmapHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangePixelColorHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( ChangeBackgrndColorHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); @@ -721,9 +725,9 @@ private: DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickWorkOnHdl_Impl, Button*, void ); - DECL_LINK( SelectColorLBHdl_Impl, void * ); + DECL_LINK_TYPED( SelectColorLBHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SelectValSetHdl_Impl, ValueSet*, void ); - DECL_LINK( SelectColorModelHdl_Impl, void * ); + DECL_LINK_TYPED( SelectColorModelHdl_Impl, ListBox&, void ); void ChangeColor(const Color &rNewColor); DECL_LINK( ModifiedHdl_Impl, void * ); diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index d9126586d850..b1dcf0a04e0c 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -176,18 +176,24 @@ private: DECL_LINK( SizeHdl_Impl, MetricField * ); DECL_LINK_TYPED( RatioHdl_Impl, Button*, void ); - DECL_LINK( ClickInvisibleHdl_Impl, void * ); - DECL_LINK( ChangeStartHdl_Impl, void * ); + DECL_LINK_TYPED( ClickInvisibleHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeStartClickHdl_Impl, Button*, void ); - DECL_LINK( ChangeEndHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeStartListBoxHdl_Impl, ListBox&, void ); + DECL_LINK( ChangeStartModifyHdl_Impl, void * ); + void ChangeStartHdl_Impl(void*); + DECL_LINK_TYPED( ChangeEndListBoxHdl_Impl, ListBox&, void ); + DECL_LINK( ChangeEndModifyHdl_Impl, void * ); DECL_LINK_TYPED( ChangeEndClickHdl_Impl, Button*, void ); - DECL_LINK( ChangePreviewHdl_Impl, void * ); + void ChangeEndHdl_Impl(void*); + DECL_LINK_TYPED( ChangePreviewListBoxHdl_Impl, ListBox&, void ); + DECL_LINK( ChangePreviewModifyHdl_Impl, void* ); + void ChangePreviewHdl_Impl(void*); DECL_LINK( ChangeTransparentHdl_Impl, void * ); - DECL_LINK( ChangeEdgeStyleHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeEdgeStyleHdl_Impl, ListBox&, void ); - // LineCaps - DECL_LINK ( ChangeCapStyleHdl_Impl, void * ); + // LineCaps + DECL_LINK_TYPED( ChangeCapStyleHdl_Impl, ListBox&, void ); bool FillXLSet_Impl(); @@ -285,14 +291,16 @@ private: DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); - DECL_LINK( SelectLinestyleHdl_Impl, 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( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); DECL_LINK_TYPED( ChangeMetricHdl_Impl, Button*, void ); - DECL_LINK( SelectTypeHdl_Impl, void * ); + DECL_LINK_TYPED( SelectTypeListBoxHdl_Impl, ListBox&, void ); + void SelectTypeHdl_Impl(ListBox*); void CheckChanges_Impl(); @@ -361,7 +369,7 @@ private: DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void ); - DECL_LINK( SelectLineEndHdl_Impl, void * ); + DECL_LINK_TYPED( SelectLineEndHdl_Impl, ListBox&, void ); long ChangePreviewHdl_Impl( void* p ); void CheckChanges_Impl(); diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx index 42a85b2ac6f0..0151c20358f0 100644 --- a/cui/source/inc/hangulhanjadlg.hxx +++ b/cui/source/inc/hangulhanjadlg.hxx @@ -79,8 +79,9 @@ namespace svx virtual void LoseFocus() SAL_OVERRIDE; virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; - DECL_LINK( SelectSuggestionHdl, Control* ); + DECL_LINK_TYPED( SelectSuggestionListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( SelectSuggestionValueSetHdl, ValueSet*, void ); + void SelectSuggestionHdl(Control*); void SetHelpIds(); @@ -297,7 +298,7 @@ namespace svx DECL_LINK( EditModifyHdl3, Edit* ); DECL_LINK( EditModifyHdl4, Edit* ); - DECL_LINK( BookLBSelectHdl, void* ); + DECL_LINK_TYPED( BookLBSelectHdl, ListBox&, void ); DECL_LINK_TYPED( NewPBPushHdl, Button*, void ); DECL_LINK_TYPED( DeletePBPushHdl, Button*, void ); diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx index 571559a101d9..03edc7ba1f8c 100644 --- a/cui/source/inc/labdlg.hxx +++ b/cui/source/inc/labdlg.hxx @@ -65,8 +65,8 @@ private: void SetupAnsatz_Impl( sal_uInt16 nType ); void SetupType_Impl( sal_uInt16 nType ); - DECL_LINK( AnsatzSelectHdl_Impl, ListBox * ); - DECL_LINK( AnsatzRelSelectHdl_Impl, ListBox * ); + DECL_LINK_TYPED( AnsatzSelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( AnsatzRelSelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( LineOptHdl_Impl, Button *, void ); DECL_LINK_TYPED( SelectCaptTypeHdl_Impl, ValueSet*, void ); diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx index 81ffca5cb44b..5d68a776fcbc 100644 --- a/cui/source/inc/measure.hxx +++ b/cui/source/inc/measure.hxx @@ -62,6 +62,7 @@ private: DECL_LINK_TYPED( ClickAutoPosHdl_Impl, Button*, void ); DECL_LINK( ChangeAttrHdl_Impl, void * ); + DECL_LINK_TYPED( ChangeAttrListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeAttrClickHdl_Impl, Button*, void ); public: diff --git a/cui/source/inc/multipat.hxx b/cui/source/inc/multipat.hxx index 5415fb23a0ad..f462570a4148 100644 --- a/cui/source/inc/multipat.hxx +++ b/cui/source/inc/multipat.hxx @@ -66,7 +66,7 @@ private: DECL_LINK_TYPED(AddHdl_Impl, Button*, void); DECL_LINK_TYPED(DelHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); public: SvxPathSelectDialog(vcl::Window* pParent); diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index 401d399a3a97..2c204799611c 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -153,9 +153,10 @@ private: // Handler DECL_LINK_TYPED( LostFocusHdl_Impl, Control&, void ); DECL_LINK_TYPED( DoubleClickHdl_Impl, SvTreeListBox*, bool ); - DECL_LINK( SelFormatHdl_Impl, void * ); - DECL_LINK_TYPED( SelFormatListBoxHdl_Impl, SvTreeListBox*, void ); + DECL_LINK_TYPED( SelFormatListBoxHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( SelFormatTreeListBoxHdl_Impl, SvTreeListBox*, void ); 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 * ); diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 5b96a904a21e..67e0445a77ab 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -320,19 +320,20 @@ class SvxNumOptionsTabPage : public SfxTabPage void SwitchNumberType( sal_uInt8 nType, bool bBmp = false ); void CheckForStartValue_Impl(sal_uInt16 nNumberingType); - DECL_LINK( NumberTypeSelectHdl_Impl, ListBox * ); - DECL_LINK( LevelHdl_Impl, ListBox * ); + DECL_LINK_TYPED( NumberTypeSelectHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( LevelHdl_Impl, ListBox&, void ); 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( RatioHdl_Impl, Button*, void ); - DECL_LINK( CharFmtHdl_Impl, void *); - DECL_LINK( EditModifyHdl_Impl, Edit * ); + DECL_LINK_TYPED( CharFmtHdl_Impl, ListBox&, void ); + DECL_LINK( EditModifyHdl_Impl, Edit* ); + DECL_LINK_TYPED( EditListBoxHdl_Impl, ListBox&, void ); DECL_LINK( AllLevelHdl_Impl, NumericField * ); - DECL_LINK( OrientHdl_Impl, ListBox * ); + DECL_LINK_TYPED( OrientHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( SameLevelHdl_Impl, Button*, void ); - DECL_LINK( BulColorHdl_Impl, ColorListBox* ); + DECL_LINK_TYPED( BulColorHdl_Impl, ListBox&, void ); DECL_LINK( BulRelSizeHdl_Impl, MetricField *); DECL_LINK_TYPED( PreviewInvalidateHdl_Impl, Timer *, void); @@ -426,8 +427,8 @@ class SvxNumPositionTabPage : public SfxTabPage void InitControls(); - DECL_LINK( LevelHdl_Impl, ListBox * ); - DECL_LINK( EditModifyHdl_Impl, void *); + DECL_LINK_TYPED( LevelHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( EditModifyHdl_Impl, ListBox&, void); DECL_LINK( DistanceHdl_Impl, MetricField * ); DECL_LINK_TYPED( DistanceFocusHdl_Impl, Control&, void ); DECL_LINK_TYPED( RelativeHdl_Impl, Button*, void ); @@ -436,7 +437,7 @@ class SvxNumPositionTabPage : public SfxTabPage void InitPosAndSpaceMode(); void ShowControlsDependingOnPosAndSpaceMode(); - DECL_LINK(LabelFollowedByHdl_Impl, void *); + DECL_LINK_TYPED(LabelFollowedByHdl_Impl, ListBox&, void); DECL_LINK( ListtabPosHdl_Impl, MetricField* ); DECL_LINK( AlignAtHdl_Impl, MetricField* ); DECL_LINK( IndentAtHdl_Impl, MetricField* ); diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx index 441f311e9919..d88d65927453 100644 --- a/cui/source/inc/optasian.hxx +++ b/cui/source/inc/optasian.hxx @@ -48,7 +48,7 @@ class SvxAsianLayoutPage : public SfxTabPage SvxAsianLayoutPage_Impl* pImpl; - DECL_LINK(LanguageHdl, void *); + DECL_LINK_TYPED(LanguageHdl, ListBox&, void); DECL_LINK_TYPED(ChangeStandardHdl, Button*, void); DECL_LINK(ModifyHdl, Edit*); diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx index fe04cab545cd..d909e8417ca6 100644 --- a/cui/source/inc/optdict.hxx +++ b/cui/source/inc/optdict.hxx @@ -129,8 +129,8 @@ private: bool bDoNothing; bool bDicIsReadonly; - DECL_LINK(SelectBookHdl_Impl, void *); - DECL_LINK(SelectLangHdl_Impl, void *); + DECL_LINK_TYPED(SelectBookHdl_Impl, ListBox&, void); + DECL_LINK_TYPED(SelectLangHdl_Impl, ListBox&, void); DECL_LINK_TYPED(SelectHdl, SvTreeListBox*, void); DECL_LINK_TYPED(NewDelButtonHdl, Button*, void); DECL_LINK_TYPED(NewDelActionHdl, SvxDictEdit&, bool); diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx index 76726d33728b..906ea8c9f33d 100644 --- a/cui/source/inc/optlingu.hxx +++ b/cui/source/inc/optlingu.hxx @@ -78,10 +78,11 @@ class SvxEditModulesDlg : public ModalDialog DECL_LINK_TYPED(UpDownHdl_Impl, Button*, void); DECL_LINK_TYPED(ClickHdl_Impl, Button*, void); DECL_LINK_TYPED(BackHdl_Impl, Button*, void); - DECL_LINK( LangSelectHdl_Impl, ListBox* ); + DECL_LINK_TYPED( LangSelectListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( BoxCheckButtonHdl_Impl2, SvLBoxButtonData*, void ); DECL_LINK_TYPED( BoxCheckButtonHdl_Impl, SvTreeListBox*, void ); DECL_LINK(OpenURLHdl_Impl, void *); + void LangSelectHdl_Impl(ListBox*); public: SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rData); diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index 1d55426a4545..0c5b225301dc 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -149,7 +149,7 @@ private: bool mbEnableDrawingLayerFillStyles : 1; void Init_Impl(); - DECL_LINK( LayoutHdl_Impl, void *); + DECL_LINK_TYPED( LayoutHdl_Impl, ListBox&, void); DECL_LINK_TYPED( PaperBinHdl_Impl, Control&, void); DECL_LINK_TYPED( SwapOrientation_Impl, Button*, void ); void SwapFirstValues_Impl( bool bSet ); @@ -158,10 +158,10 @@ private: DECL_LINK_TYPED( CenterHdl_Impl, Button*, void); void UpdateExample_Impl( bool bResetbackground = false ); - DECL_LINK( PaperSizeSelect_Impl, ListBox* ); + DECL_LINK_TYPED( PaperSizeSelect_Impl, ListBox&, void ); DECL_LINK( PaperSizeModify_Impl, void *); - DECL_LINK( FrameDirectionModify_Impl, ListBox* ); + DECL_LINK_TYPED( FrameDirectionModify_Impl, ListBox&, void ); void ResetBackground_Impl( const SfxItemSet& rSet ); diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index fdb840c71334..b4b401ea0420 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -90,7 +90,7 @@ private: void Init_Impl(); void UpdateExample_Impl(); - DECL_LINK( LineDistHdl_Impl, ListBox* ); + DECL_LINK_TYPED( LineDistHdl_Impl, ListBox&, void ); DECL_LINK(ModifyHdl_Impl, void *); DECL_LINK_TYPED( AutoHdl_Impl, Button*, void ); @@ -154,8 +154,8 @@ class SvxParaAlignTabPage : public SfxTabPage VclPtr<svx::FrameDirectionListBox> m_pTextDirectionLB; DECL_LINK_TYPED(AlignHdl_Impl, Button*, void); - DECL_LINK(LastLineHdl_Impl, void *); - DECL_LINK(TextDirectionHdl_Impl, void *); + DECL_LINK_TYPED(LastLineHdl_Impl, ListBox&, void); + DECL_LINK_TYPED(TextDirectionHdl_Impl, ListBox&, void); void UpdateExample_Impl(); @@ -262,8 +262,8 @@ private: DECL_LINK_TYPED(OrphanHdl_Impl, Button*, void); DECL_LINK_TYPED(HyphenClickHdl_Impl, Button*, void); DECL_LINK_TYPED(ApplyCollClickHdl_Impl, Button*, void); - DECL_LINK( PageBreakPosHdl_Impl, ListBox* ); - DECL_LINK( PageBreakTypeHdl_Impl, ListBox* ); + DECL_LINK_TYPED( PageBreakPosHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED( PageBreakTypeHdl_Impl, ListBox&, void ); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; }; diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx index 26a439f80402..3d5aa611232e 100644 --- a/cui/source/inc/pastedlg.hxx +++ b/cui/source/inc/pastedlg.hxx @@ -50,7 +50,7 @@ class SvPasteObjectDialog : public ModalDialog FixedText& ObjectSource() { return *m_pFtObjectSource; } void SelectObject(); - DECL_LINK( SelectHdl, ListBox * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( DoubleClickHdl, ListBox&, void ); public: diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx index 6003fc6c1385..7635ec68dc31 100644 --- a/cui/source/inc/swpossizetabpage.hxx +++ b/cui/source/inc/swpossizetabpage.hxx @@ -103,8 +103,8 @@ class SvxSwPosSizeTabPage : public SfxTabPage DECL_LINK_TYPED(RangeModifyHdl, Control&, void); DECL_LINK_TYPED(RangeModifyClickHdl, Button*, void); DECL_LINK_TYPED(AnchorTypeHdl, Button*, void); - DECL_LINK( PosHdl, ListBox * ); - DECL_LINK( RelHdl, ListBox * ); + 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(ProtectHdl, Button*, void); diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx index c0a1896bcc4b..725ef2f755e1 100644 --- a/cui/source/inc/textanim.hxx +++ b/cui/source/inc/textanim.hxx @@ -65,7 +65,7 @@ private: FieldUnit eFUnit; SfxMapUnit eUnit; - DECL_LINK( SelectEffectHdl_Impl, void * ); + DECL_LINK_TYPED( SelectEffectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ClickEndlessHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickAutoHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickPixelHdl_Impl, Button*, void ); diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx index 26f75237ba50..a598f2e53575 100644 --- a/cui/source/inc/thesdlg.hxx +++ b/cui/source/inc/thesdlg.hxx @@ -144,7 +144,7 @@ public: // Handler DECL_LINK_TYPED( ReplaceBtnHdl_Impl, Button *, void ); DECL_LINK_TYPED( LeftBtnHdl_Impl, Button *, void ); - DECL_LINK( LanguageHdl_Impl, ListBox * ); + DECL_LINK_TYPED( LanguageHdl_Impl, ListBox&, void ); DECL_LINK( WordSelectHdl_Impl, ComboBox * ); DECL_LINK_TYPED( AlternativesSelectHdl_Impl, SvTreeListBox*, void ); DECL_LINK_TYPED( AlternativesDoubleClickHdl_Impl, SvTreeListBox*, bool ); diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 9f2ac0421969..1ccc1ce4af65 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -139,7 +139,7 @@ SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& get(m_pEndED, "end"); get(m_pHintFT, "hintft"); - LanguageHdl(m_pLanguageLB); + LanguageHdl(*m_pLanguageLB); m_pLanguageLB->SetSelectHdl(LINK(this, SvxAsianLayoutPage, LanguageHdl)); m_pStandardCB->SetClickHdl(LINK(this, SvxAsianLayoutPage, ChangeStandardHdl)); Link<> aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl)); @@ -310,10 +310,10 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* ) eLastUsedLanguageTypeForForbiddenCharacters = LANGUAGE_CHINESE_TRADITIONAL; } m_pLanguageLB->SelectLanguage( eLastUsedLanguageTypeForForbiddenCharacters ); - LanguageHdl(m_pLanguageLB); + LanguageHdl(*m_pLanguageLB); } -IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl) +IMPL_LINK_NOARG_TYPED(SvxAsianLayoutPage, LanguageHdl, ListBox&, void) { //set current value LanguageType eSelectLanguage = m_pLanguageLB->GetSelectLanguage(); @@ -374,8 +374,6 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl) m_pEndFT->Enable(bAvail); m_pStartED->SetText(sStart); m_pEndED->SetText(sEnd); - - return 0; } IMPL_LINK_TYPED(SvxAsianLayoutPage, ChangeStandardHdl, Button*, pBox, void) diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 9f12dc047dc6..555915e9743d 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -115,7 +115,7 @@ void SvxDefaultColorOptPage::Construct() FillColorBox(); m_pLbChartColors->SelectEntryPos( 0 ); - ListClickedHdl(m_pLbChartColors); + ListClickedHdl(*m_pLbChartColors); } @@ -135,7 +135,7 @@ bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs ) void SvxDefaultColorOptPage::Reset( const SfxItemSet* ) { m_pLbChartColors->SelectEntryPos( 0 ); - ListClickedHdl(m_pLbChartColors); + ListClickedHdl(*m_pLbChartColors); } void SvxDefaultColorOptPage::FillColorBox() @@ -247,9 +247,9 @@ IMPL_LINK_TYPED( SvxDefaultColorOptPage, RemoveChartColor, Button*, pButton, voi } } -IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ColorLB*, _pColorList ) +IMPL_LINK_TYPED( SvxDefaultColorOptPage, ListClickedHdl, ListBox&, _rBox, void ) { - Color aCol = _pColorList->GetSelectEntryColor(); + Color aCol = static_cast<ColorLB&>(_rBox).GetSelectEntryColor(); long nIndex = GetColorIndex( aCol ); @@ -257,8 +257,6 @@ IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ColorLB*, _pColorList ) m_pValSetColorBox->SetNoSelection(); else m_pValSetColorBox->SelectItem( nIndex + 1 ); // ValueSet is 1-based - - return 0L; } IMPL_LINK_NOARG_TYPED(SvxDefaultColorOptPage, BoxClickedHdl, ValueSet*, void) diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx index 8046c1daa42f..bd2d2f013717 100644 --- a/cui/source/options/optchart.hxx +++ b/cui/source/options/optchart.hxx @@ -46,7 +46,7 @@ private: DECL_LINK_TYPED( ResetToDefaults, Button *, void ); DECL_LINK_TYPED( AddChartColor, Button *, void ); DECL_LINK_TYPED( RemoveChartColor, Button *, void ); - DECL_LINK( ListClickedHdl, ColorLB * ); + DECL_LINK_TYPED( ListClickedHdl, ListBox&, void ); DECL_LINK_TYPED(BoxClickedHdl, ValueSet*, void); void FillColorBox(); diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index d95fd2a6a0d5..916ea82461c6 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -177,7 +177,7 @@ public: virtual void dispose() SAL_OVERRIDE; public: - void SetLinks (Link<Button*,void> const&, Link<> const&, Link<Control&,void> const&); + void SetLinks (Link<Button*,void> const&, Link<ListBox&,void> const&, Link<Control&,void> const&); unsigned GetEntryHeight () const { return vEntries[0]->GetHeight(); } void Update (EditableColorConfig const*, EditableExtendedColorConfig const*); void ScrollHdl(const ScrollBar&); @@ -219,7 +219,7 @@ private: void SetAppearance(Wallpaper const& aTextWall, ColorListBox const& aSampleList); void SetTextColor (Color C) { m_pText->SetTextColor(C); } public: - void SetLinks (Link<Button*,void> const&, Link<> const&, Link<Control&,void> const&); + void SetLinks (Link<Button*,void> const&, Link<ListBox&,void> const&, Link<Control&,void> const&); void Update (ColorConfigEntry, ColorConfigValue const&); void Update (ExtendedColorConfigValue const&); void ColorChanged (ColorConfigEntry, ColorConfigValue&); @@ -414,7 +414,7 @@ void ColorConfigWindow_Impl::Entry::SetAppearance( // SetLinks() void ColorConfigWindow_Impl::Entry::SetLinks( - Link<Button*,void> const& aCheckLink, Link<> const& aColorLink, + Link<Button*,void> const& aCheckLink, Link<ListBox&,void> const& aColorLink, Link<Control&,void> const& aGetFocusLink) { m_pColorList->SetSelectHdl(aColorLink); @@ -689,7 +689,7 @@ void ColorConfigWindow_Impl::Init(ScrollBar *pVScroll, HeaderBar *pHeaderHB) // SetLinks() void ColorConfigWindow_Impl::SetLinks ( - Link<Button*,void> const& aCheckLink, Link<> const& aColorLink, Link<Control&,void> const& aGetFocusLink + Link<Button*,void> const& aCheckLink, Link<ListBox&,void> const& aColorLink, Link<Control&,void> const& aGetFocusLink ) { for (unsigned i = 0; i != vEntries.size(); ++i) vEntries[i]->SetLinks(aCheckLink, aColorLink, aGetFocusLink); @@ -846,7 +846,7 @@ class ColorConfigCtrl_Impl : public VclVBox DECL_LINK_TYPED(ScrollHdl, ScrollBar*, void); DECL_LINK_TYPED(ClickHdl, Button*, void); - DECL_LINK(ColorHdl, ColorListBox*); + DECL_LINK_TYPED(ColorHdl, ListBox&, void); DECL_LINK_TYPED(ControlFocusHdl, Control&, void); virtual bool PreNotify (NotifyEvent& rNEvt) SAL_OVERRIDE; @@ -900,7 +900,7 @@ ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(vcl::Window* pParent) m_pVScroll->SetEndScrollHdl(aScrollLink); Link<Button*,void> aCheckLink = LINK(this, ColorConfigCtrl_Impl, ClickHdl); - Link<> aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl); + Link<ListBox&,void> aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl); Link<Control&,void> aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl); m_pScrollWindow->SetLinks(aCheckLink, aColorLink, aGetFocusLink); @@ -1006,12 +1006,10 @@ IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ClickHdl, Button*, pBox, void) } // a color list has changed -IMPL_LINK(ColorConfigCtrl_Impl, ColorHdl, ColorListBox*, pBox) +IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ColorHdl, ListBox&, rBox, void) { DBG_ASSERT(pColorConfig, "Configuration not set" ); - if (pBox) - m_pScrollWindow->ColorHdl(pColorConfig, pExtColorConfig, pBox); - return 0; + m_pScrollWindow->ColorHdl(pColorConfig, pExtColorConfig, static_cast<ColorListBox*>(&rBox)); } IMPL_LINK_TYPED(ColorConfigCtrl_Impl, ControlFocusHdl, Control&, rCtrl, void) { @@ -1175,12 +1173,11 @@ void SvxColorOptionsTabPage::UpdateColorConfig() m_pColorConfigCT->Update(); } -IMPL_LINK(SvxColorOptionsTabPage, SchemeChangedHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SvxColorOptionsTabPage, SchemeChangedHdl_Impl, ListBox&, rBox, void) { - pColorConfig->LoadScheme(pBox->GetSelectEntry()); - pExtColorConfig->LoadScheme(pBox->GetSelectEntry()); + pColorConfig->LoadScheme(rBox.GetSelectEntry()); + pExtColorConfig->LoadScheme(rBox.GetSelectEntry()); UpdateColorConfig(); - return 0; } IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, void ) @@ -1205,7 +1202,7 @@ IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, vo pExtColorConfig->AddScheme(sName); m_pColorSchemeLB->InsertEntry(sName); m_pColorSchemeLB->SelectEntry(sName); - m_pColorSchemeLB->GetSelectHdl().Call(m_pColorSchemeLB); + m_pColorSchemeLB->GetSelectHdl().Call(*m_pColorSchemeLB); } } else @@ -1218,7 +1215,7 @@ IMPL_LINK_TYPED(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, Button*, pButton, vo OUString sDeleteScheme(m_pColorSchemeLB->GetSelectEntry()); m_pColorSchemeLB->RemoveEntry(m_pColorSchemeLB->GetSelectEntryPos()); m_pColorSchemeLB->SelectEntryPos(0); - m_pColorSchemeLB->GetSelectHdl().Call(m_pColorSchemeLB); + m_pColorSchemeLB->GetSelectHdl().Call(*m_pColorSchemeLB); //first select the new scheme and then delete the old one pColorConfig->DeleteScheme(sDeleteScheme); pExtColorConfig->DeleteScheme(sDeleteScheme); diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx index f182e4bd5d3d..3fa8d3a120a7 100644 --- a/cui/source/options/optcolor.hxx +++ b/cui/source/options/optcolor.hxx @@ -41,7 +41,7 @@ class SvxColorOptionsTabPage : public SfxTabPage svtools::EditableColorConfig* pColorConfig; svtools::EditableExtendedColorConfig* pExtColorConfig; - DECL_LINK(SchemeChangedHdl_Impl, ListBox*); + DECL_LINK_TYPED(SchemeChangedHdl_Impl, ListBox&, void); DECL_LINK_TYPED(SaveDeleteHdl_Impl, Button*, void); DECL_LINK_TYPED(CheckNameHdl_Impl, AbstractSvxNameDialog&, bool); void UpdateColorConfig(); diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 802763a5ca2e..28535aaaa1d3 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -433,7 +433,7 @@ void SvxEditDictionaryDialog::RemoveDictEntry(SvTreeListEntry* pEntry) -IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectBookHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxEditDictionaryDialog, SelectBookHdl_Impl, ListBox&, void) { sal_Int32 nPos = pAllDictsLB->GetSelectEntryPos(); @@ -453,12 +453,11 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectBookHdl_Impl) pLangFT->Enable( bEnable ); pLangLB->Enable( bEnable ); } - return 0; } -IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxEditDictionaryDialog, SelectLangHdl_Impl, ListBox&, void) { sal_Int32 nDicPos = pAllDictsLB->GetSelectEntryPos(); sal_Int32 nLang = pLangLB->GetSelectLanguage(); @@ -488,7 +487,6 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl) else SetLanguage_Impl( nOldLang ); } - return 1; } diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 79e037c9d467..0764524c0b6d 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1473,7 +1473,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet ) // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support // #i15812# must be done *before* the configured currency is set // and update the decimal separator used for the given locale - LocaleSettingHdl(m_pLocaleSettingLB); + LocaleSettingHdl(*m_pLocaleSettingLB); // configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default OUString aAbbrev; @@ -1651,8 +1651,9 @@ namespace } } -IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) +IMPL_LINK_TYPED( OfaLanguagesTabPage, LocaleSettingHdl, ListBox&, rListBox, void ) { + SvxLanguageBox* pBox = static_cast<SvxLanguageBox*>(&rListBox); LanguageType eLang = pBox->GetSelectLanguage(); SvtScriptType nType = SvtLanguageOptions::GetScriptTypeOfLanguage(eLang); // first check if CTL must be enabled @@ -1697,8 +1698,6 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) OUString aDatePatternsString = lcl_getDatePatternsConfigString( aLocaleWrapper); m_bDatePatternsValid = true; m_pDatePatternsED->SetText( aDatePatternsString); - - return 0; } IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, pEd ) diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index ae66faa9b637..c2f5fac0e18d 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -160,7 +160,7 @@ class OfaLanguagesTabPage : public SfxTabPage bool m_bDatePatternsValid; DECL_LINK_TYPED( SupportHdl, Button*, void ) ; - DECL_LINK( LocaleSettingHdl, SvxLanguageBox* ) ; + DECL_LINK_TYPED( LocaleSettingHdl, ListBox&, void ) ; DECL_LINK( DatePatternsHdl, Edit* ) ; public: diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 3033918c8751..345468494451 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -525,9 +525,9 @@ void SvxProxyTabPage::EnableControls_Impl(bool bEnable) -IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxProxyTabPage, ProxyHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); // Restore original system values if( nPos == 1 ) @@ -536,7 +536,6 @@ IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox ) } EnableControls_Impl(nPos == 2); - return 0; } diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index 32804fb4a9d9..0183f077af0c 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -95,7 +95,7 @@ private: void ReadConfigDefaults_Impl(); void RestoreConfigDefaults_Impl(); - DECL_LINK( ProxyHdl_Impl, ListBox * ); + DECL_LINK_TYPED( ProxyHdl_Impl, ListBox&, void ); DECL_STATIC_LINK_TYPED( SvxProxyTabPage, LoseFocusHdl_Impl, Control&, void ); public: diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 552bd17f2a49..b43d1e90e092 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -861,10 +861,9 @@ IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, AssignHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxJavaParameterDlg, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxJavaParameterDlg, SelectHdl_Impl, ListBox&, void) { EnableRemoveButton(); - return 0; } @@ -1066,10 +1065,9 @@ IMPL_LINK_NOARG_TYPED(SvxJavaClassPathDlg, RemoveHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxJavaClassPathDlg, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxJavaClassPathDlg, SelectHdl_Impl, ListBox&, void) { EnableRemoveButton(); - return 0; } @@ -1129,7 +1127,7 @@ void SvxJavaClassPathDlg::SetClassPath( const OUString& _rPath ) } // select first entry m_pPathList->SelectEntryPos(0); - SelectHdl_Impl( NULL ); + SelectHdl_Impl( *m_pPathList ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx index a139fa27da17..294f5e910db3 100644 --- a/cui/source/options/optjava.hxx +++ b/cui/source/options/optjava.hxx @@ -129,7 +129,7 @@ private: DECL_LINK(ModifyHdl_Impl, void *); DECL_LINK_TYPED(AssignHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); DECL_LINK_TYPED(DblClickHdl_Impl, ListBox&, void); DECL_LINK_TYPED(RemoveHdl_Impl, Button*, void); @@ -165,7 +165,7 @@ private: DECL_LINK_TYPED(AddArchiveHdl_Impl, Button*, void); DECL_LINK_TYPED(AddPathHdl_Impl, Button*, void); DECL_LINK_TYPED(RemoveHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, void *); + DECL_LINK_TYPED(SelectHdl_Impl, ListBox&, void); bool IsPathDuplicate( const OUString& _rPath ); inline void EnableRemoveButton() diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 40b77cb3d6bf..278355608267 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1901,7 +1901,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD if(!m_pLanguageLB->IsLanguageSelected( eSysLang ) ) m_pLanguageLB->SelectEntryPos(0); - m_pLanguageLB->SetSelectHdl( LINK( this, SvxEditModulesDlg, LangSelectHdl_Impl )); + m_pLanguageLB->SetSelectHdl( LINK( this, SvxEditModulesDlg, LangSelectListBoxHdl_Impl )); LangSelectHdl_Impl(m_pLanguageLB); } @@ -2010,7 +2010,12 @@ IMPL_LINK_NOARG_TYPED( SvxEditModulesDlg, BoxCheckButtonHdl_Impl, SvTreeListBox } } -IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxEditModulesDlg, LangSelectListBoxHdl_Impl, ListBox&, rBox, void ) +{ + LangSelectHdl_Impl(&rBox); +} + +void SvxEditModulesDlg::LangSelectHdl_Impl(ListBox* pBox) { LanguageType eCurLanguage = m_pLanguageLB->GetSelectLanguage(); static Locale aLastLocale; @@ -2262,7 +2267,6 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) } } aLastLocale = aCurLocale; - return 0; } IMPL_LINK_TYPED( SvxEditModulesDlg, UpDownHdl_Impl, Button *, pBtn, void ) diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index 22f65cceaf7c..8042509293ce 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -219,7 +219,7 @@ public: VclPtr<Edit> mpDevice; VclPtr<Edit> mpDriverVersion; - DECL_LINK(OSSelectHdl, ListBox*); + DECL_LINK_TYPED(OSSelectHdl, ListBox&, void); DECL_LINK(EditModifiedHdl, Edit*); ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag); @@ -274,17 +274,15 @@ ListEntryDialog::ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplM SetText(get<FixedText>(rTag + "title")->GetText()); } -IMPL_LINK(ListEntryDialog, OSSelectHdl, ListBox*, pListBox) +IMPL_LINK_TYPED(ListEntryDialog, OSSelectHdl, ListBox&, rListBox, void) { - if (pListBox == mpOS) + if (&rListBox == mpOS) { if (mpOS->GetSelectEntryPos() == 0) maEntry.maOS.clear(); else maEntry.maOS = mpOS->GetSelectEntry(); } - - return 0; } IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit) diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index eee1ad2ff536..cdde1a1dffec 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -185,7 +185,7 @@ SvxSaveTabPage::SvxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet pImpl->aDefaultReadonlyArr[APP_WRITER_GLOBAL] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::WRITERGLOBAL); } - Link<> aLink = LINK( this, SvxSaveTabPage, ODFVersionHdl_Impl ); + Link<ListBox&,void> aLink = LINK( this, SvxSaveTabPage, ODFVersionHdl_Impl ); aODFVersionLB->SetSelectHdl( aLink ); aLink = LINK( this, SvxSaveTabPage, FilterHdl_Impl ); aDocTypeLB->SetSelectHdl( aLink ); @@ -460,7 +460,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) } } aDocTypeLB->SelectEntryPos(0); - FilterHdl_Impl(aDocTypeLB); + FilterHdl_Impl(*aDocTypeLB); } catch(Exception& e) { @@ -497,7 +497,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) aODFVersionLB->SelectEntryPos( aODFVersionLB->GetEntryPos( pDefaultVersion ) ); AutoClickHdl_Impl( aAutoSaveCB ); - ODFVersionHdl_Impl( aODFVersionLB ); + ODFVersionHdl_Impl( *aODFVersionLB ); aDocInfoCB->SaveValue(); aBackupCB->SaveValue(); @@ -558,7 +558,7 @@ static OUString lcl_ExtracUIName(const Sequence<PropertyValue> &rProperties) return sName; } -IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxSaveTabPage, FilterHdl_Impl, ListBox&, rBox, void ) { const sal_Int32 nCurPos = aDocTypeLB->GetSelectEntryPos(); @@ -568,7 +568,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) if ( nData >= 0 && nData < APP_COUNT ) { - if(aDocTypeLB == pBox) + if(aDocTypeLB == &rBox) { aSaveAsLB->Clear(); const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray(); @@ -604,7 +604,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) } else { - OUString sSelect = pBox->GetSelectEntry(); + OUString sSelect = rBox.GetSelectEntry(); const OUString* pFilters = pImpl->aFilterArr[nData].getConstArray(); OUString* pUIFilters = pImpl->aUIFilterArr[nData].getArray(); for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++) @@ -618,11 +618,10 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) } } - ODFVersionHdl_Impl( aSaveAsLB ); - return 0; + ODFVersionHdl_Impl( *aSaveAsLB ); }; -IMPL_LINK_NOARG(SvxSaveTabPage, ODFVersionHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxSaveTabPage, ODFVersionHdl_Impl, ListBox&, void) { sal_IntPtr nVersion = sal_IntPtr( aODFVersionLB->GetSelectEntryData() ); bool bShown = SvtSaveOptions::ODFDefaultVersion( nVersion ) != SvtSaveOptions::ODFVER_LATEST; @@ -645,8 +644,6 @@ IMPL_LINK_NOARG(SvxSaveTabPage, ODFVersionHdl_Impl) aODFWarningFI->Show( bShown ); aODFWarningFT->Show( bShown ); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx index 0a33a2a36239..06f450723cfc 100644 --- a/cui/source/options/optsave.hxx +++ b/cui/source/options/optsave.hxx @@ -61,8 +61,8 @@ private: SvxSaveTabPage_Impl* pImpl; DECL_LINK_TYPED( AutoClickHdl_Impl, Button*, void ); - DECL_LINK( FilterHdl_Impl, ListBox * ); - DECL_LINK(ODFVersionHdl_Impl, void *); + DECL_LINK_TYPED( FilterHdl_Impl, ListBox&, void ); + DECL_LINK_TYPED(ODFVersionHdl_Impl, ListBox&, void ); void DetectHiddenControls(); diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 2450e1ab9484..905cf4e98a61 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -500,7 +500,7 @@ IMPL_LINK_TYPED( SvxPersonalizationTabPage, DefaultPersona, Button*, pButton, vo } } -IMPL_LINK( SvxPersonalizationTabPage, SelectInstalledPersona, ListBox*, ) +IMPL_LINK_NOARG_TYPED( SvxPersonalizationTabPage, SelectInstalledPersona, ListBox&, void) { m_pOwnPersona->Check(); @@ -519,8 +519,6 @@ IMPL_LINK( SvxPersonalizationTabPage, SelectInstalledPersona, ListBox*, ) aFilter.ImportGraphic( aGraphic, aURLObj ); Bitmap aBmp = aGraphic.GetBitmap(); m_pExtensionPersonaPreview->SetModeImage( Image( aBmp ) ); - - return 0; } /// Find the value on the Persona page, and convert it to a usable form. diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 59e9cbdf81a9..5878033abfd2 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -68,7 +68,7 @@ private: DECL_LINK_TYPED( DefaultPersona, Button*, void ); /// Handle the Personas installed through extensions selection - DECL_LINK( SelectInstalledPersona, ListBox* ); + DECL_LINK_TYPED( SelectInstalledPersona, ListBox&, void ); }; /** Dialog that will allow the user to choose a Persona to use. diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index d3fcb3428db7..c297ce3b5cc4 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -203,7 +203,7 @@ AlignmentTabPage::AlignmentTabPage( vcl::Window* pParent, const SfxItemSet& rCor // windows to be disabled, if stacked text is turned OFF m_pOrientHlp->AddDependentWindow( *m_pCbAsianMode, TRISTATE_FALSE ); - Link<> aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl ); + Link<ListBox&,void> aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl ); m_pLbHorAlign->SetSelectHdl( aLink ); m_pBtnWrap->SetClickHdl( LINK( this, AlignmentTabPage, UpdateEnableClickHdl ) ); @@ -435,10 +435,9 @@ IMPL_LINK_NOARG_TYPED(AlignmentTabPage, UpdateEnableClickHdl, Button*, void) UpdateEnableControls(); } -IMPL_LINK_NOARG(AlignmentTabPage, UpdateEnableHdl) +IMPL_LINK_NOARG_TYPED(AlignmentTabPage, UpdateEnableHdl, ListBox&, void) { UpdateEnableControls(); - return 0; } diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 25ab173d60f8..096ef6d31bcd 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -172,10 +172,10 @@ static bool lcl_FindEntry( ListBox& rLB, const OUString& rEntry, return false; } -IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox) +IMPL_LINK_TYPED(OfaAutoCorrDlg, SelectLanguageHdl, ListBox&, rBox, void) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); - void* pVoid = pBox->GetEntryData(nPos); + sal_Int32 nPos = rBox.GetSelectEntryPos(); + void* pVoid = rBox.GetEntryData(nPos); LanguageType eNewLang = (LanguageType)reinterpret_cast<sal_IntPtr>(pVoid); // save old settings and fill anew if(eNewLang != eLastDialogLanguage) @@ -186,7 +186,6 @@ IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox) else if (m_nExceptionsPageId == nPageId) static_cast<OfaAutocorrExceptPage*>(GetTabPage( nPageId ))->SetLanguage(eNewLang); } - return 0; } OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(vcl::Window* pParent, const SfxItemSet& rSet) @@ -1728,21 +1727,20 @@ bool OfaAutocorrExceptPage::NewDelHdl(void* pBtn) return false; } -IMPL_LINK(OfaAutocorrExceptPage, SelectHdl, ListBox*, pBox) +IMPL_LINK_TYPED(OfaAutocorrExceptPage, SelectHdl, ListBox&, rBox, void) { - if (pBox == m_pAbbrevLB) + if (&rBox == m_pAbbrevLB) { - m_pAbbrevED->SetText(pBox->GetSelectEntry()); + m_pAbbrevED->SetText(rBox.GetSelectEntry()); m_pNewAbbrevPB->Enable(false); m_pDelAbbrevPB->Enable(); } else { - m_pDoubleCapsED->SetText(pBox->GetSelectEntry()); + m_pDoubleCapsED->SetText(rBox.GetSelectEntry()); m_pNewDoublePB->Enable(false); m_pDelDoublePB->Enable(); } - return 0; } IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt) diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index b271fc28f144..19da4fa2e2f3 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -551,7 +551,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) } pTableBck_Impl->nTableWhich = SID_ATTR_BRUSH_TABLE; - TblDestinationHdl_Impl(m_pTblLBox); + TblDestinationHdl_Impl(*m_pTblLBox); m_pTblLBox->SaveValue(); } else if( bHighlighting ) @@ -1139,7 +1139,7 @@ IMPL_LINK_NOARG_TYPED(SvxBackgroundTabPage, BackgroundColorHdl_Impl, ValueSet*, m_pPreviewWin1->NotifyChange( aBgdColor ); } -IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBackgroundTabPage, SelectHdl_Impl, ListBox&, void) { if ( drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect) ) { @@ -1149,7 +1149,6 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl) { ShowBitmapUI_Impl(); } - return 0; } IMPL_LINK_TYPED( SvxBackgroundTabPage, FileClickHdl_Impl, Button*, pBox, void ) @@ -1313,9 +1312,9 @@ void SvxBackgroundTabPage::ShowTblControl() m_pAsGrid->Show(); } -IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nSelPos = pBox->GetSelectEntryPos(); + sal_Int32 nSelPos = rBox.GetSelectEntryPos(); if( pTableBck_Impl && pTableBck_Impl->nActPos != nSelPos) { std::unique_ptr<SvxBrushItem> xItemHolder; @@ -1398,7 +1397,6 @@ IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox ) } FillControls_Impl(*pActItem, aUserData); } - return 0; } void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr, diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index fb22d0ade3cd..0dda1cd7af80 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -548,8 +548,8 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) m_pFrameSel->SelectAllVisibleBorders(); // set the current style and color (caches style in control even if nothing is selected) - SelStyleHdl_Impl(m_pLbLineStyle); - SelColHdl_Impl(m_pLbLineColor); + SelStyleHdl_Impl(*m_pLbLineStyle); + SelColHdl_Impl(*m_pLbLineColor); } bool bEnable = m_pWndShadows->GetSelectItemId() > 1 ; @@ -565,7 +565,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) if ( m_pLbLineStyle->GetSelectEntryPos() == 0 ) { m_pLbLineStyle->SelectEntryPos( 1 ); - SelStyleHdl_Impl(m_pLbLineStyle); + SelStyleHdl_Impl(*m_pLbLineStyle); } const SfxPoolItem* pItem; @@ -836,8 +836,8 @@ IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, SelPreHdl_Impl, ValueSet*, void) m_pLbLineStyle->SelectEntryPos( 1 ); // set current style to all previously selected lines - SelStyleHdl_Impl(m_pLbLineStyle); - SelColHdl_Impl(m_pLbLineColor); + SelStyleHdl_Impl(*m_pLbLineStyle); + SelColHdl_Impl(*m_pLbLineColor); } // Presets ValueSet does not show a selection (used as push buttons). @@ -859,17 +859,15 @@ IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, SelSdwHdl_Impl, ValueSet*, void) -IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb ) +IMPL_LINK_TYPED( SvxBorderTabPage, SelColHdl_Impl, ListBox&, rLb, void ) { - ColorListBox* pColLb = static_cast<ColorListBox*>(pLb); + ColorListBox* pColLb = static_cast<ColorListBox*>(&rLb); - if (pLb == m_pLbLineColor) + if (&rLb == m_pLbLineColor) { m_pFrameSel->SetColorToSelection( pColLb->GetSelectEntryColor() ); m_pLbLineStyle->SetColor( pColLb->GetSelectEntryColor() ); } - - return 0; } IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl) @@ -888,9 +886,9 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl) -IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb ) +IMPL_LINK_TYPED( SvxBorderTabPage, SelStyleHdl_Impl, ListBox&, rLb, void ) { - if (pLb == m_pLbLineStyle) + if (&rLb == m_pLbLineStyle) { sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( m_pLineWidthMF->GetValue( ), @@ -899,8 +897,6 @@ IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb ) m_pFrameSel->SetStyleToSelection ( nVal, SvxBorderStyle( m_pLbLineStyle->GetSelectEntryStyle() ) ); } - - return 0; } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 34e77c2f8a28..451930219ec7 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -431,11 +431,11 @@ void SvxCharNamePage::Initialize() m_pEastFontNameLB->SetModifyHdl( aLink ); m_pEastFontStyleLB->SetModifyHdl( aLink ); m_pEastFontSizeLB->SetModifyHdl( aLink ); - m_pEastFontLanguageLB->SetSelectHdl( aLink ); + m_pEastFontLanguageLB->SetSelectHdl( LINK( this, SvxCharNamePage, FontModifyListBoxHdl_Impl ) ); m_pCTLFontNameLB->SetModifyHdl( aLink ); m_pCTLFontStyleLB->SetModifyHdl( aLink ); m_pCTLFontSizeLB->SetModifyHdl( aLink ); - m_pCTLFontLanguageLB->SetSelectHdl( aLink ); + m_pCTLFontLanguageLB->SetSelectHdl( LINK( this, SvxCharNamePage, FontModifyListBoxHdl_Impl ) ); m_pImpl->m_aUpdateIdle.SetIdleHdl( LINK( this, SvxCharNamePage, UpdateHdl_Impl ) ); } @@ -1183,6 +1183,10 @@ IMPL_LINK_NOARG_TYPED(SvxCharNamePage, UpdateHdl_Impl, Idle *, void) +IMPL_LINK_TYPED( SvxCharNamePage, FontModifyListBoxHdl_Impl, ListBox&, rBox, void ) +{ + FontModifyHdl_Impl(&rBox); +} IMPL_LINK( SvxCharNamePage, FontModifyHdl_Impl, void*, pNameBox ) { m_pImpl->m_aUpdateIdle.Start(); @@ -1482,7 +1486,7 @@ void SvxCharEffectsPage::Initialize() m_pFontColorLB->SetSelectHdl( LINK( this, SvxCharEffectsPage, ColorBoxSelectHdl_Impl ) ); // handler - Link<> aLink = LINK( this, SvxCharEffectsPage, SelectHdl_Impl ); + Link<ListBox&,void> aLink = LINK( this, SvxCharEffectsPage, SelectListBoxHdl_Impl ); m_pUnderlineLB->SetSelectHdl( aLink ); m_pUnderlineColorLB->SetSelectHdl( aLink ); m_pOverlineLB->SetSelectHdl( aLink ); @@ -1701,7 +1705,11 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet ) -IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SvxCharEffectsPage, SelectListBoxHdl_Impl, ListBox&, rBox, void ) +{ + SelectHdl_Impl(&rBox); +} +void SvxCharEffectsPage::SelectHdl_Impl( ListBox* pBox ) { if ( m_pEmphasisLB == pBox ) { @@ -1730,12 +1738,11 @@ IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox ) m_pIndividualWordsBtn->Enable( bUEnable || bOEnable || ( nSPos > 0 && nSPos != LISTBOX_ENTRY_NOTFOUND ) ); } UpdatePreview_Impl(); - return 0; } -IMPL_LINK_NOARG(SvxCharEffectsPage, UpdatePreview_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharEffectsPage, UpdatePreview_Impl, ListBox&, void) { bool bEnable = ( ( m_pUnderlineLB->GetSelectEntryPos() > 0 ) || ( m_pOverlineLB->GetSelectEntryPos() > 0 ) || @@ -1743,7 +1750,6 @@ IMPL_LINK_NOARG(SvxCharEffectsPage, UpdatePreview_Impl) m_pIndividualWordsBtn->Enable( bEnable ); UpdatePreview_Impl(); - return 0; } @@ -1762,8 +1768,9 @@ IMPL_LINK_NOARG_TYPED(SvxCharEffectsPage, TristClickHdl_Impl, Button*, void) -IMPL_LINK( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox ) +IMPL_LINK_TYPED( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ListBox&, rListBox, void ) { + ColorListBox* pBox = static_cast<ColorListBox*>(&rListBox); SvxFont& rFont = GetPreviewFont(); SvxFont& rCJKFont = GetPreviewCJKFont(); SvxFont& rCTLFont = GetPreviewCTLFont(); @@ -1778,7 +1785,6 @@ IMPL_LINK( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox ) rCTLFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); m_pPreviewWin->Invalidate(); - return 0; } @@ -2028,20 +2034,18 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet ) } // the select handler for the underline/overline/strikeout list boxes -// SelectHdl_Impl( NULL ); DBG_ASSERT(m_pUnderlineLB->GetSelectHdl() == m_pOverlineLB->GetSelectHdl(), "SvxCharEffectsPage::Reset: inconsistence (1)!"); DBG_ASSERT(m_pUnderlineLB->GetSelectHdl() == m_pStrikeoutLB->GetSelectHdl(), "SvxCharEffectsPage::Reset: inconsistence (1)!"); - m_pUnderlineLB->GetSelectHdl().Call(NULL); + m_pUnderlineLB->GetSelectHdl().Call(*m_pUnderlineLB); // don't call SelectHdl_Impl directly! // in DisableControls, we may have re-routed the select handler // the select handler for the emphasis listbox -// SelectHdl_Impl( m_pEmphasisLB ); - DBG_ASSERT(m_pEmphasisLB->GetSelectHdl() == LINK(this, SvxCharEffectsPage, SelectHdl_Impl), + DBG_ASSERT(m_pEmphasisLB->GetSelectHdl() == LINK(this, SvxCharEffectsPage, SelectListBoxHdl_Impl), "SvxCharEffectsPage::Reset: inconsistence (2)!"); - m_pEmphasisLB->GetSelectHdl().Call( m_pEmphasisLB ); + m_pEmphasisLB->GetSelectHdl().Call( *m_pEmphasisLB ); // this is for consistency only. Here it would be allowed to call SelectHdl_Impl directly ... // Effects @@ -2704,7 +2708,7 @@ void SvxCharPositionPage::Initialize() m_pNormalPosBtn->Check(); PositionHdl_Impl( m_pNormalPosBtn ); m_pKerningLB->SelectEntryPos( 0 ); - KerningSelectHdl_Impl( NULL ); + KerningSelectHdl_Impl( *m_pKerningLB ); Link<Button*,void> aLink2 = LINK( this, SvxCharPositionPage, PositionHdl_Impl ); m_pHighPosBtn->SetClickHdl( aLink2 ); @@ -2853,7 +2857,7 @@ IMPL_LINK_TYPED( SvxCharPositionPage, FitToLineHdl_Impl, Button*, pBox, void ) -IMPL_LINK_NOARG(SvxCharPositionPage, KerningSelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxCharPositionPage, KerningSelectHdl_Impl, ListBox&, void) { if ( m_pKerningLB->GetSelectEntryPos() > LW_NORMAL ) { @@ -2882,8 +2886,6 @@ IMPL_LINK_NOARG(SvxCharPositionPage, KerningSelectHdl_Impl) } KerningModifyHdl_Impl( NULL ); - - return 0; } @@ -3126,7 +3128,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet ) m_pKerningLB->SelectEntryPos( LW_NORMAL ); } //enable/disable and set min/max of the Edit - KerningSelectHdl_Impl(m_pKerningLB); + KerningSelectHdl_Impl(*m_pKerningLB); //the attribute value must be displayed also if it's above the maximum allowed value long nVal = static_cast<long>(m_pKerningMF->GetMax()); if(nVal < nKerning) @@ -3431,7 +3433,7 @@ void SvxCharTwoLinesPage::Initialize() m_pTwoLinesBtn->SetClickHdl( LINK( this, SvxCharTwoLinesPage, TwoLinesHdl_Impl ) ); - Link<> aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl ); + Link<ListBox&,void> aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl ); m_pStartBracketLB->SetSelectHdl( aLink ); m_pEndBracketLB->SetSelectHdl( aLink ); @@ -3512,21 +3514,20 @@ IMPL_LINK_NOARG_TYPED(SvxCharTwoLinesPage, TwoLinesHdl_Impl, Button*, void) -IMPL_LINK( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); - if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == reinterpret_cast<sal_uLong>(pBox->GetEntryData( nPos )) ) - SelectCharacter( pBox ); + sal_Int32 nPos = rBox.GetSelectEntryPos(); + if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == reinterpret_cast<sal_uLong>(rBox.GetEntryData( nPos )) ) + SelectCharacter( &rBox ); else { - bool bStart = pBox == m_pStartBracketLB; + bool bStart = &rBox == m_pStartBracketLB; if( bStart ) m_nStartBracketPosition = nPos; else m_nEndBracketPosition = nPos; } UpdatePreview_Impl(); - return 0; } diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index 21fa98fa7fc2..e7fa56d2a6ab 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -128,7 +128,7 @@ SvxConnectionPage::SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rI m_pMtrFldLine1->SetModifyHdl( aLink ); m_pMtrFldLine2->SetModifyHdl( aLink ); m_pMtrFldLine3->SetModifyHdl( aLink ); - m_pLbType->SetSelectHdl( aLink ); + m_pLbType->SetSelectHdl( LINK( this, SvxConnectionPage, ChangeAttrListBoxHdl_Impl ) ); } SvxConnectionPage::~SvxConnectionPage() @@ -396,6 +396,10 @@ VclPtr<SfxTabPage> SvxConnectionPage::Create( vcl::Window* pWindow, return VclPtr<SvxConnectionPage>::Create( pWindow, *rAttrs ); } +IMPL_LINK_TYPED( SvxConnectionPage, ChangeAttrListBoxHdl_Impl, ListBox&, r, void ) +{ + ChangeAttrHdl_Impl(&r); +} IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p ) { if( p == m_pMtrFldHorz1 ) diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index 61ebffe4687f..60f575fd9696 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -422,22 +422,20 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType ) -IMPL_LINK( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox&, rListBox, void ) { - if (pListBox == m_pLB_ANSATZ) + if (&rListBox == m_pLB_ANSATZ) { SetupAnsatz_Impl( m_pLB_ANSATZ->GetSelectEntryPos() ); } - return 0; } -IMPL_LINK( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox&, rListBox, void ) { - if (pListBox == m_pLB_ANSATZ_REL) + if (&rListBox == m_pLB_ANSATZ_REL) { nAnsatzRelPos = m_pLB_ANSATZ_REL->GetSelectEntryPos(); } - return 0; } IMPL_LINK_TYPED( SvxCaptionTabPage, LineOptHdl_Impl, Button *, pButton, void ) diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 2d76be168a90..88a859564d61 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -145,7 +145,7 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs m_pTsbBelowRefEdge->SetClickHdl( LINK( this, SvxMeasurePage, ChangeAttrClickHdl_Impl ) ); m_pTsbParallel->SetClickHdl( LINK( this, SvxMeasurePage, ChangeAttrClickHdl_Impl ) ); m_pTsbShowUnit->SetClickHdl( LINK( this, SvxMeasurePage, ChangeAttrClickHdl_Impl ) ); - m_pLbUnit->SetSelectHdl( aLink ); + m_pLbUnit->SetSelectHdl( LINK( this, SvxMeasurePage, ChangeAttrListBoxHdl_Impl ) ); } SvxMeasurePage::~SvxMeasurePage() @@ -664,9 +664,12 @@ IMPL_LINK_TYPED( SvxMeasurePage, ChangeAttrClickHdl_Impl, Button*, p, void ) { ChangeAttrHdl_Impl(p); } +IMPL_LINK_TYPED( SvxMeasurePage, ChangeAttrListBoxHdl_Impl, ListBox&, rBox, void ) +{ + ChangeAttrHdl_Impl(&rBox); +} IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) { - if( p == m_pMtrFldLineDist ) { sal_Int32 nValue = GetCoreValue( *m_pMtrFldLineDist, eUnit ); diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index e9aa60a197a6..4e666c9bec2e 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -335,15 +335,15 @@ void SvxNumberFormatTabPage::Init_Impl() m_pCbSourceFormat->Disable(); m_pCbSourceFormat->Hide(); - Link<> aLink = LINK( this, SvxNumberFormatTabPage, SelFormatHdl_Impl ); + Link<ListBox&,void> aLink2 = LINK( this, SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl ); - m_pLbCategory->SetSelectHdl( aLink ); - m_pLbFormat->SetSelectHdl( LINK( this, SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl ) ); - m_pLbLanguage->SetSelectHdl( aLink ); - m_pLbCurrency->SetSelectHdl( aLink ); + m_pLbCategory->SetSelectHdl( aLink2 ); + m_pLbFormat->SetSelectHdl( LINK( this, SvxNumberFormatTabPage, SelFormatTreeListBoxHdl_Impl ) ); + m_pLbLanguage->SetSelectHdl( aLink2 ); + m_pLbCurrency->SetSelectHdl( aLink2 ); m_pCbSourceFormat->SetClickHdl( LINK( this, SvxNumberFormatTabPage, SelFormatClickHdl_Impl ) ); - aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl ); + Link<> aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl ); m_pEdDecimals->SetModifyHdl( aLink ); m_pEdLeadZeroes->SetModifyHdl( aLink ); @@ -356,9 +356,7 @@ void SvxNumberFormatTabPage::Init_Impl() m_pIbInfo->SetClickHdl( HDL( ClickHdl_Impl ) ); UpdateThousandEngineeringText(); - Link<Control&,void> aLink2 = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl); - - m_pEdComment->SetLoseFocusHdl( aLink2); + m_pEdComment->SetLoseFocusHdl( LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl) ); aResetWinTimer.SetTimeoutHdl(LINK( this, SvxNumberFormatTabPage, TimeHdl_Impl)); aResetWinTimer.SetTimeout( 10); @@ -1194,17 +1192,21 @@ IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatClickHdl_Impl, Button*, pLb, v { SelFormatHdl_Impl(pLb); } -IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl, SvTreeListBox*, pLb, void ) +IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatTreeListBoxHdl_Impl, SvTreeListBox*, pLb, void ) { SelFormatHdl_Impl(pLb); } -IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) +IMPL_LINK_TYPED( SvxNumberFormatTabPage, SelFormatListBoxHdl_Impl, ListBox&, rLb, void ) +{ + SelFormatHdl_Impl(&rLb); +} +void SvxNumberFormatTabPage::SelFormatHdl_Impl(void * pLb ) { if (pLb == m_pCbSourceFormat) { EnableBySourceFormat_Impl(); // enable/disable everything else if ( m_pCbSourceFormat->IsChecked() ) - return 0; // just disabled everything else + return; // just disabled everything else // Reinit options enable/disable for current selection. @@ -1280,7 +1282,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) } UpdateOptions_Impl( false ); - return 0; + return; } @@ -1291,7 +1293,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) EditHdl_Impl( NULL ); UpdateOptions_Impl( false ); - return 0; + return; } @@ -1301,9 +1303,8 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) UpdateFormatListBox_Impl( false, true ); EditHdl_Impl(m_pEdFormat); - return 0; + return; } - return 0; } diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 14abb1d56f60..fe69953ca189 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -1526,7 +1526,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet ) { m_pAlignFT->Show(); m_pAlignLB->Show(); - m_pAlignLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl)); + m_pAlignLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, EditListBoxHdl_Impl)); } else { @@ -1801,29 +1801,29 @@ void SvxNumOptionsTabPage::SwitchNumberType( sal_uInt8 nType, bool ) m_pOrientLB->Enable(bEnableBitmap); } -IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox&, rBox, void ) { sal_uInt16 nSaveNumLvl = nActNumLvl; nActNumLvl = 0; - if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) + if(rBox.IsEntryPosSelected( pActNum->GetLevelCount() ) && + (rBox.GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) { nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(false); + rBox.SetUpdateMode(false); for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - pBox->SelectEntryPos( i, false ); - pBox->SetUpdateMode(true); + rBox.SelectEntryPos( i, false ); + rBox.SetUpdateMode(true); } - else if(pBox->GetSelectEntryCount()) + else if(rBox.GetSelectEntryCount()) { sal_uInt16 nMask = 1; for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) { - if(pBox->IsEntryPosSelected( i )) + if(rBox.IsEntryPosSelected( i )) nActNumLvl |= nMask; nMask <<= 1; } - pBox->SelectEntryPos( pActNum->GetLevelCount(), false ); + rBox.SelectEntryPos( pActNum->GetLevelCount(), false ); } else { @@ -1833,14 +1833,13 @@ IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox *, pBox ) { if(nActNumLvl & nMask) { - pBox->SelectEntryPos(i); + rBox.SelectEntryPos(i); break; } nMask <<=1; } } InitControls(); - return 0; } IMPL_LINK_NOARG_TYPED(SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer *, void) @@ -1868,7 +1867,7 @@ IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, NumericField*, pBox ) return 0; } -IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox&, rBox, void ) { OUString sSelectStyle; bool bShowOrient = false; @@ -1880,7 +1879,7 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) { SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); // PAGEDESC does not exist - sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(pBox->GetSelectEntryData()); + sal_uInt16 nNumType = (sal_uInt16)reinterpret_cast<sal_uLong>(rBox.GetSelectEntryData()); aNumFmt.SetNumberingType((sal_Int16)nNumType); sal_uInt16 nNumberingType = aNumFmt.GetNumberingType(); if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN))) @@ -1944,10 +1943,9 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) if(!sSelectStyle.isEmpty()) { m_pCharFmtLB->SelectEntry(sSelectStyle); - CharFmtHdl_Impl(m_pCharFmtLB); + CharFmtHdl_Impl(*m_pCharFmtLB); bAutomaticCharStyles = true; } - return 0; } void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) @@ -1961,9 +1959,9 @@ void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) m_pStartED->GetModifyHdl().Call(m_pStartED); } -IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox&, rBox, void ) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); nPos ++; // no VERT_NONE sal_uInt16 nMask = 1; @@ -1984,8 +1982,6 @@ IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox *, pBox ) nMask <<= 1; } SetModified(false); - return 0; - } IMPL_LINK_TYPED( SvxNumOptionsTabPage, SameLevelHdl_Impl, Button*, pBox, void ) @@ -2006,8 +2002,9 @@ IMPL_LINK_TYPED( SvxNumOptionsTabPage, SameLevelHdl_Impl, Button*, pBox, void ) InitControls(); } -IMPL_LINK( SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox*, pBox ) +IMPL_LINK_TYPED( SvxNumOptionsTabPage, BulColorHdl_Impl, ListBox&, rListBox, void ) { + ColorListBox* pBox = static_cast<ColorListBox*>(&rListBox); Color nSetColor = pBox->GetSelectEntryColor(); sal_uInt16 nMask = 1; @@ -2022,7 +2019,6 @@ IMPL_LINK( SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox*, pBox ) nMask <<= 1; } SetModified(); - return 0; } IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, MetricField *, pField) @@ -2315,7 +2311,7 @@ IMPL_LINK_TYPED( SvxNumOptionsTabPage, RatioHdl_Impl, Button*, pBox, void ) } } -IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNumOptionsTabPage, CharFmtHdl_Impl, ListBox&, void) { bAutomaticCharStyles = false; sal_Int32 nEntryPos = m_pCharFmtLB->GetSelectEntryPos(); @@ -2338,10 +2334,12 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, CharFmtHdl_Impl) nMask <<= 1; } SetModified(false); - return 0; - }; +IMPL_LINK_NOARG_TYPED( SvxNumOptionsTabPage, EditListBoxHdl_Impl, ListBox&, void ) +{ + EditModifyHdl_Impl(nullptr); +} IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit *, pEdit ) { bool bPrefix = pEdit == m_pPrefixED; @@ -3313,7 +3311,7 @@ void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric) m_pIndentAtMF->SetUnit( eMetric ); } -IMPL_LINK_NOARG(SvxNumPositionTabPage, EditModifyHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, EditModifyHdl_Impl, ListBox&, void) { sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) @@ -3336,32 +3334,31 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, EditModifyHdl_Impl) nMask <<= 1; } SetModified(); - return 0; } -IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxNumPositionTabPage, LevelHdl_Impl, ListBox&, rBox, void ) { sal_uInt16 nSaveNumLvl = nActNumLvl; nActNumLvl = 0; - if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) + if(rBox.IsEntryPosSelected( pActNum->GetLevelCount() ) && + (rBox.GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) { nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(false); + rBox.SetUpdateMode(false); for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - pBox->SelectEntryPos( i, false ); - pBox->SetUpdateMode(true); + rBox.SelectEntryPos( i, false ); + rBox.SetUpdateMode(true); } - else if(pBox->GetSelectEntryCount()) + else if(rBox.GetSelectEntryCount()) { sal_uInt16 nMask = 1; for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) { - if(pBox->IsEntryPosSelected( i )) + if(rBox.IsEntryPosSelected( i )) nActNumLvl |= nMask; nMask <<= 1; } - pBox->SelectEntryPos( pActNum->GetLevelCount(), false ); + rBox.SelectEntryPos( pActNum->GetLevelCount(), false ); } else { @@ -3371,7 +3368,7 @@ IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) { if(nActNumLvl & nMask) { - pBox->SelectEntryPos(i); + rBox.SelectEntryPos(i); break; } nMask <<=1; @@ -3382,7 +3379,6 @@ IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); InitControls(); - return 0; } IMPL_LINK_TYPED( SvxNumPositionTabPage, DistanceFocusHdl_Impl, Control&, rControl, void ) @@ -3492,7 +3488,7 @@ IMPL_LINK_TYPED( SvxNumPositionTabPage, RelativeHdl_Impl, Button*, pBox, void ) bLastRelative = bOn; } -IMPL_LINK_NOARG(SvxNumPositionTabPage, LabelFollowedByHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox&, void) { // determine value to be set at the chosen list levels SvxNumberFormat::LabelFollowedBy eLabelFollowedBy = SvxNumberFormat::LISTTAB; @@ -3547,8 +3543,6 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, LabelFollowedByHdl_Impl) } SetModified(); - - return 0; } IMPL_LINK( SvxNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld ) diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index fc90d1fa01d7..9310f1642371 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -494,7 +494,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // alignment m_pLayoutBox->SelectEntryPos( ::PageUsageToPos_Impl( nUse ) ); m_pBspWin->SetUsage( nUse ); - LayoutHdl_Impl( 0 ); + LayoutHdl_Impl( *m_pLayoutBox ); //adjust numeration type of the page style //Get the Position of the saved NumType @@ -927,7 +927,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet ) -IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxPageDescPage, LayoutHdl_Impl, ListBox&, void) { // switch inside outside const sal_uInt16 nPos = PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() ); @@ -947,7 +947,6 @@ IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl) m_pOutsideLbl->Hide(); } UpdateExample_Impl( true ); - return 0; } @@ -987,9 +986,9 @@ IMPL_LINK_NOARG_TYPED(SvxPageDescPage, PaperBinHdl_Impl, Control&, void) -IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void ) { - const sal_Int32 nPos = pBox->GetSelectEntryPos(); + const sal_Int32 nPos = rBox.GetSelectEntryPos(); Paper ePaper = (Paper)reinterpret_cast<sal_uLong>(m_pPaperSizeBox->GetEntryData( nPos )); if ( ePaper != PAPER_USER ) @@ -1054,7 +1053,6 @@ IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) UpdateExample_Impl( true ); } } - return 0; } @@ -1103,7 +1101,7 @@ IMPL_LINK_TYPED( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void ) // recalculate margins if necessary CalcMargin_Impl(); - PaperSizeSelect_Impl( m_pPaperSizeBox ); + PaperSizeSelect_Impl( *m_pPaperSizeBox ); RangeHdl_Impl( *m_pPaperWidthEdit ); SwapFirstValues_Impl( bBorderModified ); UpdateExample_Impl( true ); @@ -1694,11 +1692,10 @@ void SvxPageDescPage::DisableVerticalPageDir() } } -IMPL_LINK( SvxPageDescPage, FrameDirectionModify_Impl, ListBox*,) +IMPL_LINK_NOARG_TYPED( SvxPageDescPage, FrameDirectionModify_Impl, ListBox&, void) { m_pBspWin->SetFrameDirection( (sal_uInt32) m_pTextFlowBox->GetSelectEntryValue() ); m_pBspWin->Invalidate(); - return 0; } bool SvxPageDescPage::IsPrinterRangeOverflow( diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index d4617e22548b..7d9965c57fac 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -765,12 +765,12 @@ void SvxStdParagraphTabPage::SetLineSpacing_Impl break; default: ;//prevent warning } - LineDistHdl_Impl( m_pLineDist ); + LineDistHdl_Impl( *m_pLineDist ); } -IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox ) +IMPL_LINK_TYPED( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox&, rBox, void ) { - switch( pBox->GetSelectEntryPos() ) + switch( rBox.GetSelectEntryPos() ) { case LLINESPACE_1: case LLINESPACE_15: @@ -832,7 +832,6 @@ IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox ) break; } UpdateExample_Impl(); - return 0; } IMPL_LINK_NOARG(SvxStdParagraphTabPage, ModifyHdl_Impl) @@ -1295,16 +1294,15 @@ IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, AlignHdl_Impl, Button*, void) UpdateExample_Impl(); } -IMPL_LINK_NOARG(SvxParaAlignTabPage, LastLineHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, LastLineHdl_Impl, ListBox&, void) { //fdo#41350 only enable 'Expand last word' if last line is also justified bool bLastLineIsBlock = m_pLastLineLB->GetSelectEntryPos() == 2; m_pExpandCB->Enable(bLastLineIsBlock); UpdateExample_Impl(); - return 0; } -IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox&, void) { SvxFrameDirection eDir = m_pTextDirectionLB->GetSelectEntryValue(); switch ( eDir ) @@ -1318,8 +1316,6 @@ IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl) SAL_WARN( "cui.tabpages", "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" ); } } - - return 0; } void SvxParaAlignTabPage::UpdateExample_Impl() @@ -1737,7 +1733,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet ) } } - PageBreakPosHdl_Impl( m_pBreakPositionLB ); + PageBreakPosHdl_Impl( *m_pBreakPositionLB ); PageBreakHdl_Impl( m_pPageBreakBox ); } @@ -2127,9 +2123,9 @@ IMPL_LINK_NOARG_TYPED(SvxExtParagraphTabPage, ApplyCollClickHdl_Impl, Button*, v } } -IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox&, rListBox, void ) { - if ( 0 == pListBox->GetSelectEntryPos() ) + if ( 0 == rListBox.GetSelectEntryPos() ) { m_pApplyCollBtn->Enable(); @@ -2143,7 +2139,7 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) m_pPagenumEdit->Enable(bEnable); } } - else if ( 1 == pListBox->GetSelectEntryPos() ) + else if ( 1 == rListBox.GetSelectEntryPos() ) { m_pApplyCollBtn->SetState( TRISTATE_FALSE ); m_pApplyCollBtn->Enable(false); @@ -2151,14 +2147,13 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) m_pPagenumText->Enable(false); m_pPagenumEdit->Enable(false); } - return 0; } -IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox&, rListBox, void ) { //column break or break break after sal_Int32 nBreakPos = m_pBreakPositionLB->GetSelectEntryPos(); - if ( pListBox->GetSelectEntryPos() == 1 || 1 == nBreakPos) + if ( rListBox.GetSelectEntryPos() == 1 || 1 == nBreakPos) { m_pApplyCollBtn->SetState( TRISTATE_FALSE ); m_pApplyCollBtn->Enable(false); @@ -2167,8 +2162,7 @@ IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox ) m_pPagenumEdit->Enable(false); } else - PageBreakPosHdl_Impl( m_pBreakPositionLB ); - return 0; + PageBreakPosHdl_Impl( *m_pBreakPositionLB ); } void SvxExtParagraphTabPage::PageCreated(const SfxAllItemSet& aSet) diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 65a6a0867789..c115591a0af9 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1237,8 +1237,8 @@ IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, AnchorTypeHdl, Button*, void) if(m_bHtmlMode) { - PosHdl(m_pHoriLB); - PosHdl(m_pVertLB); + PosHdl(*m_pHoriLB); + PosHdl(*m_pVertLB); } } @@ -1248,9 +1248,9 @@ IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, MirrorHdl, Button*, void) InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX); } -IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SvxSwPosSizeTabPage, RelHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHoriToLB; + bool bHori = &rLB == m_pHoriToLB; UpdateExample(); @@ -1274,23 +1274,19 @@ IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB ) } } } - if (pLB) // only if the handler has been called by a change of the controller - RangeModifyHdl(*m_pWidthMF); - - return 0; - + RangeModifyHdl(*m_pWidthMF); } -IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SvxSwPosSizeTabPage, PosHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHoriLB; + bool bHori = &rLB == m_pHoriLB; ListBox *pRelLB = bHori ? m_pHoriToLB : m_pVertToLB; FixedText *pRelFT = bHori ? m_pHoriToFT : m_pVertToFT; FrmMap *pMap = bHori ? m_pHMap : m_pVMap; - sal_uInt16 nMapPos = GetMapPos(pMap, *pLB); - sal_uInt16 nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB); + sal_uInt16 nMapPos = GetMapPos(pMap, rLB); + sal_uInt16 nAlign = GetAlignment(pMap, nMapPos, rLB, *pRelLB); if (bHori) { @@ -1308,7 +1304,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) RangeModifyHdl( *m_pWidthMF ); short nRel = 0; - if (pLB->GetSelectEntryCount()) + if (rLB.GetSelectEntryCount()) { if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) @@ -1354,7 +1350,7 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) bSet = true; } if(bSet) - PosHdl(m_pVertLB); + PosHdl(*m_pVertLB); } else { @@ -1377,11 +1373,10 @@ IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) m_pHoriToLB->SelectEntryPos(0) ; } if(bSet) - PosHdl(m_pHoriLB); + PosHdl(*m_pHoriLB); } } - return 0; } IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit *, pEdit ) @@ -1816,7 +1811,7 @@ sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_u rLB.Enable(rLB.GetEntryCount() != 0); rFT.Enable(rLB.GetEntryCount() != 0); - RelHdl(&rLB); + RelHdl(rLB); return nLBRelations; } @@ -1869,7 +1864,7 @@ sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap, if (!_rLB.GetSelectEntryCount()) _rLB.SelectEntryPos(0); - PosHdl(&_rLB); + PosHdl(_rLB); return GetMapPos(_pMap, _rLB); } diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 0a5e83e47460..4ffacbe99e71 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -335,7 +335,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) m_pMtrFldAmount->SaveValue(); - SelectEffectHdl_Impl( NULL ); + SelectEffectHdl_Impl( *m_pLbEffect ); ClickEndlessHdl_Impl( NULL ); ClickAutoHdl_Impl( NULL ); //ClickPixelHdl_Impl( NULL ); @@ -467,7 +467,7 @@ VclPtr<SfxTabPage> SvxTextAnimationPage::Create( vcl::Window* pWindow, return VclPtr<SvxTextAnimationPage>::Create( pWindow, *rAttrs ); } -IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxTextAnimationPage, SelectEffectHdl_Impl, ListBox&, void) { sal_Int32 nPos = m_pLbEffect->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -522,7 +522,6 @@ IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl) } } - return 0L; } IMPL_LINK_NOARG_TYPED(SvxTextAnimationPage, ClickEndlessHdl_Impl, Button*, void) diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 3d0e20cf2ce3..31d8f9cdda63 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -155,6 +155,10 @@ IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl) return 0L; } +IMPL_LINK_TYPED(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, ListBox&, rListBox, void) +{ + ModifiedTrgrHdl_Impl(&rListBox); +} IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrHdl_Impl, void *, pControl) { if(pControl == m_pLbTrgrGradientType || pControl == this) @@ -288,7 +292,7 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt m_pMtrTrgrEndValue->SetValue( 100 ); m_pMtrTrgrStartValue->SetValue( 0 ); Link<> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrHdl_Impl); - m_pLbTrgrGradientType->SetSelectHdl( aLink ); + m_pLbTrgrGradientType->SetSelectHdl( LINK( this, SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl) ); m_pMtrTrgrCenterX->SetModifyHdl( aLink ); m_pMtrTrgrCenterY->SetModifyHdl( aLink ); m_pMtrTrgrAngle->SetModifyHdl( aLink ); @@ -879,7 +883,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbBitmap->SelectEntryPos( 0 ); else m_pLbBitmap->SelectEntryPos( _nPos ); - ModifyBitmapHdl_Impl( this ); + ModifyBitmapHdl_Impl( *m_pLbBitmap ); } if( *m_pnHatchingListState != ChangeType::NONE ) @@ -898,9 +902,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbHatching->SelectEntryPos( 0 ); else m_pLbHatching->SelectEntryPos( _nPos ); - ModifyHatchingHdl_Impl( this ); + ModifyHatchingHdl_Impl( *m_pLbHatching ); - ModifyHatchBckgrdColorHdl_Impl( this ); + ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor ); } if( *m_pnGradientListState != ChangeType::NONE ) @@ -919,7 +923,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbGradient->SelectEntryPos( 0 ); else m_pLbGradient->SelectEntryPos( _nPos ); - ModifyGradientHdl_Impl( this ); + ModifyGradientHdl_Impl( *m_pLbGradient ); } if( *m_pnColorListState != ChangeType::NONE ) @@ -938,7 +942,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) else m_pLbColor->SelectEntryPos( _nPos ); - ModifyColorHdl_Impl( this ); + ModifyColorHdl_Impl( *m_pLbColor ); // Backgroundcolor of hatch _nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos(); @@ -952,7 +956,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) else m_pLbHatchBckgrdColor->SelectEntryPos( _nPos ); - ModifyHatchBckgrdColorHdl_Impl( this ); + ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor ); } // evaluate if any other Tabpage set another filltype @@ -1848,7 +1852,7 @@ VclPtr<SfxTabPage> SvxAreaTabPage::Create( vcl::Window* pWindow, -IMPL_LINK_NOARG(SvxAreaTabPage, SelectDialogTypeHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, SelectDialogTypeHdl_Impl, ListBox&, void) { switch( (drawing::FillStyle)m_pTypeLB->GetSelectEntryPos() ) { @@ -1859,8 +1863,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, SelectDialogTypeHdl_Impl) case drawing::FillStyle_HATCH: ClickHatchingHdl_Impl(); break; case drawing::FillStyle_BITMAP: ClickBitmapHdl_Impl(); break; } - - return 0; } void SvxAreaTabPage::ClickInvisibleHdl_Impl() @@ -1906,12 +1908,12 @@ void SvxAreaTabPage::ClickColorHdl_Impl() // Controls for Hatch-Background m_pFlHatchBckgrd->Hide(); - ModifyColorHdl_Impl( this ); + ModifyColorHdl_Impl( *m_pLbColor ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyColorHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbColor->GetSelectEntryPos(); @@ -1933,8 +1935,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyColorHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } @@ -1961,13 +1961,13 @@ void SvxAreaTabPage::ClickGradientHdl_Impl() // Controls for Hatch-Background m_pFlHatchBckgrd->Hide(); - ModifyGradientHdl_Impl( this ); + ModifyGradientHdl_Impl( *m_pLbGradient ); ModifyStepCountHdl_Impl( m_pTsbStepCount ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyGradientHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyGradientHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbGradient->GetSelectEntryPos(); @@ -1989,8 +1989,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyGradientHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } @@ -2016,14 +2014,14 @@ void SvxAreaTabPage::ClickHatchingHdl_Impl() m_pCbxHatchBckgrd->Enable(); m_pLbHatchBckgrdColor->Enable(); - ModifyHatchingHdl_Impl( this ); - ModifyHatchBckgrdColorHdl_Impl( this ); + ModifyHatchingHdl_Impl( *m_pLbHatching ); + ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor ); ToggleHatchBckgrdColorHdl_Impl( *m_pCbxHatchBckgrd ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchingHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchingHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbHatching->GetSelectEntryPos(); @@ -2045,13 +2043,11 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchingHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl, ListBox&, void) { const SfxPoolItem* pPoolItem = NULL; sal_Int32 _nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos(); @@ -2070,8 +2066,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl) m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlXRectPreview->Invalidate(); - - return 0L; } @@ -2140,13 +2134,13 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl() m_pBxBitmap->Show(); - ModifyBitmapHdl_Impl( this ); + ModifyBitmapHdl_Impl( *m_pLbBitmap ); ModifyTileHdl_Impl( m_pTsbOriginal ); } -IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyBitmapHdl_Impl, ListBox&, void) { //UUUU mbDirectGraphicSet = false; @@ -2173,8 +2167,6 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl) m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlBitmapPreview->Invalidate(); - - return 0L; } diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 22fa3d32056e..d9fc6138557f 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -195,8 +195,8 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) else m_pLbBackgroundColor->SelectEntryPos( nPos ); - ChangePixelColorHdl_Impl( this ); - ChangeBackgrndColorHdl_Impl( this ); + ChangePixelColorHdl_Impl( *m_pLbColor ); + ChangeBackgrndColorHdl_Impl( *m_pLbBackgroundColor ); } // determining (possibly cutting) the name and @@ -221,7 +221,7 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) m_pLbBitmaps->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); *m_pPageType = PT_BITMAP; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -288,7 +288,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* ) m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->Invalidate(); - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); // determine button state if( m_pBitmapList.is() && m_pBitmapList->Count() ) @@ -316,7 +316,7 @@ VclPtr<SfxTabPage> SvxBitmapTabPage::Create( vcl::Window* pWindow, -IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBitmapHdl_Impl, ListBox&, void) { std::unique_ptr<GraphicObject> pGraphicObject; int nPos(m_pLbBitmaps->GetSelectEntryPos()); @@ -429,8 +429,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl) m_bBmpChanged = false; } - - return 0; } @@ -570,7 +568,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void) *m_pnBitmapListState |= ChangeType::MODIFIED; - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); } } @@ -659,7 +657,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickImportHdl_Impl, Button*, void) *m_pnBitmapListState |= ChangeType::MODIFIED; - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); } } else @@ -752,7 +750,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl_Impl, Button*, void) m_pCtlPreview->Invalidate(); m_pCtlPixel->Invalidate(); - ChangeBitmapHdl_Impl( this ); + ChangeBitmapHdl_Impl( *m_pLbBitmaps ); *m_pnBitmapListState |= ChangeType::MODIFIED; } @@ -937,7 +935,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickSaveHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxBitmapTabPage, ChangePixelColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangePixelColorHdl_Impl, ListBox&, void) { m_pCtlPixel->SetPixelColor( m_pLbColor->GetSelectEntryColor() ); m_pCtlPixel->Invalidate(); @@ -950,13 +948,11 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangePixelColorHdl_Impl) m_pCtlPreview->Invalidate(); m_bBmpChanged = true; - - return 0L; } -IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, ListBox&, void) { m_pCtlPixel->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() ); m_pCtlPixel->Invalidate(); @@ -969,8 +965,6 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl) m_pCtlPreview->Invalidate(); m_bBmpChanged = true; - - return 0L; } diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index be9c42beba58..48455fdd16f6 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -278,7 +278,7 @@ void SvxColorTabPage::Update(bool bLoaded) XColorEntry* pEntry = pColorList->GetColor( nPos ); ChangeColor(pEntry->GetColor()); } - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); } UpdateModified(); @@ -499,7 +499,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& ) } // so that the possibly changed color is discarded - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); *pPageType = PT_COLOR; *pPos = LISTBOX_ENTRY_NOTFOUND; @@ -641,7 +641,7 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet ) m_pLbColorModel->SelectEntryPos( aStr.toInt32() ); ChangeColor(aNewColor); - SelectColorModelHdl_Impl( this ); + SelectColorModelHdl_Impl( *m_pLbColorModel ); m_pCtlPreviewOld->Invalidate(); UpdateModified(); @@ -762,7 +762,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickAddHdl_Impl, Button*, void) *pnColorListState |= ChangeType::MODIFIED; - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); } UpdateModified(); @@ -900,7 +900,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickDeleteHdl_Impl, Button*, void) // positioning m_pLbColor->SelectEntryPos( nPos ); - SelectColorLBHdl_Impl( this ); + SelectColorLBHdl_Impl( *m_pLbColor ); m_pCtlPreviewOld->Invalidate(); @@ -912,7 +912,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickDeleteHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxColorTabPage, SelectColorLBHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectColorLBHdl_Impl, ListBox&, void) { sal_Int32 nPos = m_pLbColor->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -931,7 +931,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorLBHdl_Impl) XColorEntry* pEntry = pColorList->GetColor(nPos); ChangeColor(pEntry->GetColor()); } - return 0; } @@ -980,7 +979,7 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell) } } -IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxColorTabPage, SelectColorModelHdl_Impl, ListBox&, void) { int nPos = m_pLbColorModel->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) @@ -1008,8 +1007,6 @@ IMPL_LINK_NOARG(SvxColorTabPage, SelectColorModelHdl_Impl) ChangeColor(aCurrentColor); } - - return 0; } diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 7bf1bdb2dc7a..62f69953475b 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -116,15 +116,16 @@ SvxGradientTabPage::SvxGradientTabPage LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); Link<> aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl ); - m_pLbGradientType->SetSelectHdl( aLink ); + Link<ListBox&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl ); + m_pLbGradientType->SetSelectHdl( aLink2 ); m_pMtrCenterX->SetModifyHdl( aLink ); m_pMtrCenterY->SetModifyHdl( aLink ); m_pMtrAngle->SetModifyHdl( aLink ); m_pMtrBorder->SetModifyHdl( aLink ); m_pMtrColorFrom->SetModifyHdl( aLink ); - m_pLbColorFrom->SetSelectHdl( aLink ); + m_pLbColorFrom->SetSelectHdl( aLink2 ); m_pMtrColorTo->SetModifyHdl( aLink ); - m_pLbColorTo->SetSelectHdl( aLink ); + m_pLbColorTo->SetSelectHdl( aLink2 ); m_pBtnLoad->SetClickHdl( LINK( this, SvxGradientTabPage, ClickLoadHdl_Impl ) ); @@ -244,7 +245,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& ) m_pLbGradients->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); *m_pPageType = PT_GRADIENT; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -373,7 +374,7 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) void SvxGradientTabPage::Reset( const SfxItemSet* ) { // m_pLbGradients->SelectEntryPos( 0 ); - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); // determine state of the buttons if( m_pGradientList->Count() ) @@ -400,6 +401,10 @@ VclPtr<SfxTabPage> SvxGradientTabPage::Create( vcl::Window* pWindow, +IMPL_LINK_TYPED( SvxGradientTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ModifiedHdl_Impl(&rListBox); +} IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl ) { css::awt::GradientStyle eXGS = (css::awt::GradientStyle) m_pLbGradientType->GetSelectEntryPos(); @@ -517,7 +522,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void) *m_pnGradientListState |= ChangeType::MODIFIED; - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); } // determine button state @@ -614,7 +619,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickDeleteHdl_Impl, Button*, void) m_pCtlPreview->Invalidate(); - ChangeGradientHdl_Impl( this ); + ChangeGradientHdl_Impl( *m_pLbGradients ); *m_pnGradientListState |= ChangeType::MODIFIED; } @@ -803,7 +808,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickSaveHdl_Impl, Button*, void) -IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ChangeGradientHdl_Impl, ListBox&, void) { std::unique_ptr<XGradient> pGradient; int nPos = m_pLbGradients->GetSelectEntryPos(); @@ -872,7 +877,6 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl_Impl) m_pCtlPreview->Invalidate(); } - return 0L; } diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index d528bd85dc93..2c6928c46ccc 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -117,10 +117,11 @@ SvxHatchTabPage::SvxHatchTabPage m_pLbHatchings->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl_Impl ) ); Link<> aLink = LINK( this, SvxHatchTabPage, ModifiedHdl_Impl ); + Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl ); m_pMtrDistance->SetModifyHdl( aLink ); m_pMtrAngle->SetModifyHdl( aLink ); - m_pLbLineType->SetSelectHdl( aLink ); - m_pLbLineColor->SetSelectHdl( aLink ); + m_pLbLineType->SetSelectHdl( aLink2 ); + m_pLbLineColor->SetSelectHdl( aLink2 ); m_pBtnAdd->SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); m_pBtnModify->SetClickHdl( @@ -221,7 +222,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) m_pLbHatchings->SelectEntryPos( *m_pPos ); } // colors could have been deleted - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); *m_pPageType = PT_HATCH; *m_pPos = LISTBOX_ENTRY_NOTFOUND; @@ -334,7 +335,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) void SvxHatchTabPage::Reset( const SfxItemSet* rSet ) { - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); // determine button state if( m_pHatchingList->Count() ) @@ -366,6 +367,10 @@ VclPtr<SfxTabPage> SvxHatchTabPage::Create( vcl::Window* pWindow, +IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ModifiedHdl_Impl(&rListBox); +} IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) { if( p == m_pMtrAngle ) @@ -399,7 +404,7 @@ IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) -IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void) { std::unique_ptr<XHatch> pHatch; int nPos = m_pLbHatchings->GetSelectEntryPos(); @@ -466,8 +471,6 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ChangeHatchHdl_Impl) m_pLbLineType->SaveValue(); m_pLbLineColor->SaveValue(); m_pLbHatchings->SaveValue(); - - return 0L; } @@ -554,7 +557,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) *m_pnHatchingListState |= ChangeType::MODIFIED; - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); } // determine button state @@ -651,7 +654,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickDeleteHdl_Impl, Button*, void) m_pCtlPreview->Invalidate(); - ChangeHatchHdl_Impl( this ); + ChangeHatchHdl_Impl( *m_pLbHatchings ); *m_pnHatchingListState |= ChangeType::MODIFIED; } diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 5c2227d13cbb..640b30bb84ff 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -183,24 +183,22 @@ SvxLineTabPage::SvxLineTabPage m_ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH ); m_pLbLineStyle->SetSelectHdl( LINK( this, SvxLineTabPage, ClickInvisibleHdl_Impl ) ); - m_pLbColor->SetSelectHdl( LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); - m_pMtrLineWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); + m_pLbColor->SetSelectHdl( LINK( this, SvxLineTabPage, ChangePreviewListBoxHdl_Impl ) ); + m_pMtrLineWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangePreviewModifyHdl_Impl ) ); m_pMtrTransparent->SetModifyHdl( LINK( this, SvxLineTabPage, ChangeTransparentHdl_Impl ) ); - Link<> aStart = LINK( this, SvxLineTabPage, ChangeStartHdl_Impl ); - Link<> aEnd = LINK( this, SvxLineTabPage, ChangeEndHdl_Impl ); - m_pLbStartStyle->SetSelectHdl( aStart ); - m_pLbEndStyle->SetSelectHdl( aEnd ); - m_pMtrStartWidth->SetModifyHdl( aStart ); - m_pMtrEndWidth->SetModifyHdl( aEnd ); + m_pLbStartStyle->SetSelectHdl( LINK( this, SvxLineTabPage, ChangeStartListBoxHdl_Impl ) ); + m_pLbEndStyle->SetSelectHdl( LINK( this, SvxLineTabPage, ChangeEndListBoxHdl_Impl ) ); + m_pMtrStartWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangeStartModifyHdl_Impl ) ); + m_pMtrEndWidth->SetModifyHdl( LINK( this, SvxLineTabPage, ChangeEndModifyHdl_Impl ) ); m_pTsbCenterStart->SetClickHdl( LINK( this, SvxLineTabPage, ChangeStartClickHdl_Impl ) ); m_pTsbCenterEnd->SetClickHdl( LINK( this, SvxLineTabPage, ChangeEndClickHdl_Impl ) ); - Link<> aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl ); + Link<ListBox&,void> aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl ); m_pLBEdgeStyle->SetSelectHdl( aEdgeStyle ); // LineCaps - Link<> aCapStyle = LINK( this, SvxLineTabPage, ChangeCapStyleHdl_Impl ); + Link<ListBox&,void> aCapStyle = LINK( this, SvxLineTabPage, ChangeCapStyleHdl_Impl ); m_pLBCapStyle->SetSelectHdl( aCapStyle ); // Symbols on a line (eg star charts), MB-handler set @@ -643,13 +641,13 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) if( m_nPageType == 2 ) // 1 { m_pLbLineStyle->SelectEntryPos( *m_pPosDashLb + 2 ); // +2 due to SOLID and INVLISIBLE - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( nullptr ); } if( m_nPageType == 3 ) { m_pLbStartStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID m_pLbEndStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( nullptr ); } } @@ -670,7 +668,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) else m_pLbColor->SelectEntryPos( nColorPos ); - ChangePreviewHdl_Impl( this ); + ChangePreviewHdl_Impl( nullptr ); } m_nPageType = 0; @@ -1510,7 +1508,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) // LineCaps m_pLBCapStyle->SaveValue(); - ClickInvisibleHdl_Impl( this ); + ClickInvisibleHdl_Impl( *m_pLbLineStyle ); ChangePreviewHdl_Impl( NULL ); } @@ -1524,8 +1522,16 @@ VclPtr<SfxTabPage> SvxLineTabPage::Create( vcl::Window* pWindow, } - -IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ChangePreviewHdl_Impl(&rListBox); +} +IMPL_LINK( SvxLineTabPage, ChangePreviewModifyHdl_Impl, void *, pCntrl ) +{ + ChangePreviewHdl_Impl(pCntrl); + return 0; +} +void SvxLineTabPage::ChangePreviewHdl_Impl(void * pCntrl ) { if(pCntrl == m_pMtrLineWidth) { @@ -1582,8 +1588,6 @@ IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl ) const bool bHasLineEnd = m_pLbEndStyle->GetSelectEntryPos() != 0; m_pBoxEnd->Enable(bHasLineEnd && bHasLineStyle); - - return 0L; } @@ -1592,7 +1596,16 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangeStartClickHdl_Impl, Button*, p, void ) { ChangeStartHdl_Impl(p); } -IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangeStartListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ChangeStartHdl_Impl(&rListBox); +} +IMPL_LINK( SvxLineTabPage, ChangeStartModifyHdl_Impl, void *, p ) +{ + ChangeStartHdl_Impl(p); + return 0; +} +void SvxLineTabPage::ChangeStartHdl_Impl( void * p ) { if( m_pCbxSynchronize->IsChecked() ) { @@ -1604,32 +1617,26 @@ IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p ) m_pTsbCenterEnd->SetState( m_pTsbCenterStart->GetState() ); } - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } -IMPL_LINK_NOARG(SvxLineTabPage, ChangeEdgeStyleHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineTabPage, ChangeEdgeStyleHdl_Impl, ListBox&, void) { - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } // fdo#43209 -IMPL_LINK_NOARG( SvxLineTabPage, ChangeCapStyleHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SvxLineTabPage, ChangeCapStyleHdl_Impl, ListBox&, void ) { - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } -IMPL_LINK_NOARG(SvxLineTabPage, ClickInvisibleHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineTabPage, ClickInvisibleHdl_Impl, ListBox&, void) { if( m_pLbLineStyle->GetSelectEntryPos() == 0 ) // invisible { @@ -1658,9 +1665,7 @@ IMPL_LINK_NOARG(SvxLineTabPage, ClickInvisibleHdl_Impl) m_pGridEdgeCaps->Enable(); } } - ChangePreviewHdl_Impl( NULL ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } @@ -1669,7 +1674,16 @@ IMPL_LINK_TYPED( SvxLineTabPage, ChangeEndClickHdl_Impl, Button*, p, void ) { ChangeEndHdl_Impl(p); } -IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineTabPage, ChangeEndListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + ChangeEndHdl_Impl(&rListBox); +} +IMPL_LINK( SvxLineTabPage, ChangeEndModifyHdl_Impl, void *, p ) +{ + ChangeEndHdl_Impl(p); + return 0; +} +void SvxLineTabPage::ChangeEndHdl_Impl( void * p ) { if( m_pCbxSynchronize->IsChecked() ) { @@ -1681,9 +1695,7 @@ IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p ) m_pTsbCenterStart->SetState( m_pTsbCenterEnd->GetState() ); } - ChangePreviewHdl_Impl( this ); - - return 0L; + ChangePreviewHdl_Impl( nullptr ); } diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 176a6657b71c..2107aef63627 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -131,7 +131,7 @@ SvxLineDefTabPage::SvxLineDefTabPage m_pNumFldNumber1->SetModifyHdl( LINK( this, SvxLineDefTabPage, ChangeNumber1Hdl_Impl ) ); m_pNumFldNumber2->SetModifyHdl( LINK( this, SvxLineDefTabPage, ChangeNumber2Hdl_Impl ) ); - m_pLbLineStyles->SetSelectHdl( LINK( this, SvxLineDefTabPage, SelectLinestyleHdl_Impl ) ); + m_pLbLineStyles->SetSelectHdl( LINK( this, SvxLineDefTabPage, SelectLinestyleListBoxHdl_Impl ) ); // #i122042# switch off default adding of 'none' and 'solid' entries // for this ListBox; we want to select only editable/dashed styles @@ -141,13 +141,13 @@ SvxLineDefTabPage::SvxLineDefTabPage m_pCbxSynchronize->SetClickHdl( LINK( this, SvxLineDefTabPage, ChangeMetricHdl_Impl ) ); // preview must be updated when there's something changed - Link<> aLink = LINK( this, SvxLineDefTabPage, SelectTypeHdl_Impl ); + Link<ListBox&, void> aLink = LINK( this, SvxLineDefTabPage, SelectTypeListBoxHdl_Impl ); m_pLbType1->SetSelectHdl( aLink ); m_pLbType2->SetSelectHdl( aLink ); - aLink = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); - m_pMtrLength1->SetModifyHdl( aLink ); - m_pMtrLength2->SetModifyHdl( aLink ); - m_pMtrDistance->SetModifyHdl( aLink ); + Link<> aLink2 = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); + m_pMtrLength1->SetModifyHdl( aLink2 ); + m_pMtrLength2->SetModifyHdl( aLink2 ); + m_pMtrDistance->SetModifyHdl( aLink2 ); pDashList = NULL; } @@ -198,7 +198,7 @@ void SvxLineDefTabPage::ActivatePage( const SfxItemSet& ) m_pLbLineStyles->SelectEntryPos( *pPosDashLb ); } // so that a possibly existing line style is discarded - SelectLinestyleHdl_Impl( this ); + SelectLinestyleHdl_Impl( nullptr ); // determining (and possibly cutting) the name // and displaying it in the GroupBox @@ -355,7 +355,12 @@ VclPtr<SfxTabPage> SvxLineDefTabPage::Create( vcl::Window* pWindow, const SfxIte -IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineDefTabPage, SelectLinestyleListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + SelectLinestyleHdl_Impl(&rListBox); +} + +void SvxLineDefTabPage::SelectLinestyleHdl_Impl(ListBox* p) { if(pDashList->Count()) { @@ -384,7 +389,6 @@ IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p ) if( p ) *pPageType = 2; } - return 0L; } @@ -506,7 +510,12 @@ IMPL_LINK_TYPED( SvxLineDefTabPage, ChangeMetricHdl_Impl, Button*, p, void ) -IMPL_LINK( SvxLineDefTabPage, SelectTypeHdl_Impl, void *, p ) +IMPL_LINK_TYPED( SvxLineDefTabPage, SelectTypeListBoxHdl_Impl, ListBox&, rListBox, void ) +{ + SelectTypeHdl_Impl(&rListBox); +} + +void SvxLineDefTabPage::SelectTypeHdl_Impl(ListBox* p) { if ( p == m_pLbType1 || !p ) { @@ -536,7 +545,6 @@ IMPL_LINK( SvxLineDefTabPage, SelectTypeHdl_Impl, void *, p ) } } ChangePreviewHdl_Impl( p ); - return 0L; } @@ -715,7 +723,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickDeleteHdl_Impl, Button*, void) m_pLbLineStyles->RemoveEntry( nPos ); m_pLbLineStyles->SelectEntryPos( 0 ); - SelectLinestyleHdl_Impl( this ); + SelectLinestyleHdl_Impl( nullptr ); *pPageType = 0; // style should not be taken *pnDashListState |= ChangeType::MODIFIED; diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index 3b4e7eaa58e0..e0157ccc0bb9 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -168,7 +168,7 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& ) if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND ) { m_pLbLineEnds->SelectEntryPos( *pPosLineEndLb ); - SelectLineEndHdl_Impl( this ); + SelectLineEndHdl_Impl( *m_pLbLineEnds ); } INetURLObject aURL( pLineEndList->GetPath() ); @@ -285,7 +285,7 @@ VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create( vcl::Window* pWindow, const Sfx -IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, ListBox&, void) { if( pLineEndList->Count() > 0 ) { @@ -307,7 +307,6 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl) // if there is an entry selected in the ListBox *pPageType = 3; } - return 0L; } @@ -489,7 +488,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void) *pnLineEndListState |= ChangeType::MODIFIED; - SelectLineEndHdl_Impl( this ); + SelectLineEndHdl_Impl( *m_pLbLineEnds ); } else { @@ -530,7 +529,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void) m_pLbLineEnds->RemoveEntry( nPos ); m_pLbLineEnds->SelectEntryPos( 0 ); - SelectLineEndHdl_Impl( this ); + SelectLineEndHdl_Impl( *m_pLbLineEnds ); *pPageType = 0; // LineEnd shall not be taken over *pnLineEndListState |= ChangeType::MODIFIED; diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 13f119f5eafa..4722406423b8 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -160,8 +160,8 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA //aCtlXRectPreview.SetFillAttr( aXFillAttr ); m_pTsbShowShadow->SetClickHdl( LINK( this, SvxShadowTabPage, ClickShadowHdl_Impl ) ); + m_pLbShadowColor->SetSelectHdl( LINK( this, SvxShadowTabPage, SelectShadowHdl_Impl ) ); Link<> aLink = LINK( this, SvxShadowTabPage, ModifyShadowHdl_Impl ); - m_pLbShadowColor->SetSelectHdl( aLink ); m_pMtrTransparent->SetModifyHdl( aLink ); m_pMtrDistance->SetModifyHdl( aLink ); } @@ -509,6 +509,10 @@ IMPL_LINK_NOARG_TYPED(SvxShadowTabPage, ClickShadowHdl_Impl, Button*, void) +IMPL_LINK_TYPED(SvxShadowTabPage, SelectShadowHdl_Impl, ListBox&, rListBox, void) +{ + ModifyShadowHdl_Impl(&rListBox); +} IMPL_LINK_NOARG(SvxShadowTabPage, ModifyShadowHdl_Impl) { if( m_pTsbShowShadow->GetState() == TRISTATE_TRUE ) diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index fbe4ddc8d587..500f7dfeb471 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -517,7 +517,7 @@ void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const OUString& r OUString sOld = pBoolDefault->GetSelectEntry(); pBoolDefault->SelectEntry(rText); if (sOld != rText) - LINK(this, OFieldDescControl, ChangeHdl).Call(pBoolDefault); + LINK(this, OFieldDescControl, ChangeHdl).Call(*pBoolDefault); } break; case FIELD_PROPERTY_DEFAULT: @@ -549,7 +549,7 @@ void OFieldDescControl::SetControlText( sal_uInt16 nControlId, const OUString& r OUString sOld = pAutoIncrement->GetSelectEntry(); pAutoIncrement->SelectEntry(rText); if (sOld != rText) - LINK(this, OFieldDescControl, ChangeHdl).Call(pAutoIncrement); + LINK(this, OFieldDescControl, ChangeHdl).Call(*pAutoIncrement); } break; @@ -622,16 +622,16 @@ void OFieldDescControl::SetModified(bool /*bModified*/) { } -IMPL_LINK( OFieldDescControl, ChangeHdl, ListBox *, pListBox ) +IMPL_LINK_TYPED( OFieldDescControl, ChangeHdl, ListBox&, rListBox, void ) { if ( !pActFieldDescr ) - return 0; + return; - if ( pListBox->IsValueChangedFromSaved() ) + if ( rListBox.IsValueChangedFromSaved() ) SetModified(true); // Special treatment for Bool fields - if(pListBox == pRequired && pBoolDefault ) + if(&rListBox == pRequired && pBoolDefault ) { // If pRequired = sal_True then the sal_Bool field must NOT contain <<none>> OUString sDef = BoolStringUI(::comphelper::getString(pActFieldDescr->GetControlDefault())); @@ -652,9 +652,9 @@ IMPL_LINK( OFieldDescControl, ChangeHdl, ListBox *, pListBox ) } // A special treatment only for AutoIncrement - if (pListBox == pAutoIncrement) + if (&rListBox == pAutoIncrement) { - if(pListBox->GetSelectEntryPos() == 1) + if(rListBox.GetSelectEntryPos() == 1) { // no DeactivateAggregate( tpAutoIncrementValue ); if(pActFieldDescr->IsPrimaryKey()) @@ -682,7 +682,7 @@ IMPL_LINK( OFieldDescControl, ChangeHdl, ListBox *, pListBox ) ArrangeAggregates(); } - if(pListBox == m_pType) + if(&rListBox == m_pType) { TOTypeInfoSP pTypeInfo = getTypeInfo(m_pType->GetSelectEntryPos()); pActFieldDescr->FillFromTypeInfo(pTypeInfo,true,false); // SetType(pTypeInfo); @@ -690,8 +690,6 @@ IMPL_LINK( OFieldDescControl, ChangeHdl, ListBox *, pListBox ) DisplayData(pActFieldDescr); CellModified(-1, m_pType->GetPos()); } - - return 0; } // Rearrange all Controls, such that they are in fixed order and really on top diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 20c906f96441..771266a5cfe6 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -454,7 +454,7 @@ namespace dbaui lateUIInit(); - Link<> aLink(LINK(this, OTableListBoxControl, OnTableChanged)); + Link<ListBox&,void> aLink(LINK(this, OTableListBoxControl, OnTableChanged)); m_pLeftTable->SetSelectHdl(aLink); m_pRightTable->SetSelectHdl(aLink); } @@ -514,9 +514,9 @@ namespace dbaui m_pLeftTable->GrabFocus(); } - IMPL_LINK( OTableListBoxControl, OnTableChanged, ListBox*, pListBox ) + IMPL_LINK_TYPED( OTableListBoxControl, OnTableChanged, ListBox&, rListBox, void ) { - OUString strSelected(pListBox->GetSelectEntry()); + OUString strSelected(rListBox.GetSelectEntry()); OTableWindow* pLeft = NULL; OTableWindow* pRight = NULL; @@ -524,7 +524,7 @@ namespace dbaui if ( m_pTableMap->size() == 2 ) { ListBox* pOther; - if (pListBox == m_pLeftTable) + if (&rListBox == m_pLeftTable) pOther = m_pRightTable; else pOther = m_pLeftTable; @@ -555,7 +555,7 @@ namespace dbaui pLoop = aFind->second; OSL_ENSURE(pLoop != NULL, "ORelationDialog::OnTableChanged: invalid ListBox entry!"); // We need to find strSelect, because we filled the ListBoxes with the table names with which we compare now - if (pListBox == m_pLeftTable) + if (&rListBox == m_pLeftTable) { // Insert the previously selected Entry on the left side on the right side m_pRightTable->InsertEntry(m_strCurrentLeft); @@ -588,12 +588,11 @@ namespace dbaui } } - pListBox->GrabFocus(); + rListBox.GrabFocus(); m_pRC_Tables->setWindowTables(pLeft,pRight); NotifyCellChange(); - return 0; } void OTableListBoxControl::NotifyCellChange() diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index 8139d8805b83..bbe4db6bfbb6 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -99,7 +99,7 @@ namespace dbaui m_pFieldSeparator->SetSelectHdl(getControlModifiedLink()); m_pTextSeparator->SetUpdateDataHdl(getControlModifiedLink()); m_pTextSeparator->SetSelectHdl(getControlModifiedLink()); - m_pCharSet->SetSelectHdl(getControlModifiedLink()); + m_pCharSet->SetSelectHdl(LINK(this, OTextConnectionHelper, CharsetSelectHdl)); m_pFieldSeparator->SetModifyHdl(getControlModifiedLink()); m_pTextSeparator->SetModifyHdl(getControlModifiedLink()); @@ -151,6 +151,11 @@ namespace dbaui Show(); } + IMPL_LINK_TYPED(OTextConnectionHelper, CharsetSelectHdl, ListBox&, rListBox, void) + { + getControlModifiedLink().Call(&rListBox); + } + OTextConnectionHelper::~OTextConnectionHelper() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx index 6a2f1d90f8fb..89474ed541b1 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx @@ -85,6 +85,7 @@ namespace dbaui DECL_LINK_TYPED(OnSetExtensionHdl,RadioButton&,void); DECL_LINK(OnControlModified,Control*); DECL_LINK(OnEditModified,Edit*); + DECL_LINK_TYPED(CharsetSelectHdl,ListBox&,void); private: OUString GetSeparator( const ComboBox& rBox, const OUString& rList ); diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index e4a7c8d46e9a..023bccd470e9 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -275,13 +275,12 @@ IMPL_LINK_TYPED( OUserAdmin, UserHdl, Button *, pButton, void ) } } -IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( OUserAdmin, ListDblClickHdl, ListBox&, void ) { m_TableCtrl->setUserName(GetUser()); m_TableCtrl->UpdateTables(); m_TableCtrl->DeactivateCell(); m_TableCtrl->ActivateCell(m_TableCtrl->GetCurRow(),m_TableCtrl->GetCurColumnId()); - return 0; } OUString OUserAdmin::GetUser() diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx index 7e5682103130..6cf91135bb7c 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.hxx +++ b/dbaccess/source/ui/dlg/UserAdmin.hxx @@ -55,7 +55,7 @@ protected: OUString m_UserName; // methods - DECL_LINK( ListDblClickHdl, ListBox * ); + DECL_LINK_TYPED( ListDblClickHdl, ListBox&, void ); DECL_LINK_TYPED( UserHdl, Button *, void ); void FillUserNames(); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 2c2dbbef65d7..513d939a0073 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -120,7 +120,7 @@ namespace dbaui get(m_pBooleanComparisonModeLabel, "comparisonft"); get(m_pBooleanComparisonMode, "comparison"); m_pBooleanComparisonMode->SetDropDownLineCount( 4 ); - m_pBooleanComparisonMode->SetSelectHdl( getControlModifiedLink() ); + m_pBooleanComparisonMode->SetSelectHdl( LINK(this, SpecialSettingsPage, BooleanComparisonSelectHdl) ); m_pBooleanComparisonModeLabel->Show(); m_pBooleanComparisonMode->Show(); } @@ -136,6 +136,11 @@ namespace dbaui } } + IMPL_LINK_TYPED(SpecialSettingsPage, BooleanComparisonSelectHdl, ListBox&, rListBox, void) + { + getControlModifiedLink().Call(&rListBox); + } + SpecialSettingsPage::~SpecialSettingsPage() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index b6054d413a55..9d31cd4f2918 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -91,6 +91,7 @@ namespace dbaui private: void impl_initBooleanSettings(); + DECL_LINK_TYPED(BooleanComparisonSelectHdl, ListBox&, void); }; // GeneratedValuesPage diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index f86314a3155b..26fe737feb97 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -243,10 +243,9 @@ IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, RemoveAllClickHdl, Button*, void ) checkButtons(); } -IMPL_LINK( ODbaseIndexDialog, OnListEntrySelected, ListBox*, /*NOTINTERESTEDIN*/ ) +IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, OnListEntrySelected, ListBox&, void ) { checkButtons(); - return 0; } IMPL_LINK( ODbaseIndexDialog, TableSelectHdl, ComboBox*, pComboBox ) diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index be5ac35d6b7e..9cf8ac1ada4c 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -89,7 +89,7 @@ protected: DECL_LINK_TYPED( AddAllClickHdl, Button*, void ); DECL_LINK_TYPED( RemoveAllClickHdl, Button*, void ); DECL_LINK_TYPED( OKClickHdl, Button*, void ); - DECL_LINK( OnListEntrySelected, ListBox* ); + DECL_LINK_TYPED( OnListEntrySelected, ListBox&, void ); OUString m_aDSN; TableInfoList m_aTableInfoList; diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 18943cbf3c26..bf8d8569ad18 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -90,10 +90,15 @@ namespace dbaui m_pCharsetLabel->Show(); m_pCharset = get<CharSetListBox>("charset"); m_pCharset->Show(); - m_pCharset->SetSelectHdl(getControlModifiedLink()); + m_pCharset->SetSelectHdl(LINK(this, OCommonBehaviourTabPage, CharsetSelectHdl)); } } + IMPL_LINK_TYPED(OCommonBehaviourTabPage, CharsetSelectHdl, ListBox&, rListBox, void) + { + getControlModifiedLink().Call(&rListBox); + } + OCommonBehaviourTabPage::~OCommonBehaviourTabPage() { disposeOnce(); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index 7ab4d970a469..c035af296823 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -82,6 +82,8 @@ namespace dbaui // <method>OGenericAdministrationPage::fillWindows</method> virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE; + private: + DECL_LINK_TYPED(CharsetSelectHdl, ListBox&, void); }; // ODbaseDetailsPage diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 30885ab5cc5f..7647308875a8 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -328,7 +328,7 @@ namespace dbaui executeCurrent(); } - IMPL_LINK_NOARG( DirectSQLDialog, OnListEntrySelected ) + IMPL_LINK_NOARG_TYPED( DirectSQLDialog, OnListEntrySelected, ListBox&, void ) { if (!m_pSQLHistory->IsTravelSelect()) { @@ -336,7 +336,6 @@ namespace dbaui if (LISTBOX_ENTRY_NOTFOUND != nSelected) switchToHistory(nSelected, false); } - return 0L; } } // namespace dbaui diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 7286e93acb0c..23ecc2a54ed3 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -406,14 +406,14 @@ namespace dbaui OGenericAdministrationPage::Reset(_rCoreAttrs); } - IMPL_LINK( OGeneralPageWizard, OnEmbeddedDBTypeSelected, ListBox*, _pBox ) + IMPL_LINK_TYPED( OGeneralPageWizard, OnEmbeddedDBTypeSelected, ListBox&, _rBox, void ) { // get the type from the entry data - const sal_Int32 nSelected = _pBox->GetSelectEntryPos(); + const sal_Int32 nSelected = _rBox.GetSelectEntryPos(); if (static_cast<size_t>(nSelected) >= m_aEmbeddedURLPrefixes.size() ) { SAL_WARN("dbaccess.ui.OGeneralPage", "Got out-of-range value '" << nSelected << "' from the DatasourceType selection ListBox's GetSelectEntryPos(): no corresponding URL prefix"); - return 0L; + return; } const OUString sURLPrefix = m_aEmbeddedURLPrefixes[ nSelected ]; @@ -423,17 +423,17 @@ namespace dbaui // tell the listener we were modified callModifiedHdl(); // outta here - return 0L; + return; } - IMPL_LINK( OGeneralPage, OnDatasourceTypeSelected, ListBox*, _pBox ) + IMPL_LINK_TYPED( OGeneralPage, OnDatasourceTypeSelected, ListBox&, _rBox, void ) { // get the type from the entry data - const sal_Int32 nSelected = _pBox->GetSelectEntryPos(); + const sal_Int32 nSelected = _rBox.GetSelectEntryPos(); if (static_cast<size_t>(nSelected) >= m_aURLPrefixes.size() ) { SAL_WARN("dbaccess.ui.OGeneralPage", "Got out-of-range value '" << nSelected << "' from the DatasourceType selection ListBox's GetSelectEntryPos(): no corresponding URL prefix"); - return 0L; + return; } const OUString sURLPrefix = m_aURLPrefixes[ nSelected ]; @@ -442,8 +442,6 @@ namespace dbaui onTypeSelected( sURLPrefix ); // tell the listener we were modified callModifiedHdl(); - // outta here - return 0L; } // OGeneralPageDialog @@ -704,20 +702,19 @@ namespace dbaui if ( m_aCreationModeHandler.IsSet() ) m_aCreationModeHandler.Call( *this ); - OnEmbeddedDBTypeSelected( m_pEmbeddedDBType ); + OnEmbeddedDBTypeSelected( *m_pEmbeddedDBType ); } IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnSetupModeSelected, Button*, void ) { if ( m_aCreationModeHandler.IsSet() ) m_aCreationModeHandler.Call( *this ); - OnDatasourceTypeSelected(m_pDatasourceType); + OnDatasourceTypeSelected(*m_pDatasourceType); } - IMPL_LINK( OGeneralPageWizard, OnDocumentSelected, ListBox*, /*_pBox*/ ) + IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnDocumentSelected, ListBox&, void ) { m_aDocumentSelectionHandler.Call( *this ); - return 0L; } IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnOpenDocument, Button*, void ) diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index f7f05720f4e0..5330cc8fab65 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -97,7 +97,7 @@ namespace dbaui /// sets the title of the parent dialog virtual void setParentTitle( const OUString& _sURLPrefix ); - DECL_LINK(OnDatasourceTypeSelected, ListBox*); + DECL_LINK_TYPED(OnDatasourceTypeSelected, ListBox&, void); }; // OGeneralPageDialog @@ -185,10 +185,10 @@ namespace dbaui void initializeEmbeddedDBList(); protected: - DECL_LINK( OnEmbeddedDBTypeSelected, ListBox* ); + DECL_LINK_TYPED( OnEmbeddedDBTypeSelected, ListBox&, void ); DECL_LINK_TYPED( OnCreateDatabaseModeSelected, Button*, void ); DECL_LINK_TYPED( OnSetupModeSelected, Button*, void ); - DECL_LINK( OnDocumentSelected, ListBox* ); + DECL_LINK_TYPED( OnDocumentSelected, ListBox&, void ); DECL_LINK_TYPED( OnOpenDocument, Button*, void ); }; diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 235393ae249c..975b96a4b090 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -406,8 +406,9 @@ namespace dbaui } } - IMPL_LINK( IndexFieldsControl, OnListEntrySelected, ListBox*, _pBox ) + IMPL_LINK( IndexFieldsControl, OnListEntrySelected, void*, p ) { + ListBox* _pBox = static_cast<ListBox*>(p); if (!_pBox->IsTravelSelect() && m_aModifyHdl.IsSet()) m_aModifyHdl.Call(this); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 2a8fedd2607a..6c6edc6964a8 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -130,7 +130,7 @@ namespace dbaui void OParameterDialog::Construct() { - m_pAllParams->SetSelectHdl(LINK(this, OParameterDialog, OnEntrySelected)); + m_pAllParams->SetSelectHdl(LINK(this, OParameterDialog, OnEntryListBoxSelected)); m_pParam->SetLoseFocusHdl(LINK(this, OParameterDialog, OnValueLoseFocusHdl)); m_pParam->SetModifyHdl(LINK(this, OParameterDialog, OnValueModified)); m_pTravelNext->SetClickHdl(LINK(this, OParameterDialog, OnButtonClicked)); @@ -140,7 +140,7 @@ namespace dbaui if (m_pAllParams->GetEntryCount()) { m_pAllParams->SelectEntryPos(0); - LINK(this, OParameterDialog, OnEntrySelected).Call(m_pAllParams); + OnEntrySelected(); if (m_pAllParams->GetEntryCount() == 1) { @@ -226,7 +226,7 @@ namespace dbaui else if (m_pOKBtn == pButton) { // transfer the current values into the Any - if (LINK(this, OParameterDialog, OnEntrySelected).Call(m_pAllParams) != 0L) + if (OnEntrySelected()) { // there was an error interpreting the current text m_bNeedErrorOnCurrent = true; // we're are out of the complex web :) of direct and indirect calls to OnValueLoseFocus now, @@ -277,7 +277,7 @@ namespace dbaui nNext = (nCurrent + 1) % nCount; m_pAllParams->SelectEntryPos(nNext); - LINK(this, OParameterDialog, OnEntrySelected).Call(m_pAllParams); + OnEntrySelected(); m_bNeedErrorOnCurrent = true; // we're are out of the complex web :) of direct and indirect calls to OnValueLoseFocus now, // so the next time it is called we need an error message, again .... @@ -285,7 +285,12 @@ namespace dbaui } } - IMPL_LINK(OParameterDialog, OnEntrySelected, ListBox*, /*pList*/) + IMPL_LINK_NOARG_TYPED(OParameterDialog, OnEntryListBoxSelected, ListBox&, void) + { + OnEntrySelected(); + } + + bool OParameterDialog::OnEntrySelected() { if (m_aResetVisitFlag.IsActive()) { @@ -299,7 +304,7 @@ namespace dbaui if (OnValueLoseFocus()) { // there was an error interpreting the text m_pAllParams->SelectEntryPos(m_nCurrentlySelected); - return 1L; + return true; } m_aFinalValues[m_nCurrentlySelected].Value <<= OUString(m_pParam->GetText()); @@ -319,7 +324,7 @@ namespace dbaui m_aResetVisitFlag.SetTimeout(1000); m_aResetVisitFlag.Start(); - return 0L; + return false; } IMPL_LINK_NOARG_TYPED(OParameterDialog, OnVisitedTimeout, Timer*, void) diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 764ce8ff2042..46cab6256d30 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -551,7 +551,7 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,bool _b sName = _rItem.Name; // select the appropriate field name SelectField( *pColumnListControl, sName ); - ListSelectHdl( pColumnListControl ); + ListSelectHdl( *pColumnListControl ); // select the appropriate condition pPredicateListControl->SelectEntryPos( GetSelectionPos( (sal_Int32)_rItem.Handle, *pPredicateListControl ) ); @@ -681,16 +681,16 @@ void DlgFilterCrit::EnableLines() m_pET_WHEREVALUE3->Disable(); } -IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) +IMPL_LINK_TYPED( DlgFilterCrit, ListSelectHdl, ListBox&, rListBox, void ) { OUString aName; ListBox* pComp; - if(pListBox == m_pLB_WHEREFIELD1) + if(&rListBox == m_pLB_WHEREFIELD1) { aName = LbText(*m_pLB_WHEREFIELD1); pComp = m_pLB_WHERECOMP1; } - else if(pListBox == m_pLB_WHEREFIELD2) + else if(&rListBox == m_pLB_WHEREFIELD2) { aName = LbText(*m_pLB_WHEREFIELD2); pComp = m_pLB_WHERECOMP2; @@ -736,13 +736,11 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) pComp->SelectEntryPos(0); EnableLines(); - return 0; } -IMPL_LINK( DlgFilterCrit, ListSelectCompHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( DlgFilterCrit, ListSelectCompHdl, ListBox&, void ) { EnableLines(); - return 0; } void DlgFilterCrit::BuildWherePart() diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index d04714332942..9d7ff34d15c9 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -143,10 +143,9 @@ void DlgOrderCrit::dispose() ModalDialog::dispose(); } -IMPL_LINK( DlgOrderCrit, FieldListSelectHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( DlgOrderCrit, FieldListSelectHdl, ListBox&, void ) { EnableLines(); - return 0; } void DlgOrderCrit::impl_initializeOrderList_nothrow() diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index f5fefbd3033a..fdbe72116fd4 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -117,7 +117,7 @@ namespace dbaui DECL_LINK_TYPED( OnScroll, ScrollBar*, void); DECL_LINK_TYPED( FormatClickHdl, Button *, void ); - DECL_LINK( ChangeHdl, ListBox * ); + DECL_LINK_TYPED( ChangeHdl, ListBox&, void ); // used by ActivatePropertyField DECL_LINK_TYPED( OnControlFocusLost, Control&, void ); diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index 12973d55b9f5..fc23f23ab900 100644 --- a/dbaccess/source/ui/inc/RelationControl.hxx +++ b/dbaccess/source/ui/inc/RelationControl.hxx @@ -41,7 +41,7 @@ namespace dbaui OUString m_strCurrentLeft; OUString m_strCurrentRight; private: - DECL_LINK( OnTableChanged, ListBox* ); + DECL_LINK_TYPED( OnTableChanged, ListBox&, void ); public: OTableListBoxControl(VclBuilderContainer* _pParent, const OJoinTableView::OTableWindowMap* _pTableMap, diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index e8778521e50a..e25a0c148b99 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -91,7 +91,7 @@ namespace dbaui friend class OWizTypeSelectControl; friend class OWizTypeSelectList; - DECL_LINK( ColumnSelectHdl, MultiListBox* ); + DECL_LINK_TYPED( ColumnSelectHdl, ListBox&, void ); DECL_LINK_TYPED( ButtonClickHdl, Button *, void ); protected: VclPtr<OWizTypeSelectList> m_pColumnNames; diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index 972261f59822..8b0e4a1a2163 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -88,7 +88,7 @@ namespace dbaui DECL_LINK_TYPED( OnExecute, Button*, void ); DECL_LINK_TYPED( OnClose, void*, void ); DECL_LINK_TYPED( OnCloseClick, Button*, void ); - DECL_LINK( OnListEntrySelected, void* ); + DECL_LINK_TYPED( OnListEntrySelected, ListBox&, void ); DECL_LINK( OnStatementModified, void* ); private: diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index 53229d06ed56..207fd9cf6266 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -84,7 +84,7 @@ namespace dbaui bool isNewField() const { return GetCurRow() >= (sal_Int32)m_aFields.size(); } - DECL_LINK( OnListEntrySelected, ListBox* ); + DECL_LINK( OnListEntrySelected, void* ); private: using ::svt::EditBrowseBox::Init; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index bf73aa551cda..19addb46e505 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -95,10 +95,11 @@ namespace dbaui private: DECL_LINK_TYPED(OnVisitedTimeout, Timer*, void); DECL_LINK(OnValueModified, Control*); - DECL_LINK(OnEntrySelected, ListBox*); + DECL_LINK_TYPED(OnEntryListBoxSelected, ListBox&, void); DECL_LINK_TYPED(OnButtonClicked, Button*, void); DECL_LINK_TYPED(OnValueLoseFocusHdl, Control&, void); bool OnValueLoseFocus(); + bool OnEntrySelected(); }; } // namespace dbaui diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index d09f69064bf3..3347734bfcd0 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -91,8 +91,8 @@ namespace dbaui ::dbtools::OPredicateInputController m_aPredicateInput; static void SelectField( ListBox& rBox, const OUString& rField ); - DECL_LINK( ListSelectHdl, ListBox * ); - DECL_LINK( ListSelectCompHdl, ListBox * ); + DECL_LINK_TYPED( ListSelectHdl, ListBox&, void ); + DECL_LINK_TYPED( ListSelectCompHdl, ListBox&, void ); void SetLine( sal_uInt16 nIdx,const css::beans::PropertyValue& _rItem,bool _bOr ); void EnableLines(); diff --git a/dbaccess/source/ui/inc/queryorder.hxx b/dbaccess/source/ui/inc/queryorder.hxx index 9e65263b038f..6b086812e1d9 100644 --- a/dbaccess/source/ui/inc/queryorder.hxx +++ b/dbaccess/source/ui/inc/queryorder.hxx @@ -75,7 +75,7 @@ namespace dbaui VclPtr<ListBox> m_aColumnList[DOG_ROWS]; VclPtr<ListBox> m_aValueList[DOG_ROWS]; - DECL_LINK( FieldListSelectHdl, ListBox * ); + DECL_LINK_TYPED( FieldListSelectHdl, ListBox&, void ); void EnableLines(); public: diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index aa7125916aeb..7b04c4913a10 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -281,7 +281,7 @@ OUString OWizTypeSelect::GetTitle() const return ModuleRes(STR_WIZ_TYPE_SELECT_TITEL); } -IMPL_LINK( OWizTypeSelect, ColumnSelectHdl, MultiListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( OWizTypeSelect, ColumnSelectHdl, ListBox&, void ) { OUString aColumnName( m_pColumnNames->GetSelectEntry() ); @@ -290,7 +290,6 @@ IMPL_LINK( OWizTypeSelect, ColumnSelectHdl, MultiListBox *, /*pListBox*/ ) m_pTypeControl->DisplayData(pField); m_pTypeControl->Enable(m_pColumnNames->GetSelectEntryCount() == 1 ); - return 0; } void OWizTypeSelect::Reset() @@ -324,7 +323,7 @@ void OWizTypeSelect::ActivatePage( ) m_pColumnNames->SelectEntryPos(static_cast<sal_uInt16>(m_nDisplayRow)); m_nDisplayRow = 0; - m_pColumnNames->GetSelectHdl().Call(m_pColumnNames); + m_pColumnNames->GetSelectHdl().Call(*m_pColumnNames); } bool OWizTypeSelect::LeavePage() @@ -444,7 +443,7 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt ) } } } - GetSelectHdl().Call(this); + GetSelectHdl().Call(*this); } break; } diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index 84c901cbd9a0..417b0b1a748c 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -153,10 +153,10 @@ void DlgQryJoin::dispose() ModalDialog::dispose(); } -IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( DlgQryJoin, LBChangeHdl, ListBox&, void ) { if (m_pLB_JoinType->GetSelectEntryPos() == m_pLB_JoinType->GetSavedValue() ) - return 1; + return; m_pLB_JoinType->SaveValue(); m_pML_HelpText->SetText(OUString()); @@ -237,7 +237,6 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) } m_pML_HelpText->SetText( sHelpText ); - return 1; } IMPL_LINK_NOARG_TYPED( DlgQryJoin, OKClickHdl, Button*, void ) @@ -325,7 +324,7 @@ void DlgQryJoin::setJoinType(EJoinType _eNewJoinType) } } - LBChangeHdl(m_pLB_JoinType); + LBChangeHdl(*m_pLB_JoinType); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx index eeb8fea63328..b69b7b9e0e3a 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hxx +++ b/dbaccess/source/ui/querydesign/querydlg.hxx @@ -55,7 +55,7 @@ namespace dbaui DECL_LINK_TYPED( OKClickHdl, Button*, void ); - DECL_LINK( LBChangeHdl, ListBox* ); + DECL_LINK_TYPED( LBChangeHdl, ListBox&, void ); DECL_LINK_TYPED( NaturalToggleHdl, CheckBox&, void ); /** setJoinType enables and set the new join type diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx index ed7beec4aec3..965ccac369d5 100644 --- a/extensions/source/abpilot/tableselectionpage.cxx +++ b/extensions/source/abpilot/tableselectionpage.cxx @@ -93,10 +93,9 @@ namespace abp } - IMPL_LINK( TableSelectionPage, OnTableSelected, void*, /*NOTINTERESTEDIN*/ ) + IMPL_LINK_NOARG_TYPED( TableSelectionPage, OnTableSelected, ListBox&, void ) { updateDialogTravelUI(); - return 0L; } diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx index 3b92ba60ada5..da51e010a6c9 100644 --- a/extensions/source/abpilot/tableselectionpage.hxx +++ b/extensions/source/abpilot/tableselectionpage.hxx @@ -50,7 +50,7 @@ namespace abp virtual bool canAdvance() const SAL_OVERRIDE; private: - DECL_LINK( OnTableSelected, void* ); + DECL_LINK_TYPED( OnTableSelected, ListBox&, void ); DECL_LINK_TYPED( OnTableDoubleClicked, ListBox&, void ); }; diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index fbf65eccfabb..50f4fb3b2f66 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -237,7 +237,7 @@ class MappingDialog_Impl : public ModalDialog DECL_LINK_TYPED(OkHdl, Button*, void); - DECL_LINK(ListBoxSelectHdl, ListBox*); + DECL_LINK_TYPED(ListBoxSelectHdl, ListBox&, void); public: MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pDatMan); @@ -348,7 +348,7 @@ MappingDialog_Impl::MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pMa aListBoxes[0]->InsertEntry(pNames[nField]); } - Link<> aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl); + Link<ListBox&,void> aLnk = LINK(this, MappingDialog_Impl, ListBoxSelectHdl); aListBoxes[0]->SelectEntryPos(0); aListBoxes[0]->SetSelectHdl(aLnk); @@ -422,19 +422,18 @@ void MappingDialog_Impl::dispose() ModalDialog::dispose(); } -IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox) +IMPL_LINK_TYPED(MappingDialog_Impl, ListBoxSelectHdl, ListBox&, rListBox, void) { - const sal_Int32 nEntryPos = pListBox->GetSelectEntryPos(); + const sal_Int32 nEntryPos = rListBox.GetSelectEntryPos(); if(0 < nEntryPos) { for(sal_uInt16 i = 0; i < COLUMN_COUNT; i++) { - if(pListBox != aListBoxes[i] && aListBoxes[i]->GetSelectEntryPos() == nEntryPos) + if(&rListBox != aListBoxes[i] && aListBoxes[i]->GetSelectEntryPos() == nEntryPos) aListBoxes[i]->SelectEntryPos(0); } } SetModified(); - return 0; } IMPL_LINK_NOARG_TYPED(MappingDialog_Impl, OkHdl, Button*, void) diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 8fa2b4e66056..4993130b2e27 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -462,10 +462,9 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt ) return bResult; } -IMPL_LINK( BibToolBar, SelHdl, ListBox*, /*pLb*/ ) +IMPL_LINK_NOARG_TYPED( BibToolBar, SelHdl, ListBox&, void ) { aIdle.Start(); - return 0; } IMPL_LINK_NOARG_TYPED( BibToolBar, SendSelHdl, Idle*, void ) diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index a4b131a29a88..6eb060cee5b1 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -128,7 +128,7 @@ class BibToolBar: public ToolBox sal_Int16 nOutStyle; BibDataManager* pDatMan; - DECL_LINK( SelHdl, ListBox* ); + DECL_LINK_TYPED( SelHdl, ListBox&, void ); DECL_LINK_TYPED( SendSelHdl, Idle*, void ); DECL_LINK_TYPED( MenuHdl, ToolBox*, void ); DECL_LINK_TYPED( OptionsChanged_Impl, LinkParamNone*, void ); diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 13857eb888b5..e8850fc7d0ba 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -213,7 +213,7 @@ namespace dbp sDataSourceName = aFileNotation.get(::svt::OFileNotation::N_SYSTEM); m_pDatasource->InsertEntry(sDataSourceName); m_pDatasource->SelectEntry(sDataSourceName); - LINK(this, OTableSelectionPage, OnListboxSelection).Call(m_pDatasource); + LINK(this, OTableSelectionPage, OnListboxSelection).Call(*m_pDatasource); } } @@ -224,16 +224,14 @@ namespace dbp } - IMPL_LINK( OTableSelectionPage, OnListboxSelection, ListBox*, _pBox ) + IMPL_LINK_TYPED( OTableSelectionPage, OnListboxSelection, ListBox&, _rBox, void ) { - if (m_pDatasource == _pBox) + if (m_pDatasource == &_rBox) { // new data source selected implFillTables(); } updateDialogTravelUI(); - - return 0L; } diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 6e8267d83efc..b98bb31583f7 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -54,7 +54,7 @@ namespace dbp virtual bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) SAL_OVERRIDE; protected: - DECL_LINK( OnListboxSelection, ListBox* ); + DECL_LINK_TYPED( OnListboxSelection, ListBox&, void ); DECL_LINK_TYPED( OnListboxDoubleClicked, ListBox&, void ); DECL_LINK_TYPED( OnSearchClicked, Button*, void ); diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index 74b96f4e51b3..d79c06c3bc80 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -401,10 +401,9 @@ namespace dbp } - IMPL_LINK(OGridFieldsSelection, OnEntrySelected, ListBox*, /*NOTINTERESTEDIN*/) + IMPL_LINK_NOARG_TYPED(OGridFieldsSelection, OnEntrySelected, ListBox&, void) { implCheckButtons(); - return 0L; } diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx index 98c0aa41e98a..16881bbe9f8a 100644 --- a/extensions/source/dbpilots/gridwizard.hxx +++ b/extensions/source/dbpilots/gridwizard.hxx @@ -96,7 +96,7 @@ namespace dbp protected: DECL_LINK_TYPED(OnMoveOneEntry, Button*, void); DECL_LINK_TYPED(OnMoveAllEntries, Button*, void); - DECL_LINK(OnEntrySelected, ListBox*); + DECL_LINK_TYPED(OnEntrySelected, ListBox&, void); DECL_LINK_TYPED(OnEntryDoubleClicked, ListBox&, void); void implCheckButtons(); diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 5faaa92a04b4..45e08891f02c 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -285,10 +285,9 @@ namespace dbp } - IMPL_LINK( ORadioSelectionPage, OnEntrySelected, ListBox*, /*_pList*/ ) + IMPL_LINK_NOARG_TYPED( ORadioSelectionPage, OnEntrySelected, ListBox&, void ) { implCheckMoveButtons(); - return 0L; } @@ -408,10 +407,9 @@ namespace dbp OGBWPage::dispose(); } - IMPL_LINK( OOptionValuesPage, OnOptionSelected, ListBox*, /*NOTINTERESTEDIN*/ ) + IMPL_LINK_NOARG_TYPED( OOptionValuesPage, OnOptionSelected, ListBox&, void ) { implTraveledOptions(); - return 0L; } diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx index 0515544c0784..e50469583d79 100644 --- a/extensions/source/dbpilots/groupboxwiz.hxx +++ b/extensions/source/dbpilots/groupboxwiz.hxx @@ -101,7 +101,7 @@ namespace dbp virtual bool canAdvance() const SAL_OVERRIDE; DECL_LINK_TYPED( OnMoveEntry, Button*, void ); - DECL_LINK( OnEntrySelected, ListBox* ); + DECL_LINK_TYPED( OnEntrySelected, ListBox&, void ); DECL_LINK( OnNameModified, Edit* ); void implCheckMoveButtons(); @@ -152,7 +152,7 @@ namespace dbp void implTraveledOptions(); - DECL_LINK( OnOptionSelected, ListBox* ); + DECL_LINK_TYPED( OnOptionSelected, ListBox&, void ); }; class OOptionDBFieldPage : public ODBFieldPage diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 87a605d57bfe..cca2309137da 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -300,10 +300,9 @@ namespace dbp } - IMPL_LINK( OContentTableSelection, OnTableSelected, ListBox*, /*_pListBox*/ ) + IMPL_LINK_NOARG_TYPED( OContentTableSelection, OnTableSelected, ListBox&, void ) { updateDialogTravelUI(); - return 0L; } @@ -409,11 +408,10 @@ namespace dbp } - IMPL_LINK( OContentFieldSelection, OnFieldSelected, ListBox*, /*NOTINTERESTEDIN*/ ) + IMPL_LINK_NOARG_TYPED( OContentFieldSelection, OnFieldSelected, ListBox&, void ) { updateDialogTravelUI(); m_pDisplayedField->SetText(m_pSelectTableField->GetSelectEntry()); - return 0L; } diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index efe066862b2f..968b19470c62 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -114,7 +114,7 @@ namespace dbp protected: DECL_LINK_TYPED( OnTableDoubleClicked, ListBox&, void ); - DECL_LINK( OnTableSelected, ListBox* ); + DECL_LINK_TYPED( OnTableSelected, ListBox&, void ); }; class OContentFieldSelection : public OLCPage @@ -131,7 +131,7 @@ namespace dbp virtual void dispose() SAL_OVERRIDE; protected: - DECL_LINK( OnFieldSelected, ListBox* ); + DECL_LINK_TYPED( OnFieldSelected, ListBox&, void ); DECL_LINK_TYPED( OnTableDoubleClicked, ListBox&, void ); // TabPage overridables diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx index 325f129a65d5..be90a9be44ac 100644 --- a/extensions/source/propctrlr/commoncontrol.cxx +++ b/extensions/source/propctrlr/commoncontrol.cxx @@ -95,13 +95,12 @@ namespace pcr } - IMPL_LINK( CommonBehaviourControlHelper, ModifiedHdl, vcl::Window*, /*_pWin*/ ) + IMPL_LINK_NOARG( CommonBehaviourControlHelper, ModifiedHdl ) { setModified(); return 0; } - IMPL_LINK_NOARG_TYPED( CommonBehaviourControlHelper, GetFocusHdl, Control&, void ) { try diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx index d1ab9eda6ec0..5ae884768db9 100644 --- a/extensions/source/propctrlr/commoncontrol.hxx +++ b/extensions/source/propctrlr/commoncontrol.hxx @@ -30,6 +30,7 @@ class NotifyEvent; class Control; +class ListBox; namespace pcr { @@ -86,7 +87,8 @@ namespace pcr virtual vcl::Window* getVclWindow() = 0; /// may be used by derived classes, they forward the event to the PropCtrListener - DECL_LINK( ModifiedHdl, vcl::Window* ); + DECL_LINK( ModifiedHdl, void* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( GetFocusHdl, Control&, void ); DECL_LINK_TYPED( LoseFocusHdl, Control&, void ); }; diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index 4169fec2fa2c..a38cc772c455 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -58,11 +58,24 @@ namespace pcr ListLikeControlWithModifyHandler( vcl::Window* _pParent, WinBits _nStyle ) : TListboxWindow( _pParent, _nStyle ) { + TListboxWindow::SetSelectHdl( LINK(this, ListLikeControlWithModifyHandler, OnSelect) ); } - void SetModifyHdl( const Link<>& _rLink ) { TListboxWindow::SetSelectHdl( _rLink ); } + void SetModifyHdl( const Link<>& _rLink ) { aModifyHdl = _rLink;; } + private: + DECL_LINK_TYPED(OnSelect, ListBox&, void); + Link<> aModifyHdl; }; + template< class LISTBOX_WINDOW > + void ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::LinkStubOnSelect(void * instance, ListBox& data) { + return static_cast<ListLikeControlWithModifyHandler< LISTBOX_WINDOW > *>(instance)->OnSelect(data); + } + template< class LISTBOX_WINDOW > + void ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::OnSelect(ListBox& rListBox) + { + aModifyHdl.Call(&rListBox); + } //= OTimeControl diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 94c4c0fa2b0d..f180ac3f0626 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -677,9 +677,9 @@ IMPL_LINK_TYPED( SaneDlg, ClickBtnHdl, Button*, pButton, void ) } } -IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox ) +IMPL_LINK_TYPED( SaneDlg, SelectHdl, ListBox&, rListBox, void ) { - if( pListBox == mpDeviceBox && Sane::IsSane() && Sane::CountDevices() ) + if( &rListBox == mpDeviceBox && Sane::IsSane() && Sane::CountDevices() ) { int nNewNumber = mpDeviceBox->GetSelectEntryPos(); int nOldNumber = mrSane.GetDeviceNumber(); @@ -693,19 +693,18 @@ IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox ) } if( mrSane.IsOpen() ) { - if( pListBox == mpQuantumRangeBox ) + if( &rListBox == mpQuantumRangeBox ) { OString aValue(OUStringToOString(mpQuantumRangeBox->GetSelectEntry(), osl_getThreadTextEncoding())); double fValue = atof(aValue.getStr()); mrSane.SetOptionValue( mnCurrentOption, fValue, mnCurrentElement ); } - else if( pListBox == mpStringRangeBox ) + else if( &rListBox == mpStringRangeBox ) { mrSane.SetOptionValue( mnCurrentOption, mpStringRangeBox->GetSelectEntry() ); } } - return 0; } IMPL_LINK_TYPED( SaneDlg, OptionsBoxSelectHdl, SvTreeListBox*, pBox, void ) diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx index 17cae7604a9f..5b79a6128ced 100644 --- a/extensions/source/scanner/sanedlg.hxx +++ b/extensions/source/scanner/sanedlg.hxx @@ -81,7 +81,7 @@ private: bool doScan; DECL_LINK_TYPED( ClickBtnHdl, Button*, void ); - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK( ModifyHdl, Edit* ); DECL_LINK_TYPED( ReloadSaneOptionsHdl, Sane&, void ); DECL_LINK_TYPED( OptionsBoxSelectHdl, SvTreeListBox*, void ); diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 6126cdd7b978..17a922836acb 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -1629,11 +1629,10 @@ void ImplErrorDialog::dispose() MessageDialog::dispose(); } -IMPL_LINK_NOARG(ImplErrorDialog, SelectHdl) +IMPL_LINK_NOARG_TYPED(ImplErrorDialog, SelectHdl, ListBox&, void) { OUString* pStr = static_cast<OUString*>(m_pErrors->GetSelectEntryData()); m_pExplanation->SetText( pStr ? *pStr : OUString() ); - return 0; } diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 39633df93b12..97eedd165a6f 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -59,7 +59,7 @@ class ImplErrorDialog : public MessageDialog VclPtr<ListBox> m_pErrors; VclPtr<FixedText> m_pExplanation; - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); public: explicit ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& ); virtual ~ImplErrorDialog(); diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 539b8f28b5bf..58d6461d171c 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -157,12 +157,12 @@ void FuncPage::UpdateFunctionList() m_pLbFunction->SetUpdateMode( true ); m_pLbFunction->SelectEntryPos(0); - if(IsVisible()) SelHdl(m_pLbFunction); + if(IsVisible()) SelHdl(*m_pLbFunction); } -IMPL_LINK( FuncPage, SelHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( FuncPage, SelHdl, ListBox&, rLb, void ) { - if(pLb==m_pLbFunction) + if(&rLb==m_pLbFunction) { const IFunctionDescription* pDesc = GetFuncDesc( GetFunction() ); if ( pDesc ) @@ -178,7 +178,6 @@ IMPL_LINK( FuncPage, SelHdl, ListBox*, pLb ) m_pLbFunction->SetHelpId(m_aHelpId); UpdateFunctionList(); } - return 0; } IMPL_LINK_NOARG_TYPED(FuncPage, DblClkHdl, ListBox&, void) diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index 7ef74fad608d..04ceb66a482c 100644 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -72,7 +72,7 @@ private: void impl_addFunctions(const IFunctionCategory* _pCategory); - DECL_LINK( SelHdl, ListBox* ); + DECL_LINK_TYPED( SelHdl, ListBox&, void ); DECL_LINK_TYPED(DblClkHdl, ListBox&, void); protected: diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 9ee6d15536b9..4a9f910cc3d8 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -367,7 +367,7 @@ short RemoteFilesDialog::Execute() if( m_pServices_lb->GetEntryCount() > 0 ) { Show(); - SelectServiceHdl( NULL ); + SelectServiceHdl( *m_pServices_lb ); } if( !m_bIsConnected ) { @@ -749,7 +749,7 @@ IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, AddServiceHdl, Button*, void ) m_pServices_lb->InsertEntry( sPrefix + newService->GetName() ); m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 ); m_pAddService_btn->SetPopupMenu( m_pAddMenu ); - SelectServiceHdl( NULL ); + SelectServiceHdl( *m_pServices_lb ); m_bIsUpdated = true; @@ -763,7 +763,7 @@ IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, AddServiceHdl, Button*, void ) }; } -IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl ) +IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, SelectServiceHdl, ListBox&, void ) { int nPos = GetSelectedServicePos(); @@ -775,8 +775,6 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl ) m_bServiceChanged = true; OpenURL( sURL ); } - - return 1; } IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton, void ) @@ -1020,7 +1018,7 @@ IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, SplitHdl, Splitter*, void ) m_pSplitter->SetPosPixel( Point( placeSize.Width(), m_pSplitter->GetPosPixel().Y() ) ); } -IMPL_LINK_NOARG ( RemoteFilesDialog, SelectFilterHdl ) +IMPL_LINK_NOARG_TYPED( RemoteFilesDialog, SelectFilterHdl, ListBox&, void ) { unsigned int nPos = m_pFilter_lb->GetSelectEntryPos(); @@ -1033,8 +1031,6 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectFilterHdl ) if( !sCurrentURL.isEmpty() && m_bIsConnected ) OpenURL( sCurrentURL ); } - - return 1; } IMPL_LINK_TYPED( RemoteFilesDialog, TreeSelectHdl, SvTreeListBox *, pBox, void ) diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 78488cc15a5c..1e54c413cf2f 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -186,7 +186,7 @@ private: , const OUString& rPassword, bool bPersistent ); DECL_LINK_TYPED ( AddServiceHdl, Button*, void ); - DECL_LINK ( SelectServiceHdl, void * ); + DECL_LINK_TYPED ( SelectServiceHdl, ListBox&, void ); DECL_LINK_TYPED ( EditServiceMenuHdl, MenuButton *, void ); DECL_LINK_TYPED( DoubleClickHdl, SvTreeListBox*, bool ); @@ -197,7 +197,7 @@ private: DECL_LINK_TYPED( SplitHdl, Splitter*, void ); - DECL_LINK( SelectFilterHdl, void * ); + DECL_LINK_TYPED( SelectFilterHdl, ListBox&, void ); DECL_LINK_TYPED( TreeSelectHdl, SvTreeListBox*, void ); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index d2714b466ce1..d99b36d02bfd 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1232,7 +1232,7 @@ void SvtFileDialog::EnableAutocompletion( bool _bEnable ) -IMPL_LINK_NOARG( SvtFileDialog, FilterSelectHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SvtFileDialog, FilterSelectHdl_Impl, ListBox&, void ) { OUString sSelectedFilterDisplayName; SvtFileDialogFilter_Impl* pSelectedFilter = _pImp->GetSelectedFilterEntry( sSelectedFilterDisplayName ); @@ -1302,8 +1302,6 @@ IMPL_LINK_NOARG( SvtFileDialog, FilterSelectHdl_Impl ) } } } - - return 0; } IMPL_LINK_NOARG_TYPED(SvtFileDialog, FilterSelectTimerHdl_Impl, Timer*, void) diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 19b5d8ab0e2e..98d66c6232c5 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -84,7 +84,7 @@ private: bool m_bHasFilename; ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_context; - DECL_LINK( FilterSelectHdl_Impl, void* ); + DECL_LINK_TYPED( FilterSelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( FilterSelectTimerHdl_Impl, Timer*, void ); DECL_LINK_TYPED( NewFolderHdl_Impl, Button*, void ); DECL_LINK_TYPED( OpenUrlHdl_Impl, SvtURLBox*, void ); diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index 69d6399deab6..feca69663bb0 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -197,7 +197,7 @@ public: // access to the filter listbox only as Control* - we want to maintain the entries/userdata ourself Control* GetFilterListControl() { return _pLbFilter; } const Control* GetFilterListControl() const { return _pLbFilter; } - inline void SetFilterListSelectHdl( const Link<>& _rHandler ); + inline void SetFilterListSelectHdl( const Link<ListBox&,void>& _rHandler ); // inits the listbox for the filters from the filter list (_pFilter) void ClearFilterList( ); @@ -217,7 +217,7 @@ public: void SetCurFilter( SvtFileDialogFilter_Impl* _pFilter, const OUString& _rDisplayName ); }; -inline void SvtExpFileDlg_Impl::SetFilterListSelectHdl( const Link<>& _rHandler ) +inline void SvtExpFileDlg_Impl::SetFilterListSelectHdl( const Link<ListBox&,void>& _rHandler ) { _pLbFilter->SetSelectHdl( _rHandler ); } diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index c33120863f34..77cd59561307 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -426,7 +426,7 @@ private: Idle m_aBoxLoseFocusIdle; Link<void*,void> m_aRemovedHdl; - DECL_STATIC_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox* ); + DECL_STATIC_LINK_TYPED( CustomPropertiesWindow, TypeHdl, ListBox&, void ); DECL_LINK_TYPED( RemoveHdl, Button*, void ); DECL_LINK_TYPED( EditLoseFocusHdl, Control&, void ); DECL_LINK_TYPED( BoxLoseFocusHdl, Control&, void ); diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx index f719b721a95e..f8d353c8a85b 100644 --- a/include/sfx2/mgetempl.hxx +++ b/include/sfx2/mgetempl.hxx @@ -71,9 +71,9 @@ friend class SfxStyleDialog; DECL_LINK_TYPED( GetFocusHdl, Control&, void ); DECL_LINK_TYPED( LoseFocusHdl, Control&, void ); - DECL_LINK( EditStyleSelectHdl_Impl, void * ); + DECL_LINK_TYPED( EditStyleSelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( EditStyleHdl_Impl, Button*, void ); - DECL_LINK( EditLinkStyleSelectHdl_Impl, void * ); + DECL_LINK_TYPED( EditLinkStyleSelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( EditLinkStyleHdl_Impl, Button*, void ); void UpdateName_Impl(ListBox *, const OUString &rNew); diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx index 11ddc5fe5e97..92bafdb75be9 100644 --- a/include/svtools/PlaceEditDialog.hxx +++ b/include/svtools/PlaceEditDialog.hxx @@ -86,7 +86,7 @@ private: DECL_LINK_TYPED ( DelHdl, Button *, void ); DECL_LINK_TYPED ( EditHdl, DetailsContainer*, void ); DECL_LINK ( ModifyHdl, void* ); - DECL_LINK ( SelectTypeHdl, void * ); + DECL_LINK_TYPED ( SelectTypeHdl, ListBox&, void ); DECL_LINK ( EditLabelHdl, void * ); DECL_LINK ( EditUsernameHdl, void * ); diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 18ca39d6b40a..377cbc3370a6 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -149,7 +149,7 @@ class CmisDetailsContainer : public DetailsContainer private: void selectRepository( ); DECL_LINK_TYPED ( RefreshReposHdl, Button*, void ); - DECL_LINK ( SelectRepoHdl, void * ); + DECL_LINK_TYPED ( SelectRepoHdl, ListBox&, void ); }; #endif diff --git a/include/svtools/addresstemplate.hxx b/include/svtools/addresstemplate.hxx index 00b532a0ba3a..75aa5f7fd8dc 100644 --- a/include/svtools/addresstemplate.hxx +++ b/include/svtools/addresstemplate.hxx @@ -126,7 +126,7 @@ namespace svt void loadConfiguration(); DECL_LINK_TYPED(OnFieldScroll, ScrollBar*, void); - DECL_LINK(OnFieldSelect, ListBox*); + DECL_LINK_TYPED(OnFieldSelect, ListBox&, void); DECL_LINK_TYPED(OnAdministrateDatasources, Button*, void); DECL_STATIC_LINK_TYPED(AddressBookSourceDialog, OnComboGetFocus, Control&, void); DECL_LINK_TYPED(OnComboLoseFocus, Control&, void); diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 753e0684f8e9..afe8adccbaae 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -389,6 +389,9 @@ namespace svt protected: virtual bool MoveAllowed(const KeyEvent& rEvt) const SAL_OVERRIDE; virtual void SetModifyHdl(const Link<>& rLink) SAL_OVERRIDE; + private: + Link<> maModifyHdl; + DECL_LINK_TYPED(ListBoxSelectHdl, ListBox&, void); }; diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx index 3c7c5848a788..afec7688e160 100644 --- a/include/svtools/prnsetup.hxx +++ b/include/svtools/prnsetup.hxx @@ -54,7 +54,7 @@ private: SVT_DLLPRIVATE void ImplSetInfo(); DECL_DLLPRIVATE_LINK_TYPED( ImplPropertiesHdl, Button*, void ); - DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* ); + DECL_DLLPRIVATE_LINK_TYPED( ImplChangePrinterHdl, ListBox&, void ); DECL_DLLPRIVATE_LINK_TYPED( ImplStatusHdl, Timer*, void ); public: diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx index 28b4f68ddc60..386e0e26063a 100644 --- a/include/svx/ctredlin.hxx +++ b/include/svx/ctredlin.hxx @@ -194,10 +194,11 @@ private: VclPtr<Edit> m_pEdComment; bool bModified; - DECL_LINK( SelDateHdl, ListBox* ); + 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( ModifyListBoxHdl, ListBox&, void ); DECL_LINK( ModifyDate, void* ); DECL_LINK_TYPED( RefHandle, Button*, void ); diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx index 7ba3b025350b..613c74260a01 100644 --- a/include/svx/fillctrl.hxx +++ b/include/svx/fillctrl.hxx @@ -60,8 +60,8 @@ private: sal_Int32 mnLastPosHatch; sal_Int32 mnLastPosBitmap; - DECL_LINK(SelectFillTypeHdl,ListBox *); - DECL_LINK(SelectFillAttrHdl,ListBox *); + DECL_LINK_TYPED(SelectFillTypeHdl, ListBox&, void); + DECL_LINK_TYPED(SelectFillAttrHdl, ListBox&, void); public: SFX_DECL_TOOLBOX_CONTROL(); diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx index 105036552eb3..ef78729a9bbb 100644 --- a/include/svx/float3d.hxx +++ b/include/svx/float3d.hxx @@ -194,7 +194,7 @@ private: DECL_LINK_TYPED( ClickAssignHdl, Button*, void ); DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( ClickColorHdl, Button*, void ); - DECL_LINK( SelectHdl, void * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK( ModifyHdl, void * ); void ClickLight(PushButton &rBtn); diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx index 4dd6aaeb1236..38148e0dc370 100644 --- a/include/svx/fontwork.hxx +++ b/include/svx/fontwork.hxx @@ -150,7 +150,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontWorkDialog : public SfxDockingWindow DECL_LINK( ModifyInputHdl_Impl, void * ); DECL_LINK_TYPED( InputTimoutHdl_Impl, Idle *, void ); - DECL_LINK( ColorSelectHdl_Impl, void * ); + DECL_LINK_TYPED( ColorSelectHdl_Impl, ListBox&, void ); void SetStyle_Impl(const XFormTextStyleItem*); void SetAdjust_Impl(const XFormTextAdjustItem*); diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx index 05982c4eeee9..960361be4ab2 100644 --- a/include/svx/lboxctrl.hxx +++ b/include/svx/lboxctrl.hxx @@ -39,7 +39,7 @@ protected: void Impl_SetInfo( sal_Int32 nCount ); DECL_LINK_TYPED( PopupModeEndHdl, FloatingWindow*, void ); - DECL_LINK( SelectHdl, void * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); public: SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx index c47932ba72d9..61992decfb69 100644 --- a/include/svx/rubydialog.hxx +++ b/include/svx/rubydialog.hxx @@ -132,9 +132,9 @@ class SvxRubyDialog : public SfxModelessDialog DECL_LINK_TYPED(CloseHdl_Impl, Button*, void); DECL_LINK_TYPED(StylistHdl_Impl, Button*, void); DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void); - DECL_LINK(PositionHdl_Impl, ListBox*); - DECL_LINK(AdjustHdl_Impl, ListBox*); - DECL_LINK(CharStyleHdl_Impl, void *); + 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(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 b0ac3e345454..893284222fd4 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -159,9 +159,9 @@ protected: sfx2::sidebar::SidebarController* mpSidebarController; - DECL_LINK(SelectFillTypeHdl, ListBox* ); - DECL_LINK(SelectFillAttrHdl, ListBox* ); - DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); + 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(ModifyTransSliderHdl, Slider*, void); diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx index dadb601b144a..18c108caca0c 100644 --- a/include/svx/sidebar/LinePropertyPanelBase.hxx +++ b/include/svx/sidebar/LinePropertyPanelBase.hxx @@ -165,13 +165,13 @@ private: void Initialize(); - DECL_LINK(ChangeLineStyleHdl, void*); + DECL_LINK_TYPED(ChangeLineStyleHdl, ListBox&, void); DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void); DECL_LINK(ChangeTransparentHdl , void *); - DECL_LINK(ChangeStartHdl, void *); - DECL_LINK(ChangeEndHdl, void *); - DECL_LINK(ChangeEdgeStyleHdl, void *); - DECL_LINK(ChangeCapStyleHdl, void *); + DECL_LINK_TYPED(ChangeStartHdl, ListBox&, void); + DECL_LINK_TYPED(ChangeEndHdl, ListBox&, void); + DECL_LINK_TYPED(ChangeEdgeStyleHdl, ListBox&, void); + DECL_LINK_TYPED(ChangeCapStyleHdl, ListBox&, void); VclPtr<PopupControl> CreateLineWidthPopupControl (PopupContainer* pParent); }; diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 1d1286358dc7..598c142f1ce9 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -235,7 +235,7 @@ private: DECL_LINK_TYPED( CommandHdl_Impl, Button*, void ); DECL_LINK_TYPED(TemplateHdl_Impl, Button*, void); DECL_LINK_TYPED( FocusHdl_Impl, Control&, void ); - DECL_LINK( LBSelectHdl_Impl, Control* ); + DECL_LINK_TYPED( LBSelectHdl_Impl, ListBox&, void ); DECL_LINK_TYPED(LoseFocusHdl_Impl, Control&, void); DECL_LINK_TYPED(FormatHdl_Impl, Button*, void); DECL_LINK_TYPED(NoFormatHdl_Impl, Button*, void); diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx index 1db08a1948df..acc824958acd 100644 --- a/include/vcl/lstbox.hxx +++ b/include/vcl/lstbox.hxx @@ -44,7 +44,7 @@ private: sal_uInt16 mnDDHeight; sal_Int32 mnSaveValue; sal_Int32 m_nMaxWidthChars; - Link<> maSelectHdl; + Link<ListBox&,void> maSelectHdl; Link<ListBox&,void> maDoubleClickHdl; sal_uInt16 mnLineCount; @@ -191,8 +191,8 @@ public: void DrawEntry( const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos = false ); - void SetSelectHdl( const Link<>& rLink ) { maSelectHdl = rLink; } - const Link<>& GetSelectHdl() const { return maSelectHdl; } + void SetSelectHdl( const Link<ListBox&,void>& rLink ) { maSelectHdl = rLink; } + const Link<ListBox&,void>& GetSelectHdl() const { return maSelectHdl; } void SetDoubleClickHdl( const Link<ListBox&,void>& rLink ) { maDoubleClickHdl = rLink; } const Link<ListBox&,void>& GetDoubleClickHdl() const { return maDoubleClickHdl; } diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx index fa5b94761acf..05d1053f4ed7 100644 --- a/include/vcl/tabctrl.hxx +++ b/include/vcl/tabctrl.hxx @@ -77,7 +77,7 @@ private: SAL_DLLPRIVATE void ImplFreeLayoutData(); SAL_DLLPRIVATE bool ImplHandleKeyEvent( const KeyEvent& rKeyEvent ); - DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, void* ); + DECL_DLLPRIVATE_LINK_TYPED( ImplListBoxSelectHdl, ListBox&, void ); DECL_DLLPRIVATE_LINK_TYPED( ImplWindowEventListener, VclWindowEvent&, void ); diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index bf7e664bd519..41a4b0d171f2 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -398,17 +398,15 @@ void Condition::GetFocus() m_pCondLHS->GrabFocus(); } -IMPL_LINK( Condition, OnTypeSelected, ListBox*, /*_pNotInterestedIn*/ ) +IMPL_LINK_NOARG_TYPED( Condition, OnTypeSelected, ListBox&, void ) { impl_layoutOperands(); - return 0L; } -IMPL_LINK( Condition, OnOperationSelected, ListBox*, /*_pNotInterestedIn*/ ) +IMPL_LINK_NOARG_TYPED( Condition, OnOperationSelected, ListBox&, void ) { impl_layoutOperands(); - return 0L; } void Condition::impl_layoutOperands() diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx index 294fd18d1799..c8660d062c5c 100644 --- a/reportdesign/source/ui/dlg/Condition.hxx +++ b/reportdesign/source/ui/dlg/Condition.hxx @@ -167,8 +167,8 @@ namespace rptui void impl_setCondition( const OUString& _rConditionFormula ); private: - DECL_LINK( OnTypeSelected, ListBox* ); - DECL_LINK( OnOperationSelected, ListBox* ); + DECL_LINK_TYPED( OnTypeSelected, ListBox&, void ); + DECL_LINK_TYPED( OnOperationSelected, ListBox&, void ); }; diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 68ce8f2f20c6..26665dd16cca 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -1177,18 +1177,18 @@ IMPL_LINK_NOARG_TYPED( OGroupsSortingDialog, OnFormatAction, ToolBox*, void ) } } -IMPL_LINK( OGroupsSortingDialog, LBChangeHdl, ListBox*, pListBox ) +IMPL_LINK_TYPED( OGroupsSortingDialog, LBChangeHdl, ListBox&, rListBox, void ) { - if ( pListBox->IsValueChangedFromSaved() ) + if ( rListBox.IsValueChangedFromSaved() ) { sal_Int32 nRow = m_pFieldExpression->GetCurRow(); sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(nRow); - if (pListBox != m_pHeaderLst && pListBox != m_pFooterLst) + if (&rListBox != m_pHeaderLst && &rListBox != m_pFooterLst) { - if ( pListBox->IsValueChangedFromSaved() ) + if ( rListBox.IsValueChangedFromSaved() ) SaveData(nRow); - if ( pListBox == m_pGroupOnLst ) - m_pGroupIntervalEd->Enable( pListBox->GetSelectEntryPos() != 0 ); + if ( &rListBox == m_pGroupOnLst ) + m_pGroupIntervalEd->Enable( rListBox.GetSelectEntryPos() != 0 ); } else if ( nGroupPos != NO_GROUP ) { @@ -1197,17 +1197,16 @@ IMPL_LINK( OGroupsSortingDialog, LBChangeHdl, ListBox*, pListBox ) aArgs[1].Name = PROPERTY_GROUP; aArgs[1].Value <<= xGroup; - if ( m_pHeaderLst == pListBox ) + if ( m_pHeaderLst == &rListBox ) aArgs[0].Name = PROPERTY_HEADERON; else aArgs[0].Name = PROPERTY_FOOTERON; - aArgs[0].Value <<= pListBox->GetSelectEntryPos() == 0; - m_pController->executeChecked(m_pHeaderLst == pListBox ? SID_GROUPHEADER : SID_GROUPFOOTER,aArgs); + aArgs[0].Value <<= rListBox.GetSelectEntryPos() == 0; + m_pController->executeChecked(m_pHeaderLst == &rListBox ? SID_GROUPHEADER : SID_GROUPFOOTER, aArgs); m_pFieldExpression->InvalidateHandleColumn(); } } - return 1L; } void OGroupsSortingDialog::showHelpText(sal_uInt16 _nResId) diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx index 3b3fd602dd28..4b9ed07e75ba 100644 --- a/reportdesign/source/ui/inc/GroupsSorting.hxx +++ b/reportdesign/source/ui/inc/GroupsSorting.hxx @@ -84,7 +84,7 @@ class OGroupsSortingDialog : public FloatingWindow private: DECL_LINK_TYPED( OnControlFocusLost, Control&, void ); DECL_LINK_TYPED( OnControlFocusGot, Control&, void ); - DECL_LINK( LBChangeHdl, ListBox* ); + DECL_LINK_TYPED( LBChangeHdl, ListBox&, void ); DECL_LINK_TYPED( OnFormatAction, ToolBox*, void ); /** returns the groups diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index fe2fbc0fcb91..72afc4fea95f 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -129,7 +129,7 @@ void ScRandomNumberGeneratorDialog::Init() mpEnableSeed->SetToggleHdl( LINK( this, ScRandomNumberGeneratorDialog, CheckChanged )); mpEnableRounding->SetToggleHdl( LINK( this, ScRandomNumberGeneratorDialog, CheckChanged )); - DistributionChanged(NULL); + DistributionChanged(*mpDistributionCombo.get()); CheckChanged(*mpEnableSeed); } @@ -420,7 +420,7 @@ IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, CheckChanged, CheckBox&, vo mpDecimalPlaces->Enable(mpEnableRounding->IsChecked()); } -IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged) +IMPL_LINK_NOARG_TYPED(ScRandomNumberGeneratorDialog, DistributionChanged, ListBox&, void) { sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos(); sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>( mpDistributionCombo->GetEntryData(aSelectedIndex) ); @@ -514,7 +514,6 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged) break; } } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index e6a2cc7788d1..b3a2e2cc4e86 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -130,8 +130,8 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar mpLbAxisCol->SelectEntry(rData.maAxisColor); mpCbOnlyBar->Check(rData.mbOnlyBar); - TypeSelectHdl(NULL); - PosSelectHdl(NULL); + TypeSelectHdl(*mpLbTypeMin.get()); + PosSelectHdl(*mpLbTypeMin.get()); } ScDataBarSettingsDlg::~ScDataBarSettingsDlg() @@ -308,7 +308,7 @@ IMPL_LINK_NOARG_TYPED( ScDataBarSettingsDlg, OkBtnHdl, Button*, void ) } } -IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl ) +IMPL_LINK_NOARG_TYPED( ScDataBarSettingsDlg, TypeSelectHdl, ListBox&, void ) { sal_Int32 nSelectMin = mpLbTypeMin->GetSelectEntryPos(); if( nSelectMin <= COLORSCALE_MAX) @@ -339,10 +339,9 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl ) mpEdMax->SetText(OUString::number(0)); } } - return 0; } -IMPL_LINK_NOARG( ScDataBarSettingsDlg, PosSelectHdl ) +IMPL_LINK_NOARG_TYPED( ScDataBarSettingsDlg, PosSelectHdl, ListBox&, void ) { sal_Int32 axisPos = mpLbAxisPos->GetSelectEntryPos(); if(axisPos != 2 && axisPos != 1) // disable if axis vertical position is automatic @@ -360,7 +359,6 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, PosSelectHdl ) mpLenMax->SetText(OUString::number(100)); } } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 27cc8d0a93b0..540bfdea18db 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -236,7 +236,7 @@ void ScCondFormatList::DoScroll(long nDelta) mpScrollBar->SetPosPixel(aNewPoint); } -IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox) +IMPL_LINK_TYPED(ScCondFormatList, ColFormatTypeHdl, ListBox&, rBox, void) { EntryContainer::iterator itr = maEntries.begin(); for(; itr != maEntries.end(); ++itr) @@ -245,35 +245,35 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox) break; } if(itr == maEntries.end()) - return 0; + return; - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); switch(nPos) { case 0: if((*itr)->GetType() == condformat::entry::COLORSCALE2) - return 0; + return; itr->disposeAndClear(); *itr = VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos ); break; case 1: if((*itr)->GetType() == condformat::entry::COLORSCALE3) - return 0; + return; itr->disposeAndClear(); *itr = VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos ); break; case 2: if((*itr)->GetType() == condformat::entry::DATABAR) - return 0; + return; itr->disposeAndClear(); *itr = VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos ); break; case 3: if((*itr)->GetType() == condformat::entry::ICONSET) - return 0; + return; itr->disposeAndClear(); *itr = VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos ); @@ -284,17 +284,15 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox) mpDialogParent->InvalidateRefData(); (*itr)->SetActive(); RecalcAll(); - return 0; } -IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox) +IMPL_LINK_TYPED(ScCondFormatList, TypeListHdl, ListBox&, rBox, void) { //Resolves: fdo#79021 At this point we are still inside the ListBox Select. //If we call maEntries.replace here then the pBox will be deleted before it //has finished Select and will crash on accessing its deleted this. So Post //to do the real work after the Select has completed - Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), pBox, true); - return 0; + Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), &rBox, true); } IMPL_LINK_TYPED(ScCondFormatList, AfterTypeListHdl, void*, p, void) diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 46c764e5b209..db4639c0f363 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -209,7 +209,7 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pD { OUString aStyleName = pFormatEntry->GetStyle(); maLbStyle->SelectEntry(aStyleName); - StyleSelectHdl(NULL); + StyleSelectHdl(*maLbStyle.get()); ScConditionMode eMode = pFormatEntry->GetOperation(); maLbCondType->SelectEntryPos(ConditionModeToEntryPos(eMode)); @@ -544,12 +544,11 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, SvxFontPrevWindow& rWdPre } -IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl) +IMPL_LINK_NOARG_TYPED(ScConditionFrmtEntry, StyleSelectHdl, ListBox&, void) { mbIsInStyleCreate = true; StyleSelect( *maLbStyle.get(), mpDoc, *maWdPreview.get() ); mbIsInStyleCreate = false; - return 0; } // formula @@ -576,7 +575,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, maLbStyle->SelectEntryPos(1); } - StyleSelectHdl(NULL); + StyleSelectHdl(*maLbStyle.get()); } ScFormulaFrmtEntry::~ScFormulaFrmtEntry() @@ -601,11 +600,9 @@ void ScFormulaFrmtEntry::Init(ScCondFormatDlg* pDialogParent) maLbStyle->SetSelectHdl( LINK( this, ScFormulaFrmtEntry, StyleSelectHdl ) ); } -IMPL_LINK_NOARG(ScFormulaFrmtEntry, StyleSelectHdl) +IMPL_LINK_NOARG_TYPED(ScFormulaFrmtEntry, StyleSelectHdl, ListBox&, void) { StyleSelect( *maLbStyle.get(), mpDoc, *maWdPreview.get() ); - - return 0; } ScFormatEntry* ScFormulaFrmtEntry::createFormulaEntry() const @@ -770,8 +767,8 @@ ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); - EntryTypeHdl(maLbEntryTypeMin.get()); - EntryTypeHdl(maLbEntryTypeMax.get()); + EntryTypeHdl(*maLbEntryTypeMin.get()); + EntryTypeHdl(*maLbEntryTypeMax.get()); } ScColorScale2FrmtEntry::~ScColorScale2FrmtEntry() @@ -879,19 +876,19 @@ void ScColorScale2FrmtEntry::SetInactive() Deselect(); } -IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox&, rBox, void ) { Edit* pEd = NULL; - if (pBox == maLbEntryTypeMin.get()) + if (&rBox == maLbEntryTypeMin.get()) pEd = maEdMin; - else if (pBox == maLbEntryTypeMax.get()) + else if (&rBox == maLbEntryTypeMax.get()) pEd = maEdMax.get(); if (!pEd) - return 0; + return; bool bEnableEdit = true; - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); if(nPos < 2) { bEnableEdit = false; @@ -901,8 +898,6 @@ IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox ) pEd->Enable(); else pEd->Disable(); - - return 0; } ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ): @@ -947,9 +942,9 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument FreeResource(); maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); - EntryTypeHdl(maLbEntryTypeMin.get()); - EntryTypeHdl(maLbEntryTypeMiddle.get()); - EntryTypeHdl(maLbEntryTypeMax.get()); + EntryTypeHdl(*maLbEntryTypeMin.get()); + EntryTypeHdl(*maLbEntryTypeMiddle.get()); + EntryTypeHdl(*maLbEntryTypeMax.get()); } ScColorScale3FrmtEntry::~ScColorScale3FrmtEntry() @@ -1073,21 +1068,21 @@ void ScColorScale3FrmtEntry::SetInactive() Deselect(); } -IMPL_LINK( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox&, rBox, void ) { Edit* pEd = NULL; - if(pBox == maLbEntryTypeMin.get()) + if(&rBox == maLbEntryTypeMin.get()) pEd = maEdMin.get(); - else if(pBox == maLbEntryTypeMiddle.get()) + else if(&rBox == maLbEntryTypeMiddle.get()) pEd = maEdMiddle.get(); - else if(pBox == maLbEntryTypeMax.get()) + else if(&rBox == maLbEntryTypeMax.get()) pEd = maEdMax.get(); if (!pEd) - return 0; + return; bool bEnableEdit = true; - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); if(nPos < 2) { bEnableEdit = false; @@ -1097,11 +1092,9 @@ IMPL_LINK( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox*, pBox ) pEd->Enable(); else pEd->Disable(); - - return 0; } -IMPL_LINK_NOARG( ScConditionFrmtEntry, ConditionTypeSelectHdl ) +IMPL_LINK_NOARG_TYPED( ScConditionFrmtEntry, ConditionTypeSelectHdl, ListBox&, void ) { sal_Int32 nSelectPos = maLbCondType->GetSelectEntryPos(); ScConditionMode eMode = EntryPosToConditionMode(nSelectPos); @@ -1123,8 +1116,6 @@ IMPL_LINK_NOARG( ScConditionFrmtEntry, ConditionTypeSelectHdl ) maFtVal->Show(); break; } - - return 0; } //databar @@ -1175,13 +1166,13 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, mpDataBarData.reset(new ScDataBarFormatData(*pFormat->GetDataBarData())); SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, *maLbDataBarMinType.get(), *maEdDataBarMin.get(), pDoc); SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), pDoc); - DataBarTypeSelectHdl(NULL); + DataBarTypeSelectHdl(*maLbDataBarMinType.get()); } else { maLbDataBarMinType->SelectEntryPos(0); maLbDataBarMaxType->SelectEntryPos(0); - DataBarTypeSelectHdl(NULL); + DataBarTypeSelectHdl(*maLbDataBarMinType.get()); } Init(); @@ -1269,7 +1260,7 @@ void ScDataBarFrmtEntry::SetInactive() Deselect(); } -IMPL_LINK_NOARG( ScDataBarFrmtEntry, DataBarTypeSelectHdl ) +IMPL_LINK_NOARG_TYPED( ScDataBarFrmtEntry, DataBarTypeSelectHdl, ListBox&, void ) { sal_Int32 nSelectPos = maLbDataBarMinType->GetSelectEntryPos(); if(nSelectPos <= COLORSCALE_MAX) @@ -1282,8 +1273,6 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, DataBarTypeSelectHdl ) maEdDataBarMax->Disable(); else maEdDataBarMax->Enable(); - - return 0; } IMPL_LINK_NOARG_TYPED( ScDataBarFrmtEntry, OptionBtnHdl, Button*, void ) @@ -1296,7 +1285,7 @@ IMPL_LINK_NOARG_TYPED( ScDataBarFrmtEntry, OptionBtnHdl, Button*, void ) mpDataBarData.reset(pDlg->GetData()); SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, *maLbDataBarMinType, *maEdDataBarMin.get(), mpDoc); SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), mpDoc); - DataBarTypeSelectHdl(NULL); + DataBarTypeSelectHdl(*maLbDataBarMinType.get()); } } @@ -1322,7 +1311,7 @@ ScDateFrmtEntry::ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const maLbStyle->SelectEntry(aStyleName); } - StyleSelectHdl(NULL); + StyleSelectHdl(*maLbStyle.get()); } ScDateFrmtEntry::~ScDateFrmtEntry() @@ -1397,13 +1386,11 @@ OUString ScDateFrmtEntry::GetExpressionString() return ScCondFormatHelper::GetExpression(DATE, 0); } -IMPL_LINK_NOARG( ScDateFrmtEntry, StyleSelectHdl ) +IMPL_LINK_NOARG_TYPED( ScDateFrmtEntry, StyleSelectHdl, ListBox&, void ) { mbIsInStyleCreate = true; StyleSelect( *maLbStyle.get(), mpDoc, *maWdPreview.get() ); mbIsInStyleCreate = false; - - return 0; } class ScIconSetFrmtDataEntry : public Control @@ -1548,7 +1535,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, maEntries[0]->SetFirstEntry(); } else - IconSetTypeHdl(NULL); + IconSetTypeHdl(*maLbIconSetType.get()); } ScIconSetFrmtEntry::~ScIconSetFrmtEntry() @@ -1575,7 +1562,7 @@ void ScIconSetFrmtEntry::Init() maLbIconSetType->SetSelectHdl( LINK( this, ScIconSetFrmtEntry, IconSetTypeHdl ) ); } -IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl ) +IMPL_LINK_NOARG_TYPED( ScIconSetFrmtEntry, IconSetTypeHdl, ListBox&, void ) { ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap(); @@ -1597,8 +1584,6 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl ) maEntries[0]->SetFirstEntry(); SetHeight(); - - return 0; } OUString ScIconSetFrmtEntry::GetExpressionString() diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 87eb9c75ee6e..7ef844199185 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -124,7 +124,7 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( mpSourceButton->SetLoseFocusHdl(aLink); mpSourceEdit->SetModifyHdl(LINK(this, ScPivotLayoutDialog, SourceEditModified)); - mpSourceListBox->SetSelectHdl(LINK(this, ScPivotLayoutDialog, SourceEditModified)); + mpSourceListBox->SetSelectHdl(LINK(this, ScPivotLayoutDialog, SourceListSelected)); // Destination UI aLink2 = LINK(this, ScPivotLayoutDialog, ToggleDestination); @@ -677,6 +677,11 @@ IMPL_LINK_NOARG_TYPED(ScPivotLayoutDialog, LoseFocusHandler, Control&, void) mbDialogLostFocus = !IsActive(); } +IMPL_LINK_NOARG_TYPED(ScPivotLayoutDialog, SourceListSelected, ListBox&, void) +{ + UpdateSourceRange(); +} + IMPL_LINK_NOARG(ScPivotLayoutDialog, SourceEditModified) { UpdateSourceRange(); diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index ab3772cd7ec3..16b2f0c52b06 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -483,19 +483,19 @@ IMPL_LINK_TYPED( ScConsolidateDlg, ClickHdl, Button*, pBtn, void ) } } -IMPL_LINK( ScConsolidateDlg, SelectHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScConsolidateDlg, SelectHdl, ListBox&, rLb, void ) { - if ( pLb == pLbConsAreas ) + if ( &rLb == pLbConsAreas ) { if ( pLbConsAreas->GetSelectEntryCount() > 0 ) pBtnRemove->Enable(); else pBtnRemove->Disable(); } - else if ( (pLb == pLbDataArea) || (pLb == pLbDestArea) ) + else if ( (&rLb == pLbDataArea) || (&rLb == pLbDestArea) ) { - Edit* pEd = (pLb == pLbDataArea) ? pEdDataArea : pEdDestArea; - const sal_Int32 nSelPos = pLb->GetSelectEntryPos(); + Edit* pEd = (&rLb == pLbDataArea) ? pEdDataArea : pEdDestArea; + const sal_Int32 nSelPos = rLb.GetSelectEntryPos(); if ( pRangeUtil && (nSelPos > 0) @@ -506,7 +506,7 @@ IMPL_LINK( ScConsolidateDlg, SelectHdl, ListBox*, pLb ) { OUString aString( pAreaData[nSelPos-1].aStrArea ); - if ( pLb == pLbDestArea ) + if ( &rLb == pLbDestArea ) ScRangeUtil::CutPosString( aString, aString ); pEd->SetText( aString ); @@ -522,7 +522,6 @@ IMPL_LINK( ScConsolidateDlg, SelectHdl, ListBox*, pLb ) pBtnAdd->Enable(); } } - return 0; } IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit*, pEd ) diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 93bcce13684c..60b4b5cdfb1c 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -114,10 +114,9 @@ void ScDataPilotDatabaseDlg::GetValues( ScImportSourceDesc& rDesc ) rDesc.bNative = ( nSelect == DP_TYPELIST_SQLNAT ); } -IMPL_LINK_NOARG(ScDataPilotDatabaseDlg, SelectHdl) +IMPL_LINK_NOARG_TYPED(ScDataPilotDatabaseDlg, SelectHdl, ListBox&, void) { FillObjects(); - return 0; } void ScDataPilotDatabaseDlg::FillObjects() diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 15cf1d13dc42..94b1148af7b7 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -764,14 +764,14 @@ IMPL_LINK_TYPED( ScFilterDlg, TimeOutHdl, Timer*, _pTimer, void ) pTimer->Start(); } -IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScFilterDlg, LbSelectHdl, ListBox&, rLb, void ) { /* * Handle enable/disable logic depending on which ListBox was selected */ sal_uInt16 nOffset = GetSliderPos(); - if ( pLb == pLbConnect1 ) + if ( &rLb == pLbConnect1 ) { pLbField1->Enable(); pLbCond1->Enable(); @@ -785,7 +785,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) maRefreshExceptQuery[nQE] = true; } - else if ( pLb == pLbConnect2 ) + else if ( &rLb == pLbConnect2 ) { pLbField2->Enable(); pLbCond2->Enable(); @@ -798,7 +798,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) maRefreshExceptQuery.resize(nQE + 1, false); maRefreshExceptQuery[nQE]=true; } - else if ( pLb == pLbConnect3 ) + else if ( &rLb == pLbConnect3 ) { pLbField3->Enable(); pLbCond3->Enable(); @@ -812,7 +812,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) maRefreshExceptQuery[nQE] = true; } - else if ( pLb == pLbConnect4 ) + else if ( &rLb == pLbConnect4 ) { pLbField4->Enable(); pLbCond4->Enable(); @@ -825,7 +825,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) maRefreshExceptQuery.resize(nQE + 1, false); maRefreshExceptQuery[nQE] = true; } - else if ( pLb == pLbField1 ) + else if ( &rLb == pLbField1 ) { if ( pLbField1->GetSelectEntryPos() == 0 ) { @@ -874,11 +874,11 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) pLbConnect2->Enable(); } theQueryData.GetEntry(nOffset).bDoQuery = true; - const sal_Int32 nField = pLb->GetSelectEntryPos(); + const sal_Int32 nField = rLb.GetSelectEntryPos(); theQueryData.GetEntry(nOffset).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } } - else if ( pLb == pLbField2 ) + else if ( &rLb == pLbField2 ) { if ( pLbField2->GetSelectEntryPos() == 0 ) { @@ -920,13 +920,13 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) { pLbConnect3->Enable(); } - const sal_Int32 nField = pLb->GetSelectEntryPos(); + const sal_Int32 nField = rLb.GetSelectEntryPos(); sal_uInt16 nQ=1+nOffset; theQueryData.GetEntry(nQ).bDoQuery = true; theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } } - else if ( pLb == pLbField3 ) + else if ( &rLb == pLbField3 ) { if ( pLbField3->GetSelectEntryPos() == 0 ) { @@ -961,14 +961,14 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) pLbConnect4->Enable(); } - const sal_Int32 nField = pLb->GetSelectEntryPos(); + const sal_Int32 nField = rLb.GetSelectEntryPos(); sal_uInt16 nQ=2+nOffset; theQueryData.GetEntry(nQ).bDoQuery = true; theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } } - else if ( pLb == pLbField4 ) + else if ( &rLb == pLbField4 ) { if ( pLbField4->GetSelectEntryPos() == 0 ) { @@ -988,34 +988,32 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb ) else { UpdateValueList( 4 ); - const sal_Int32 nField = pLb->GetSelectEntryPos(); + const sal_Int32 nField = rLb.GetSelectEntryPos(); sal_uInt16 nQ=3+nOffset; theQueryData.GetEntry(nQ).bDoQuery = true; theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + static_cast<SCCOL>(nField) - 1 ; } } - else if ( pLb == pLbCond1) + else if ( &rLb == pLbCond1) { - theQueryData.GetEntry(nOffset).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); + theQueryData.GetEntry(nOffset).eOp=(ScQueryOp)rLb.GetSelectEntryPos(); } - else if ( pLb == pLbCond2) + else if ( &rLb == pLbCond2) { sal_uInt16 nQ=1+nOffset; - theQueryData.GetEntry(nQ).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); + theQueryData.GetEntry(nQ).eOp=(ScQueryOp)rLb.GetSelectEntryPos(); } - else if ( pLb == pLbCond3) + else if ( &rLb == pLbCond3) { sal_uInt16 nQ=2+nOffset; - theQueryData.GetEntry(nQ).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); + theQueryData.GetEntry(nQ).eOp=(ScQueryOp)rLb.GetSelectEntryPos(); } else { sal_uInt16 nQ=3+nOffset; - theQueryData.GetEntry(nQ).eOp=(ScQueryOp)pLb->GetSelectEntryPos(); + theQueryData.GetEntry(nQ).eOp=(ScQueryOp)rLb.GetSelectEntryPos(); } - - return 0; } IMPL_LINK_TYPED( ScFilterDlg, CheckBoxHdl, Button*, pBox, void ) diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index 29b6dc2c5e93..847b5b737b0f 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -209,9 +209,9 @@ bool ScFilterOptionsMgr::VerifyPosStr( const OUString& rPosStr ) const // Handler: -IMPL_LINK( ScFilterOptionsMgr, LbAreaSelHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScFilterOptionsMgr, LbAreaSelHdl, ListBox&, rLb, void ) { - if ( pLb == pLbCopyArea ) + if ( &rLb == pLbCopyArea ) { OUString aString; const sal_Int32 nSelPos = pLbCopyArea->GetSelectEntryPos(); @@ -221,8 +221,6 @@ IMPL_LINK( ScFilterOptionsMgr, LbAreaSelHdl, ListBox*, pLb ) pEdCopyArea->SetText( aString ); } - - return 0; } IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, pEd ) diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index 078fbfc01d5b..1b3a155a0752 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -429,13 +429,14 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem() // Handler: -IMPL_LINK( ScPivotFilterDlg, LbSelectHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScPivotFilterDlg, LbSelectHdl, ListBox&, rLb, void ) { /* * Handling the enable/disable logic based on which ListBox was touched: */ - if (pLb == m_pLbConnect1) + + if (&rLb == m_pLbConnect1) { if ( !m_pLbField2->IsEnabled() ) { @@ -444,7 +445,7 @@ IMPL_LINK( ScPivotFilterDlg, LbSelectHdl, ListBox*, pLb ) m_pEdVal2->Enable(); } } - else if (pLb == m_pLbConnect2) + else if (&rLb == m_pLbConnect2) { if ( !m_pLbField3->IsEnabled() ) { @@ -453,7 +454,7 @@ IMPL_LINK( ScPivotFilterDlg, LbSelectHdl, ListBox*, pLb ) m_pEdVal3->Enable(); } } - else if (pLb == m_pLbField1) + else if (&rLb == m_pLbField1) { if ( m_pLbField1->GetSelectEntryPos() == 0 ) { @@ -485,7 +486,7 @@ IMPL_LINK( ScPivotFilterDlg, LbSelectHdl, ListBox*, pLb ) } } } - else if (pLb == m_pLbField2) + else if (&rLb == m_pLbField2) { if ( m_pLbField2->GetSelectEntryPos() == 0 ) { @@ -509,14 +510,12 @@ IMPL_LINK( ScPivotFilterDlg, LbSelectHdl, ListBox*, pLb ) } } } - else if (pLb == m_pLbField3) + else if (&rLb == m_pLbField3) { ( m_pLbField3->GetSelectEntryPos() == 0 ) ? ClearValueList( 3 ) : UpdateValueList( 3 ); } - - return 0; } IMPL_LINK_TYPED( ScPivotFilterDlg, CheckBoxHdl, Button*, pBox, void ) diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index e54cc5ce619b..e1c7fe32e192 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -294,13 +294,13 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa // select field reference type mxLbTypeWrp->SetControlValue( rFuncData.maFieldRef.ReferenceType ); - SelectHdl( mpLbType ); // enables base field/item list boxes + SelectHdl( *mpLbType.get() ); // enables base field/item list boxes // select base field mpLbBaseField->SelectEntry(aSelectedEntry); if( mpLbBaseField->GetSelectEntryPos() >= mpLbBaseField->GetEntryCount() ) mpLbBaseField->SelectEntryPos( 0 ); - SelectHdl( mpLbBaseField ); // fills base item list, selects base item + SelectHdl( *mpLbBaseField.get() ); // fills base item list, selects base item // select base item switch( rFuncData.maFieldRef.ReferenceItemType ) @@ -361,9 +361,9 @@ sal_Int32 ScDPFunctionDlg::FindBaseItemPos( const OUString& rEntry, sal_Int32 nS return bFound ? nPos : LISTBOX_ENTRY_NOTFOUND; } -IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) +IMPL_LINK_TYPED( ScDPFunctionDlg, SelectHdl, ListBox&, rLBox, void ) { - if( pLBox == mpLbType ) + if( &rLBox == mpLbType ) { bool bEnableField, bEnableItem; switch( mxLbTypeWrp->GetControlValue() ) @@ -391,7 +391,7 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) mpFtBaseItem->Enable( bEnableItem ); mpLbBaseItem->Enable( bEnableItem ); } - else if( pLBox == mpLbBaseField ) + else if( &rLBox == mpLbBaseField ) { // keep "previous" and "next" entries while( mpLbBaseItem->GetEntryCount() > SC_BASEITEM_USER_POS ) @@ -416,7 +416,6 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) sal_uInt16 nItemPos = (mpLbBaseItem->GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; mpLbBaseItem->SelectEntryPos( nItemPos ); } - return 0; } IMPL_LINK_NOARG_TYPED(ScDPFunctionDlg, DblClickHdl, ListBox&, void) @@ -811,14 +810,13 @@ IMPL_LINK_TYPED( ScDPSubtotalOptDlg, CheckHdl, Button*, pCBox, void ) } } -IMPL_LINK( ScDPSubtotalOptDlg, SelectHdl, ListBox*, pLBox ) +IMPL_LINK_TYPED( ScDPSubtotalOptDlg, SelectHdl, ListBox&, rLBox, void ) { - if (pLBox == m_pLbHierarchy) + if (&rLBox == m_pLbHierarchy) { mrDPObj.GetMembers(maLabelData.mnCol, m_pLbHierarchy->GetSelectEntryPos(), maLabelData.maMembers); InitHideListBox(); } - return 0; } ScDPShowDetailDlg::ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient ) : diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 0dffe036b483..5fe87be77c87 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -705,10 +705,9 @@ IMPL_LINK( ScImportAsciiDlg, SeparatorHdl, Control*, pCtrl ) return 0; } -IMPL_LINK( ScImportAsciiDlg, CharSetHdl, SvxTextEncodingBox*, pCharSetBox ) +IMPL_LINK_TYPED( ScImportAsciiDlg, CharSetHdl, ListBox&, rListBox, void ) { - OSL_ENSURE( pCharSetBox, "ScImportAsciiDlg::CharSetHdl - missing sender" ); - + SvxTextEncodingBox* pCharSetBox = static_cast<SvxTextEncodingBox*>(&rListBox); if( (pCharSetBox == pLbCharSet) && (pCharSetBox->GetSelectEntryCount() == 1) ) { SetPointer( Pointer( PointerStyle::Wait ) ); @@ -721,7 +720,6 @@ IMPL_LINK( ScImportAsciiDlg, CharSetHdl, SvxTextEncodingBox*, pCharSetBox ) mpTableBox->Execute( CSVCMD_NEWCELLTEXTS ); SetPointer( Pointer( PointerStyle::Arrow ) ); } - return 0; } IMPL_LINK( ScImportAsciiDlg, FirstRowHdl, NumericField*, pNumField ) @@ -731,12 +729,10 @@ IMPL_LINK( ScImportAsciiDlg, FirstRowHdl, NumericField*, pNumField ) return 0; } -IMPL_LINK( ScImportAsciiDlg, LbColTypeHdl, ListBox*, pListBox ) +IMPL_LINK_TYPED( ScImportAsciiDlg, LbColTypeHdl, ListBox&, rListBox, void ) { - OSL_ENSURE( pListBox, "ScImportAsciiDlg::LbColTypeHdl - missing sender" ); - if( pListBox == pLbType ) - mpTableBox->Execute( CSVCMD_SETCOLUMNTYPE, pListBox->GetSelectEntryPos() ); - return 0; + if( &rListBox == pLbType ) + mpTableBox->Execute( CSVCMD_SETCOLUMNTYPE, rListBox.GetSelectEntryPos() ); } IMPL_LINK_NOARG_TYPED(ScImportAsciiDlg, UpdateTextHdl, ScCsvTableBox&, void) @@ -774,8 +770,8 @@ IMPL_LINK_TYPED( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox&, rTableBox, void ) pFtType->Enable( bEnable ); pLbType->Enable( bEnable ); - Link<> aSelHdl = pLbType->GetSelectHdl(); - pLbType->SetSelectHdl( Link<>() ); + Link<ListBox&,void> aSelHdl = pLbType->GetSelectHdl(); + pLbType->SetSelectHdl( Link<ListBox&,void>() ); if( bEmpty ) pLbType->SetNoSelection(); else if( bEnable ) diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 92753b06d6dd..f4f972d83bb2 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -425,9 +425,9 @@ IMPL_LINK_TYPED( ScSpecialFilterDlg, TimeOutHdl, Idle*, _pIdle, void ) pIdle->Start(); } -IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox&, rLb, void ) { - if ( pLb == pLbFilterArea ) + if ( &rLb == pLbFilterArea ) { OUString aString; const sal_Int32 nSelPos = pLbFilterArea->GetSelectEntryPos(); @@ -437,8 +437,6 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox*, pLb ) pEdFilterArea->SetText( aString ); } - - return 0; } IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index b5ef0b344c33..c81e7ad19d6e 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -442,23 +442,23 @@ void ScTabPageSortFields::SetLastSortKey( sal_uInt16 nItem ) // Handler: -IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb ) +IMPL_LINK_TYPED( ScTabPageSortFields, SelectHdl, ListBox&, rLb, void ) { - OUString aSelEntry = pLb->GetSelectEntry(); + OUString aSelEntry = rLb.GetSelectEntry(); ScSortKeyItems::iterator pIter; // If last listbox is enabled add one item - if ( maSortKeyItems.back().m_pLbSort == pLb ) + if ( maSortKeyItems.back().m_pLbSort == &rLb ) if ( aSelEntry != aStrUndefined ) { SetLastSortKey( nSortKeyCount ); - return 0; + return; } // Find selected listbox for ( pIter = maSortKeyItems.begin(); pIter != maSortKeyItems.end(); ++pIter ) { - if ( pIter->m_pLbSort == pLb ) break; + if ( pIter->m_pLbSort == &rLb ) break; } // If not selecting the last Listbox, modify the succeeding ones @@ -481,7 +481,6 @@ IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb ) pIter->EnableField(); } } - return 0; } // Sort option Tab Page: @@ -678,7 +677,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet* /* rArgSet */ ) if ( eLang == LANGUAGE_DONTKNOW ) eLang = LANGUAGE_SYSTEM; m_pLbLanguage->SelectLanguage( eLang ); - FillAlgorHdl(m_pLbLanguage); // get algorithms, select default + FillAlgorHdl(*m_pLbLanguage.get()); // get algorithms, select default if ( !aSortData.aCollatorAlgorithm.isEmpty() ) m_pLbAlgorithm->SelectEntry( pColRes->GetTranslation( aSortData.aCollatorAlgorithm ) ); @@ -876,9 +875,9 @@ IMPL_LINK_TYPED( ScTabPageSortOptions, EnableHdl, Button*, pButton, void ) } } -IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb ) +IMPL_LINK_TYPED( ScTabPageSortOptions, SelOutPosHdl, ListBox&, rLb, void ) { - if (pLb == m_pLbOutPos) + if (&rLb == m_pLbOutPos) { OUString aString; const sal_Int32 nSelPos = m_pLbOutPos->GetSelectEntryPos(); @@ -888,7 +887,6 @@ IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb ) m_pEdOutPos->SetText( aString ); } - return 0; } IMPL_LINK_TYPED( ScTabPageSortOptions, SortDirHdl, Button *, pBtn, void ) @@ -930,7 +928,7 @@ void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) } } -IMPL_LINK_NOARG(ScTabPageSortOptions, FillAlgorHdl) +IMPL_LINK_NOARG_TYPED(ScTabPageSortOptions, FillAlgorHdl, ListBox&, void) { m_pLbAlgorithm->SetUpdateMode( false ); m_pLbAlgorithm->Clear(); @@ -963,7 +961,6 @@ IMPL_LINK_NOARG(ScTabPageSortOptions, FillAlgorHdl) } m_pLbAlgorithm->SetUpdateMode( true ); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 04c1de102261..ab1bf01394b5 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -100,10 +100,10 @@ void ScTpSubTotalGroup::Init() OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found :-(" ); - mpLbGroup->SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectHdl ) ); + mpLbGroup->SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectListBoxHdl ) ); mpLbColumns->SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectTreeListBoxHdl ) ); mpLbColumns->SetCheckButtonHdl( LINK( this, ScTpSubTotalGroup, CheckHdl ) ); - mpLbFunctions->SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectHdl ) ); + mpLbFunctions->SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectListBoxHdl ) ); nFieldArr[0] = 0; FillListBoxes(); @@ -346,7 +346,11 @@ IMPL_LINK_TYPED( ScTpSubTotalGroup, SelectTreeListBoxHdl, SvTreeListBox*, pLb, v { SelectHdl(pLb); } -IMPL_LINK( ScTpSubTotalGroup, SelectHdl, void *, pLb ) +IMPL_LINK_TYPED( ScTpSubTotalGroup, SelectListBoxHdl, ListBox&, rLb, void ) +{ + SelectHdl(&rLb); +} +void ScTpSubTotalGroup::SelectHdl(void *pLb) { if ( (mpLbColumns->GetEntryCount() > 0) && (mpLbColumns->GetSelectionCount() > 0) ) @@ -357,7 +361,7 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, void *, pLb ) OSL_ENSURE( pFunction, "EntryData not found!" ); if ( !pFunction ) - return 0; + return; if ( pLb == mpLbColumns ) { @@ -369,7 +373,6 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, void *, pLb ) mpLbColumns->CheckEntryPos( nColumn ); } } - return 0; } IMPL_LINK_TYPED( ScTpSubTotalGroup, CheckHdl, SvTreeListBox*, pLb, void ) diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index ae2628455887..6b0b56abf78c 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -401,7 +401,7 @@ void ScTPValidationValue::Init() m_pLbAllow->SelectEntryPos( SC_VALIDDLG_ALLOW_ANY ); m_pLbValue->SelectEntryPos( SC_VALIDDLG_DATA_EQUAL ); - SelectHdl( NULL ); + SelectHdl( *m_pLbAllow.get() ); CheckHdl( NULL ); } @@ -449,7 +449,7 @@ void ScTPValidationValue::Reset( const SfxItemSet* rArgSet ) aFmlaStr = static_cast< const SfxStringItem* >( pItem )->GetValue(); SetSecondFormula( aFmlaStr ); - SelectHdl( NULL ); + SelectHdl( *m_pLbAllow.get() ); CheckHdl( NULL ); } @@ -598,7 +598,7 @@ IMPL_LINK_TYPED( ScTPValidationValue, KillFocusHdl, Control&, rControl, void ) } } -IMPL_LINK_NOARG(ScTPValidationValue, SelectHdl) +IMPL_LINK_NOARG_TYPED(ScTPValidationValue, SelectHdl, ListBox&, void) { const sal_Int32 nLbPos = m_pLbAllow->GetSelectEntryPos(); bool bEnable = (nLbPos != SC_VALIDDLG_ALLOW_ANY); @@ -657,7 +657,6 @@ IMPL_LINK_NOARG(ScTPValidationValue, SelectHdl) m_pEdMax->Show( bShowMax ); m_pFtHint->Show( bRange ); m_pBtnRef->Show( bRange ); // cell range picker - return 0; } IMPL_LINK_NOARG_TYPED(ScTPValidationValue, CheckHdl, Button*, void) @@ -779,7 +778,7 @@ void ScTPValidationError::Init() m_pLbAction->SelectEntryPos( 0 ); m_pTsbShow->EnableTriState( false ); - SelectActionHdl( NULL ); + SelectActionHdl( *m_pLbAction.get() ); } VclPtr<SfxTabPage> ScTPValidationError::Create( vcl::Window* pParent, @@ -812,7 +811,7 @@ void ScTPValidationError::Reset( const SfxItemSet* rArgSet ) else m_pEdError->SetText( EMPTY_OUSTRING ); - SelectActionHdl( NULL ); + SelectActionHdl( *m_pLbAction.get() ); } bool ScTPValidationError::FillItemSet( SfxItemSet* rArgSet ) @@ -825,7 +824,7 @@ bool ScTPValidationError::FillItemSet( SfxItemSet* rArgSet ) return true; } -IMPL_LINK_NOARG(ScTPValidationError, SelectActionHdl) +IMPL_LINK_NOARG_TYPED(ScTPValidationError, SelectActionHdl, ListBox&, void) { ScValidErrorStyle eStyle = (ScValidErrorStyle) m_pLbAction->GetSelectEntryPos(); bool bMacro = ( eStyle == SC_VALERR_MACRO ); @@ -833,8 +832,6 @@ IMPL_LINK_NOARG(ScTPValidationError, SelectActionHdl) m_pBtnSearch->Enable( bMacro ); m_pFtError->Enable( !bMacro ); m_pEdError->Enable( !bMacro ); - - return 0L; } IMPL_LINK_NOARG_TYPED(ScTPValidationError, ClickSearchHdl, Button*, void) diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 9ea7238a0864..1dba9a5976c9 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -124,7 +124,7 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP, aFiFuncDesc->SetFont(aFont); aFiFuncDesc->SetBackground( GetBackground() ); //! never transparent? - Link<> aLink=LINK( this, ScFunctionDockWin, SelHdl); + Link<ListBox&,void> aLink=LINK( this, ScFunctionDockWin, SelHdl); aCatBox->SetSelectHdl(aLink); aFuncList->SetSelectHdl(aLink); aDDFuncList->SetSelectHdl(aLink); @@ -148,7 +148,7 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP, Range aYRange(3*aTxtSize.Height()+aFuncList->GetPosPixel().Y(), GetOutputSizePixel().Height()-2*aTxtSize.Height()); aPrivatSplit->SetYRange(aYRange); - SelHdl(aCatBox.get()); + SelHdl(*aCatBox.get()); bInit = true; } @@ -276,7 +276,7 @@ void ScFunctionDockWin::SetSize() aFuncList->Disable(); aFuncList->Hide(); pAllFuncList=aDDFuncList.get(); - SelHdl(aCatBox.get()); + SelHdl(*aCatBox.get()); aDDFuncList->SelectEntryPos(nSelEntry); } break; @@ -294,7 +294,7 @@ void ScFunctionDockWin::SetSize() aFuncList->Enable(); aFuncList->Show(); pAllFuncList=aFuncList.get(); - SelHdl(aCatBox.get()); + SelHdl(*aCatBox.get()); aFuncList->SelectEntryPos(nSelEntry); } break; @@ -922,21 +922,18 @@ void ScFunctionDockWin::DoEnter() #* #************************************************************************/ -IMPL_LINK( ScFunctionDockWin, SelHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScFunctionDockWin, SelHdl, ListBox&, rLb, void ) { - if ( pLb == aCatBox.get() ) + if ( &rLb == aCatBox.get() ) { UpdateFunctionList(); SetDescription(); } - if ( pLb == aFuncList.get() || pLb == aDDFuncList.get() ) + if ( &rLb == aFuncList.get() || &rLb == aDDFuncList.get() ) { SetDescription(); } - - //SetSize(); - return 0; } /************************************************************************* @@ -1053,7 +1050,7 @@ void ScFunctionDockWin::Initialize(SfxChildWinInfo *pInfo) aStr = aStr.copy( n1+1 ); sal_Int32 nSelPos = aStr.toInt32(); aCatBox->SelectEntryPos(nSelPos); - SelHdl(aCatBox.get()); + SelHdl(*aCatBox.get()); // if the window has already been shown (from SfxDockingWindow::Initialize if docked), // set the splitter position now, otherwise it is set in StateChanged with type INITSHOW diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx index e8aeaecb95d0..689cbd87dd8d 100644 --- a/sc/source/ui/inc/PivotLayoutDialog.hxx +++ b/sc/source/ui/inc/PivotLayoutDialog.hxx @@ -94,7 +94,8 @@ private: DECL_LINK_TYPED(LoseFocusHandler, Control&, void); DECL_LINK_TYPED(ToggleSource, RadioButton&, void); DECL_LINK_TYPED(ToggleDestination, RadioButton&, void); - DECL_LINK(SourceEditModified, void*); + DECL_LINK_TYPED(SourceListSelected, ListBox&, void); + DECL_LINK(SourceEditModified, void*); void ToggleSource(); void ToggleDestination(); virtual bool Close() SAL_OVERRIDE; diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx index b9d7934bd4f5..c8bbbbc5ab92 100644 --- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx +++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx @@ -79,7 +79,7 @@ private: DECL_LINK( InputRangeModified, void* ); DECL_LINK( Parameter1ValueModified, void* ); DECL_LINK( Parameter2ValueModified, void* ); - DECL_LINK( DistributionChanged, void* ); + DECL_LINK_TYPED( DistributionChanged, ListBox&, void ); DECL_LINK_TYPED( CheckChanged, CheckBox&, void ); }; diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx index 7b93cc8f46a8..a66efcf57c39 100644 --- a/sc/source/ui/inc/areasdlg.hxx +++ b/sc/source/ui/inc/areasdlg.hxx @@ -73,9 +73,9 @@ private: bool Impl_GetItem( Edit* pEd, SfxStringItem& rItem ); // Handler: - DECL_LINK( Impl_SelectHdl, ListBox* ); - DECL_LINK( Impl_ModifyHdl, formula::RefEdit* ); - DECL_LINK_TYPED( Impl_BtnHdl, Button*, void ); + DECL_LINK_TYPED( Impl_SelectHdl, ListBox&, void ); + DECL_LINK( Impl_ModifyHdl, formula::RefEdit* ); + DECL_LINK_TYPED( Impl_BtnHdl, Button*, void ); DECL_LINK_TYPED( Impl_GetFocusHdl, Control&, void ); }; diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx index ed694ad38cd8..bac09680793e 100644 --- a/sc/source/ui/inc/colorformat.hxx +++ b/sc/source/ui/inc/colorformat.hxx @@ -50,8 +50,8 @@ private: ScAddress maPos; DECL_LINK_TYPED(OkBtnHdl, Button*, void); - DECL_LINK(TypeSelectHdl, void*); - DECL_LINK(PosSelectHdl, void*); + DECL_LINK_TYPED(TypeSelectHdl, ListBox&, void); + DECL_LINK_TYPED(PosSelectHdl, ListBox&, void); void Init(); diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index bac7c365f590..affbeff01f61 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -91,9 +91,9 @@ public: DECL_LINK_TYPED( ScrollHdl, ScrollBar*, void ); DECL_LINK( EntrySelectHdl, ScCondFrmtEntry* ); - DECL_LINK( TypeListHdl, ListBox*); - DECL_LINK_TYPED( AfterTypeListHdl, void*, void); - DECL_LINK( ColFormatTypeHdl, ListBox*); + DECL_LINK_TYPED( TypeListHdl, ListBox&, void ); + DECL_LINK_TYPED( AfterTypeListHdl, void*, void ); + DECL_LINK_TYPED( ColFormatTypeHdl, ListBox&, void ); }; class ScCondFormatDlg : public ScAnyRefDlg diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx index 3fd588dee14f..8eebe484cf07 100644 --- a/sc/source/ui/inc/condformatdlgentry.hxx +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -100,8 +100,8 @@ class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener virtual OUString GetExpressionString() SAL_OVERRIDE; void Init(ScCondFormatDlg* pDialogParent); - DECL_LINK( StyleSelectHdl, void* ); - DECL_LINK( ConditionTypeSelectHdl, void* ); + DECL_LINK_TYPED( StyleSelectHdl, ListBox&, void ); + DECL_LINK_TYPED( ConditionTypeSelectHdl, ListBox&, void ); DECL_LINK( OnEdChanged, Edit* ); // Searches the lookup table for the entry position, given condition mode @@ -142,7 +142,7 @@ class ScFormulaFrmtEntry : public ScCondFrmtEntry virtual OUString GetExpressionString() SAL_OVERRIDE; void Init(ScCondFormatDlg* pDialogParent); - DECL_LINK( StyleSelectHdl, void* ); + DECL_LINK_TYPED( StyleSelectHdl, ListBox&, void ); public: ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL ); @@ -176,7 +176,7 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry virtual OUString GetExpressionString() SAL_OVERRIDE; void Init(); - DECL_LINK( EntryTypeHdl, ListBox* ); + DECL_LINK_TYPED( EntryTypeHdl, ListBox&, void ); public: ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL ); virtual ~ScColorScale2FrmtEntry(); @@ -211,7 +211,7 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry virtual OUString GetExpressionString() SAL_OVERRIDE; void Init(); - DECL_LINK( EntryTypeHdl, ListBox* ); + DECL_LINK_TYPED( EntryTypeHdl, ListBox&, void ); public: ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL ); virtual ~ScColorScale3FrmtEntry(); @@ -243,7 +243,7 @@ class ScDataBarFrmtEntry : public ScCondFrmtEntry void Init(); DECL_LINK_TYPED( OptionBtnHdl, Button*, void ); - DECL_LINK( DataBarTypeSelectHdl, void* ); + DECL_LINK_TYPED( DataBarTypeSelectHdl, ListBox&, void ); public: ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = NULL ); virtual ~ScDataBarFrmtEntry(); @@ -274,7 +274,7 @@ protected: private: void Init(); - DECL_LINK( StyleSelectHdl, void* ); + DECL_LINK_TYPED( StyleSelectHdl, ListBox&, void ); VclPtr<ListBox> maLbDateEntry; VclPtr<FixedText> maFtStyle; @@ -299,7 +299,7 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry void Init(); - DECL_LINK( IconSetTypeHdl, void* ); + DECL_LINK_TYPED( IconSetTypeHdl, ListBox&, void ); public: ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = NULL ); diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx index e875010bfda9..07ea7c215ff3 100644 --- a/sc/source/ui/inc/consdlg.hxx +++ b/sc/source/ui/inc/consdlg.hxx @@ -95,7 +95,7 @@ private: DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( GetFocusHdl, Control&, void ); DECL_LINK( ModifyHdl, formula::RefEdit* ); - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); static ScSubTotalFunc LbPosToFunc( sal_Int32 nPos ); static sal_Int32 FuncToLbPos( ScSubTotalFunc eFunc ); diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx index 8e84a04daaea..8eaeb59e8957 100644 --- a/sc/source/ui/inc/crnrdlg.hxx +++ b/sc/source/ui/inc/crnrdlg.hxx @@ -81,7 +81,7 @@ private: DECL_LINK_TYPED( OkBtnHdl, Button*, void ); DECL_LINK_TYPED( AddBtnHdl, Button*, void ); DECL_LINK_TYPED( RemoveBtnHdl, Button*, void ); - DECL_LINK( Range1SelectHdl, void * ); + DECL_LINK_TYPED( Range1SelectHdl, ListBox&, void ); DECL_LINK( Range1DataModifyHdl, void * ); DECL_LINK_TYPED( ColClickHdl, Button*, void ); DECL_LINK_TYPED( RowClickHdl, Button*, void ); diff --git a/sc/source/ui/inc/dapidata.hxx b/sc/source/ui/inc/dapidata.hxx index 02c76e0dc8ae..3ddb187edcbb 100644 --- a/sc/source/ui/inc/dapidata.hxx +++ b/sc/source/ui/inc/dapidata.hxx @@ -36,7 +36,7 @@ private: void FillObjects(); - DECL_LINK( SelectHdl, void* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); public: ScDataPilotDatabaseDlg(vcl::Window* pParent); diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx index 3749cb4bf05c..988e8aea7e82 100644 --- a/sc/source/ui/inc/dwfunctr.hxx +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -83,7 +83,7 @@ private: DECL_LINK_TYPED( SetSelectionHdl, ListBox&, void ); DECL_LINK_TYPED( SetSelectionClickHdl, Button*, void ); - DECL_LINK( SelHdl, ListBox* ); + DECL_LINK_TYPED( SelHdl, ListBox&, void ); DECL_LINK_TYPED( SetSplitHdl, ScPrivatSplit&, void ); DECL_LINK_TYPED( TimerHdl, Idle*, void ); diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx index 59bf701f9ea2..a7c22e073e09 100644 --- a/sc/source/ui/inc/filtdlg.hxx +++ b/sc/source/ui/inc/filtdlg.hxx @@ -145,7 +145,7 @@ private: ScQueryItem* GetOutputItem (); // Handler: - DECL_LINK( LbSelectHdl, ListBox* ); + DECL_LINK_TYPED( LbSelectHdl, ListBox&, void ); DECL_LINK( ValModifyHdl, ComboBox* ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); DECL_LINK_TYPED( EndDlgHdl, Button*, void ); @@ -213,7 +213,7 @@ private: const ScRange& rSource ); // Handler - DECL_LINK( FilterAreaSelHdl, ListBox* ); + DECL_LINK_TYPED( FilterAreaSelHdl, ListBox&, void ); DECL_LINK( FilterAreaModHdl, formula::RefEdit* ); DECL_LINK_TYPED( EndDlgHdl, Button*, void ); diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx index e5626ba48435..4016a5b3df4a 100644 --- a/sc/source/ui/inc/foptmgr.hxx +++ b/sc/source/ui/inc/foptmgr.hxx @@ -78,7 +78,7 @@ private: // Handler: DECL_LINK( EdAreaModifyHdl, Edit* ); - DECL_LINK( LbAreaSelHdl, ListBox* ); + DECL_LINK_TYPED( LbAreaSelHdl, ListBox&, void ); DECL_LINK_TYPED( BtnCopyResultHdl, CheckBox&, void ); }; diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx index fcf2638e295c..942ee3045f80 100644 --- a/sc/source/ui/inc/funcpage.hxx +++ b/sc/source/ui/inc/funcpage.hxx @@ -61,8 +61,8 @@ private: const ScFuncDesc* aLRUList[LRU_MAX]; - DECL_LINK( SelHdl, ListBox* ); - DECL_LINK( DblClkHdl, ListBox* ); + DECL_LINK_TYPED( SelHdl, ListBox&, void ); + DECL_LINK_TYPED( DblClkHdl, ListBox&, void ); protected: diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx index 647512aa07d7..13ad0f9ca4ac 100644 --- a/sc/source/ui/inc/instbdlg.hxx +++ b/sc/source/ui/inc/instbdlg.hxx @@ -93,7 +93,7 @@ private: DECL_LINK_TYPED(BrowseHdl_Impl, Button*, void); DECL_LINK_TYPED(ChoiceHdl_Impl, Button*, void); - DECL_LINK(SelectHdl_Impl, 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); diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx index 610ea8c3d8d7..8204e7980795 100644 --- a/sc/source/ui/inc/linkarea.hxx +++ b/sc/source/ui/inc/linkarea.hxx @@ -52,7 +52,7 @@ private: DECL_LINK(FileHdl, void *); DECL_LINK_TYPED(BrowseHdl, Button*, void); - DECL_LINK(RangeHdl, void *); + DECL_LINK_TYPED(RangeHdl, ListBox&, void); DECL_LINK_TYPED(ReloadHdl, Button*, void); DECL_LINK_TYPED( DialogClosedHdl, sfx2::FileDialogHelper*, void ); diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx index a758072bb435..99cd8fe51481 100644 --- a/sc/source/ui/inc/mvtabdlg.hxx +++ b/sc/source/ui/inc/mvtabdlg.hxx @@ -76,7 +76,7 @@ private: void Init (); void InitDocListBox (); DECL_LINK_TYPED( OkHdl, Button*, void ); - DECL_LINK( SelHdl, ListBox * ); + DECL_LINK_TYPED( SelHdl, ListBox&, void ); DECL_LINK_TYPED( CheckBtnHdl, RadioButton&, void ); DECL_LINK( CheckNameHdl, Edit * ); }; diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx index 332a0d7b0b0d..09526bde2b04 100644 --- a/sc/source/ui/inc/namedlg.hxx +++ b/sc/source/ui/inc/namedlg.hxx @@ -108,7 +108,7 @@ private: DECL_LINK_TYPED( EdModifyCheckBoxHdl, CheckBox&, void ); DECL_LINK_TYPED( AssignGetFocusHdl, Control&, void ); DECL_LINK_TYPED( SelectionChangedHdl_Impl, SvTreeListBox*, void ); - DECL_LINK( ScopeChangedHdl, void* ); + DECL_LINK_TYPED( ScopeChangedHdl, ListBox&, void ); protected: virtual void RefInputDone( bool bForced = false ) SAL_OVERRIDE; diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx index 6bdb0dd1b64d..47594807be3f 100644 --- a/sc/source/ui/inc/optsolver.hxx +++ b/sc/source/ui/inc/optsolver.hxx @@ -198,7 +198,7 @@ private: DECL_LINK_TYPED( CursorDownHdl, ScCursorRefEdit&, void ); DECL_LINK( CondModifyHdl, void* ); DECL_LINK( TargetModifyHdl, void* ); - DECL_LINK( SelectHdl, void* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); }; class ScSolverProgressDialog : public ModelessDialog diff --git a/sc/source/ui/inc/pfiltdlg.hxx b/sc/source/ui/inc/pfiltdlg.hxx index 07480b3d3187..2e74c0a8e809 100644 --- a/sc/source/ui/inc/pfiltdlg.hxx +++ b/sc/source/ui/inc/pfiltdlg.hxx @@ -90,7 +90,7 @@ private: sal_uInt16 GetFieldSelPos ( SCCOL nField ); // Handler: - DECL_LINK( LbSelectHdl, ListBox* ); + DECL_LINK_TYPED( LbSelectHdl, ListBox&, void ); DECL_LINK( ValModifyHdl, ComboBox* ); DECL_LINK_TYPED( CheckBoxHdl, Button*, void ); }; diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index ce2b8b6cbe68..c26316bd12d4 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -74,7 +74,7 @@ private: /** Searches for a listbox entry, starts search at specified position. */ sal_Int32 FindBaseItemPos( const OUString& rEntry, sal_Int32 nStartPos ) const; - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( DblClickHdl, ListBox&, void ); private: @@ -153,7 +153,7 @@ private: DECL_LINK_TYPED( RadioClickHdl, Button*, void ); DECL_LINK_TYPED( CheckHdl, Button*, void ); - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); private: VclPtr<ListBox> m_pLbSortBy; diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx index e43a1fb7f1b7..097416347eba 100644 --- a/sc/source/ui/inc/scuiasciiopt.hxx +++ b/sc/source/ui/inc/scuiasciiopt.hxx @@ -100,12 +100,12 @@ private: void UpdateVertical(); inline bool Seek( sal_uLong nPos ); // synced to and from mnStreamPos - DECL_LINK( CharSetHdl, SvxTextEncodingBox* ); + DECL_LINK_TYPED( CharSetHdl, ListBox&, void ); DECL_LINK( FirstRowHdl, NumericField* ); DECL_LINK_TYPED( RbSepFixHdl, Button*, void ); DECL_LINK( SeparatorHdl, Control* ); DECL_LINK_TYPED( SeparatorClickHdl, Button*, void ); - DECL_LINK( LbColTypeHdl, ListBox* ); + 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/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx index 8ff70de3eec3..d599d4b1c5bf 100644 --- a/sc/source/ui/inc/scuiautofmt.hxx +++ b/sc/source/ui/inc/scuiautofmt.hxx @@ -65,7 +65,7 @@ private: DECL_LINK_TYPED( CheckHdl, Button*, void ); DECL_LINK_TYPED( AddHdl, Button*, void ); DECL_LINK_TYPED( RemoveHdl, Button*, void ); - DECL_LINK( SelFmtHdl, void * ); + DECL_LINK_TYPED( SelFmtHdl, ListBox&, void ); DECL_LINK_TYPED( CloseHdl, Button *, void ); DECL_LINK_TYPED( DblClkHdl, ListBox&, void ); DECL_LINK_TYPED( RenameHdl, Button*, void ); diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx index 4e9e06b71c62..44b583b123f1 100644 --- a/sc/source/ui/inc/scuitphfedit.hxx +++ b/sc/source/ui/inc/scuitphfedit.hxx @@ -97,7 +97,7 @@ private: bool IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj); static bool IsDateEntry(EditTextObject* pTextObj); static bool IsExtFileNameEntry(EditTextObject* pTextObj); - DECL_LINK( ListHdl_Impl, ListBox* ); + DECL_LINK_TYPED( ListHdl_Impl, ListBox&, void); DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_STATIC_LINK_TYPED( ScHFEditPage, MenuHdl, ScExtIButton&, void ); }; diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx index c2bcbb4c6b7b..6d0efd43dfc4 100644 --- a/sc/source/ui/inc/solveroptions.hxx +++ b/sc/source/ui/inc/solveroptions.hxx @@ -45,7 +45,7 @@ class ScSolverOptionsDialog : public ModalDialog OUString maEngine; com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> maProperties; - DECL_LINK( EngineSelectHdl, void* ); + DECL_LINK_TYPED( EngineSelectHdl, ListBox&, void ); DECL_LINK_TYPED( SettingsSelHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( SettingsDoubleClickHdl, SvTreeListBox*, bool ); DECL_LINK_TYPED( ButtonHdl, Button*, void ); diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx index d642b2bea328..8ce953db4c86 100644 --- a/sc/source/ui/inc/tpsort.hxx +++ b/sc/source/ui/inc/tpsort.hxx @@ -94,7 +94,7 @@ private: void SetLastSortKey( sal_uInt16 nItem ); // Handler ------------------------ - DECL_LINK( SelectHdl, ListBox * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); }; // Sort Options @@ -165,10 +165,10 @@ private: // Handler ------------------------ DECL_LINK_TYPED( EnableHdl, Button*, void ); - DECL_LINK( SelOutPosHdl, ListBox * ); + DECL_LINK_TYPED( SelOutPosHdl, ListBox&, void ); void EdOutPosModHdl ( Edit* pEd ); DECL_LINK_TYPED( SortDirHdl, Button *, void ); - DECL_LINK( FillAlgorHdl, void * ); + DECL_LINK_TYPED( FillAlgorHdl, ListBox&, void ); }; #endif // INCLUDED_SC_SOURCE_UI_INC_TPSORT_HXX diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx index 627f176dca5a..d6fdccc35e48 100644 --- a/sc/source/ui/inc/tpsubt.hxx +++ b/sc/source/ui/inc/tpsubt.hxx @@ -70,9 +70,10 @@ private: sal_uInt16 GetFieldSelPos ( SCCOL nField ); // Handler ------------------------ - DECL_LINK( SelectHdl, void* ); + DECL_LINK_TYPED( SelectListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( SelectTreeListBoxHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( CheckHdl, SvTreeListBox*, void ); + void SelectHdl(void *); }; class ScTpSubTotalGroup1 : public ScTpSubTotalGroup diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx index a7babb368e2a..f46c6fc2c109 100644 --- a/sc/source/ui/inc/tptable.hxx +++ b/sc/source/ui/inc/tptable.hxx @@ -75,7 +75,7 @@ private: // Handler: DECL_LINK_TYPED(PageDirHdl, Button*, void); DECL_LINK_TYPED( PageNoHdl, Button*, void ); - DECL_LINK(ScaleHdl, void *); + DECL_LINK_TYPED(ScaleHdl, ListBox&, void); }; #endif // INCLUDED_SC_SOURCE_UI_INC_TPTABLE_HXX diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx index 8195c7d45c23..70c5e769169a 100644 --- a/sc/source/ui/inc/tpusrlst.hxx +++ b/sc/source/ui/inc/tpusrlst.hxx @@ -95,7 +95,7 @@ private: const ScRefAddress& rEndPos ); // Handler: - DECL_LINK( LbSelectHdl, ListBox* ); + DECL_LINK_TYPED( LbSelectHdl, ListBox&, void ); DECL_LINK_TYPED( BtnClickHdl, Button*, void ); DECL_LINK( EdEntriesModHdl, VclMultiLineEdit* ); }; diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx index 96d1e1b7acbe..288fda0b2428 100644 --- a/sc/source/ui/inc/tpview.hxx +++ b/sc/source/ui/inc/tpview.hxx @@ -61,8 +61,8 @@ class ScTpContentOptions : public SfxTabPage ScViewOptions* pLocalOptions; void InitGridOpt(); - DECL_LINK( GridHdl, ListBox* ); - DECL_LINK( SelLbObjHdl, ListBox* ); + DECL_LINK_TYPED( GridHdl, ListBox&, void ); + DECL_LINK_TYPED( SelLbObjHdl, ListBox&, void ); DECL_LINK_TYPED( CBHdl, Button*, void ); ScTpContentOptions( vcl::Window* pParent, @@ -106,7 +106,7 @@ class ScTpLayoutOptions : public SfxTabPage SvxStringArray aUnitArr; - DECL_LINK(MetricHdl, void *); + DECL_LINK_TYPED(MetricHdl, ListBox&, void ); DECL_LINK_TYPED( AlignHdl, Button*, void ); ScDocument *pDoc; diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index 9251a899771f..c86719d80985 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -100,7 +100,7 @@ private: void SetFirstFormula( const OUString& rFmlaStr ); void SetSecondFormula( const OUString& rFmlaStr ); - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); DECL_LINK_TYPED(CheckHdl, Button*, void); VclPtr<ListBox> m_pLbAllow; @@ -272,9 +272,6 @@ private: void Init(); - // Handler ------------------------ - // DECL_LINK( SelectHdl, ListBox * ); - public: ScTPValidationHelp( vcl::Window* pParent, const SfxItemSet& rArgSet ); virtual ~ScTPValidationHelp(); @@ -298,7 +295,7 @@ private: void Init(); // Handler ------------------------ - DECL_LINK(SelectActionHdl, void *); + DECL_LINK_TYPED(SelectActionHdl, ListBox&, void); DECL_LINK_TYPED(ClickSearchHdl, Button*, void); public: diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index 5cd874c5e8f1..169e4bf05acf 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -153,7 +153,7 @@ void ScColRowNameRangesDlg::Init() pEdAssign->GrabFocus(); pRbAssign->Enable(); - Range1SelectHdl( 0 ); + Range1SelectHdl( *pLbRange.get() ); } // set data range of a labeled range to default values and set the @@ -563,7 +563,7 @@ IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, AddBtnHdl, Button*, void) pEdAssign2->SetText( EMPTY_OUSTRING ); theCurArea = ScRange(); theCurData = theCurArea; - Range1SelectHdl( 0 ); + Range1SelectHdl( *pLbRange.get() ); } else { @@ -631,13 +631,13 @@ IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, RemoveBtnHdl, Button*, void) pBtnColHead->Check(); pBtnRowHead->Check( false ); pEdAssign2->SetText( EMPTY_OUSTRING ); - Range1SelectHdl( 0 ); + Range1SelectHdl( *pLbRange.get() ); } } } // handler called when a row in the listbox is selected, updates form input fields -IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl) +IMPL_LINK_NOARG_TYPED(ScColRowNameRangesDlg, Range1SelectHdl, ListBox&, void) { sal_Int32 nSelectPos = pLbRange->GetSelectEntryPos(); const sal_Int32 nCnt = pLbRange->GetEntryCount(); @@ -702,8 +702,6 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl) pEdAssign->Enable(); pRbAssign->Enable(); - - return 0; } // handler called when the label range has changed diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 8cef9ad6f2d6..683ccd3d9dbb 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -286,10 +286,9 @@ IMPL_LINK_NOARG_TYPED(ScInsertTableDlg, BrowseHdl_Impl, Button*, void) pDocInserter->StartExecuteModal( LINK( this, ScInsertTableDlg, DialogClosedHdl ) ); } -IMPL_LINK_NOARG(ScInsertTableDlg, SelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(ScInsertTableDlg, SelectHdl_Impl, ListBox&, void) { DoEnable_Impl(); - return 0; } void ScInsertTableDlg::DoEnable_Impl() diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index d5f5b01fee4d..b7eae20364d3 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -197,10 +197,9 @@ void ScLinkedAreaDlg::InitFromOldLink( const OUString& rFile, const OUString& rF UpdateEnable(); } -IMPL_LINK_NOARG(ScLinkedAreaDlg, RangeHdl) +IMPL_LINK_NOARG_TYPED(ScLinkedAreaDlg, RangeHdl, ListBox&, void) { UpdateEnable(); - return 0; } IMPL_LINK_NOARG_TYPED(ScLinkedAreaDlg, ReloadHdl, Button*, void) diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index e1f9226ae5d9..cc7f92ebe6f5 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -211,7 +211,7 @@ void ScMoveTableDlg::Init() pEdTabName->Enable(false); pFtWarn->Hide(); InitDocListBox(); - SelHdl( pLbDoc ); + SelHdl( *pLbDoc.get() ); } void ScMoveTableDlg::InitDocListBox() @@ -294,9 +294,9 @@ IMPL_LINK_NOARG_TYPED(ScMoveTableDlg, OkHdl, Button*, void) EndDialog( RET_OK ); } -IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb ) +IMPL_LINK_TYPED( ScMoveTableDlg, SelHdl, ListBox&, rLb, void ) { - if ( pLb == pLbDoc ) + if ( &rLb == pLbDoc ) { ScDocument* pDoc = GetSelectedDoc(); OUString aName; @@ -317,8 +317,6 @@ IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb ) pLbTable->SelectEntryPos( 0 ); ResetRenameInput(); } - - return 0; } IMPL_LINK( ScMoveTableDlg, CheckNameHdl, Edit *, pEdt ) diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 35286f880f73..77fb82af60cc 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -716,12 +716,11 @@ IMPL_LINK_NOARG(ScOptSolverDlg, CondModifyHdl) return 0; } -IMPL_LINK_NOARG(ScOptSolverDlg, SelectHdl) +IMPL_LINK_NOARG_TYPED(ScOptSolverDlg, SelectHdl, ListBox&, void) { // select handler for operator list boxes, just to enable/disable "delete" buttons ReadConditions(); EnableButtons(); - return 0; } IMPL_LINK_NOARG_TYPED(ScOptSolverDlg, ScrollHdl, ScrollBar*, void) diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index 73ea8a542b18..e8190e49cc17 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -251,7 +251,7 @@ IMPL_LINK_NOARG_TYPED(ScAutoFormatDlg, AddHdl, Button*, void) bCoreDataChanged = true; } - SelFmtHdl( 0 ); + SelFmtHdl( *m_pLbFormat.get() ); bOk = true; } else @@ -305,11 +305,11 @@ IMPL_LINK_NOARG_TYPED(ScAutoFormatDlg, RemoveHdl, Button*, void) pFormat->erase(it); nIndex--; - SelFmtHdl( 0 ); + SelFmtHdl( *m_pLbFormat.get() ); } } - SelFmtHdl( 0 ); + SelFmtHdl( *m_pLbFormat.get() ); } IMPL_LINK_NOARG_TYPED(ScAutoFormatDlg, RenameHdl, Button*, void) @@ -374,7 +374,7 @@ IMPL_LINK_NOARG_TYPED(ScAutoFormatDlg, RenameHdl, Button*, void) bCoreDataChanged = true; } - SelFmtHdl( 0 ); + SelFmtHdl( *m_pLbFormat.get() ); bOk = true; bFmtRenamed = true; } @@ -393,7 +393,7 @@ IMPL_LINK_NOARG_TYPED(ScAutoFormatDlg, RenameHdl, Button*, void) } } -IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl) +IMPL_LINK_NOARG_TYPED(ScAutoFormatDlg, SelFmtHdl, ListBox&, void) { nIndex = m_pLbFormat->GetSelectEntryPos(); UpdateChecks(); @@ -411,8 +411,6 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl) ScAutoFormatData* p = pFormat->findByIndex(nIndex); m_pWndPreview->NotifyChange(p); - - return 0; } OUString ScAutoFormatDlg::GetCurrFormatName() diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index e01a7a9fef0c..fb58e94c290d 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -361,7 +361,7 @@ IMPL_LINK_NOARG_TYPED(ScSolverOptionsDialog, SettingsDoubleClickHdl, SvTreeListB return false; } -IMPL_LINK_NOARG(ScSolverOptionsDialog, EngineSelectHdl) +IMPL_LINK_NOARG_TYPED(ScSolverOptionsDialog, EngineSelectHdl, ListBox&, void) { const sal_Int32 nSelectPos = m_pLbEngine->GetSelectEntryPos(); if ( nSelectPos < maImplNames.getLength() ) @@ -374,7 +374,6 @@ IMPL_LINK_NOARG(ScSolverOptionsDialog, EngineSelectHdl) FillListBox(); // using maProperties } } - return 0; } IMPL_LINK_NOARG_TYPED(ScSolverOptionsDialog, SettingsSelHdl, SvTreeListBox*, void) diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index be5178409d9f..7e5fdd9c044b 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -524,10 +524,9 @@ IMPL_LINK_NOARG_TYPED(ScNameDlg, SelectionChangedHdl_Impl, SvTreeListBox*, void) SelectionChanged(); } -IMPL_LINK_NOARG(ScNameDlg, ScopeChangedHdl) +IMPL_LINK_NOARG_TYPED(ScNameDlg, ScopeChangedHdl, ListBox&, void) { ScopeChanged(); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index 72b962ec569d..bef3220fc23b 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -222,18 +222,15 @@ IMPL_LINK_TYPED(ScCalcOptionsDialog, AsZeroModifiedHdl, Button*, pCheckBox, void maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero = static_cast<CheckBox*>(pCheckBox)->IsChecked(); } -IMPL_LINK(ScCalcOptionsDialog, ConversionModifiedHdl, ListBox*, pConv ) +IMPL_LINK_TYPED(ScCalcOptionsDialog, ConversionModifiedHdl, ListBox&, rConv, void ) { - - maConfig.meStringConversion = (ScCalcConfig::StringConversion)pConv->GetSelectEntryPos(); + maConfig.meStringConversion = (ScCalcConfig::StringConversion)rConv.GetSelectEntryPos(); CoupleEmptyAsZeroToStringConversion(); - return 0; } -IMPL_LINK(ScCalcOptionsDialog, SyntaxModifiedHdl, ListBox*, pSyntax) +IMPL_LINK_TYPED(ScCalcOptionsDialog, SyntaxModifiedHdl, ListBox&, rSyntax, void) { - maConfig.SetStringRefSyntax(toAddressConvention(pSyntax->GetSelectEntryPos())); - return 0; + maConfig.SetStringRefSyntax(toAddressConvention(rSyntax.GetSelectEntryPos())); } IMPL_LINK_TYPED(ScCalcOptionsDialog, CBUseOpenCLHdl, Button*, pCheckBox, void) diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx index f7a2040d6657..7f9923bda8f3 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.hxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx @@ -43,8 +43,8 @@ public: DECL_LINK( EditModifiedHdl, Edit * ); DECL_STATIC_LINK_TYPED( ScCalcOptionsDialog, TestClickHdl, Button*, void ); DECL_LINK_TYPED( AsZeroModifiedHdl, Button*, void); - DECL_LINK( ConversionModifiedHdl, ListBox*); - DECL_LINK( SyntaxModifiedHdl, ListBox*); + DECL_LINK_TYPED( ConversionModifiedHdl, ListBox&, void); + DECL_LINK_TYPED( SyntaxModifiedHdl, ListBox&, void); DECL_LINK_TYPED( CBUseOpenCLHdl, Button*, void); DECL_LINK( SpinOpenCLMinSizeHdl, NumericField*); diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 2c96167fb022..864b871db90b 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -457,9 +457,9 @@ void ScTpUserLists::RemoveList( size_t nList ) // Handler: -IMPL_LINK( ScTpUserLists, LbSelectHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScTpUserLists, LbSelectHdl, ListBox&, rLb, void ) { - if ( pLb == mpLbLists ) + if ( &rLb == mpLbLists ) { sal_Int32 nSelPos = mpLbLists->GetSelectEntryPos(); if ( nSelPos != LISTBOX_ENTRY_NOTFOUND ) @@ -476,8 +476,6 @@ IMPL_LINK( ScTpUserLists, LbSelectHdl, ListBox*, pLb ) UpdateEntries( nSelPos ); } } - - return 0; } IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) @@ -515,7 +513,7 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) if ( mpLbLists->GetEntryCount() > 0 ) { mpLbLists->SelectEntryPos( nCancelPos ); - LbSelectHdl( mpLbLists ); + LbSelectHdl( *mpLbLists.get() ); mpFtLists->Enable(); mpLbLists->Enable(); } @@ -552,7 +550,7 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) AddNewList( theEntriesStr ); UpdateUserListBox(); mpLbLists->SelectEntryPos( mpLbLists->GetEntryCount()-1 ); - LbSelectHdl( mpLbLists ); + LbSelectHdl( *mpLbLists.get() ); mpFtLists->Enable(); mpLbLists->Enable(); } @@ -561,7 +559,7 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) if ( mpLbLists->GetEntryCount() > 0 ) { mpLbLists->SelectEntryPos( nCancelPos ); - LbSelectHdl( mpLbLists ); + LbSelectHdl( *mpLbLists.get() ); mpLbLists->Enable(); mpLbLists->Enable(); } @@ -589,7 +587,7 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) else { mpLbLists->SelectEntryPos( 0 ); - LbSelectHdl( mpLbLists ); + LbSelectHdl( *mpLbLists.get() ); } mpBtnNew->Show(); @@ -636,7 +634,7 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) ( nRemovePos >= mpLbLists->GetEntryCount() ) ? mpLbLists->GetEntryCount()-1 : nRemovePos ); - LbSelectHdl( mpLbLists ); + LbSelectHdl( *mpLbLists.get() ); } else { @@ -693,7 +691,7 @@ IMPL_LINK_TYPED( ScTpUserLists, BtnClickHdl, Button*, pBtn, void ) CopyListFromArea( theStartPos, theEndPos ); UpdateUserListBox(); mpLbLists->SelectEntryPos( mpLbLists->GetEntryCount()-1 ); - LbSelectHdl( mpLbLists ); + LbSelectHdl( *mpLbLists.get() ); mpEdCopyFrom->SetText( theAreaStr ); mpEdCopyFrom->Disable(); mpBtnCopy->Disable(); diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index c2db50993c06..740702a5d2e2 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -69,7 +69,7 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent, get(pOutlineCB,"outline"); SetExchangeSupport(); - Link<> aSelObjHdl(LINK( this, ScTpContentOptions, SelLbObjHdl ) ); + Link<ListBox&,void> aSelObjHdl(LINK( this, ScTpContentOptions, SelLbObjHdl ) ); pObjGrfLB-> SetSelectHdl(aSelObjHdl); pDiagramLB-> SetSelectHdl(aSelObjHdl); pDrawLB-> SetSelectHdl(aSelObjHdl); @@ -244,20 +244,18 @@ SfxTabPage::sfxpg ScTpContentOptions::DeactivatePage( SfxItemSet* pSetP ) return SfxTabPage::LEAVE_PAGE; } -IMPL_LINK( ScTpContentOptions, SelLbObjHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScTpContentOptions, SelLbObjHdl, ListBox&, rLb, void ) { - const sal_Int32 nSelPos = pLb->GetSelectEntryPos(); + const sal_Int32 nSelPos = rLb.GetSelectEntryPos(); ScVObjMode eMode = ScVObjMode(nSelPos); ScVObjType eType = VOBJ_TYPE_OLE; - if ( pLb == pDiagramLB ) + if ( &rLb == pDiagramLB ) eType = VOBJ_TYPE_CHART; - else if ( pLb == pDrawLB ) + else if ( &rLb == pDrawLB ) eType = VOBJ_TYPE_DRAW; pLocalOptions->SetObjMode( eType, eMode ); - - return 0; } IMPL_LINK_TYPED( ScTpContentOptions, CBHdl, Button*, pBtn, void ) @@ -358,9 +356,9 @@ void ScTpContentOptions::InitGridOpt() pColorLB->SelectEntryPos( pColorLB->InsertEntry( aCol, aName ) ); } -IMPL_LINK( ScTpContentOptions, GridHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScTpContentOptions, GridHdl, ListBox&, rLb, void ) { - sal_Int32 nSelPos = pLb->GetSelectEntryPos(); + sal_Int32 nSelPos = rLb.GetSelectEntryPos(); bool bGrid = ( nSelPos <= 1 ); bool bGridOnTop = ( nSelPos == 1 ); @@ -368,7 +366,6 @@ IMPL_LINK( ScTpContentOptions, GridHdl, ListBox*, pLb ) pColorLB->Enable(bGrid); pLocalOptions->SetOption( VOPT_GRID, bGrid ); pLocalOptions->SetOption( VOPT_GRID_ONTOP, bGridOnTop ); - return 0; } ScTpLayoutOptions::ScTpLayoutOptions( vcl::Window* pParent, @@ -681,7 +678,7 @@ SfxTabPage::sfxpg ScTpLayoutOptions::DeactivatePage( SfxItemSet* pSetP ) return SfxTabPage::LEAVE_PAGE; } -IMPL_LINK_NOARG(ScTpLayoutOptions, MetricHdl) +IMPL_LINK_NOARG_TYPED(ScTpLayoutOptions, MetricHdl, ListBox&, void) { const sal_Int32 nMPos = m_pUnitLB->GetSelectEntryPos(); if(nMPos != LISTBOX_ENTRY_NOTFOUND) @@ -692,8 +689,6 @@ IMPL_LINK_NOARG(ScTpLayoutOptions, MetricHdl) ::SetFieldUnit( *m_pTabMF, eFieldUnit ); m_pTabMF->SetValue( m_pTabMF->Normalize( nVal ), FUNIT_TWIP ); } - - return 0; } IMPL_LINK_TYPED( ScTpLayoutOptions, AlignHdl, Button*, pBox, void ) diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 334a8d4b9882..5d9c573117f6 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -539,8 +539,9 @@ IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_GetFocusHdl, Control&, rCtrl, void ) } } -IMPL_LINK( ScPrintAreasDlg, Impl_SelectHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( ScPrintAreasDlg, Impl_SelectHdl, ListBox&, rLb, void ) { + ListBox* pLb = &rLb; const sal_Int32 nSelPos = pLb->GetSelectEntryPos(); Edit* pEd = NULL; @@ -562,7 +563,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_SelectHdl, ListBox*, pLb ) else if( pLb == pLbRepeatRow ) pEd = pEdRepeatRow; else - return 0; + return; // fill edit field according to list box selection if( (nSelPos == 0) || (nSelPos == nAllSheetPos) ) @@ -571,8 +572,6 @@ IMPL_LINK( ScPrintAreasDlg, Impl_SelectHdl, ListBox*, pLb ) pLb->SelectEntryPos( 0 ); else if( nSelPos >= nFirstCustomPos ) pEd->SetText( *static_cast< OUString* >( pLb->GetEntryData( nSelPos ) ) ); - - return 0; } IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd ) diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index 2fb3a486d794..d33cea554748 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -771,9 +771,9 @@ void ScHFEditPage::ClearTextAreas() // Handler: -IMPL_LINK( ScHFEditPage, ListHdl_Impl, ListBox*, pList ) +IMPL_LINK_TYPED( ScHFEditPage, ListHdl_Impl, ListBox&, rList, void ) { - if ( pList && pList == m_pLbDefined ) + if ( &rList == m_pLbDefined ) { ScHFEntryId eSel = static_cast<ScHFEntryId>(m_pLbDefined->GetSelectEntryPos()); if(!m_pLbDefined->IsTravelSelect()) @@ -789,7 +789,6 @@ IMPL_LINK( ScHFEditPage, ListHdl_Impl, ListBox*, pList ) ProcessDefinedListSel(eSel, true); } } - return 0; } IMPL_LINK_TYPED( ScHFEditPage, ClickHdl, Button*, pBtn, void ) diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index f65472fd8405..d0776bdfd3ba 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -67,7 +67,6 @@ static bool lcl_PutBoolItem( sal_uInt16 nWhich, #define PAGENO_HDL LINK(this,ScTablePage,PageNoHdl) #define PAGEDIR_HDL LINK(this,ScTablePage,PageDirHdl) -#define SCALE_HDL LINK(this,ScTablePage,ScaleHdl) #define WAS_DEFAULT(w,s) (SfxItemState::DEFAULT==(s).GetItemState((w),true)) #define GET_BOOL(sid,set) static_cast<const SfxBoolItem&>((set).Get(GetWhich((sid)))).GetValue() @@ -112,7 +111,7 @@ ScTablePage::ScTablePage( vcl::Window* pParent, const SfxItemSet& rCoreAttrs ) : m_pBtnPageNo->SetClickHdl( PAGENO_HDL ); m_pBtnTopDown->SetClickHdl( PAGEDIR_HDL ); m_pBtnLeftRight->SetClickHdl( PAGEDIR_HDL ); - m_pLbScaleMode->SetSelectHdl( SCALE_HDL ); + m_pLbScaleMode->SetSelectHdl( LINK(this,ScTablePage,ScaleHdl) ); } @@ -228,7 +227,7 @@ void ScTablePage::Reset( const SfxItemSet* rCoreSet ) } PageDirHdl( NULL ); - ScaleHdl( NULL ); + ScaleHdl( *m_pLbScaleMode.get() ); // remember for FillItemSet m_pBtnFormulas->SaveValue(); @@ -376,7 +375,7 @@ IMPL_LINK_TYPED( ScTablePage, PageNoHdl, Button*, pBtn, void ) m_pEdPageNo->Disable(); } -IMPL_LINK_NOARG(ScTablePage, ScaleHdl) +IMPL_LINK_NOARG_TYPED(ScTablePage, ScaleHdl, ListBox&, void) { // controls for Box "Reduce/enlarge" m_pBxScaleAll->Show(m_pLbScaleMode->GetSelectEntryPos() == SC_TPTABLE_SCALE_PERCENT); @@ -386,8 +385,6 @@ IMPL_LINK_NOARG(ScTablePage, ScaleHdl) // controls for Box "Scale to pages" m_pBxScalePageNum->Show(m_pLbScaleMode->GetSelectEntryPos() == SC_TPTABLE_SCALE_TO_PAGES); - - return 0; } // Helper functions for FillItemSet: diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx index 31a4a0671190..fa97da227d22 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx @@ -87,13 +87,12 @@ void NumberFormatPropertyPanel::dispose() void NumberFormatPropertyPanel::Initialize() { - Link<> aLink = LINK(this, NumberFormatPropertyPanel, NumFormatSelectHdl); - mpLbCategory->SetSelectHdl ( aLink ); + mpLbCategory->SetSelectHdl ( LINK(this, NumberFormatPropertyPanel, NumFormatSelectHdl) ); mpLbCategory->SelectEntryPos(0); mpLbCategory->SetAccessibleName(OUString( "Category")); mpLbCategory->SetDropDownLineCount(mpLbCategory->GetEntryCount()); - aLink = LINK(this, NumberFormatPropertyPanel, NumFormatValueHdl); + Link<> aLink = LINK(this, NumberFormatPropertyPanel, NumFormatValueHdl); mpEdDecimals->SetModifyHdl( aLink ); mpEdLeadZeroes->SetModifyHdl( aLink ); @@ -106,16 +105,15 @@ void NumberFormatPropertyPanel::Initialize() mpTBCategory->SetAccessibleRelationLabeledBy(mpTBCategory); } -IMPL_LINK( NumberFormatPropertyPanel, NumFormatSelectHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( NumberFormatPropertyPanel, NumFormatSelectHdl, ListBox&, rBox, void ) { - const sal_Int32 nVal = pBox->GetSelectEntryPos(); + const sal_Int32 nVal = rBox.GetSelectEntryPos(); if( nVal != mnCategorySelected ) { SfxUInt16Item aItem( SID_NUMBER_TYPE_FORMAT, nVal ); GetBindings()->GetDispatcher()->Execute(SID_NUMBER_TYPE_FORMAT, SfxCallMode::RECORD, &aItem, 0L); mnCategorySelected = nVal; } - return 0L; } IMPL_LINK_NOARG_TYPED( NumberFormatPropertyPanel, NumFormatValueClickHdl, Button*, void ) diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx index efda9627f322..b03b6d0df97d 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx @@ -83,7 +83,7 @@ private: ::sfx2::sidebar::EnumContext maContext; SfxBindings* mpBindings; - DECL_LINK(NumFormatSelectHdl, ListBox*); + DECL_LINK_TYPED(NumFormatSelectHdl, ListBox&, void); DECL_LINK(NumFormatValueHdl, void*); DECL_LINK_TYPED(NumFormatValueClickHdl, Button*, void); diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index e7bbc92c5e0b..365cb5400574 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -971,7 +971,7 @@ IMPL_LINK_TYPED( SdPublishingDlg, DesignHdl, Button *, pButton, void ) } // Clickhandler for the choice of one design -IMPL_LINK_NOARG(SdPublishingDlg, DesignSelectHdl) +IMPL_LINK_NOARG_TYPED(SdPublishingDlg, DesignSelectHdl, ListBox&, void) { const sal_Int32 nPos = pPage1_Designs->GetSelectEntryPos(); m_pDesign = &m_aDesignList[nPos]; @@ -981,8 +981,6 @@ IMPL_LINK_NOARG(SdPublishingDlg, DesignSelectHdl) SetDesign(m_pDesign); UpdatePage(); - - return 0; } // Clickhandler for the delete of one design diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx index de878b01b353..1d48964dc4bc 100644 --- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx @@ -176,7 +176,7 @@ public: bool select( const OUString& rsPresetId ); private: - DECL_LINK( implSelectHdl, Control* ); + DECL_LINK_TYPED( implSelectHdl, ListBox&, void ); DECL_LINK_TYPED( implDoubleClickHdl, CategoryListBox&, void ); void onSelectEffect(); @@ -307,11 +307,10 @@ void CustomAnimationCreateTabPage::dispose() TabPage::dispose(); } -IMPL_LINK( CustomAnimationCreateTabPage, implSelectHdl, Control*, pControl ) +IMPL_LINK_TYPED( CustomAnimationCreateTabPage, implSelectHdl, ListBox&, rControl, void ) { - if( pControl == mpLBEffects ) + if( &rControl == mpLBEffects ) onSelectEffect(); - return 0; } IMPL_LINK_TYPED( CustomAnimationCreateTabPage, implDoubleClickHdl, CategoryListBox&, rControl, void ) diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 831f990f64e6..278a8bc549a1 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -109,18 +109,24 @@ public: private: std::map< sal_uInt16, OUString > maPropertyValues; VclPtr<ListBox> mpControl; + DECL_LINK_TYPED(OnSelect, ListBox&, void); + Link<> maModifyLink; }; PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const OUString& aPresetId, const Link<>& rModifyHdl ) -: PropertySubControl( nControlType ) +: PropertySubControl( nControlType ), maModifyLink(rModifyHdl) { mpControl = VclPtr<ListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN ); mpControl->SetDropDownLineCount( 10 ); - mpControl->SetSelectHdl( rModifyHdl ); + mpControl->SetSelectHdl( LINK(this, PresetPropertyBox, OnSelect) ); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_PRESETPROPERTYBOX ); setValue( rValue, aPresetId ); +} +IMPL_LINK_TYPED(PresetPropertyBox, OnSelect, ListBox&, rListBox, void) +{ + maModifyLink.Call(&rListBox); } void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId ) @@ -185,14 +191,16 @@ public: private: VclPtr<ColorListBox> mpControl; + DECL_LINK_TYPED(OnSelect, ListBox&, void); + Link<> maModifyLink; }; ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link<>& rModifyHdl ) -: PropertySubControl( nControlType ) +: PropertySubControl( nControlType ), maModifyLink(rModifyHdl) { mpControl = VclPtr<ColorListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN ); mpControl->SetDropDownLineCount( 10 ); - mpControl->SetSelectHdl( rModifyHdl ); + mpControl->SetSelectHdl( LINK(this, ColorPropertyBox, OnSelect) ); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_COLORPROPERTYBOX ); SfxObjectShell* pDocSh = SfxObjectShell::Current(); @@ -218,6 +226,11 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent } } +IMPL_LINK_TYPED(ColorPropertyBox, OnSelect, ListBox&, rListBox, void) +{ + maModifyLink.Call(&rListBox); +} + ColorPropertyBox::~ColorPropertyBox() { mpControl.disposeAndClear(); @@ -988,8 +1001,9 @@ public: virtual void dispose() SAL_OVERRIDE; void update( STLPropertySet* pSet ); - DECL_LINK( implSelectHdl, Control* ); + DECL_LINK_TYPED( implSelectHdl, ListBox&, void ); DECL_LINK_TYPED( implClickHdl, Button*, void ); + void implHdl(Control*); private: void updateControlStates(); @@ -1301,10 +1315,14 @@ void CustomAnimationEffectTabPage::updateControlStates() IMPL_LINK_TYPED( CustomAnimationEffectTabPage, implClickHdl, Button*, pBtn, void ) { - implSelectHdl(pBtn); + implHdl(pBtn); +} +IMPL_LINK_TYPED( CustomAnimationEffectTabPage, implSelectHdl, ListBox&, rListBox, void ) +{ + implHdl(&rListBox); } -IMPL_LINK( CustomAnimationEffectTabPage, implSelectHdl, Control*, pControl ) +void CustomAnimationEffectTabPage::implHdl(Control* pControl ) { if( pControl == mpLBAfterEffect ) { @@ -1334,7 +1352,6 @@ IMPL_LINK( CustomAnimationEffectTabPage, implSelectHdl, Control*, pControl ) } updateControlStates(); - return 0; } void CustomAnimationEffectTabPage::update( STLPropertySet* pSet ) @@ -1591,8 +1608,9 @@ public: void update( STLPropertySet* pSet ); - DECL_LINK( implControlHdl, Control* ); + DECL_LINK_TYPED( implControlHdl, ListBox&, void ); DECL_LINK_TYPED( implClickHdl, Button*, void ); + void implHdl(Control*); private: const STLPropertySet* mpSet; @@ -1808,18 +1826,20 @@ void CustomAnimationDurationTabPage::dispose() IMPL_LINK_TYPED( CustomAnimationDurationTabPage, implClickHdl, Button*, pBtn, void ) { - implControlHdl(pBtn); + implHdl(pBtn); +} +IMPL_LINK_TYPED( CustomAnimationDurationTabPage, implControlHdl, ListBox&, rListBox, void ) +{ + implHdl(&rListBox); } -IMPL_LINK( CustomAnimationDurationTabPage, implControlHdl, Control*, pControl ) +void CustomAnimationDurationTabPage::implHdl( Control* pControl ) { if( pControl == mpLBTrigger ) { mpRBClickSequence->Check( false ); mpRBInteractive->Check(); } - - return 0; } void CustomAnimationDurationTabPage::update( STLPropertySet* pSet ) @@ -1984,7 +2004,7 @@ public: void update( STLPropertySet* pSet ); void updateControlStates(); - DECL_LINK(implSelectHdl, void *); + DECL_LINK_TYPED(implSelectHdl, ListBox&, void); private: VclPtr<FixedText> maFTGroupText; @@ -2168,10 +2188,9 @@ void CustomAnimationTextAnimTabPage::updateControlStates() } } -IMPL_LINK_NOARG(CustomAnimationTextAnimTabPage, implSelectHdl) +IMPL_LINK_NOARG_TYPED(CustomAnimationTextAnimTabPage, implSelectHdl, ListBox&, void) { updateControlStates(); - return 0; } CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const OString& sPage) diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 9081eafde016..463a1aac779e 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -190,8 +190,8 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase, mpPBAddEffect->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) ); mpPBChangeEffect->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) ); mpPBRemoveEffect->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) ); - mpLBStart->SetSelectHdl( LINK( this, CustomAnimationPane, implControlHdl ) ); - mpCBSpeed->SetSelectHdl( LINK( this, CustomAnimationPane, implControlHdl ) ); + mpLBStart->SetSelectHdl( LINK( this, CustomAnimationPane, implControlListBoxHdl ) ); + mpCBSpeed->SetSelectHdl( LINK( this, CustomAnimationPane, implControlListBoxHdl ) ); mpPBPropertyMore->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) ); mpPBMoveUp->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) ); mpPBMoveDown->SetClickHdl( LINK( this, CustomAnimationPane, implClickHdl ) ); @@ -2020,9 +2020,13 @@ IMPL_LINK_TYPED( CustomAnimationPane, implClickHdl, Button*, pBtn, void ) { implControlHdl(pBtn); } +IMPL_LINK_TYPED( CustomAnimationPane, implControlListBoxHdl, ListBox&, rListBox, void ) +{ + implControlHdl(&rListBox); +} /// this link is called when one of the controls is modified -IMPL_LINK( CustomAnimationPane, implControlHdl, Control*, pControl ) +void CustomAnimationPane::implControlHdl(Control* pControl ) { if( pControl == mpPBAddEffect ) onChange(true); @@ -2049,8 +2053,6 @@ IMPL_LINK( CustomAnimationPane, implControlHdl, Control*, pControl ) } updateControls(); - - return 0; } IMPL_LINK_NOARG_TYPED(CustomAnimationPane, lateInitCallback, Timer *, void) diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index 33c363e76e3c..5ab1de657575 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -116,11 +116,12 @@ private: bool setProperty1Value( sal_Int32 nType, CustomAnimationEffectPtr pEffect, const ::com::sun::star::uno::Any& rValue ); void UpdateLook(); - DECL_LINK( implControlHdl, Control* ); + DECL_LINK_TYPED( implControlListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( implClickHdl, Button*, void ); DECL_LINK(implPropertyHdl, void *); DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(lateInitCallback, Timer *, void); + void implControlHdl(Control*); private: ViewShellBase& mrBase; diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index c527ff52169a..233da3af03f9 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -998,10 +998,9 @@ IMPL_LINK_NOARG_TYPED(SlideTransitionPane, PlayButtonClicked, Button*, void) playCurrentEffect(); } -IMPL_LINK_NOARG(SlideTransitionPane, TransitionSelected) +IMPL_LINK_NOARG_TYPED(SlideTransitionPane, TransitionSelected, ListBox&, void) { applyToSelectedPages(); - return 0; } IMPL_LINK_NOARG_TYPED(SlideTransitionPane, AdvanceSlideRadioButtonToggled, RadioButton&, void) @@ -1016,13 +1015,12 @@ IMPL_LINK_NOARG(SlideTransitionPane, AdvanceTimeModified) return 0; } -IMPL_LINK_NOARG(SlideTransitionPane, SpeedListBoxSelected) +IMPL_LINK_NOARG_TYPED(SlideTransitionPane, SpeedListBoxSelected, ListBox&, void) { applyToSelectedPages(); - return 0; } -IMPL_LINK_NOARG(SlideTransitionPane, SoundListBoxSelected) +IMPL_LINK_NOARG_TYPED(SlideTransitionPane, SoundListBoxSelected, ListBox&, void) { if( mpLB_SOUND->GetSelectEntryCount() ) { @@ -1035,7 +1033,6 @@ IMPL_LINK_NOARG(SlideTransitionPane, SoundListBoxSelected) } updateControlState(); applyToSelectedPages(); - return 0; } IMPL_LINK_NOARG_TYPED(SlideTransitionPane, LoopSoundBoxChecked, Button*, void) diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx index 023ac54a2add..4b0e8e1c207f 100644 --- a/sd/source/ui/animations/SlideTransitionPane.hxx +++ b/sd/source/ui/animations/SlideTransitionPane.hxx @@ -89,11 +89,11 @@ private: DECL_LINK_TYPED( PlayButtonClicked, Button*, void ); DECL_LINK_TYPED( AutoPreviewClicked, Button*, void ); - DECL_LINK( TransitionSelected, void * ); + DECL_LINK_TYPED( TransitionSelected, ListBox&, void ); DECL_LINK_TYPED( AdvanceSlideRadioButtonToggled, RadioButton&, void ); DECL_LINK( AdvanceTimeModified, void * ); - DECL_LINK( SpeedListBoxSelected, void * ); - DECL_LINK( SoundListBoxSelected, void * ); + DECL_LINK_TYPED( SpeedListBoxSelected, ListBox&, void ); + DECL_LINK_TYPED( SoundListBoxSelected, ListBox&, void ); DECL_LINK_TYPED( LoopSoundBoxChecked, Button*, void ); DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(LateInitCallback, Timer *, void); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index b77e49f675a8..b349a438471b 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -576,7 +576,7 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, RemoveHdl, Button*, void) EnableDisableButtons(); } -IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl) +IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, SelectHdl, ListBox&, void) { OUString* pData = static_cast<OUString*>(pImagesLst->GetSelectEntryData()); OUString sImgUrl = pData ? OUString(*pData) : ""; @@ -633,7 +633,6 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl) pImg->SetImage(Image()); } EnableDisableButtons(); - return 0; } Reference< drawing::XDrawPage > SdPhotoAlbumDialog::appendNewSlide(AutoLayout aLayout, diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.hxx b/sd/source/ui/dlg/PhotoAlbumDialog.hxx index a82f0aad4f6d..1b7cf81c9d0e 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.hxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.hxx @@ -78,7 +78,7 @@ private: DECL_LINK_TYPED(DownHdl, Button*, void); DECL_LINK_TYPED(RemoveHdl, Button*, void); - DECL_LINK(SelectHdl, void*); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); Reference< drawing::XDrawPage > appendNewSlide(AutoLayout aLayout, Reference< drawing::XDrawPages > xDrawPages); diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 86421fde3f0c..a4bf97f08732 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -221,7 +221,7 @@ void CopyDlg::GetAttr( SfxItemSet& rOutAttrs ) /** * enables and selects end color LB */ -IMPL_LINK_NOARG(CopyDlg, SelectColorHdl) +IMPL_LINK_NOARG_TYPED(CopyDlg, SelectColorHdl, ListBox&, void) { sal_Int32 nPos = m_pLbStartColor->GetSelectEntryPos(); @@ -232,7 +232,6 @@ IMPL_LINK_NOARG(CopyDlg, SelectColorHdl) m_pLbEndColor->Enable(); m_pFtEndColor->Enable(); } - return 0; } /** diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index bfa142d5afcb..b926bdf80193 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -58,7 +58,7 @@ SdCustomShowDlg::SdCustomShowDlg( vcl::Window* pWindow, m_pBtnRemove->SetClickHdl( aLink ); m_pBtnCopy->SetClickHdl( aLink ); m_pCbxUseCustomShow->SetClickHdl( aLink ); - m_pLbCustomShows->SetSelectHdl( LINK( this, SdCustomShowDlg, SelectHdl ) ); + m_pLbCustomShows->SetSelectHdl( LINK( this, SdCustomShowDlg, SelectListBoxHdl ) ); m_pBtnStartShow->SetClickHdl( LINK( this, SdCustomShowDlg, StartShowHdl ) ); // for test @@ -121,10 +121,12 @@ IMPL_LINK_TYPED( SdCustomShowDlg, ClickButtonHdl, Button *, p, void ) { SelectHdl(p); } -/** - * ButtonHdl() - */ -IMPL_LINK( SdCustomShowDlg, SelectHdl, void *, p ) +IMPL_LINK_TYPED( SdCustomShowDlg, SelectListBoxHdl, ListBox&, rListBox, void ) +{ + SelectHdl(&rListBox); +} + +void SdCustomShowDlg::SelectHdl(void *p) { // new CustomShow if( p == m_pBtnNew ) @@ -261,8 +263,6 @@ IMPL_LINK( SdCustomShowDlg, SelectHdl, void *, p ) } CheckState(); - - return 0L; } // StartShow-Hdl @@ -295,11 +295,10 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow, get( m_pBtnHelp, "help" ); Link<Button*,void> aLink = LINK( this, SdDefineCustomShowDlg, ClickButtonHdl ); - Link<> aLink2= LINK( this, SdDefineCustomShowDlg, ClickButtonHdl2 ); m_pBtnAdd->SetClickHdl( aLink ); m_pBtnRemove->SetClickHdl( aLink ); - m_pEdtName->SetModifyHdl( aLink2 ); - m_pLbPages->SetSelectHdl( aLink2 ); // because of status + m_pEdtName->SetModifyHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl2 ) ); + m_pLbPages->SetSelectHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl4 ) ); // because of status m_pLbCustomPages->SetSelectHdl( LINK( this, SdDefineCustomShowDlg, ClickButtonHdl3 ) ); // because of status m_pBtnOK->SetClickHdl( LINK( this, SdDefineCustomShowDlg, OKHdl ) ); @@ -391,6 +390,10 @@ IMPL_LINK_TYPED( SdDefineCustomShowDlg, ClickButtonHdl3, SvTreeListBox*, p, void { ClickButtonHdl2(p); } +IMPL_LINK_TYPED( SdDefineCustomShowDlg, ClickButtonHdl4, ListBox&, rListBox, void ) +{ + ClickButtonHdl2(&rListBox); +} // ButtonHdl() IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl2, void *, p ) { diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index c0fc28a8a63c..d372d55a92c0 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -225,22 +225,22 @@ public: static OUString GetUiTextForCommand (const OUString& aCommandURL); static Image GetUiIconForCommand (const OUString& aCommandURL); - DECL_LINK( SelectFileHdl, void * ); - DECL_LINK( SelectRegionHdl, ListBox * ); + DECL_LINK_TYPED( SelectFileHdl, ListBox&, void ); + DECL_LINK_TYPED( SelectRegionHdl, ListBox&, void ); DECL_LINK_TYPED( UpdatePreviewHdl, Idle *, void ); DECL_LINK_TYPED( UpdatePageListHdl, Idle *, void ); DECL_LINK_TYPED( StartTypeHdl, Button *, void ); - DECL_LINK( SelectTemplateHdl, void * ); + DECL_LINK_TYPED( SelectTemplateHdl, ListBox&, void); DECL_LINK_TYPED( NextPageHdl, Button*, void ); DECL_LINK_TYPED( LastPageHdl, Button*, void ); DECL_LINK_TYPED( PreviewFlagHdl, Button*, void ); DECL_LINK_TYPED( EffectPreviewIdleHdl, Idle *, void ); DECL_LINK_TYPED( EffectPreviewClickHdl, SdDocPreviewWin&, void ); - DECL_LINK( SelectLayoutHdl, void * ); + DECL_LINK_TYPED( SelectLayoutHdl, ListBox&, void ); DECL_LINK_TYPED( PageSelectHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( PresTypeHdl, Button*, void ); DECL_LINK( UpdateUserDataHdl, void * ); - DECL_LINK( SelectEffectHdl, void* ); + DECL_LINK_TYPED( SelectEffectHdl, ListBox&, void); DECL_LINK_TYPED( OpenButtonHdl, Button *, void ); OUString maCreateStr; @@ -639,7 +639,7 @@ AssistentDlgImpl::AssistentDlgImpl( vcl::Window* pWindow, const Link<ListBox&,vo mpPage1RegionLB->SelectEntry( pStandardTemplateDir->msRegion ); SelectTemplateRegion( pStandardTemplateDir->msRegion ); mpPage1TemplateLB->SelectEntry( pStandardTemplateEntry->msTitle ); - SelectTemplateHdl(mpPage1TemplateLB); + SelectTemplateHdl(*mpPage1TemplateLB); } } } @@ -1079,26 +1079,23 @@ void AssistentDlgImpl::UpdatePage() // UI-Handler // ******************************************************************** -IMPL_LINK( AssistentDlgImpl, SelectRegionHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( AssistentDlgImpl, SelectRegionHdl, ListBox&, rLB, void ) { - if( pLB == mpPage1RegionLB ) + if( &rLB == mpPage1RegionLB ) { - SelectTemplateRegion( pLB->GetSelectEntry() ); + SelectTemplateRegion( rLB.GetSelectEntry() ); SetStartType( ST_TEMPLATE ); mpPage2Medium5RB->Check(); } else { - SelectLayoutRegion( pLB->GetSelectEntry() ); + SelectLayoutRegion( rLB.GetSelectEntry() ); } - - return 0; } -IMPL_LINK_NOARG(AssistentDlgImpl, SelectEffectHdl) +IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, SelectEffectHdl, ListBox&, void) { maEffectPrevIdle.Start(); - return 0; } IMPL_LINK_NOARG_TYPED( AssistentDlgImpl, OpenButtonHdl, Button*, void ) @@ -1142,26 +1139,23 @@ IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, PreviewFlagHdl, Button*, void) } } -IMPL_LINK_NOARG(AssistentDlgImpl, SelectTemplateHdl) +IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, SelectTemplateHdl, ListBox&, void) { SetStartType( ST_TEMPLATE ); mpPage2Medium5RB->Check(); mpPage2LayoutLB->SelectEntryPos(0); maPrevIdle.Start(); - return 0; } -IMPL_LINK_NOARG(AssistentDlgImpl, SelectLayoutHdl) +IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, SelectLayoutHdl, ListBox&, void) { maPrevIdle.Start(); - return 0; } -IMPL_LINK_NOARG(AssistentDlgImpl, SelectFileHdl) +IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, SelectFileHdl, ListBox&, void) { SetStartType( ST_OPEN ); maPrevIdle.Start(); - return 0; } IMPL_LINK_NOARG_TYPED(AssistentDlgImpl, PageSelectHdl, SvTreeListBox*, void) @@ -1274,7 +1268,7 @@ void AssistentDlgImpl::SelectTemplateRegion( const OUString& rRegion ) if(GetStartType() == ST_TEMPLATE) { mpPage1TemplateLB->SelectEntryPos( 0 ); - SelectTemplateHdl(NULL); + SelectTemplateHdl(*mpPage1TemplateLB); } break; } diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index f2c6359569a6..550ac1569909 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -312,11 +312,9 @@ void SdModifyFieldDlg::FillControls() m_pLbFormat->SaveValue(); } -IMPL_LINK_NOARG(SdModifyFieldDlg, LanguageChangeHdl) +IMPL_LINK_NOARG_TYPED(SdModifyFieldDlg, LanguageChangeHdl, ListBox&, void) { FillFormatList(); - - return 0L; } SfxItemSet SdModifyFieldDlg::GetItemSet() diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 1276126cb055..0cdbed14fbb6 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -146,8 +146,7 @@ private: bool mbHandoutMode; DECL_LINK_TYPED( UpdateOnClickHdl, Button*, void ); - - DECL_LINK( LanguageChangeHdl, void * ); + DECL_LINK_TYPED( LanguageChangeHdl, ListBox&, void ); void FillFormatList(int eFormat); void GetOrSetDateTimeLanguage( LanguageType &rLanguage, bool bSet ); @@ -477,11 +476,9 @@ void HeaderFooterTabPage::dispose() TabPage::dispose(); } -IMPL_LINK_NOARG(HeaderFooterTabPage, LanguageChangeHdl) +IMPL_LINK_NOARG_TYPED(HeaderFooterTabPage, LanguageChangeHdl, ListBox&, void) { FillFormatList( (int)reinterpret_cast<sal_IntPtr>(mpCBDateTimeFormat->GetSelectEntryData()) ); - - return 0L; } void HeaderFooterTabPage::FillFormatList( int eFormat ) diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 644250429ca9..b390066e02a3 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -425,7 +425,7 @@ IMPL_LINK_NOARG_TYPED(SdNavigatorWin, ClickObjectHdl, SvTreeListBox*, bool) return false; } -IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl) +IMPL_LINK_NOARG_TYPED(SdNavigatorWin, SelectDocumentHdl, ListBox&, void) { OUString aStrLb = maLbDocs->GetSelectEntry(); long nPos = maLbDocs->GetSelectEntryPos(); @@ -465,8 +465,6 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl) meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED; SetDragImage(); } - - return 0L; } /** diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 88bc1506ed69..ee4fd3d9e2ed 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -136,7 +136,7 @@ SdTPAction::SdTPAction(vcl::Window* pWindow, const SfxItemSet& rInAttrs) set_width_request(aSize.Width()); set_height_request(aSize.Height()); - ClickActionHdl( this ); + ClickActionHdl( *m_pLbAction ); } SdTPAction::~SdTPAction() @@ -359,7 +359,7 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs ) default: break; } - ClickActionHdl( this ); + ClickActionHdl( *m_pLbAction ); m_pLbAction->SaveValue(); m_pEdtSound->SaveValue(); @@ -476,7 +476,7 @@ IMPL_LINK_NOARG_TYPED(SdTPAction, ClickSearchHdl, Button*, void) OpenFileDialog(); } -IMPL_LINK_NOARG(SdTPAction, ClickActionHdl) +IMPL_LINK_NOARG_TYPED(SdTPAction, ClickActionHdl, ListBox&, void) { presentation::ClickAction eCA = GetActualClickAction(); @@ -646,8 +646,6 @@ IMPL_LINK_NOARG(SdTPAction, ClickActionHdl) default: break; } - - return 0L; } IMPL_LINK_NOARG_TYPED(SdTPAction, SelectTreeHdl, SvTreeListBox*, void) diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 8fef0a3efb60..6d9dac5f2806 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -535,7 +535,7 @@ VclPtr<SfxTabPage> SdTpOptionsMisc::Create( vcl::Window* pWindow, return VclPtr<SdTpOptionsMisc>::Create( pWindow, *rAttrs ); } -IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl) +IMPL_LINK_NOARG_TYPED(SdTpOptionsMisc, SelectMetricHdl_Impl, ListBox&, void) { sal_Int32 nPos = m_pLbMetric->GetSelectEntryPos(); @@ -547,7 +547,6 @@ IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl) SetFieldUnit( *m_pMtrFldTabstop, eUnit ); m_pMtrFldTabstop->SetValue( m_pMtrFldTabstop->Normalize( nVal ), FUNIT_TWIP ); } - return 0; } void SdTpOptionsMisc::SetImpressMode() diff --git a/sd/source/ui/inc/copydlg.hxx b/sd/source/ui/inc/copydlg.hxx index 25c0ce4310f4..0ef9b0806985 100644 --- a/sd/source/ui/inc/copydlg.hxx +++ b/sd/source/ui/inc/copydlg.hxx @@ -69,7 +69,7 @@ private: Fraction maUIScale; ::sd::View* mpView; - DECL_LINK( SelectColorHdl, void * ); + DECL_LINK_TYPED( SelectColorHdl, ListBox&, void ); DECL_LINK_TYPED( SetViewData, Button*, void ); DECL_LINK_TYPED( SetDefault, Button*, void ); }; diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx index b31862e13344..b622351fc5e2 100644 --- a/sd/source/ui/inc/custsdlg.hxx +++ b/sd/source/ui/inc/custsdlg.hxx @@ -52,8 +52,9 @@ private: void CheckState(); DECL_LINK_TYPED( ClickButtonHdl, Button*, void ); - DECL_LINK( SelectHdl, void* ); + DECL_LINK_TYPED( SelectListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( StartShowHdl, Button*, void ); + void SelectHdl(void*); public: SdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc ); @@ -86,6 +87,7 @@ private: DECL_LINK_TYPED( ClickButtonHdl, Button*, void ); DECL_LINK( ClickButtonHdl2, void* ); DECL_LINK_TYPED( ClickButtonHdl3, SvTreeListBox*, void ); + DECL_LINK_TYPED( ClickButtonHdl4, ListBox&, void ); DECL_LINK_TYPED( OKHdl, Button*, void ); public: diff --git a/sd/source/ui/inc/dlgfield.hxx b/sd/source/ui/inc/dlgfield.hxx index fe11b0768b45..2aba3666fc4d 100644 --- a/sd/source/ui/inc/dlgfield.hxx +++ b/sd/source/ui/inc/dlgfield.hxx @@ -45,7 +45,7 @@ private: void FillFormatList(); void FillControls(); - DECL_LINK( LanguageChangeHdl, void * ); + DECL_LINK_TYPED( LanguageChangeHdl, ListBox&, void ); public: SdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet ); diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index 96c79583abb1..ad9af41a863d 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -145,7 +145,7 @@ private: DECL_LINK_TYPED( SelectToolboxHdl, ToolBox *, void ); DECL_LINK_TYPED( DropdownClickToolBoxHdl, ToolBox *, void ); DECL_LINK_TYPED( ClickObjectHdl, SvTreeListBox*, bool ); - DECL_LINK( SelectDocumentHdl, void * ); + DECL_LINK_TYPED( SelectDocumentHdl, ListBox&, void ); DECL_LINK_TYPED( MenuSelectHdl, Menu *, bool ); DECL_LINK_TYPED( ShapeFilterCallback, Menu *, bool ); diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx index 9abdd7b27f7f..9dc3854cdd53 100644 --- a/sd/source/ui/inc/pubdlg.hxx +++ b/sd/source/ui/inc/pubdlg.hxx @@ -182,7 +182,7 @@ private: DECL_LINK_TYPED( LastPageHdl, Button*, void ); DECL_LINK_TYPED( DesignHdl, Button*, void ); - DECL_LINK( DesignSelectHdl, void * ); + DECL_LINK_TYPED( DesignSelectHdl, ListBox&, void ); DECL_LINK_TYPED( DesignDeleteHdl, Button*, void ); DECL_LINK_TYPED( BaseHdl, Button*, void ); DECL_LINK_TYPED( ContentHdl, Button*, void ); diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx index aced93545f74..11d3232395ac 100644 --- a/sd/source/ui/inc/tpaction.hxx +++ b/sd/source/ui/inc/tpaction.hxx @@ -79,7 +79,7 @@ private: ::std::vector< long > aVerbVector; DECL_LINK_TYPED( ClickSearchHdl, Button*, void ); - DECL_LINK( ClickActionHdl, void * ); + DECL_LINK_TYPED( ClickActionHdl, ListBox&, void ); DECL_LINK_TYPED( SelectTreeHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( CheckFileHdl, Control&, void ); diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx index 3f3676fd4650..26b0e0d6010e 100644 --- a/sd/source/ui/inc/tpoption.hxx +++ b/sd/source/ui/inc/tpoption.hxx @@ -117,7 +117,7 @@ private: static OUString GetScale( sal_Int32 nX, sal_Int32 nY ); static bool SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32& rY ); - DECL_LINK( SelectMetricHdl_Impl, void * ); + DECL_LINK_TYPED( SelectMetricHdl_Impl, ListBox&, void ); /** Enable or disable the controls in the compatibility section of the 'general' tab page depending on whether there is at least one diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 1d7de9740fd8..06ebccb32c34 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1588,11 +1588,9 @@ IMPL_LINK_TYPED( SfxHelpIndexWindow_Impl, ActivatePageHdl, TabControl *, pTabCtr pTabCtrl->SetTabPage( nId, pPage ); } -IMPL_LINK_NOARG(SfxHelpIndexWindow_Impl, SelectHdl) +IMPL_LINK_NOARG_TYPED(SfxHelpIndexWindow_Impl, SelectHdl, ListBox&, void) { aIdle.Start(); - - return 0; } IMPL_LINK_NOARG_TYPED(SfxHelpIndexWindow_Impl, InitHdl, Idle *, void) diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 72217a1359dc..78b0947c79a9 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -313,7 +313,7 @@ private: inline BookmarksTabPage_Impl* GetBookmarksPage(); DECL_LINK_TYPED(ActivatePageHdl, TabControl*, void ); - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); DECL_LINK_TYPED(InitHdl, Idle *, void); DECL_LINK_TYPED(SelectFactoryHdl, Idle *, void); DECL_LINK_TYPED(KeywordHdl, IndexTabPage_Impl&, void); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 3b24d4da76ab..4f2a3445f568 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1504,9 +1504,10 @@ void CustomPropertiesWindow::dispose() vcl::Window::dispose(); } -IMPL_STATIC_LINK( - CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox ) +IMPL_STATIC_LINK_TYPED( + CustomPropertiesWindow, TypeHdl, ListBox&, rListBox, void ) { + CustomPropertiesTypeBox* pBox = static_cast<CustomPropertiesTypeBox*>(&rListBox); long nType = reinterpret_cast<long>( pBox->GetSelectEntryData() ); CustomPropertyLine* pLine = pBox->GetLine(); pLine->m_aValueEdit->Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) ); @@ -1529,8 +1530,6 @@ IMPL_STATIC_LINK( pLine->m_bIsDate = false; pLine->m_aDateField->SetSizePixel( pLine->m_aTimeField->GetSizePixel() ); } - - return 0; } IMPL_LINK_TYPED( CustomPropertiesWindow, RemoveHdl, Button*, pBtn, void ) @@ -1878,7 +1877,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny ) pNewLine->m_aTypeBox->SelectEntryPos( m_aTypeBox->GetEntryPos( reinterpret_cast<void*>(nType) ) ); } - TypeHdl( nullptr, pNewLine->m_aTypeBox.get() ); + TypeHdl( nullptr, *pNewLine->m_aTypeBox.get() ); pNewLine->m_aNameBox->GrabFocus(); } diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 425cf984dbda..16a06c479ebe 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -342,7 +342,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() m_pDescFt->SetText( pStyle->GetDescription( eUnit ) ); } -IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, ListBox&, void ) { OUString aTemplName(m_pFollowLb->GetSelectEntry()); OUString aEditTemplName(m_pNameRo->GetText()); @@ -350,7 +350,6 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) m_pEditStyleBtn->Enable(); else m_pEditStyleBtn->Disable(); - return 0; } IMPL_LINK_NOARG_TYPED( SfxManageStyleSheetPage, EditStyleHdl_Impl, Button*, void ) @@ -361,14 +360,13 @@ IMPL_LINK_NOARG_TYPED( SfxManageStyleSheetPage, EditStyleHdl_Impl, Button*, void } } -IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl, ListBox&, void ) { sal_Int32 linkSelectPos = m_pBaseLb->GetSelectEntryPos(); if ( linkSelectPos == 0 ) m_pEditLinkStyleBtn->Disable(); else m_pEditLinkStyleBtn->Enable(); - return 0; } IMPL_LINK_NOARG_TYPED( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, void ) diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 207166cc74f1..439cc15acef1 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1698,9 +1698,9 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable) } } -IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox&, rBox, void ) { - if (SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString() == pBox->GetSelectEntry()) + if (SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString() == rBox.GetSelectEntry()) { EnableHierarchical(true); } @@ -1708,8 +1708,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) { EnableHierarchical(false); } - - return 0; } // Select-Handler for the Toolbox diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index c15911e76891..5bc866fc27b4 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -147,8 +147,8 @@ class SfxNewFileDialog_Impl DECL_LINK_TYPED( Update, Idle *, void ); - DECL_LINK(RegionSelect, ListBox*); - DECL_LINK(TemplateSelect, void*); + DECL_LINK_TYPED(RegionSelect, ListBox&, void); + DECL_LINK_TYPED(TemplateSelect, ListBox&, void); DECL_LINK_TYPED(DoubleClick, ListBox&, void); DECL_LINK_TYPED(Expand, VclExpander&, void); DECL_LINK_TYPED(LoadFile, Button*, void); @@ -238,12 +238,12 @@ IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, Update, Idle*, void) } } -IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox*, pBox ) +IMPL_LINK_TYPED( SfxNewFileDialog_Impl, RegionSelect, ListBox&, rBox, void ) { if (xDocShell.Is() && xDocShell->GetProgress()) - return 0; + return; - const sal_uInt16 nRegion = pBox->GetSelectEntryPos(); + const sal_uInt16 nRegion = rBox.GetSelectEntryPos(); const sal_uInt16 nCount = aTemplates.GetRegionCount()? aTemplates.GetCount(nRegion): 0; m_pTemplateLb->SetUpdateMode(false); m_pTemplateLb->Clear(); @@ -259,27 +259,25 @@ IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox*, pBox ) m_pTemplateLb->SetUpdateMode(true); m_pTemplateLb->Invalidate(); m_pTemplateLb->Update(); - TemplateSelect(m_pTemplateLb); - return 0; + TemplateSelect(*m_pTemplateLb); } IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, Expand, VclExpander&, void) { - TemplateSelect(m_pTemplateLb); + TemplateSelect(*m_pTemplateLb); } -IMPL_LINK_NOARG(SfxNewFileDialog_Impl, TemplateSelect) +IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, TemplateSelect, ListBox&, void) { // Still loading if ( xDocShell && xDocShell->GetProgress() ) - return 0; + return; if (!m_pMoreBt->get_expanded()) // Dialog is not opened - return 0; + return; aPrevIdle.Start(); - return 0; } IMPL_LINK_NOARG_TYPED( SfxNewFileDialog_Impl, DoubleClick, ListBox&, void ) @@ -418,7 +416,7 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( aPrevIdle.SetIdleHdl( LINK( this, SfxNewFileDialog_Impl, Update)); m_pRegionLb->SelectEntryPos(0); - RegionSelect(m_pRegionLb); + RegionSelect(*m_pRegionLb); } SfxNewFileDialog_Impl::~SfxNewFileDialog_Impl() diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index afa26b5be746..e327154fdd67 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -219,7 +219,7 @@ protected: bool m_bWantHierarchical :1; bool bBindingUpdate :1; - DECL_LINK( FilterSelectHdl, ListBox* ); + DECL_LINK_TYPED( FilterSelectHdl, ListBox&, void ); DECL_LINK_TYPED( FmtSelectHdl, SvTreeListBox*, void ); DECL_LINK_TYPED( ApplyHdl, LinkParamNone*, void ); DECL_LINK_TYPED( TreeListApplyHdl, SvTreeListBox*, bool ); diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx index c8ad31788839..a06e17338cd8 100644 --- a/starmath/inc/ElementsDockingWindow.hxx +++ b/starmath/inc/ElementsDockingWindow.hxx @@ -138,7 +138,7 @@ class SmElementsDockingWindow : public SfxDockingWindow SmViewShell* GetView(); void SelectClickHandler(SmElement* pElement); - DECL_LINK(ElementSelectedHandle, ListBox*); + DECL_LINK_TYPED(ElementSelectedHandle, ListBox&, void); public: diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index d09aabe38042..08e10e32aede 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -364,7 +364,7 @@ class SmSymbolDialog : public ModalDialog VclPtr<OutputDevice> pFontListDev; - DECL_LINK(SymbolSetChangeHdl, void*); + DECL_LINK_TYPED(SymbolSetChangeHdl, ListBox&, void); DECL_LINK_TYPED(SymbolChangeHdl, SmShowSymbolSetWindow&, void); DECL_LINK_TYPED(SymbolDblClickHdl, SmShowSymbol&, void); DECL_LINK_TYPED(SymbolDblClickHdl2, SmShowSymbolSetWindow&, void); @@ -437,8 +437,8 @@ class SmSymDefineDialog : public ModalDialog DECL_LINK(OldSymbolChangeHdl, ComboBox *); DECL_LINK(OldSymbolSetChangeHdl, ComboBox *); DECL_LINK(ModifyHdl, ComboBox *); - DECL_LINK(FontChangeHdl, ListBox *); - DECL_LINK(SubsetChangeHdl, ListBox*); + DECL_LINK_TYPED(FontChangeHdl, ListBox&, void); + DECL_LINK_TYPED(SubsetChangeHdl, ListBox&, void); DECL_LINK(StyleChangeHdl, ComboBox *); DECL_LINK_TYPED(CharHighlightHdl, SvxShowCharSet*, void); DECL_LINK_TYPED(AddClickHdl, Button *, void); diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index 7ba0a1e4f402..2b6ed9512046 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -149,7 +149,7 @@ public: class SmFontPickListBox : public SmFontPickList, public ListBox { protected: - DECL_LINK(SelectHdl, ListBox *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); public: SmFontPickListBox(vcl::Window* pParent, WinBits nBits); diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index ae493da6c0a6..17735bf9e8c6 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -725,19 +725,18 @@ void SmElementsDockingWindow::SelectClickHandler( SmElement* pElement ) } } -IMPL_LINK( SmElementsDockingWindow, ElementSelectedHandle, ListBox*, pList) +IMPL_LINK_TYPED( SmElementsDockingWindow, ElementSelectedHandle, ListBox&, rList, void) { for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aCategories) ; i++) { sal_uInt16 aCurrentCategory = aCategories[i]; OUString aCurrentCategoryString = SM_RESSTR(aCurrentCategory); - if (aCurrentCategoryString == pList->GetSelectEntry()) + if (aCurrentCategoryString == rList.GetSelectEntry()) { mpElementsControl->setElementSetId(aCurrentCategory); - return 0; + return; } } - return 0; } SmViewShell* SmElementsDockingWindow::GetView() diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index f8cf2e04796e..9e93e1f1b73b 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1450,10 +1450,9 @@ void SmSymbolDialog::FillSymbolSets(bool bDeleteText) } -IMPL_LINK_NOARG( SmSymbolDialog, SymbolSetChangeHdl ) +IMPL_LINK_NOARG_TYPED( SmSymbolDialog, SymbolSetChangeHdl, ListBox&, void ) { SelectSymbolSet(m_pSymbolSets->GetSelectEntry()); - return 0; } @@ -1843,21 +1842,19 @@ IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) } -IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SmSymDefineDialog, FontChangeHdl, ListBox&, rListBox, void ) { - (void) pListBox; + (void) rListBox; #if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE(pListBox == pFonts, "Sm : wrong argument"); + OSL_ENSURE(&rListBox == pFonts, "Sm : wrong argument"); #endif SelectFont(pFonts->GetSelectEntry()); - return 0; } -IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, pListBox ) +IMPL_LINK_NOARG_TYPED( SmSymDefineDialog, SubsetChangeHdl, ListBox&, void ) { - (void) pListBox; sal_Int32 nPos = pFontsSubsetLB->GetSelectEntryPos(); if (LISTBOX_ENTRY_NOTFOUND != nPos) { @@ -1867,7 +1864,6 @@ IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, pListBox ) pCharsetDisplay->SelectCharacter( pSubset->GetRangeMin() ); } } - return 0; } diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index 5083cbbda90f..39b04440402b 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -157,7 +157,7 @@ SmFontPickListBox::SmFontPickListBox (vcl::Window* pParent, WinBits nBits) : SetSelectHdl(LINK(this, SmFontPickListBox, SelectHdl)); } -IMPL_LINK( SmFontPickListBox, SelectHdl, ListBox *, /*pListBox*/ ) +IMPL_LINK_NOARG_TYPED( SmFontPickListBox, SelectHdl, ListBox&, void ) { OUString aString; @@ -172,8 +172,6 @@ IMPL_LINK( SmFontPickListBox, SelectHdl, ListBox *, /*pListBox*/ ) } SelectEntryPos(0); - - return 0; } SmFontPickListBox& SmFontPickListBox::operator=(const SmFontPickList& rList) diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index e486e0e7b0bb..491f02be8f89 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -1,4 +1,3 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * @@ -175,6 +174,7 @@ namespace svt ListBoxCellController::ListBoxCellController(ListBoxControl* pWin) :CellController(pWin) { + GetListBox().SetSelectHdl(LINK(this, ListBoxCellController, ListBoxSelectHdl)); } @@ -217,7 +217,12 @@ namespace svt void ListBoxCellController::SetModifyHdl(const Link<>& rLink) { - GetListBox().SetSelectHdl(rLink); + maModifyHdl = rLink; + } + + IMPL_LINK_TYPED(ListBoxCellController, ListBoxSelectHdl, ListBox&, rListBox, void) + { + maModifyHdl.Call(&rListBox); } diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index 7f9ffa576ab0..eb0cbd1231b9 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -102,7 +102,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla } m_pLBServerType->SelectEntryPos( i ); - SelectTypeHdl( m_pLBServerType ); + SelectTypeHdl( *m_pLBServerType ); } } @@ -210,7 +210,7 @@ void PlaceEditDialog::InitDetails( ) if ( m_pLBServerType->GetSelectEntry() == "--------------------" ) m_pLBServerType->SelectEntryPos( 1 ); - SelectTypeHdl( m_pLBServerType ); + SelectTypeHdl( *m_pLBServerType ); } void PlaceEditDialog::UpdateLabel( ) @@ -317,7 +317,7 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl ) return 1; } -IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl ) +IMPL_LINK_NOARG_TYPED( PlaceEditDialog, SelectTypeHdl, ListBox&, void ) { if ( m_pLBServerType->GetSelectEntry() == "--------------------" ) { @@ -326,7 +326,7 @@ IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl ) else m_pLBServerType->SetNoSelection(); - return 0; + return; } if (m_xCurrentDetails.get()) @@ -345,8 +345,6 @@ IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl ) SetSizePixel(GetOptimalSize()); EditHdl(NULL); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index accb47f73571..7943e65e446a 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -493,10 +493,9 @@ IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void ) {} } -IMPL_LINK_NOARG( CmisDetailsContainer, SelectRepoHdl ) +IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, SelectRepoHdl, ListBox&, void ) { selectRepository( ); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index a54c68177e8a..62fc3085d893 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -981,22 +981,20 @@ void AssignmentPersistentData::ImplCommit() } - IMPL_LINK(AddressBookSourceDialog, OnFieldSelect, ListBox*, _pListbox) + IMPL_LINK_TYPED(AddressBookSourceDialog, OnFieldSelect, ListBox&, _rListbox, void) { // the index of the affected list box in our array - sal_IntPtr nListBoxIndex = reinterpret_cast<sal_IntPtr>(_pListbox->GetEntryData(0)); + sal_IntPtr nListBoxIndex = reinterpret_cast<sal_IntPtr>(_rListbox.GetEntryData(0)); DBG_ASSERT(nListBoxIndex >= 0 && nListBoxIndex < FIELD_CONTROLS_VISIBLE, "AddressBookSourceDialog::OnFieldScroll: invalid list box entry!"); // update the array where we remember the field selections - if (0 == _pListbox->GetSelectEntryPos()) + if (0 == _rListbox.GetSelectEntryPos()) // it's the "no field selection" entry m_pImpl->aFieldAssignments[m_pImpl->nFieldScrollPos * 2 + nListBoxIndex].clear(); else // it's a regular field entry - m_pImpl->aFieldAssignments[m_pImpl->nFieldScrollPos * 2 + nListBoxIndex] = _pListbox->GetSelectEntry(); - - return 0L; + m_pImpl->aFieldAssignments[m_pImpl->nFieldScrollPos * 2 + nListBoxIndex] = _rListbox.GetSelectEntry(); } diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index 849714f133e5..505fc3124f3d 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -310,12 +310,11 @@ IMPL_LINK_NOARG_TYPED(PrinterSetupDialog, ImplPropertiesHdl, Button*, void) -IMPL_LINK_NOARG(PrinterSetupDialog, ImplChangePrinterHdl) +IMPL_LINK_NOARG_TYPED(PrinterSetupDialog, ImplChangePrinterHdl, ListBox&, void) { mpTempPrinter = ImplPrnDlgListBoxSelect(m_pLbName, m_pBtnProperties, mpPrinter, mpTempPrinter ); ImplSetInfo(); - return 0; } diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index e675a2703a99..c1613961cdfd 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -658,7 +658,7 @@ ExportDialog::ExportDialog(FltCallDialogParameter& rPara, setupControls(); // Size - mpLbSizeX->SetSelectHdl( LINK( this, ExportDialog, SelectHdl ) ); + mpLbSizeX->SetSelectHdl( LINK( this, ExportDialog, SelectListBoxHdl ) ); if (mpSbCompression) mpSbCompression->SetScrollHdl(LINK(this, ExportDialog, SbCompressionUpdateHdl)); @@ -669,9 +669,9 @@ ExportDialog::ExportDialog(FltCallDialogParameter& rPara, mpMfSizeY->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) ); mpNfResolution->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) ); - mpLbResolution->SetSelectHdl( LINK( this, ExportDialog, SelectHdl ) ); + mpLbResolution->SetSelectHdl( LINK( this, ExportDialog, SelectListBoxHdl ) ); - mpLbColorDepth->SetSelectHdl( LINK( this, ExportDialog, SelectHdl ) ); + mpLbColorDepth->SetSelectHdl( LINK( this, ExportDialog, SelectListBoxHdl ) ); mpCbInterlaced->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); @@ -1030,9 +1030,13 @@ void ExportDialog::dispose() \************************************************************************/ IMPL_LINK_NOARG(ExportDialog, SelectHdl) { - UpdateHdl(NULL); + updateControls(); return 0; } +IMPL_LINK_NOARG_TYPED(ExportDialog, SelectListBoxHdl, ListBox&, void) +{ + updateControls(); +} IMPL_LINK_NOARG_TYPED(ExportDialog, UpdateHdl, Button*, void) { updateControls(); diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx index 0dc3dd05c054..61f86e7c0303 100644 --- a/svtools/source/filter/exportdialog.hxx +++ b/svtools/source/filter/exportdialog.hxx @@ -143,6 +143,7 @@ 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* ); diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 4e6e12a025ec..81c344b22784 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -586,8 +586,8 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent) Link<> a3Link=LINK( this, SvxTPFilter, ModifyHdl); m_pEdRange->SetModifyHdl(a3Link); m_pEdComment->SetModifyHdl(a3Link); - m_pLbAction->SetSelectHdl(a3Link); - m_pLbAuthor->SetSelectHdl(a3Link); + m_pLbAction->SetSelectHdl(LINK( this, SvxTPFilter, ModifyListBoxHdl)); + m_pLbAuthor->SetSelectHdl(LINK( this, SvxTPFilter, ModifyListBoxHdl)); RowEnableHdl(m_pCbDate); RowEnableHdl(m_pCbAuthor); @@ -756,7 +756,7 @@ void SvxTPFilter::SetLastTime(const tools::Time &aTime) void SvxTPFilter::SetDateMode(sal_uInt16 nMode) { m_pLbDate->SelectEntryPos(nMode); - SelDateHdl(m_pLbDate); + SelDateHdl(*m_pLbDate); } SvxRedlinDateMode SvxTPFilter::GetDateMode() @@ -907,11 +907,10 @@ void SvxTPFilter::ShowAction(bool bShow) } -IMPL_LINK( SvxTPFilter, SelDateHdl, ListBox*, pLb ) +IMPL_LINK_TYPED( SvxTPFilter, SelDateHdl, ListBox&, rLb, void ) { ShowDateFields(static_cast<SvxRedlinDateMode>(m_pLbDate->GetSelectEntryPos())); - ModifyHdl(pLb); - return 0; + ModifyHdl(&rLb); } IMPL_LINK_TYPED( SvxTPFilter, RowEnableHdl, Button*, pButton, void ) @@ -923,7 +922,7 @@ IMPL_LINK_TYPED( SvxTPFilter, RowEnableHdl, Button*, pButton, void ) m_pLbDate->Invalidate(); EnableDateLine1(false); EnableDateLine2(false); - if(m_pCbDate->IsChecked()) SelDateHdl(m_pLbDate); + if(m_pCbDate->IsChecked()) SelDateHdl(*m_pLbDate); } else if (pCB == m_pCbAuthor) { @@ -975,6 +974,10 @@ IMPL_LINK( SvxTPFilter, ModifyHdl, void*, pCtr) } return 0; } +IMPL_LINK_NOARG_TYPED( SvxTPFilter, ModifyListBoxHdl, ListBox&, void) +{ + bModified=true; +} void SvxTPFilter::DeactivatePage() { diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index b01bbf7ec78e..28fefa6a8c59 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -794,11 +794,10 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, InputTimoutHdl_Impl, Idle *, void) &aStartItem, &aShadowXItem, &aShadowYItem, 0L ); } -IMPL_LINK_NOARG(SvxFontWorkDialog, ColorSelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, ColorSelectHdl_Impl, ListBox&, void) { XFormTextShadowColorItem aItem( "", m_pShadowColorLB->GetSelectEntryColor() ); GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_SHDWCOLOR, SfxCallMode::RECORD, &aItem, 0L ); - return 0; } void SvxFontWorkDialog::SetColorList(const XColorListRef &pList) diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 563ae7dfba3e..643e753c542b 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -569,9 +569,9 @@ IMPL_LINK_NOARG_TYPED(SvxRubyDialog, ApplyHdl_Impl, Button*, void) if (!aRubyValues.getLength()) { AssertOneEntry(); - PositionHdl_Impl(m_pPositionLB); - AdjustHdl_Impl(m_pAdjustLB); - CharStyleHdl_Impl(m_pCharStyleLB); + PositionHdl_Impl(*m_pPositionLB); + AdjustHdl_Impl(*m_pAdjustLB); + CharStyleHdl_Impl(*m_pCharStyleLB); } GetRubyText(); //reset all edit fields - SaveValue is called @@ -608,10 +608,10 @@ IMPL_LINK_NOARG_TYPED(SvxRubyDialog, StylistHdl_Impl, Button*, void) delete pState; } -IMPL_LINK(SvxRubyDialog, AdjustHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SvxRubyDialog, AdjustHdl_Impl, ListBox&, rBox, void) { AssertOneEntry(); - sal_Int16 nAdjust = pBox->GetSelectEntryPos(); + sal_Int16 nAdjust = rBox.GetSelectEntryPos(); Sequence<PropertyValues>& aRubyValues = pImpl->GetRubyValues(); for (sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) { @@ -625,13 +625,12 @@ IMPL_LINK(SvxRubyDialog, AdjustHdl_Impl, ListBox*, pBox) SetModified(true); } m_pPreviewWin->Invalidate(); - return 0; } -IMPL_LINK(SvxRubyDialog, PositionHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SvxRubyDialog, PositionHdl_Impl, ListBox&, rBox, void) { AssertOneEntry(); - sal_Bool bAbove = !pBox->GetSelectEntryPos(); + sal_Bool bAbove = !rBox.GetSelectEntryPos(); const Type& rType = cppu::UnoType<bool>::get(); Sequence<PropertyValues>& aRubyValues = pImpl->GetRubyValues(); for (sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) @@ -646,10 +645,9 @@ IMPL_LINK(SvxRubyDialog, PositionHdl_Impl, ListBox*, pBox) SetModified(true); } m_pPreviewWin->Invalidate(); - return 0; } -IMPL_LINK_NOARG(SvxRubyDialog, CharStyleHdl_Impl) +IMPL_LINK_NOARG_TYPED(SvxRubyDialog, CharStyleHdl_Impl, ListBox&, void) { AssertOneEntry(); OUString sStyleName; @@ -669,7 +667,6 @@ IMPL_LINK_NOARG(SvxRubyDialog, CharStyleHdl_Impl) } SetModified(true); } - return 0; } IMPL_LINK(SvxRubyDialog, EditModifyHdl_Impl, Edit*, pEdit) diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 4688a8b4216f..726987297703 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1104,10 +1104,9 @@ void SvxSearchDialog::InitAttrList_Impl( const SfxItemSet* pSSet, -IMPL_LINK( SvxSearchDialog, LBSelectHdl_Impl, Control *, pCtrl ) +IMPL_LINK_TYPED( SvxSearchDialog, LBSelectHdl_Impl, ListBox&, rCtrl, void ) { - ClickHdl_Impl(pCtrl); - return 0; + ClickHdl_Impl(&rCtrl); } IMPL_LINK_TYPED( SvxSearchDialog, FlagHdl_Impl, Button *, pCtrl, void ) diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 0dcded535ef4..549e4fc6330a 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -274,7 +274,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p m_pBtnSpecularColor->SetClickHdl( aLink ); - Link<> aLink2 = LINK( this, Svx3DWin, SelectHdl ); + Link<ListBox&,void> aLink2 = LINK( this, Svx3DWin, SelectHdl ); m_pLbMatFavorites->SetSelectHdl( aLink2 ); m_pLbMatColor->SetSelectHdl( aLink2 ); m_pLbMatEmission->SetSelectHdl( aLink2 ); @@ -290,11 +290,11 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p m_pLbAmbientlight->SetSelectHdl( aLink2 ); m_pLbShademode->SetSelectHdl( aLink2 ); - aLink2 = LINK( this, Svx3DWin, ModifyHdl ); - m_pMtrMatSpecularIntensity->SetModifyHdl( aLink2 ); - m_pNumHorizontal->SetModifyHdl( aLink2 ); - m_pNumVertical->SetModifyHdl( aLink2 ); - m_pMtrSlant->SetModifyHdl( aLink2 ); + Link<> aLink3 = LINK( this, Svx3DWin, ModifyHdl ); + m_pMtrMatSpecularIntensity->SetModifyHdl( aLink3 ); + m_pNumHorizontal->SetModifyHdl( aLink3 ); + m_pNumVertical->SetModifyHdl( aLink3 ); + m_pMtrSlant->SetModifyHdl( aLink3 ); // Preview callback m_pCtlLightPreview->SetUserSelectionChangeCallback(LINK( this, Svx3DWin, ChangeSelectionCallbackHdl )); @@ -2465,109 +2465,105 @@ IMPL_LINK_TYPED( Svx3DWin, ClickColorHdl, Button *, pBtn, void) { aColor = aColorDlg.GetColor(); if( LBSelectColor( pLb, aColor ) ) - SelectHdl( pLb ); + SelectHdl( *pLb ); } } -IMPL_LINK( Svx3DWin, SelectHdl, void *, p ) +IMPL_LINK_TYPED( Svx3DWin, SelectHdl, ListBox&, rListBox, void ) { - if( p ) + bool bUpdatePreview = false; + + // Material + if (&rListBox == m_pLbMatFavorites) { - bool bUpdatePreview = false; + Color aColObj( COL_WHITE ); + Color aColEmis( COL_BLACK ); + Color aColSpec( COL_WHITE ); + sal_uInt16 nSpecIntens = 20; - // Material - if (p == m_pLbMatFavorites) + switch( m_pLbMatFavorites->GetSelectEntryPos() ) { - Color aColObj( COL_WHITE ); - Color aColEmis( COL_BLACK ); - Color aColSpec( COL_WHITE ); - sal_uInt16 nSpecIntens = 20; - - switch( m_pLbMatFavorites->GetSelectEntryPos() ) + case 1: // Metall { - case 1: // Metall - { - aColObj = Color(230,230,255); - aColEmis = Color(10,10,30); - aColSpec = Color(200,200,200); - nSpecIntens = 20; - } - break; - - case 2: // Gold - { - aColObj = Color(230,255,0); - aColEmis = Color(51,0,0); - aColSpec = Color(255,255,240); - nSpecIntens = 20; - } - break; + aColObj = Color(230,230,255); + aColEmis = Color(10,10,30); + aColSpec = Color(200,200,200); + nSpecIntens = 20; + } + break; - case 3: // Chrome - { - aColObj = Color(36,117,153); - aColEmis = Color(18,30,51); - aColSpec = Color(230,230,255); - nSpecIntens = 2; - } - break; + case 2: // Gold + { + aColObj = Color(230,255,0); + aColEmis = Color(51,0,0); + aColSpec = Color(255,255,240); + nSpecIntens = 20; + } + break; - case 4: // Plastic - { - aColObj = Color(255,48,57); - aColEmis = Color(35,0,0); - aColSpec = Color(179,202,204); - nSpecIntens = 60; - } - break; + case 3: // Chrome + { + aColObj = Color(36,117,153); + aColEmis = Color(18,30,51); + aColSpec = Color(230,230,255); + nSpecIntens = 2; + } + break; - case 5: // Wood - { - aColObj = Color(153,71,1); - aColEmis = Color(21,22,0); - aColSpec = Color(255,255,153); - nSpecIntens = 75; - } - break; + case 4: // Plastic + { + aColObj = Color(255,48,57); + aColEmis = Color(35,0,0); + aColSpec = Color(179,202,204); + nSpecIntens = 60; } - LBSelectColor( m_pLbMatColor, aColObj ); - LBSelectColor( m_pLbMatEmission, aColEmis ); - LBSelectColor( m_pLbMatSpecular, aColSpec ); - m_pMtrMatSpecularIntensity->SetValue( nSpecIntens ); + break; - bUpdatePreview = true; - } - else if( p == m_pLbMatColor || - p == m_pLbMatEmission || - p == m_pLbMatSpecular ) - { - m_pLbMatFavorites->SelectEntryPos( 0 ); - bUpdatePreview = true; - } - // Lighting - else if( p == m_pLbAmbientlight ) - { - bUpdatePreview = true; - } - else if( p == m_pLbLight1 || - p == m_pLbLight2 || - p == m_pLbLight3 || - p == m_pLbLight4 || - p == m_pLbLight5 || - p == m_pLbLight6 || - p == m_pLbLight7 || - p == m_pLbLight8 ) - { - bUpdatePreview = true; + case 5: // Wood + { + aColObj = Color(153,71,1); + aColEmis = Color(21,22,0); + aColSpec = Color(255,255,153); + nSpecIntens = 75; + } + break; } - else if (p == m_pLbShademode) - bUpdatePreview = true; + LBSelectColor( m_pLbMatColor, aColObj ); + LBSelectColor( m_pLbMatEmission, aColEmis ); + LBSelectColor( m_pLbMatSpecular, aColSpec ); + m_pMtrMatSpecularIntensity->SetValue( nSpecIntens ); - if( bUpdatePreview ) - UpdatePreview(); + bUpdatePreview = true; } - return 0L; + else if( &rListBox == m_pLbMatColor || + &rListBox == m_pLbMatEmission || + &rListBox == m_pLbMatSpecular ) + { + m_pLbMatFavorites->SelectEntryPos( 0 ); + bUpdatePreview = true; + } + // Lighting + else if( &rListBox == m_pLbAmbientlight ) + { + bUpdatePreview = true; + } + else if( &rListBox == m_pLbLight1 || + &rListBox == m_pLbLight2 || + &rListBox == m_pLbLight3 || + &rListBox == m_pLbLight4 || + &rListBox == m_pLbLight5 || + &rListBox == m_pLbLight6 || + &rListBox == m_pLbLight7 || + &rListBox == m_pLbLight8 ) + { + bUpdatePreview = true; + } + else if (&rListBox == m_pLbShademode) + bUpdatePreview = true; + + if( bUpdatePreview ) + UpdatePreview(); } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index ede090dc555f..b354ecbc57d6 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -4045,7 +4045,7 @@ void FmXListBoxCell::disposing() m_aItemListeners.disposeAndClear(aEvt); m_aActionListeners.disposeAndClear(aEvt); - m_pBox->SetSelectHdl( Link<>() ); + m_pBox->SetSelectHdl( Link<ListBox&,void>() ); m_pBox->SetDoubleClickHdl( Link<ListBox&,void>() ); m_pBox = NULL; diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index e8cdd5cf0c4a..f3f000109106 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -1374,7 +1374,7 @@ namespace svxform get(m_pInstanceBtn, "instances"); // handler - m_pModelsBox->SetSelectHdl( LINK( this, DataNavigatorWindow, ModelSelectHdl ) ); + m_pModelsBox->SetSelectHdl( LINK( this, DataNavigatorWindow, ModelSelectListBoxHdl ) ); Link<MenuButton *, void> aLink1 = LINK( this, DataNavigatorWindow, MenuSelectHdl ); m_pModelBtn->SetSelectHdl( aLink1 ); m_pInstanceBtn->SetSelectHdl( aLink1 ); @@ -1455,7 +1455,11 @@ namespace svxform } - IMPL_LINK( DataNavigatorWindow, ModelSelectHdl, ListBox *, pBox ) + IMPL_LINK_TYPED( DataNavigatorWindow, ModelSelectListBoxHdl, ListBox&, rBox, void ) + { + ModelSelectHdl(&rBox); + } + void DataNavigatorWindow::ModelSelectHdl(ListBox* pBox) { sal_Int32 nPos = m_pModelsBox->GetSelectEntryPos(); // pBox == NULL, if you want to force a new fill. @@ -1466,8 +1470,6 @@ namespace svxform InitPages(); SetPageModel(); } - - return 0; } IMPL_LINK_TYPED( DataNavigatorWindow, MenuSelectHdl, MenuButton *, pBtn, void ) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 5999300977fb..beebfd6b2ef1 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -311,7 +311,7 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties( VclAbstractDialog2* pDialog if ( bCreateNew ) { mpThemes->SelectEntry( mpExchangeData->pTheme->GetName() ); - SelectThemeHdl( NULL ); + SelectThemeHdl( *mpThemes ); } } @@ -472,7 +472,7 @@ void GalleryBrowser1::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( nCurSelectPos == nRenameEntryPos ) { mpThemes->SelectEntry( rGalleryHint.GetStringData() ); - SelectThemeHdl( NULL ); + SelectThemeHdl( *mpThemes ); } } break; @@ -497,7 +497,7 @@ void GalleryBrowser1::Notify( SfxBroadcaster&, const SfxHint& rHint ) else mpThemes->SetNoSelection(); - SelectThemeHdl( NULL ); + SelectThemeHdl( *mpThemes ); } } break; @@ -614,11 +614,10 @@ IMPL_LINK_TYPED( GalleryBrowser1, PopupMenuHdl, Menu*, pMenu, bool ) return false; } -IMPL_LINK_NOARG(GalleryBrowser1, SelectThemeHdl) +IMPL_LINK_NOARG_TYPED(GalleryBrowser1, SelectThemeHdl, ListBox&, void) { if (maThemeSlectionHandler) maThemeSlectionHandler(); - return 0L; } IMPL_LINK_NOARG_TYPED(GalleryBrowser1, ClickNewThemeHdl, Button*, void) diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx index 4cd406432846..edcdf307162f 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -110,7 +110,7 @@ private: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE; DECL_LINK_TYPED( ClickNewThemeHdl, Button*, void ); - DECL_LINK( SelectThemeHdl, void* ); + DECL_LINK_TYPED( SelectThemeHdl, ListBox&, void ); DECL_LINK_TYPED( ShowContextMenuHdl, void*, void ); DECL_LINK_TYPED( PopupMenuHdl, Menu*, bool ); DECL_LINK( EndNewThemePropertiesDlgHdl, VclAbstractDialog2* ); @@ -127,7 +127,7 @@ public: virtual ~GalleryBrowser1(); virtual void dispose() SAL_OVERRIDE; - void SelectTheme( sal_uIntPtr nThemePos ) { mpThemes->SelectEntryPos( (sal_uInt16) nThemePos ); SelectThemeHdl( NULL ); } + void SelectTheme( sal_uInt16 nThemePos ) { mpThemes->SelectEntryPos( nThemePos ); SelectThemeHdl( *mpThemes ); } OUString GetSelectedTheme() { return mpThemes->GetEntryCount() ? mpThemes->GetSelectEntry() : OUString(); } void ShowContextMenu(); diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index b5a7867de8a4..49bf3cbd74bf 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -349,12 +349,12 @@ namespace svxform XFrame_ref m_xFrame; XFrameModel_ref m_xFrameModel; - DECL_LINK( ModelSelectHdl, ListBox * ); + DECL_LINK_TYPED( ModelSelectListBoxHdl, ListBox&, void ); DECL_LINK_TYPED( MenuSelectHdl, MenuButton *, void ); DECL_LINK_TYPED( MenuActivateHdl, MenuButton *, void ); DECL_LINK_TYPED( ActivatePageHdl, TabControl*, void); DECL_LINK_TYPED( UpdateHdl, Timer *, void); - + void ModelSelectHdl(ListBox*); XFormsPage* GetCurrentPage( sal_uInt16& rCurId ); void LoadModels(); void SetPageModel(); diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index d5ef4c045f42..05c68c49778c 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -157,13 +157,11 @@ void AreaPropertyPanelBase::Initialize() mpLbFillType->SetAccessibleName(OUString( "Fill")); //wj acc mpLbFillAttr->SetAccessibleName(OUString( "Fill")); //wj acc - Link<> aLink = LINK( this, AreaPropertyPanelBase, SelectFillTypeHdl ); - mpLbFillType->SetSelectHdl( aLink ); + mpLbFillType->SetSelectHdl( LINK( this, AreaPropertyPanelBase, SelectFillTypeHdl ) ); - aLink = LINK( this, AreaPropertyPanelBase, SelectFillAttrHdl ); + Link<ListBox&,void> aLink = LINK( this, AreaPropertyPanelBase, SelectFillAttrHdl ); mpLbFillAttr->SetSelectHdl( aLink ); mpGradientStyle->SetSelectHdl( aLink ); - mpMTRAngle->SetModifyHdl( aLink ); mpLbFillGradFrom->SetSelectHdl( aLink ); mpLbFillGradTo->SetSelectHdl( aLink ); @@ -199,7 +197,7 @@ void AreaPropertyPanelBase::SetTransparency(sal_uInt16 nVal) mpMTRTransparent->SetValue(nVal); } -IMPL_LINK(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox *, pToolBox) +IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void) { const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos(); @@ -403,124 +401,114 @@ IMPL_LINK(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox *, pToolBox) if(drawing::FillStyle_NONE != eXFS) { - if(pToolBox) - { - mpLbFillType->Selected(); - } + mpLbFillType->Selected(); } } mpSidebarController->NotifyResize(); - - return 0; } -IMPL_LINK(AreaPropertyPanelBase, SelectFillAttrHdl, ListBox*, pToolBox) +IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, SelectFillAttrHdl, ListBox&, void) { const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos(); const XFillStyleItem aXFillStyleItem(eXFS); SfxObjectShell* pSh = SfxObjectShell::Current(); - if(pToolBox) - { - // #i122676# dependent from bFillStyleChange, do execute a single or two - // changes in one Execute call - const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS); + // #i122676# dependent from bFillStyleChange, do execute a single or two + // changes in one Execute call + const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS); - switch(eXFS) + switch(eXFS) + { + case drawing::FillStyle_SOLID: { - case drawing::FillStyle_SOLID: + if(bFillStyleChange) { - if(bFillStyleChange) - { - // #i122676# Single FillStyle change call needed here - setFillStyle(aXFillStyleItem); - } - break; + // #i122676# Single FillStyle change call needed here + setFillStyle(aXFillStyleItem); } - case drawing::FillStyle_GRADIENT: + break; + } + case drawing::FillStyle_GRADIENT: + { + + if(pSh && pSh->GetItem(SID_COLOR_TABLE)) { + XGradient aGradient; + aGradient.SetAngle(mpMTRAngle->GetValue() * 10); + aGradient.SetGradientStyle((css::awt::GradientStyle)mpGradientStyle->GetSelectEntryPos()); + aGradient.SetStartColor(mpLbFillGradFrom->GetSelectEntryColor()); + aGradient.SetEndColor(mpLbFillGradTo->GetSelectEntryColor()); - if(pSh && pSh->GetItem(SID_COLOR_TABLE)) - { - XGradient aGradient; - aGradient.SetAngle(mpMTRAngle->GetValue() * 10); - aGradient.SetGradientStyle((css::awt::GradientStyle)mpGradientStyle->GetSelectEntryPos()); - aGradient.SetStartColor(mpLbFillGradFrom->GetSelectEntryColor()); - aGradient.SetEndColor(mpLbFillGradTo->GetSelectEntryColor()); + const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient); - const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient); + // #i122676# Change FillStyle and Gradinet in one call + setFillStyleAndGradient(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillGradientItem); + } - // #i122676# Change FillStyle and Gradinet in one call - setFillStyleAndGradient(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillGradientItem); - } + break; + } + case drawing::FillStyle_HATCH: + { + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); - break; - } - case drawing::FillStyle_HATCH: + if(LISTBOX_ENTRY_NOTFOUND == nPos) { - sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + nPos = mnLastPosHatch; + } - if(LISTBOX_ENTRY_NOTFOUND == nPos) - { - nPos = mnLastPosHatch; - } + if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST)) + { + const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); - if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST)) + if(nPos < aItem.GetHatchList()->Count()) { - const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); + const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch(); + const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch); - if(nPos < aItem.GetHatchList()->Count()) - { - const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch(); - const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch); - - // #i122676# Change FillStyle and Hatch in one call - setFillStyleAndHatch(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillHatchItem); - } + // #i122676# Change FillStyle and Hatch in one call + setFillStyleAndHatch(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillHatchItem); } + } - if(LISTBOX_ENTRY_NOTFOUND != nPos) - { - mnLastPosHatch = nPos; - } - break; + if(LISTBOX_ENTRY_NOTFOUND != nPos) + { + mnLastPosHatch = nPos; } - case drawing::FillStyle_BITMAP: + break; + } + case drawing::FillStyle_BITMAP: + { + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + + if(LISTBOX_ENTRY_NOTFOUND == nPos) { - sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + nPos = mnLastPosBitmap; + } - if(LISTBOX_ENTRY_NOTFOUND == nPos) - { - nPos = mnLastPosBitmap; - } + if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST)) + { + const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST)) + if(nPos < aItem.GetBitmapList()->Count()) { - const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - - if(nPos < aItem.GetBitmapList()->Count()) - { - const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos); - const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); + const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos); + const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); - // #i122676# Change FillStyle and Bitmap in one call - setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillBitmapItem); - } + // #i122676# Change FillStyle and Bitmap in one call + setFillStyleAndBitmap(bFillStyleChange ? &aXFillStyleItem : NULL, aXFillBitmapItem); } + } - if(LISTBOX_ENTRY_NOTFOUND != nPos) - { - mnLastPosBitmap = nPos; - } - break; + if(LISTBOX_ENTRY_NOTFOUND != nPos) + { + mnLastPosBitmap = nPos; } - default: break; + break; } - mpSidebarController->NotifyResize(); + default: break; } - - return 0; + mpSidebarController->NotifyResize(); } VclPtr<PopupControl> AreaPropertyPanelBase::CreateTransparencyGradientControl (PopupContainer* pParent) @@ -1163,7 +1151,7 @@ IMPL_LINK_TYPED( AreaPropertyPanelBase, ClickTrGrHdl_Impl, ToolBox*, pToolBox, v maTrGrPopup.Show(*pToolBox); } -IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl) +IMPL_LINK_NOARG_TYPED(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, void) { sal_Int32 nSelectType = mpLBTransType->GetSelectEntryPos(); bool bGradient = false; @@ -1259,8 +1247,6 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl) SfxItemPool* pPool = 0; const XFillFloatTransparenceItem aGradientItem(pPool, aTmpGradient, bGradient); setFillFloatTransparence(aGradientItem); - - return 0L; } IMPL_LINK_NOARG(AreaPropertyPanelBase, ModifyTransparentHdl_Impl) diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx index 2ec906dea87d..8c64a3677ae4 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx @@ -179,12 +179,11 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl ) -IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl ) +IMPL_LINK_NOARG_TYPED( GraphicPropertyPanel, ClickColorModeHdl, ListBox&, void ) { const sal_Int16 nTrans = mpLBColorMode->GetSelectEntryPos(); const SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_MODE, SfxCallMode::RECORD, &aTransItem, 0L); - return 0L; } diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx index 244cfe6b15a0..76e4bdccbd74 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx @@ -89,7 +89,7 @@ private: DECL_LINK( ModifyBrightnessHdl, void * ); DECL_LINK( ModifyContrastHdl, void * ); DECL_LINK( ModifyTransHdl, void * ); - DECL_LINK( ClickColorModeHdl, void * ); + DECL_LINK_TYPED( ClickColorModeHdl, ListBox&, void ); DECL_LINK( RedHdl, void*); DECL_LINK( GreenHdl, void*); DECL_LINK( BlueHdl, void*); diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 4b05c89eda39..74f814ea77e0 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -238,8 +238,7 @@ void LinePropertyPanelBase::Initialize() FillLineStyleList(); SelectLineStyle(); - Link<> aLink = LINK( this, LinePropertyPanelBase, ChangeLineStyleHdl ); - mpLBStyle->SetSelectHdl( aLink ); + mpLBStyle->SetSelectHdl( LINK( this, LinePropertyPanelBase, ChangeLineStyleHdl ) ); mpLBStyle->SetAccessibleName(OUString( "Style")); mpLBStyle->AdaptDropDownLineCountToMaximum(); @@ -253,16 +252,14 @@ void LinePropertyPanelBase::Initialize() FillLineEndList(); SelectEndStyle(true); SelectEndStyle(false); - aLink = LINK( this, LinePropertyPanelBase, ChangeStartHdl ); - mpLBStart->SetSelectHdl( aLink ); + mpLBStart->SetSelectHdl( LINK( this, LinePropertyPanelBase, ChangeStartHdl ) ); mpLBStart->SetAccessibleName(OUString("Beginning Style")); //wj acc mpLBStart->AdaptDropDownLineCountToMaximum(); - aLink = LINK( this, LinePropertyPanelBase, ChangeEndHdl ); - mpLBEnd->SetSelectHdl( aLink ); + mpLBEnd->SetSelectHdl( LINK( this, LinePropertyPanelBase, ChangeEndHdl ) ); mpLBEnd->SetAccessibleName(OUString("Ending Style")); //wj acc mpLBEnd->AdaptDropDownLineCountToMaximum(); - aLink = LINK(this, LinePropertyPanelBase, ChangeTransparentHdl); + Link<> aLink = LINK(this, LinePropertyPanelBase, ChangeTransparentHdl); mpMFTransparent->SetModifyHdl(aLink); mpMFTransparent->SetAccessibleName(OUString("Transparency")); //wj acc @@ -270,12 +267,10 @@ void LinePropertyPanelBase::Initialize() mpMFTransparent->SetAccessibleRelationLabeledBy(mpFTTransparency); mpLBEnd->SetAccessibleRelationLabeledBy(mpLBEnd); - aLink = LINK( this, LinePropertyPanelBase, ChangeEdgeStyleHdl ); - mpLBEdgeStyle->SetSelectHdl( aLink ); + mpLBEdgeStyle->SetSelectHdl( LINK( this, LinePropertyPanelBase, ChangeEdgeStyleHdl ) ); mpLBEdgeStyle->SetAccessibleName(OUString("Corner Style")); - aLink = LINK( this, LinePropertyPanelBase, ChangeCapStyleHdl ); - mpLBCapStyle->SetSelectHdl( aLink ); + mpLBCapStyle->SetSelectHdl( LINK( this, LinePropertyPanelBase, ChangeCapStyleHdl ) ); mpLBCapStyle->SetAccessibleName(OUString("Cap Style")); } @@ -556,7 +551,7 @@ void LinePropertyPanelBase::updateLineCap(bool bDisabled, bool bSetOrDefault, mpLBCapStyle->SetNoSelection(); } -IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeLineStyleHdl) +IMPL_LINK_NOARG_TYPED(LinePropertyPanelBase, ChangeLineStyleHdl, ListBox&, void) { const sal_Int32 nPos(mpLBStyle->GetSelectEntryPos()); @@ -592,10 +587,9 @@ IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeLineStyleHdl) } ActivateControls(); - return 0; } -IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeStartHdl) +IMPL_LINK_NOARG_TYPED(LinePropertyPanelBase, ChangeStartHdl, ListBox&, void) { sal_Int32 nPos = mpLBStart->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND && mpLBStart->IsValueChangedFromSaved() ) @@ -607,10 +601,9 @@ IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeStartHdl) pItem.reset(new XLineStartItem( mpLBStart->GetSelectEntry(),mxLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() )); setLineStartStyle(pItem.get()); } - return 0; } -IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeEndHdl) +IMPL_LINK_NOARG_TYPED(LinePropertyPanelBase, ChangeEndHdl, ListBox&, void) { sal_Int32 nPos = mpLBEnd->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND && mpLBEnd->IsValueChangedFromSaved() ) @@ -622,10 +615,9 @@ IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeEndHdl) pItem.reset(new XLineEndItem( mpLBEnd->GetSelectEntry(), mxLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() )); setLineEndStyle(pItem.get()); } - return 0; } -IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeEdgeStyleHdl) +IMPL_LINK_NOARG_TYPED(LinePropertyPanelBase, ChangeEdgeStyleHdl, ListBox&, void) { const sal_Int32 nPos(mpLBEdgeStyle->GetSelectEntryPos()); @@ -659,10 +651,9 @@ IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeEdgeStyleHdl) setLineJoint(pItem.get()); } - return 0; } -IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeCapStyleHdl) +IMPL_LINK_NOARG_TYPED(LinePropertyPanelBase, ChangeCapStyleHdl, ListBox&, void) { const sal_Int32 nPos(mpLBCapStyle->GetSelectEntryPos()); @@ -691,7 +682,6 @@ IMPL_LINK_NOARG(LinePropertyPanelBase, ChangeCapStyleHdl) setLineCap(pItem.get()); } - return 0; } IMPL_LINK_TYPED(LinePropertyPanelBase, ToolboxWidthSelectHdl,ToolBox*, pToolBox, void) diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index dbcfc91b261f..ab4f82bae9dd 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -72,11 +72,11 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) mpSpacing15Button->SetClickHdl(aLink); mpSpacing2Button->SetClickHdl(aLink); - Link<> aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl ); - mpLineDist->SetSelectHdl(aLink2); + Link<ListBox&,void> aLink3 = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl ); + mpLineDist->SetSelectHdl(aLink3); SelectEntryPos(LLINESPACE_1); - aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); + Link<> aLink2 = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); mpLineDistAtPercentBox->SetModifyHdl( aLink2 ); mpLineDistAtMetricBox->SetModifyHdl( aLink2 ); @@ -321,11 +321,10 @@ void ParaLineSpacingControl::SelectEntryPos(sal_Int32 nPos) UpdateMetricFields(); } -IMPL_LINK(ParaLineSpacingControl, LineSPDistHdl_Impl, ListBox*, /*pBox*/) +IMPL_LINK_NOARG_TYPED(ParaLineSpacingControl, LineSPDistHdl_Impl, ListBox&, void) { UpdateMetricFields(); ExecuteLineSpace(); - return 0; } IMPL_LINK_NOARG( ParaLineSpacingControl, LineSPDistAtHdl_Impl ) diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx index efad9e2c8476..dea19021f3fb 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx @@ -69,7 +69,7 @@ private: /// Set the entry and update the metric fields. void SelectEntryPos(sal_Int32 nPos); - DECL_LINK(LineSPDistHdl_Impl, ListBox*); + DECL_LINK_TYPED(LineSPDistHdl_Impl, ListBox&, void); DECL_LINK(LineSPDistAtHdl_Impl, void*); DECL_LINK_TYPED(PredefinedValuesHandler, Button*, void); }; diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx index 86701705b0fe..e606b8b6ee65 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx @@ -124,9 +124,8 @@ void ShadowPropertyPanel::Initialize() mpLBShadowColor->Fill(pColorList); mpShowShadow->SetState( TRISTATE_FALSE ); mpShowShadow->SetClickHdl( LINK(this, ShadowPropertyPanel, ClickShadowHdl ) ); - Link<> aLink = LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ); mpShadowTransMetric->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) ); - mpLBShadowColor->SetSelectHdl( aLink ); + mpLBShadowColor->SetSelectHdl( LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ) ); mpShadowAngle->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) ); mpShadowDistance->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) ); mpShadowTransSlider->SetRange(Range(0,100)); @@ -150,11 +149,10 @@ IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ClickShadowHdl, Button*, void) } } -IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl) +IMPL_LINK_NOARG_TYPED(ShadowPropertyPanel, ModifyShadowColorHdl, ListBox&, void) { XColorItem aItem(makeSdrShadowColorItem(mpLBShadowColor->GetSelectEntryColor())); GetBindings()->GetDispatcher()->Execute(SID_ATTR_SHADOW_COLOR, SfxCallMode::RECORD, &aItem, 0L); - return 0; } IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowTransMetricHdl) diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx index 62741880de4e..63551c30224c 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx @@ -81,7 +81,7 @@ private: void SetTransparencyValue(long); void UpdateControls(); DECL_LINK_TYPED(ClickShadowHdl, Button*, void); - DECL_LINK(ModifyShadowColorHdl, void*); + DECL_LINK_TYPED(ModifyShadowColorHdl, ListBox&, void); DECL_LINK(ModifyShadowTransMetricHdl, void*); DECL_LINK(ModifyShadowDistanceHdl, void*); DECL_LINK_TYPED(ModifyShadowTransSliderHdl, Slider*, void); diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx index 9b06ad0038b8..0d2fe06d1161 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx @@ -64,10 +64,8 @@ TextCharacterSpacingControl::TextCharacterSpacingControl ( { initial(); FreeResource(); - Link<> aLink = LINK(this, TextCharacterSpacingControl, KerningSelectHdl); - maLBKerning->SetSelectHdl(aLink); - aLink =LINK(this, TextCharacterSpacingControl, KerningModifyHdl); - maEditKerning->SetModifyHdl(aLink); + maLBKerning->SetSelectHdl(LINK(this, TextCharacterSpacingControl, KerningSelectHdl)); + maEditKerning->SetModifyHdl(LINK(this, TextCharacterSpacingControl, KerningModifyHdl)); } @@ -379,7 +377,7 @@ IMPL_LINK_TYPED(TextCharacterSpacingControl, VSSelHdl, ValueSet*, pControl, void } } -IMPL_LINK(TextCharacterSpacingControl, KerningSelectHdl, ListBox*,) +IMPL_LINK_NOARG_TYPED(TextCharacterSpacingControl, KerningSelectHdl, ListBox&, void) { if ( maLBKerning->GetSelectEntryPos() > 0 ) { @@ -403,7 +401,6 @@ IMPL_LINK(TextCharacterSpacingControl, KerningSelectHdl, ListBox*,) maVSSpacing->StartSelection(); } KerningModifyHdl( NULL ); - return 0; } IMPL_LINK(TextCharacterSpacingControl, KerningModifyHdl, MetricField*,) diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx index f838c480d8a6..74d0bb54426b 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx @@ -87,7 +87,7 @@ private: void initial(); DECL_LINK_TYPED(VSSelHdl, ValueSet*, void); - DECL_LINK(KerningSelectHdl, ListBox*); + DECL_LINK_TYPED(KerningSelectHdl, ListBox&, void); DECL_LINK(KerningModifyHdl, MetricField*); }; }} diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx index e68ba9a1adbc..5d97ce80575e 100644 --- a/svx/source/tbxctrls/colorwindow.hxx +++ b/svx/source/tbxctrls/colorwindow.hxx @@ -55,7 +55,7 @@ private: std::function<void(const OUString&, const Color&)> maColorSelectFunction; DECL_LINK_TYPED( SelectHdl, ValueSet*, void ); - DECL_LINK( SelectPaletteHdl, void *); + DECL_LINK_TYPED( SelectPaletteHdl, ListBox&, void); DECL_LINK_TYPED( AutoColorClickHdl, Button*, void ); DECL_LINK_TYPED( OpenPickerClickHdl, Button*, void ); diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 650ef07ff3fd..5895e8e9c53f 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -582,7 +582,7 @@ void FillControl::dispose() vcl::Window::dispose(); } -IMPL_LINK(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox *, pToolBox) +IMPL_LINK_NOARG_TYPED(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void) { const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos(); @@ -747,137 +747,127 @@ IMPL_LINK(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox *, pToolBox) if(drawing::FillStyle_NONE != eXFS) { - if(pToolBox) - { - mpLbFillType->Selected(); - } + mpLbFillType->Selected(); } } - - return 0; } -IMPL_LINK(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox *, pToolBox) +IMPL_LINK_NOARG_TYPED(SvxFillToolBoxControl, SelectFillAttrHdl, ListBox&, void) { const drawing::FillStyle eXFS = (drawing::FillStyle)mpLbFillType->GetSelectEntryPos(); const XFillStyleItem aXFillStyleItem(eXFS); SfxObjectShell* pSh = SfxObjectShell::Current(); - if(pToolBox) - { - // #i122676# dependent from bFillStyleChange, do execute a single or two - // changes in one Execute call - const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS); + // #i122676# dependent from bFillStyleChange, do execute a single or two + // changes in one Execute call + const bool bFillStyleChange((drawing::FillStyle) meLastXFS != eXFS); - switch(eXFS) + switch(eXFS) + { + case drawing::FillStyle_SOLID: { - case drawing::FillStyle_SOLID: + if(bFillStyleChange) { - if(bFillStyleChange) - { - // #i122676# Single FillStyle change call needed here - SfxViewFrame::Current()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, &aXFillStyleItem, 0L); - } - break; + // #i122676# Single FillStyle change call needed here + SfxViewFrame::Current()->GetDispatcher()->Execute(SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, &aXFillStyleItem, 0L); } - case drawing::FillStyle_GRADIENT: + break; + } + case drawing::FillStyle_GRADIENT: + { + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + + if(LISTBOX_ENTRY_NOTFOUND == nPos) { - sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + nPos = mnLastPosGradient; + } - if(LISTBOX_ENTRY_NOTFOUND == nPos) - { - nPos = mnLastPosGradient; - } + if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_GRADIENT_LIST)) + { + const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST))); - if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_GRADIENT_LIST)) + if(nPos < aItem.GetGradientList()->Count()) { - const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST))); - - if(nPos < aItem.GetGradientList()->Count()) - { - const XGradient aGradient = aItem.GetGradientList()->GetGradient(nPos)->GetGradient(); - const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient); + const XGradient aGradient = aItem.GetGradientList()->GetGradient(nPos)->GetGradient(); + const XFillGradientItem aXFillGradientItem(mpLbFillAttr->GetSelectEntry(), aGradient); - // #i122676# Change FillStale and Gradinet in one call - SfxViewFrame::Current()->GetDispatcher()->Execute( - SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, &aXFillGradientItem, - bFillStyleChange ? &aXFillStyleItem : 0L, 0L); - } + // #i122676# Change FillStale and Gradinet in one call + SfxViewFrame::Current()->GetDispatcher()->Execute( + SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, &aXFillGradientItem, + bFillStyleChange ? &aXFillStyleItem : 0L, 0L); } + } - if(LISTBOX_ENTRY_NOTFOUND != nPos) - { - mnLastPosGradient = nPos; - } - break; + if(LISTBOX_ENTRY_NOTFOUND != nPos) + { + mnLastPosGradient = nPos; } - case drawing::FillStyle_HATCH: + break; + } + case drawing::FillStyle_HATCH: + { + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + + if(LISTBOX_ENTRY_NOTFOUND == nPos) { - sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + nPos = mnLastPosHatch; + } - if(LISTBOX_ENTRY_NOTFOUND == nPos) - { - nPos = mnLastPosHatch; - } + if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST)) + { + const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); - if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_HATCH_LIST)) + if(nPos < aItem.GetHatchList()->Count()) { - const SvxHatchListItem aItem(*static_cast<const SvxHatchListItem*>(pSh->GetItem(SID_HATCH_LIST))); + const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch(); + const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch); - if(nPos < aItem.GetHatchList()->Count()) - { - const XHatch aHatch = aItem.GetHatchList()->GetHatch(nPos)->GetHatch(); - const XFillHatchItem aXFillHatchItem( mpLbFillAttr->GetSelectEntry(), aHatch); - - // #i122676# Change FillStale and Hatch in one call - SfxViewFrame::Current()->GetDispatcher()->Execute( - SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, &aXFillHatchItem, - bFillStyleChange ? &aXFillStyleItem : 0L, 0L); - } + // #i122676# Change FillStale and Hatch in one call + SfxViewFrame::Current()->GetDispatcher()->Execute( + SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, &aXFillHatchItem, + bFillStyleChange ? &aXFillStyleItem : 0L, 0L); } + } - if(LISTBOX_ENTRY_NOTFOUND != nPos) - { - mnLastPosHatch = nPos; - } - break; + if(LISTBOX_ENTRY_NOTFOUND != nPos) + { + mnLastPosHatch = nPos; } - case drawing::FillStyle_BITMAP: + break; + } + case drawing::FillStyle_BITMAP: + { + sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + + if(LISTBOX_ENTRY_NOTFOUND == nPos) { - sal_Int32 nPos = mpLbFillAttr->GetSelectEntryPos(); + nPos = mnLastPosBitmap; + } - if(LISTBOX_ENTRY_NOTFOUND == nPos) - { - nPos = mnLastPosBitmap; - } + if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST)) + { + const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - if(LISTBOX_ENTRY_NOTFOUND != nPos && pSh && pSh->GetItem(SID_BITMAP_LIST)) + if(nPos < aItem.GetBitmapList()->Count()) { - const SvxBitmapListItem aItem(*static_cast<const SvxBitmapListItem*>(pSh->GetItem(SID_BITMAP_LIST))); - - if(nPos < aItem.GetBitmapList()->Count()) - { - const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos); - const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); + const XBitmapEntry* pXBitmapEntry = aItem.GetBitmapList()->GetBitmap(nPos); + const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->GetSelectEntry(), pXBitmapEntry->GetGraphicObject()); - // #i122676# Change FillStale and Bitmap in one call - SfxViewFrame::Current()->GetDispatcher()->Execute( - SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, &aXFillBitmapItem, - bFillStyleChange ? &aXFillStyleItem : 0L, 0L); - } + // #i122676# Change FillStale and Bitmap in one call + SfxViewFrame::Current()->GetDispatcher()->Execute( + SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, &aXFillBitmapItem, + bFillStyleChange ? &aXFillStyleItem : 0L, 0L); } + } - if(LISTBOX_ENTRY_NOTFOUND != nPos) - { - mnLastPosBitmap = nPos; - } - break; + if(LISTBOX_ENTRY_NOTFOUND != nPos) + { + mnLastPosBitmap = nPos; } - default: break; + break; } + default: break; } - - return 0; } void FillControl::Resize() diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 391d2e74fa35..b417110f3bfd 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -447,11 +447,11 @@ bool SvxFillTypeBox::Notify( NotifyEvent& rNEvt ) { case KEY_RETURN: bHandled = true; - ( (Link<>&)GetSelectHdl() ).Call( this ); + GetSelectHdl().Call( *this ); break; case KEY_TAB: bRelease = false; - ( (Link<>&)GetSelectHdl() ).Call( this ); + GetSelectHdl().Call( *this ); bRelease = true; break; @@ -514,12 +514,12 @@ bool SvxFillAttrBox::Notify( NotifyEvent& rNEvt ) switch ( pKEvt->GetKeyCode().GetCode() ) { case KEY_RETURN: - ( (Link<>&)GetSelectHdl() ).Call( this ); + GetSelectHdl().Call( *this ); bHandled = true; break; case KEY_TAB: bRelease = false; - GetSelectHdl().Call( this ); + GetSelectHdl().Call( *this ); bRelease = true; break; case KEY_ESCAPE: diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx index 8b0159bce12f..b6a96558cf2a 100644 --- a/svx/source/tbxctrls/lboxctrl.cxx +++ b/svx/source/tbxctrls/lboxctrl.cxx @@ -198,7 +198,7 @@ void SvxListBoxControl::Impl_SetInfo( sal_Int32 nCount ) } -IMPL_LINK_NOARG(SvxListBoxControl, SelectHdl) +IMPL_LINK_NOARG_TYPED(SvxListBoxControl, SelectHdl, ListBox&, void) { if (pPopupWin) { @@ -213,7 +213,6 @@ IMPL_LINK_NOARG(SvxListBoxControl, SelectHdl) pPopupWin->EndPopupMode(); } } - return 0; } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 37148e12bfe3..696835ba5dff 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -276,7 +276,7 @@ private: VclPtr<LineListBox> m_aLineStyleLb; bool m_bIsWriter; - DECL_LINK( SelectHdl, void * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); protected: virtual void Resize() SAL_OVERRIDE; @@ -1381,13 +1381,12 @@ IMPL_LINK_TYPED(SvxColorWindow_Impl, SelectHdl, ValueSet*, pColorSet, void) maColorSelectFunction(maCommand, aColor); } -IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectPaletteHdl) +IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, SelectPaletteHdl, ListBox&, void) { sal_Int32 nPos = mpPaletteListBox->GetSelectEntryPos(); mrPaletteManager.SetPalette( nPos ); mrPaletteManager.ReloadColorSet(*mpColorSet); mpColorSet->layoutToGivenHeight(mpColorSet->GetSizePixel().Height(), mrPaletteManager.GetColorCount()); - return 0; } IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, AutoColorClickHdl, Button*, void) @@ -1900,7 +1899,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame m_aLineStyleLb->Show(); } -IMPL_LINK_NOARG(SvxLineWindow_Impl, SelectHdl) +IMPL_LINK_NOARG_TYPED(SvxLineWindow_Impl, SelectHdl, ListBox&, void) { SvxLineItem aLineItem( SID_FRAME_LINESTYLE ); SvxBorderStyle nStyle = SvxBorderStyle( m_aLineStyleLb->GetSelectEntryStyle() ); @@ -1927,7 +1926,6 @@ IMPL_LINK_NOARG(SvxLineWindow_Impl, SelectHdl) SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ), OUString( ".uno:LineStyle" ), aArgs ); - return 0; } void SvxLineWindow_Impl::Resize() diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index c3c654366538..882c6921d0e1 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -540,7 +540,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( vcl::Window* pParent ) m_pED_Term->SetModifyHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) ); m_pED_Mapping->SetModifyHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) ); - m_pLB_Property->SetSelectHdl( LINK( this, ChineseDictionaryDialog, EditFieldsHdl ) ); + m_pLB_Property->SetSelectHdl( LINK( this, ChineseDictionaryDialog, EditFieldsListBoxHdl ) ); m_pRB_To_Simplified->SetClickHdl( LINK( this, ChineseDictionaryDialog, DirectionHdl ) ); m_pRB_To_Traditional->SetClickHdl( LINK( this, ChineseDictionaryDialog, DirectionHdl ) ); @@ -620,6 +620,10 @@ void ChineseDictionaryDialog::updateAfterDirectionChange() updateButtons(); } +IMPL_LINK_NOARG_TYPED(ChineseDictionaryDialog, EditFieldsListBoxHdl, ListBox&, void) +{ + updateButtons(); +} IMPL_LINK_NOARG(ChineseDictionaryDialog, EditFieldsHdl) { updateButtons(); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index 7f1598b525b7..c20d0ccd052d 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -125,6 +125,7 @@ public: private: DECL_LINK_TYPED( DirectionHdl, Button*, void ); DECL_LINK(EditFieldsHdl, 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/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index df536dbefd2d..1342a77e5909 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -64,10 +64,9 @@ IMPL_LINK_NOARG_TYPED(SwBreakDlg, ClickHdl, Button*, void) CheckEnable(); } -IMPL_LINK_NOARG(SwBreakDlg, SelectHdl) +IMPL_LINK_NOARG_TYPED(SwBreakDlg, SelectHdl, ListBox&, void) { CheckEnable(); - return 0; } // Handler for Change Page Number diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index b4f0596c8417..5fdcc7913349 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -768,11 +768,10 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) return 0; } -IMPL_LINK_NOARG(SwDropCapsPage, SelectHdl) +IMPL_LINK_NOARG_TYPED(SwDropCapsPage, SelectHdl, ListBox&, void) { m_pPict->UpdatePaintSettings(); bModified = true; - return 0; } void SwDropCapsPage::FillSet( SfxItemSet &rSet ) diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 70d7ae6416c0..7427ce3e16c5 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -269,7 +269,7 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet) NewStartHdl_Impl(m_pNewStartCB); m_pNewStartNF->SaveValue(); m_pNewStartNumberCB->SaveValue(); - StyleHdl_Impl(m_pNumberStyleLB); + StyleHdl_Impl(*m_pNumberStyleLB.get()); if( SfxItemState::DEFAULT <= rSet->GetItemState(RES_LINENUMBER)) { const SwFormatLineNumber& rNum = static_cast<const SwFormatLineNumber&>(rSet->Get(RES_LINENUMBER)); @@ -327,15 +327,13 @@ IMPL_LINK_NOARG_TYPED(SwParagraphNumTabPage, LineCountHdl_Impl, Button*, void) m_pRestartBX->Enable(bEnableRestartValue); } -IMPL_LINK_NOARG( SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl, ListBox&, void ) { sal_Int32 numSelectPos = m_pNumberStyleLB->GetSelectEntryPos(); if ( numSelectPos == 0 ) m_pEditNumStyleBtn->Disable(); else m_pEditNumStyleBtn->Enable(); - - return 0; } IMPL_LINK_NOARG_TYPED(SwParagraphNumTabPage, EditNumStyleHdl_Impl, Button*, void) @@ -380,13 +378,11 @@ bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl( } -IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox ) +IMPL_LINK_TYPED( SwParagraphNumTabPage, StyleHdl_Impl, ListBox&, rBox, void ) { - bool bEnable = bCurNumrule || pBox->GetSelectEntryPos() > 0; + bool bEnable = bCurNumrule || rBox.GetSelectEntryPos() > 0; m_pNewStartCB->Enable(bEnable); NewStartHdl_Impl(m_pNewStartCB); - - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index c6296b218f71..9d8447bda9bf 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -87,8 +87,8 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pRemovePB->SetClickHdl( LINK(this, SwCondCollPage, AssignRemoveClickHdl )); m_pAssignPB->SetClickHdl( LINK(this, SwCondCollPage, AssignRemoveClickHdl )); m_pTbLinks->SetSelectHdl( LINK(this, SwCondCollPage, SelectTreeListBoxHdl)); - m_pStyleLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectHdl)); - m_pFilterLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectHdl)); + m_pStyleLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectListBoxHdl)); + m_pFilterLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectListBoxHdl)); m_pTbLinks->SetStyle(m_pTbLinks->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); m_pTbLinks->SetSelectionMode( SINGLE_SELECTION ); @@ -272,7 +272,11 @@ IMPL_LINK_TYPED( SwCondCollPage, SelectTreeListBoxHdl, SvTreeListBox*, pBox, voi { SelectHdl(pBox); } -IMPL_LINK( SwCondCollPage, SelectHdl, void*, pBox) +IMPL_LINK_TYPED( SwCondCollPage, SelectListBoxHdl, ListBox&, rBox, void) +{ + SelectHdl(&rBox); +} +void SwCondCollPage::SelectHdl(void* pBox) { if (pBox == m_pFilterLB) { @@ -306,7 +310,6 @@ IMPL_LINK( SwCondCollPage, SelectHdl, void*, pBox) if(pBox != m_pStyleLB) m_pRemovePB->Enable( m_pConditionCB->IsChecked() && !sTbEntry.isEmpty() ); } - return 0; } void SwCondCollPage::SetCollection(SwFormat* pFormat, bool bNew) diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index cc674d8f57ed..4cf969f803f3 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -308,13 +308,11 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) m_pFormattingLB->SetDropDownLineCount( m_pFormattingLB->GetEntryCount() ); } -IMPL_LINK_NOARG(SwCompatibilityOptPage, SelectHdl) +IMPL_LINK_NOARG_TYPED(SwCompatibilityOptPage, SelectHdl, ListBox&, void) { const sal_Int32 nPos = m_pFormattingLB->GetSelectEntryPos(); sal_uLong nOptions = reinterpret_cast<sal_uLong>(m_pFormattingLB->GetEntryData( nPos )); SetCurrentOptions( nOptions ); - - return 0; } IMPL_LINK_NOARG_TYPED(SwCompatibilityOptPage, UseAsDefaultHdl, Button*, void) diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 7b101cecc533..f9ee4c19c368 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -352,7 +352,7 @@ void SwLoadOptPage::Reset( const SfxItemSet* rSet) m_pStandardizedPageSizeNF->Enable(m_pShowStandardizedPageCount->IsChecked()); } -IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl) +IMPL_LINK_NOARG_TYPED(SwLoadOptPage, MetricHdl, ListBox&, void) { const sal_Int32 nMPos = m_pMetricLB->GetSelectEntryPos(); if(nMPos != LISTBOX_ENTRY_NOTFOUND) @@ -368,8 +368,6 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl) if(!bModified) m_pTabMF->ClearModifyFlag(); } - - return 0; } SwCaptionOptDlg::SwCaptionOptDlg(vcl::Window* pParent, const SfxItemSet& rSet) @@ -533,9 +531,8 @@ SwCaptionOptPage::SwCaptionOptPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pNumberingSeparatorED->SetModifyHdl( aLk ); m_pTextEdit->SetModifyHdl( aLk ); - aLk = LINK(this, SwCaptionOptPage, SelectHdl); - m_pCategoryBox->SetSelectHdl( aLk ); - m_pFormatBox->SetSelectHdl( aLk ); + m_pCategoryBox->SetSelectHdl( LINK(this, SwCaptionOptPage, SelectHdl) ); + m_pFormatBox->SetSelectHdl( LINK(this, SwCaptionOptPage, SelectListBoxHdl) ); m_pLbCaptionOrder->SetSelectHdl( LINK(this, SwCaptionOptPage, OrderHdl)); @@ -850,7 +847,12 @@ IMPL_LINK_NOARG(SwCaptionOptPage, SelectHdl) return 0; } -IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox ) +IMPL_LINK_NOARG_TYPED(SwCaptionOptPage, SelectListBoxHdl, ListBox&, void) +{ + InvalidatePreview(); +} + +IMPL_LINK_TYPED( SwCaptionOptPage, OrderHdl, ListBox&, rBox, void ) { InvalidatePreview(); @@ -861,10 +863,9 @@ IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox ) bChecked = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); } - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); m_pNumberingSeparatorFT->Enable( bChecked && nPos == 1 ); m_pNumberingSeparatorED->Enable( bChecked && nPos == 1 ); - return 0; } void SwCaptionOptPage::InvalidatePreview() diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index c4ec368b83d2..54575fc5e718 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -508,10 +508,9 @@ void SwAddPrinterTabPage::SetFax( const std::vector<OUString>& rFaxLst ) m_pFaxLB->SelectEntryPos(0); } -IMPL_LINK_NOARG(SwAddPrinterTabPage, SelectHdl) +IMPL_LINK_NOARG_TYPED(SwAddPrinterTabPage, SelectHdl, ListBox&, void) { bAttrModified=true; - return 0; } void SwAddPrinterTabPage::PageCreated( const SfxAllItemSet& aSet) @@ -1785,7 +1784,7 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( vcl::Window* pParent, pDeletedLB->RemoveEntry(4); pDeletedLB->RemoveEntry(3); - Link<> aLk = LINK(this, SwRedlineOptionsTabPage, AttribHdl); + Link<ListBox&,void> aLk = LINK(this, SwRedlineOptionsTabPage, AttribHdl); pInsertLB->SetSelectHdl( aLk ); pDeletedLB->SetSelectHdl( aLk ); pChangedLB->SetSelectHdl( aLk ); @@ -2066,27 +2065,27 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet* ) pMarkPosLB->SelectEntryPos(nPos); // show settings in preview - AttribHdl(pInsertLB); - ColorHdl(pInsertColorLB); - AttribHdl(pDeletedLB); - ColorHdl(pInsertColorLB); - AttribHdl(pChangedLB); - ColorHdl(pChangedColorLB); + AttribHdl(*pInsertLB); + ColorHdl(*pInsertColorLB); + AttribHdl(*pDeletedLB); + ColorHdl(*pInsertColorLB); + AttribHdl(*pChangedLB); + ColorHdl(*pChangedColorLB); - ChangedMaskPrevHdl(); + ChangedMaskPrevHdl(*pMarkPosLB); } -IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SwRedlineOptionsTabPage, AttribHdl, ListBox&, rLB, void ) { SvxFontPrevWindow *pPrev = 0; ColorListBox *pColorLB; - if (pLB == pInsertLB) + if (&rLB == pInsertLB) { pColorLB = pInsertColorLB; pPrev = pInsertedPreviewWN; } - else if (pLB == pDeletedLB) + else if (&rLB == pDeletedLB) { pColorLB = pDeletedColorLB; pPrev = pDeletedPreviewWN; @@ -2130,11 +2129,11 @@ IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox *, pLB ) break; } - nPos = pLB->GetSelectEntryPos(); + nPos = rLB.GetSelectEntryPos(); if( nPos == LISTBOX_ENTRY_NOTFOUND ) nPos = 0; - CharAttr* pAttr = static_cast<CharAttr*>(pLB->GetEntryData( nPos )); + CharAttr* pAttr = static_cast<CharAttr*>(rLB.GetEntryData( nPos )); //switch off preview background color pPrev->ResetColor(); switch (pAttr->nItemId) @@ -2179,12 +2178,11 @@ IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox *, pLB ) } pPrev->Invalidate(); - - return 0; } -IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, ColorListBox *, pColorLB ) +IMPL_LINK_TYPED( SwRedlineOptionsTabPage, ColorHdl, ListBox&, rListBox, void ) { + ColorListBox* pColorLB = static_cast<ColorListBox*>(&rListBox); SvxFontPrevWindow *pPrev = 0; ListBox* pLB; @@ -2245,18 +2243,14 @@ IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, ColorListBox *, pColorLB ) } pPrev->Invalidate(); - - return 0; } -IMPL_LINK_NOARG(SwRedlineOptionsTabPage, ChangedMaskPrevHdl) +IMPL_LINK_NOARG_TYPED(SwRedlineOptionsTabPage, ChangedMaskPrevHdl, ListBox&, void) { pMarkPreviewWN->SetMarkPos(pMarkPosLB->GetSelectEntryPos()); pMarkPreviewWN->SetColor(pMarkColorLB->GetSelectEntryColor().GetColor()); pMarkPreviewWN->Invalidate(); - - return 0; } void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index 0516b8e6404e..b935b6394374 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -75,10 +75,9 @@ void SwCustomizeAddressListDialog::dispose() } -IMPL_LINK_NOARG(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwCustomizeAddressListDialog, ListBoxSelectHdl_Impl, ListBox&, void) { UpdateButtons(); - return 0; } IMPL_LINK_TYPED(SwCustomizeAddressListDialog, AddRenameHdl_Impl, Button*, pButton, void) diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx index 5466f1f997dd..1fae616ee4f1 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx @@ -43,7 +43,7 @@ class SwCustomizeAddressListDialog : public SfxModalDialog DECL_LINK_TYPED(AddRenameHdl_Impl, Button*, void); DECL_LINK_TYPED(DeleteHdl_Impl, Button*, void); DECL_LINK_TYPED(UpDownHdl_Impl, Button*, void); - DECL_LINK(ListBoxSelectHdl_Impl, void *); + DECL_LINK_TYPED(ListBoxSelectHdl_Impl, ListBox&, void); void UpdateButtons(); public: diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 5777bfc1569c..0a48c570f1da 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -480,7 +480,7 @@ IMPL_LINK_TYPED( SwInsertDBColAutoPilot, PageHdl, Button*, pButton, void ) if( bShowTable ) m_pPbTableFormat->Enable( 0 != m_pLbTableCol->GetEntryCount() ); - SelectHdl( bShowTable ? m_pLbTableDbColumn : m_pLbTextDbColumn ); + SelectHdl( bShowTable ? *m_pLbTableDbColumn : *m_pLbTextDbColumn ); } IMPL_LINK_TYPED( SwInsertDBColAutoPilot, DBFormatHdl, Button*, pButton, void ) @@ -784,24 +784,24 @@ IMPL_LINK_TYPED( SwInsertDBColAutoPilot, AutoFormatHdl, Button*, pButton, void ) pDlg->FillAutoFormatOfIndex( pTAutoFormat ); } -IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( SwInsertDBColAutoPilot, SelectHdl, ListBox&, rBox, void ) { - ListBox* pGetBox = pBox == m_pLbDbFormatFromUsr + ListBox* pGetBox = &rBox == m_pLbDbFormatFromUsr ? ( m_pRbAsTable->IsChecked() ? ( 0 == m_pLbTableCol->GetEntryData( 0 ) ? m_pLbTableDbColumn.get() : m_pLbTableCol.get() ) : m_pLbTextDbColumn.get() ) - : pBox; + : &rBox; SwInsDBColumn aSrch( pGetBox->GetSelectEntry(), 0 ); SwInsDBColumns::const_iterator it = aDBColumns.find( &aSrch ); - if( pBox == m_pLbDbFormatFromUsr ) + if( &rBox == m_pLbDbFormatFromUsr ) { if( !aSrch.sColumn.isEmpty() ) { - aOldNumFormatLnk.Call( pBox ); + aOldNumFormatLnk.Call( rBox ); (*it)->nUsrNumFormat = m_pLbDbFormatFromUsr->GetFormat(); } } @@ -839,10 +839,9 @@ IMPL_LINK( SwInsertDBColAutoPilot, SelectHdl, ListBox*, pBox ) // to know later on, what ListBox was the "active", a Flag // is remembered in the 1st entry - void* pPtr = pBox == m_pLbTableCol ? m_pLbTableCol.get() : 0; + void* pPtr = &rBox == m_pLbTableCol ? m_pLbTableCol.get() : 0; m_pLbTableCol->SetEntryData( 0, pPtr ); } - return 0; } IMPL_LINK_TYPED( SwInsertDBColAutoPilot, HeaderHdl, Button*, pButton, void ) diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 67daed33acfa..6cc682b2d393 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -810,7 +810,7 @@ class SwAssignFieldsControl : public Control long m_nFirstYPos; DECL_LINK_TYPED(ScrollHdl_Impl, ScrollBar*, void); - DECL_LINK(MatchHdl_Impl, ListBox*); + DECL_LINK_TYPED(MatchHdl_Impl, ListBox&, void); DECL_LINK_TYPED(GotFocusHdl_Impl, Control&, void); virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; @@ -881,7 +881,7 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem) //each position in this sequence matches the position in the header array rHeaders //if no assignment is available an empty sequence will be returned uno::Sequence< OUString> aAssignments = rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() ); - Link<> aMatchHdl = LINK(this, SwAssignFieldsControl, MatchHdl_Impl); + Link<ListBox&,void> aMatchHdl = LINK(this, SwAssignFieldsControl, MatchHdl_Impl); Link<Control&,void> aFocusHdl = LINK(this, SwAssignFieldsControl, GotFocusHdl_Impl); //fill the controls @@ -1098,9 +1098,9 @@ IMPL_LINK_TYPED(SwAssignFieldsControl, ScrollHdl_Impl, ScrollBar*, pScroll, void SetUpdateMode(true); } -IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SwAssignFieldsControl, MatchHdl_Impl, ListBox&, rBox, void) { - const OUString sColumn = pBox->GetSelectEntry(); + const OUString sColumn = rBox.GetSelectEntry(); uno::Reference< XColumnsSupplier > xColsSupp( m_rConfigItem->GetResultSet(), uno::UNO_QUERY); uno::Reference <XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : 0; OUString sPreview; @@ -1123,14 +1123,13 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox) sal_Int32 nIndex = 0; for(auto aLBIter = m_aMatches.begin(); aLBIter != m_aMatches.end(); ++aLBIter, ++nIndex) { - if(*aLBIter == pBox) + if(*aLBIter == &rBox) { m_aPreviews[nIndex]->SetText(sPreview); break; } } m_aModifyHdl.Call(0); - return 0; } IMPL_LINK_TYPED(SwAssignFieldsControl, GotFocusHdl_Impl, Control&, rControl, void) diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 0295fd7bb6b4..5192a7399b9d 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -145,6 +145,11 @@ IMPL_LINK_NOARG(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl) return 0; } +IMPL_LINK_NOARG_TYPED(SwMailMergeGreetingsPage, GreetingSelectListBoxHdl_Impl, ListBox&, void) +{ + UpdatePreview(); +} + void SwMailMergeGreetingsPage::UpdatePreview() { //find out which type of greeting should be selected: @@ -260,9 +265,10 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* _pParent) m_pMalePB->SetClickHdl(aGreetingLink); m_pAssignPB->SetClickHdl(LINK(this, SwMailMergeGreetingsPage, AssignHdl_Impl)); Link<> aLBoxLink = LINK(this, SwMailMergeGreetingsPage, GreetingSelectHdl_Impl); - m_pFemaleLB->SetSelectHdl(aLBoxLink); - m_pMaleLB->SetSelectHdl(aLBoxLink); - m_pFemaleColumnLB->SetSelectHdl(aLBoxLink); + Link<ListBox&,void> aLBoxLink2 = LINK(this, SwMailMergeGreetingsPage, GreetingSelectListBoxHdl_Impl); + m_pFemaleLB->SetSelectHdl(aLBoxLink2); + m_pMaleLB->SetSelectHdl(aLBoxLink2); + m_pFemaleColumnLB->SetSelectHdl(aLBoxLink2); m_pFemaleFieldCB->SetSelectHdl(aLBoxLink); m_pFemaleFieldCB->SetModifyHdl(aLBoxLink); m_pNeutralCB->SetSelectHdl(aLBoxLink); diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx index 91c6332fe1f0..c54091c6730f 100644 --- a/sw/source/ui/dbui/mmgreetingspage.hxx +++ b/sw/source/ui/dbui/mmgreetingspage.hxx @@ -82,6 +82,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(GreetingSelectListBoxHdl_Impl, ListBox&, void); DECL_LINK_TYPED(AssignHdl_Impl, Button*, void); virtual void UpdatePreview() SAL_OVERRIDE; diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 719cc59bdd14..78c6bd70912b 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -660,13 +660,13 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExample m_pTopMF->SetMax(rPageSize.GetHeight() - DEFAULT_TOP_DISTANCE); } -IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox&, rBox, void) { if(m_pExampleWrtShell) { sal_Int16 eType = DocumentZoomType::BY_VALUE; short nZoom = 50; - switch(pBox->GetSelectEntryPos()) + switch(rBox.GetSelectEntryPos()) { case 0 : eType = DocumentZoomType::ENTIRE_PAGE; break; case 1 : nZoom = 50; break; @@ -680,7 +680,6 @@ IMPL_LINK(SwMailMergeLayoutPage, ZoomHdl_Impl, ListBox*, pBox) m_xViewProperties->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom); } - return 0; } IMPL_LINK_NOARG_TYPED(SwMailMergeLayoutPage, ChangeAddressLoseFocusHdl_Impl, Control&, void) diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx index 7d18971aae26..3becaf6d1b73 100644 --- a/sw/source/ui/dbui/mmlayoutpage.hxx +++ b/sw/source/ui/dbui/mmlayoutpage.hxx @@ -66,7 +66,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xViewProperties; DECL_LINK_TYPED(PreviewLoadedHdl_Impl, SwOneExampleFrame&, void); - DECL_LINK(ZoomHdl_Impl, ListBox*); + DECL_LINK_TYPED(ZoomHdl_Impl, ListBox&, void); DECL_LINK(ChangeAddressHdl_Impl, void *); DECL_LINK_TYPED(ChangeAddressLoseFocusHdl_Impl, Control&, void); DECL_LINK_TYPED(GreetingsHdl_Impl, Button*, void); diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 8068ea7d47d1..66de1ff635b6 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -519,7 +519,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, OutputTypeHdl_Impl, Button*, pButton, voi m_pMailToLB->SelectEntry(sEMailColumn); // HTML format pre-selected m_pSendAsLB->SelectEntryPos(3); - SendTypeHdl_Impl(m_pSendAsLB); + SendTypeHdl_Impl(*m_pSendAsLB); } } m_pFromRB->GetClickHdl().Call(m_pFromRB->IsChecked() ? m_pFromRB.get() : 0); @@ -815,14 +815,14 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveOutputHdl_Impl, Button*, pButton, voi m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); } -IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox&, rBox, void) { SwView *const pTargetView = m_pWizard->GetConfigItem().GetTargetView(); SfxPrinter *const pDocumentPrinter = pTargetView->GetWrtShell() .getIDocumentDeviceAccess().getPrinter(true); - if (pDocumentPrinter && pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) + if (pDocumentPrinter && rBox.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) { - const QueueInfo* pInfo = Printer::GetQueueInfo( pBox->GetSelectEntry(), false ); + const QueueInfo* pInfo = Printer::GetQueueInfo( rBox.GetSelectEntry(), false ); if( pInfo ) { @@ -853,9 +853,7 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox) } else m_pPrinterSettingsPB->Disable(); - m_pWizard->GetConfigItem().SetSelectedPrinter( pBox->GetSelectEntry() ); - - return 0; + m_pWizard->GetConfigItem().SetSelectedPrinter( rBox.GetSelectEntry() ); } IMPL_LINK_NOARG_TYPED(SwMailMergeOutputPage, PrintHdl_Impl, Button*, void) @@ -918,14 +916,14 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeOutputPage, PrintHdl_Impl, Button*, void) IMPL_LINK_TYPED(SwMailMergeOutputPage, PrinterSetupHdl_Impl, Button*, pButton, void) { if( !m_pTempPrinter ) - PrinterChangeHdl_Impl(m_pPrinterLB); + PrinterChangeHdl_Impl(*m_pPrinterLB); if(m_pTempPrinter) m_pTempPrinter->Setup(pButton); } -IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox) +IMPL_LINK_TYPED(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox&, rBox, void) { - sal_uLong nDocType = reinterpret_cast<sal_uLong>(pBox->GetSelectEntryData()); + sal_uLong nDocType = reinterpret_cast<sal_uLong>(rBox.GetSelectEntryData()); bool bEnable = MM_DOCTYPE_HTML != nDocType && MM_DOCTYPE_TEXT != nDocType; m_pSendAsPB->Enable( bEnable ); m_pAttachmentGroup->Enable( bEnable ); @@ -946,7 +944,6 @@ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox) m_pAttachmentED->SetText(sAttach); } } - return 0; } IMPL_LINK_TYPED(SwMailMergeOutputPage, SendAsHdl_Impl, Button*, pButton, void) diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx index 6f264cb0db42..8f4901b596a8 100644 --- a/sw/source/ui/dbui/mmoutputpage.hxx +++ b/sw/source/ui/dbui/mmoutputpage.hxx @@ -108,10 +108,10 @@ class SwMailMergeOutputPage : public svt::OWizardPage DECL_LINK_TYPED(CopyToHdl_Impl, Button*, void); DECL_LINK_TYPED(SaveStartHdl_Impl, Button*, void ); DECL_LINK_TYPED(SaveOutputHdl_Impl, Button* , void); - DECL_LINK(PrinterChangeHdl_Impl, ListBox* ); + DECL_LINK_TYPED(PrinterChangeHdl_Impl, ListBox&,void ); DECL_LINK_TYPED(PrintHdl_Impl, Button*, void); DECL_LINK_TYPED(PrinterSetupHdl_Impl, Button*, void ); - DECL_LINK(SendTypeHdl_Impl, ListBox*); + DECL_LINK_TYPED(SendTypeHdl_Impl, ListBox&, void); DECL_LINK_TYPED(SendAsHdl_Impl, Button*, void); DECL_LINK_TYPED(SendDocumentsHdl_Impl, Button*, void); DECL_LINK_TYPED(DocumentSelectionHdl_Impl, Button*, void); diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index c9f5f314f11e..e88370572485 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -318,8 +318,9 @@ LineEnd SwAsciiFilterDlg::GetCRLF() const return eEnd; } -IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, SvxTextEncodingBox*, pBox ) +IMPL_LINK_TYPED( SwAsciiFilterDlg, CharSetSelHdl, ListBox&, rListBox, void ) { + SvxTextEncodingBox* pBox = static_cast<SvxTextEncodingBox*>(&rListBox); LineEnd eOldEnd = GetCRLF(), eEnd = (LineEnd)-1; LanguageType nLng = m_pFontLB->IsVisible() ? m_pLanguageLB->GetSelectLanguage() @@ -390,8 +391,6 @@ IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, SvxTextEncodingBox*, pBox ) if( nOldLng != nLng && m_pFontLB->IsVisible() ) m_pLanguageLB->SelectLanguage( nLng ); - - return 0; } IMPL_LINK_TYPED( SwAsciiFilterDlg, LineEndHdl, RadioButton&, rBtn, void ) diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 495af4caf296..7c06b38580b8 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -247,7 +247,7 @@ IMPL_LINK( SwEnvFormatPage, ModifyHdl, Edit *, pEdit ) lUserH = lHeight; } - m_pSizeFormatBox->GetSelectHdl().Call(m_pSizeFormatBox); + m_pSizeFormatBox->GetSelectHdl().Call(*m_pSizeFormatBox); } else { @@ -384,7 +384,7 @@ SfxItemSet *SwEnvFormatPage::GetCollItemSet(SwTextFormatColl* pColl, bool bSende return pAddrSet; } -IMPL_LINK_NOARG(SwEnvFormatPage, FormatHdl) +IMPL_LINK_NOARG_TYPED(SwEnvFormatPage, FormatHdl, ListBox&, void) { long lWidth; long lHeight; @@ -423,7 +423,6 @@ IMPL_LINK_NOARG(SwEnvFormatPage, FormatHdl) FillItem(GetParentSwEnvDlg()->aEnvItem); m_pPreview->Invalidate(); - return 0; } void SwEnvFormatPage::SetMinMax() diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx index d3a81afdaf86..6d47bc314af1 100644 --- a/sw/source/ui/envelp/envfmt.hxx +++ b/sw/source/ui/envelp/envfmt.hxx @@ -46,7 +46,7 @@ class SwEnvFormatPage : public SfxTabPage DECL_LINK( ModifyHdl, Edit * ); DECL_LINK_TYPED( LoseFocusHdl, Control&, void ); DECL_LINK_TYPED( EditHdl, MenuButton *, void ); - DECL_LINK(FormatHdl, void *); + DECL_LINK_TYPED(FormatHdl, ListBox&, void); void SetMinMax(); diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index e24dbd09f427..89d7f9d749da 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -247,13 +247,13 @@ void SwEnvPage::dispose() SfxTabPage::dispose(); } -IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SwEnvPage, DatabaseHdl, ListBox&, rListBox, void ) { SwWait aWait( *pSh->GetView().GetDocShell(), true ); - if (pListBox == m_pDatabaseLB) + if (&rListBox == m_pDatabaseLB) { - sActDBName = pListBox->GetSelectEntry(); + sActDBName = rListBox.GetSelectEntry(); pSh->GetDBManager()->GetTableNames(m_pTableLB, sActDBName); sActDBName += OUString(DB_DELIM); } @@ -263,7 +263,6 @@ IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) } pSh->GetDBManager()->GetColumnNames(m_pDBFieldLB, m_pDatabaseLB->GetSelectEntry(), m_pTableLB->GetSelectEntry()); - return 0; } IMPL_LINK_NOARG_TYPED(SwEnvPage, FieldHdl, Button*, void) diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 90f6497e7f0e..c346b7eba36c 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -288,7 +288,7 @@ SwLabPage::SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet) } m_pMakeBox->SelectEntryPos( nLstGroup ); - m_pMakeBox->GetSelectHdl().Call(m_pMakeBox); + m_pMakeBox->GetSelectHdl().Call(*m_pMakeBox); } SwLabPage::~SwLabPage() @@ -336,17 +336,16 @@ IMPL_LINK_NOARG_TYPED(SwLabPage, AddrHdl, Button*, void) m_pWritingEdit->GrabFocus(); } -IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox ) +IMPL_LINK_TYPED( SwLabPage, DatabaseHdl, ListBox&, rListBox, void ) { sActDBName = m_pDatabaseLB->GetSelectEntry(); WaitObject aObj( GetParentSwLabDlg() ); - if (pListBox == m_pDatabaseLB) + if (&rListBox == m_pDatabaseLB) GetDBManager()->GetTableNames(m_pTableLB, sActDBName); GetDBManager()->GetColumnNames(m_pDBFieldLB, sActDBName, m_pTableLB->GetSelectEntry()); - return 0; } IMPL_LINK_NOARG_TYPED(SwLabPage, FieldHdl, Button*, void) @@ -363,10 +362,10 @@ IMPL_LINK_NOARG_TYPED(SwLabPage, FieldHdl, Button*, void) IMPL_LINK_NOARG_TYPED(SwLabPage, PageHdl, Button*, void) { - m_pMakeBox->GetSelectHdl().Call(m_pMakeBox); + m_pMakeBox->GetSelectHdl().Call(*m_pMakeBox); } -IMPL_LINK_NOARG(SwLabPage, MakeHdl) +IMPL_LINK_NOARG_TYPED(SwLabPage, MakeHdl, ListBox&, void) { WaitObject aWait( GetParentSwLabDlg() ); @@ -416,15 +415,13 @@ IMPL_LINK_NOARG(SwLabPage, MakeHdl) m_pTypeBox->SelectEntry(aItem.aLstType); else m_pTypeBox->SelectEntryPos(0); - m_pTypeBox->GetSelectHdl().Call(m_pTypeBox); - return 0; + m_pTypeBox->GetSelectHdl().Call(*m_pTypeBox); } -IMPL_LINK_NOARG(SwLabPage, TypeHdl) +IMPL_LINK_NOARG_TYPED(SwLabPage, TypeHdl, ListBox&, void) { DisplayFormat(); aItem.aType = m_pTypeBox->GetSelectEntry(); - return 0; } void SwLabPage::DisplayFormat() @@ -542,7 +539,7 @@ void SwLabPage::Reset(const SfxItemSet* rSet) m_pMakeBox->SelectEntry( aItem.aMake ); //save the current type OUString sType(aItem.aType); - m_pMakeBox->GetSelectHdl().Call(m_pMakeBox); + m_pMakeBox->GetSelectHdl().Call(*m_pMakeBox); aItem.aType = sType; //#102806# a newly added make may not be in the type ListBox already if (m_pTypeBox->GetEntryPos(aItem.aType) == LISTBOX_ENTRY_NOTFOUND && !aItem.aMake.isEmpty()) @@ -550,12 +547,12 @@ void SwLabPage::Reset(const SfxItemSet* rSet) if (m_pTypeBox->GetEntryPos(aItem.aType) != LISTBOX_ENTRY_NOTFOUND) { m_pTypeBox->SelectEntry(aItem.aType); - m_pTypeBox->GetSelectHdl().Call(m_pTypeBox); + m_pTypeBox->GetSelectHdl().Call(*m_pTypeBox); } if (m_pDatabaseLB->GetEntryPos(sDBName) != LISTBOX_ENTRY_NOTFOUND) { m_pDatabaseLB->SelectEntry(sDBName); - m_pDatabaseLB->GetSelectHdl().Call(m_pDatabaseLB); + m_pDatabaseLB->GetSelectHdl().Call(*m_pDatabaseLB); } if (aItem.bCont) @@ -718,7 +715,7 @@ void SwVisitingCardPage::Reset(const SfxItemSet* rSet) if(m_pAutoTextGroupLB->GetSelectEntryPos() != i) { m_pAutoTextGroupLB->SelectEntryPos(i); - AutoTextSelectHdl(m_pAutoTextGroupLB); + AutoTextSelectHdl(*m_pAutoTextGroupLB); } if(lcl_FindBlock(*m_pAutoTextLB, aLabItem.sGlossaryBlockName)) { @@ -727,7 +724,8 @@ void SwVisitingCardPage::Reset(const SfxItemSet* rSet) *static_cast<OUString*>(pSelEntry->GetUserData()) != aLabItem.sGlossaryBlockName) { lcl_SelectBlock(*m_pAutoTextLB, aLabItem.sGlossaryBlockName); - AutoTextSelectHdl(m_pAutoTextLB); + if(m_xAutoText.is() && pExampleFrame->IsInitialized()) + pExampleFrame->ClearDocument( true ); } } } diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx index 206d9353d892..9bdc69ee9b00 100644 --- a/sw/source/ui/envelp/labelexp.cxx +++ b/sw/source/ui/envelp/labelexp.cxx @@ -132,15 +132,16 @@ IMPL_LINK_NOARG_TYPED(SwVisitingCardPage, FrameControlInitializedHdl, SwOneExamp } } -IMPL_LINK_TYPED( SwVisitingCardPage, AutoTextSelectTreeListBoxHdl, SvTreeListBox*, pBox, void ) +IMPL_LINK_NOARG_TYPED( SwVisitingCardPage, AutoTextSelectTreeListBoxHdl, SvTreeListBox*, void ) { - AutoTextSelectHdl(pBox); + if(m_xAutoText.is() && pExampleFrame->IsInitialized()) + pExampleFrame->ClearDocument( true ); } -IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox ) +IMPL_LINK_TYPED( SwVisitingCardPage, AutoTextSelectHdl, ListBox&, rBox, void ) { if(m_xAutoText.is()) { - if (m_pAutoTextGroupLB == pBox) + if (m_pAutoTextGroupLB == &rBox) { const OUString *pGroup( static_cast<const OUString*>(m_pAutoTextGroupLB->GetSelectEntryData())); uno::Any aGroup = m_xAutoText->getByName(*pGroup); @@ -158,7 +159,6 @@ IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox ) if(pExampleFrame->IsInitialized()) pExampleFrame->ClearDocument( true ); } - return 0; } void SwVisitingCardPage::UpdateFields() diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx index 6dacd6bc6b60..7634d68ceea6 100644 --- a/sw/source/ui/envelp/swuilabimp.hxx +++ b/sw/source/ui/envelp/swuilabimp.hxx @@ -48,11 +48,11 @@ class SwLabPage : public SfxTabPage bool m_bLabel; DECL_LINK_TYPED(AddrHdl, Button*, void); - DECL_LINK(DatabaseHdl, ListBox * ); + DECL_LINK_TYPED(DatabaseHdl, ListBox&, void ); DECL_LINK_TYPED(FieldHdl, Button *, void); DECL_LINK_TYPED(PageHdl, Button *, void); - DECL_LINK(MakeHdl, void *); - DECL_LINK(TypeHdl, void *); + DECL_LINK_TYPED(MakeHdl, ListBox&, void); + DECL_LINK_TYPED(TypeHdl, ListBox&, void); void DisplayFormat (); SwLabRec* GetSelectedEntryPos(); @@ -98,7 +98,7 @@ class SwVisitingCardPage : public SfxTabPage ::com::sun::star::uno::Reference< ::com::sun::star::text::XAutoTextContainer2 > m_xAutoText; DECL_LINK_TYPED( AutoTextSelectTreeListBoxHdl, SvTreeListBox*, void ); - DECL_LINK( AutoTextSelectHdl, void* ); + DECL_LINK_TYPED( AutoTextSelectHdl, ListBox&, void ); DECL_LINK_TYPED( FrameControlInitializedHdl, SwOneExampleFrame&, void ); void InitFrameControl(); diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 8da28091d685..34db853ebcae 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -183,7 +183,7 @@ void SwFieldDBPage::Reset(const SfxItemSet*) TypeHdl(0); m_pTypeLB->SetUpdateMode(true); - m_pTypeLB->SetSelectHdl(LINK(this, SwFieldDBPage, TypeHdl)); + m_pTypeLB->SetSelectHdl(LINK(this, SwFieldDBPage, TypeListBoxHdl)); m_pTypeLB->SetDoubleClickHdl(LINK(this, SwFieldDBPage, ListBoxInsertHdl)); if (IsFieldEdit()) @@ -275,7 +275,12 @@ sal_uInt16 SwFieldDBPage::GetGroup() return GRP_DB; } -IMPL_LINK( SwFieldDBPage, TypeHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwFieldDBPage, TypeListBoxHdl, ListBox&, rBox, void ) +{ + TypeHdl(&rBox); +} + +void SwFieldDBPage::TypeHdl( ListBox* pBox ) { // save old ListBoxPos const sal_Int32 nOld = GetTypeSel(); @@ -393,16 +398,12 @@ IMPL_LINK( SwFieldDBPage, TypeHdl, ListBox *, pBox ) CheckInsert(); } - - return 0; } -IMPL_LINK( SwFieldDBPage, NumSelectHdl, NumFormatListBox *, pLB ) +IMPL_LINK_TYPED( SwFieldDBPage, NumSelectHdl, ListBox&, rLB, void ) { m_pNewFormatRB->Check(); - m_aOldNumSelectHdl.Call(pLB); - - return 0; + m_aOldNumSelectHdl.Call(rLB); } void SwFieldDBPage::CheckInsert() @@ -502,7 +503,7 @@ void SwFieldDBPage::ActivateMailMergeAddress() { sal_uLong nData = TYP_DBFLD; m_pTypeLB->SelectEntryPos(m_pTypeLB->GetEntryPos( reinterpret_cast<const void*>( nData ) )); - m_pTypeLB->GetSelectHdl().Call(m_pTypeLB); + m_pTypeLB->GetSelectHdl().Call(*m_pTypeLB); const SwDBData& rData = SW_MOD()->GetDBConfig()->GetAddressSource(); m_pDatabaseTLB->Select(rData.sDataSource, rData.sCommand, aEmptyOUStr); } diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx index cc118696dc17..d6813766a735 100644 --- a/sw/source/ui/fldui/flddb.hxx +++ b/sw/source/ui/fldui/flddb.hxx @@ -52,13 +52,14 @@ class SwFieldDBPage : public SwFieldPage OUString m_sOldColumnName; sal_uLong m_nOldFormat; sal_uInt16 m_nOldSubType; - Link<> m_aOldNumSelectHdl; + Link<ListBox&,void> m_aOldNumSelectHdl; - DECL_LINK( TypeHdl, ListBox* ); - DECL_LINK( NumSelectHdl, NumFormatListBox* ); + 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); + void TypeHdl(ListBox*); void CheckInsert(); diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index a71fcb71964e..9b107f8137cf 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -235,10 +235,10 @@ IMPL_LINK_NOARG_TYPED(SwFieldDokInfPage, TypeHdl, SvTreeListBox*, void) else if (pOldEntry != pSelEntry) FillSelectionLB((sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData())); - SubTypeHdl(); + SubTypeHdl(*m_pSelectionLB); } -IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl) +IMPL_LINK_NOARG_TYPED(SwFieldDokInfPage, SubTypeHdl, ListBox&, void) { sal_uInt16 nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()); sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); @@ -279,7 +279,7 @@ IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl) } } else - return 0; + return; } nPos = 0; } @@ -367,8 +367,6 @@ IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl) { m_pFormatLB->SelectEntryPos(0); } - - return 0; } sal_Int32 SwFieldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index e4ebe9278d9b..dd89d2d6eaf7 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -51,7 +51,7 @@ class SwFieldDokInfPage : public SwFieldPage OUString m_sOldCustomFieldName; DECL_LINK_TYPED(TypeHdl, SvTreeListBox*, void); - DECL_LINK(SubTypeHdl, void * = 0); + DECL_LINK_TYPED(SubTypeHdl, ListBox&, void); sal_Int32 FillSelectionLB(sal_uInt16 nSubTypeId); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 424152214e11..00d91dc60038 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -192,7 +192,7 @@ void SwFieldDokPage::Reset(const SfxItemSet* ) } } } - TypeHdl(0); + TypeHdl(*m_pTypeLB); if (IsFieldEdit()) { @@ -205,7 +205,7 @@ void SwFieldDokPage::Reset(const SfxItemSet* ) } } -IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl) +IMPL_LINK_NOARG_TYPED(SwFieldDokPage, TypeHdl, ListBox&, void) { // save old ListBoxPos const sal_Int32 nOld = GetTypeSel(); @@ -300,7 +300,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl) } } } - m_pSelectionLB->SetSelectHdl(Link<>()); + m_pSelectionLB->SetSelectHdl(Link<ListBox&,void>()); } else { @@ -450,8 +450,6 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl) m_pValueFT->Enable(bValue || bLevel || bOffset); m_pValueED->Enable(bValue); } - - return 0; } void SwFieldDokPage::AddSubType(sal_uInt16 nTypeId) @@ -460,7 +458,7 @@ void SwFieldDokPage::AddSubType(sal_uInt16 nTypeId) m_pSelectionLB->SetEntryData(nPos, reinterpret_cast<void*>(nTypeId)); } -IMPL_LINK_NOARG(SwFieldDokPage, SubTypeHdl) +IMPL_LINK_NOARG_TYPED(SwFieldDokPage, SubTypeHdl, ListBox&, void) { sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos == LISTBOX_ENTRY_NOTFOUND) @@ -490,8 +488,6 @@ IMPL_LINK_NOARG(SwFieldDokPage, SubTypeHdl) if( nTextRes ) m_pValueFT->SetText( SW_RESSTR( nTextRes )); - - return 0; } sal_Int32 SwFieldDokPage::FillFormatLB(sal_uInt16 nTypeId) @@ -524,12 +520,12 @@ sal_Int32 SwFieldDokPage::FillFormatLB(sal_uInt16 nTypeId) } } - FormatHdl(); + FormatHdl(*m_pFormatLB); return nSize; } -IMPL_LINK_NOARG(SwFieldDokPage, FormatHdl) +IMPL_LINK_NOARG_TYPED(SwFieldDokPage, FormatHdl, ListBox&, void) { sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); @@ -557,8 +553,6 @@ IMPL_LINK_NOARG(SwFieldDokPage, FormatHdl) if (sOldText != m_pValueFT->GetText()) m_pValueED->SetText( aEmptyOUStr ); } - - return 0; } bool SwFieldDokPage::FillItemSet(SfxItemSet* ) diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx index d3035ea5e969..bef27f832d80 100644 --- a/sw/source/ui/fldui/flddok.hxx +++ b/sw/source/ui/fldui/flddok.hxx @@ -50,9 +50,9 @@ class SwFieldDokPage : public SwFieldPage sal_Int32 nOldSel; sal_uLong nOldFormat; - DECL_LINK(TypeHdl, void *); - DECL_LINK(FormatHdl, void * = 0); - DECL_LINK(SubTypeHdl, void *); + DECL_LINK_TYPED(TypeHdl, ListBox&, void); + DECL_LINK_TYPED(FormatHdl, ListBox&, void); + DECL_LINK_TYPED(SubTypeHdl, ListBox&, void); void AddSubType(sal_uInt16 nTypeId); sal_Int32 FillFormatLB(sal_uInt16 nTypeId); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 8836017ad010..31aae8eb3b05 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -176,7 +176,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) m_pListItemED->SetReturnActionLink(LINK(this, SwFieldFuncPage, ListModifyReturnActionHdl)); Link<> aListEnableLk = LINK(this, SwFieldFuncPage, ListEnableHdl); m_pListItemED->SetModifyHdl(aListEnableLk); - m_pListItemsLB->SetSelectHdl(aListEnableLk); + m_pListItemsLB->SetSelectHdl(LINK(this, SwFieldFuncPage, ListEnableListBoxHdl)); if( !IsRefresh() ) { @@ -196,7 +196,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) } } } - TypeHdl(0); + TypeHdl(*m_pTypeLB); m_pTypeLB->SetUpdateMode(true); @@ -210,7 +210,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) } } -IMPL_LINK_NOARG(SwFieldFuncPage, TypeHdl) +IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, TypeHdl, ListBox&, void) { // save old ListBoxPos const sal_Int32 nOld = GetTypeSel(); @@ -401,23 +401,19 @@ IMPL_LINK_NOARG(SwFieldFuncPage, TypeHdl) EnableInsert( bInsert ); } - - return 0; } -IMPL_LINK_NOARG(SwFieldFuncPage, SelectHdl) +IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, SelectHdl, ListBox&, void) { const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if( TYP_MACROFLD == nTypeId ) m_pNameED->SetText( m_pSelectionLB->GetSelectEntry() ); - - return 0; } IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, InsertMacroHdl, ListBox&, void) { - SelectHdl(NULL); + SelectHdl(*m_pSelectionLB); InsertHdl(nullptr); } @@ -475,6 +471,10 @@ void SwFieldFuncPage::ListModifyHdl(Control* pControl) ListEnableHdl(0); } +IMPL_LINK_NOARG_TYPED(SwFieldFuncPage, ListEnableListBoxHdl, ListBox&, void) +{ + ListEnableHdl(0); +} IMPL_LINK_NOARG(SwFieldFuncPage, ListEnableHdl) { //enable "Add" button when text is in the Edit that's not already member of the box diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx index 238bf9b659e1..bd5abd35e63a 100644 --- a/sw/source/ui/fldui/fldfunc.hxx +++ b/sw/source/ui/fldui/fldfunc.hxx @@ -66,13 +66,14 @@ class SwFieldFuncPage : public SwFieldPage sal_uLong nOldFormat; bool bDropDownLBChanged; - DECL_LINK(TypeHdl, void *); - DECL_LINK(SelectHdl, void *); + 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); void ListModifyHdl(Control*); // select Macro diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 252cf9ba58cb..1c0bd9f74222 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -93,7 +93,7 @@ SwFieldRefPage::SwFieldRefPage(vcl::Window* pParent, const SfxItemSet& rCoreSet m_pTypeLB->SetDoubleClickHdl (LINK(this, SwFieldRefPage, ListBoxInsertHdl)); m_pTypeLB->SetSelectHdl (LINK(this, SwFieldRefPage, TypeHdl)); - m_pSelectionLB->SetSelectHdl (LINK(this, SwFieldRefPage, SubTypeHdl)); + m_pSelectionLB->SetSelectHdl (LINK(this, SwFieldRefPage, SubTypeListBoxHdl)); m_pSelectionLB->SetDoubleClickHdl (LINK(this, SwFieldRefPage, ListBoxInsertHdl)); m_pFormatLB->SetDoubleClickHdl (LINK(this, SwFieldRefPage, ListBoxInsertHdl)); @@ -264,7 +264,7 @@ void SwFieldRefPage::Reset(const SfxItemSet* ) } } } - TypeHdl(0); + TypeHdl(*m_pTypeLB); if (IsFieldEdit()) { @@ -276,7 +276,7 @@ void SwFieldRefPage::Reset(const SfxItemSet* ) } } -IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl) +IMPL_LINK_NOARG_TYPED(SwFieldRefPage, TypeHdl, ListBox&, void) { // save old ListBoxPos const sal_Int32 nOld = GetTypeSel(); @@ -407,18 +407,20 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl) bool bFormat = nSize != 0; m_pFormat->Enable(bFormat); - SubTypeHdl(NULL); + SubTypeHdl(); ModifyHdl(NULL); } - - return 0; } IMPL_LINK_NOARG_TYPED(SwFieldRefPage, SubTypeTreeListBoxHdl, SvTreeListBox*, void) { - SubTypeHdl(NULL); + SubTypeHdl(); +} +IMPL_LINK_NOARG_TYPED(SwFieldRefPage, SubTypeListBoxHdl, ListBox&, void) +{ + SubTypeHdl(); } -IMPL_LINK_NOARG(SwFieldRefPage, SubTypeHdl) +void SwFieldRefPage::SubTypeHdl() { sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); @@ -461,8 +463,6 @@ IMPL_LINK_NOARG(SwFieldRefPage, SubTypeHdl) m_pNameED->SetText(m_pSelectionLB->GetSelectEntry()); break; } - - return 0; } // renew types in SelectionLB diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index 24e5944d6b1b..3e63c48b8f25 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -60,10 +60,11 @@ class SwFieldRefPage : public SwFieldPage // fallback, if previously selected text node doesn't exist anymore size_t mnSavedSelectedPos; - DECL_LINK(TypeHdl, void *); - DECL_LINK(SubTypeHdl, void * = 0); + DECL_LINK_TYPED(TypeHdl, ListBox&, void); + DECL_LINK_TYPED(SubTypeListBoxHdl, ListBox&, void); DECL_LINK_TYPED(SubTypeTreeListBoxHdl, SvTreeListBox*, void); DECL_LINK(ModifyHdl, void * = 0); + void SubTypeHdl(); void UpdateSubType(); sal_Int32 FillFormatLB(sal_uInt16 nTypeId); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 5b65c8cb9cc1..b1366fbbefdb 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -162,7 +162,7 @@ void SwFieldVarPage::Reset(const SfxItemSet* ) m_pTypeLB->SetDoubleClickHdl (LINK(this, SwFieldVarPage, ListBoxInsertHdl)); m_pTypeLB->SetSelectHdl (LINK(this, SwFieldVarPage, TypeHdl)); - m_pSelectionLB->SetSelectHdl (LINK(this, SwFieldVarPage, SubTypeHdl)); + m_pSelectionLB->SetSelectHdl (LINK(this, SwFieldVarPage, SubTypeListBoxHdl)); m_pSelectionLB->SetDoubleClickHdl (LINK(this, SwFieldVarPage, ListBoxInsertHdl)); m_pFormatLB->SetDoubleClickHdl (LINK(this, SwFieldVarPage, ListBoxInsertHdl)); m_pNumFormatLB->SetDoubleClickHdl (LINK(this, SwFieldVarPage, ListBoxInsertHdl)); @@ -190,7 +190,7 @@ void SwFieldVarPage::Reset(const SfxItemSet* ) } } } - TypeHdl(0); + TypeHdl(*m_pTypeLB); m_pTypeLB->SetUpdateMode(true); @@ -207,7 +207,7 @@ void SwFieldVarPage::Reset(const SfxItemSet* ) } } -IMPL_LINK_NOARG(SwFieldVarPage, TypeHdl) +IMPL_LINK_NOARG_TYPED(SwFieldVarPage, TypeHdl, ListBox&, void) { // save old ListBoxPos const sal_Int32 nOld = GetTypeSel(); @@ -235,11 +235,14 @@ IMPL_LINK_NOARG(SwFieldVarPage, TypeHdl) } bInit = false; +} - return 0; +IMPL_LINK_TYPED( SwFieldVarPage, SubTypeListBoxHdl, ListBox&, rBox, void ) +{ + SubTypeHdl(&rBox); } -IMPL_LINK( SwFieldVarPage, SubTypeHdl, ListBox *, pBox ) +void SwFieldVarPage::SubTypeHdl(ListBox* pBox) { sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); sal_Int32 nSelPos = m_pSelectionLB->GetSelectEntryPos(); @@ -514,7 +517,7 @@ IMPL_LINK( SwFieldVarPage, SubTypeHdl, ListBox *, pBox ) m_pChapterLevelLB->SelectEntryPos( nLevel + 1 ); OUString sDelim = static_cast<SwSetExpFieldType*>(pFieldTyp)->GetDelimiter(); m_pSeparatorED->SetText( sDelim ); - ChapterHdl(); + ChapterHdl(*m_pChapterLevelLB); } } break; @@ -587,7 +590,6 @@ IMPL_LINK( SwFieldVarPage, SubTypeHdl, ListBox *, pBox ) } m_pSelectionLB->ResetCallAddSelection(); } - return 0; } // renew types in SelectionBox @@ -1098,15 +1100,13 @@ IMPL_LINK_TYPED( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void ) } } -IMPL_LINK_NOARG(SwFieldVarPage, ChapterHdl) +IMPL_LINK_NOARG_TYPED(SwFieldVarPage, ChapterHdl, ListBox&, void) { bool bEnable = m_pChapterLevelLB->GetSelectEntryPos() != 0; m_pSeparatorED->Enable(bEnable); m_pSeparatorFT->Enable(bEnable); SeparatorHdl(); - - return 0; } IMPL_LINK_NOARG(SwFieldVarPage, SeparatorHdl) diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx index 6292a5d6210d..d4b9ea176a84 100644 --- a/sw/source/ui/fldui/fldvar.hxx +++ b/sw/source/ui/fldui/fldvar.hxx @@ -76,12 +76,13 @@ class SwFieldVarPage : public SwFieldPage sal_uLong nOldFormat; bool bInit; - DECL_LINK(TypeHdl, void *); - DECL_LINK( SubTypeHdl, ListBox* ); + DECL_LINK_TYPED(TypeHdl, ListBox&, void); + DECL_LINK_TYPED( SubTypeListBoxHdl, ListBox&, void ); DECL_LINK(ModifyHdl, void * = 0); DECL_LINK_TYPED( TBClickHdl, ToolBox *, void ); - DECL_LINK(ChapterHdl, void * = 0); + DECL_LINK_TYPED(ChapterHdl, ListBox&, void); DECL_LINK(SeparatorHdl, void * = 0); + void SubTypeHdl(ListBox*); void UpdateSubType(); sal_Int32 FillFormatLB(sal_uInt16 nTypeId); diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 8a62944e9592..2595b91ef741 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -204,7 +204,7 @@ SwColumnDlg::SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh) m_pApplyToLB->SelectEntryPos(0); ObjectHdl(0); - m_pApplyToLB->SetSelectHdl(LINK(this, SwColumnDlg, ObjectHdl)); + m_pApplyToLB->SetSelectHdl(LINK(this, SwColumnDlg, ObjectListBoxHdl)); OKButton *pOK = get<OKButton>("ok"); pOK->SetClickHdl(LINK(this, SwColumnDlg, OkHdl)); //#i80458# if no columns can be set then disable OK @@ -230,7 +230,11 @@ void SwColumnDlg::dispose() SfxModalDialog::dispose(); } -IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwColumnDlg, ObjectListBoxHdl, ListBox&, rBox, void) +{ + ObjectHdl(&rBox); +} +void SwColumnDlg::ObjectHdl(ListBox* pBox) { SfxItemSet* pSet = 0; switch(nOldSelection) @@ -290,7 +294,6 @@ IMPL_LINK(SwColumnDlg, ObjectHdl, ListBox*, pBox) pTabPage->SetPageWidth(nWidth); if( pSet ) pTabPage->Reset(pSet); - return 0; } IMPL_LINK_NOARG_TYPED(SwColumnDlg, OkHdl, Button*, void) @@ -497,11 +500,12 @@ SwColumnPage::SwColumnPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pAutoWidthBox->SetClickHdl(LINK(this, SwColumnPage, AutoWidthHdl)); aLk = LINK( this, SwColumnPage, UpdateColMgr ); - m_pLineTypeDLB->SetSelectHdl( aLk ); + Link<ListBox&,void> aLk2 = LINK( this, SwColumnPage, UpdateColMgrListBox ); + m_pLineTypeDLB->SetSelectHdl( aLk2 ); m_pLineWidthEdit->SetModifyHdl( aLk ); - m_pLineColorDLB->SetSelectHdl( aLk ); + m_pLineColorDLB->SetSelectHdl( aLk2 ); m_pLineHeightEdit->SetModifyHdl( aLk ); - m_pLinePosDLB->SetSelectHdl( aLk ); + m_pLinePosDLB->SetSelectHdl( aLk2 ); // Separator line m_pLineTypeDLB->SetUnit( FUNIT_POINT ); @@ -695,6 +699,10 @@ bool SwColumnPage::FillItemSet(SfxItemSet *rSet) } // update ColumnManager +IMPL_LINK_NOARG_TYPED( SwColumnPage, UpdateColMgrListBox, ListBox&, void ) +{ + UpdateColMgr(0); +} IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr ) { long nGutterWidth = pColMgr->GetGutterWidth(); diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index db588e66959e..9e3fee8cf273 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -138,7 +138,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) : aLk = LINK(this, SwCaptionDialog, SelectHdl); m_pCategoryBox->SetSelectHdl( aLk ); - m_pFormatBox->SetSelectHdl( aLk ); + m_pFormatBox->SetSelectHdl( LINK(this, SwCaptionDialog, SelectListBoxHdl) ); m_pOptionButton->SetClickHdl( LINK( this, SwCaptionDialog, OptionHdl ) ); m_pAutoCaptionButton->SetClickHdl(LINK(this, SwCaptionDialog, CaptionHdl)); @@ -302,6 +302,10 @@ IMPL_LINK_TYPED( SwCaptionDialog, OptionHdl, Button*, pButton, void ) DrawSample(); } +IMPL_LINK_NOARG_TYPED(SwCaptionDialog, SelectListBoxHdl, ListBox&, void) +{ + DrawSample(); +} IMPL_LINK_NOARG(SwCaptionDialog, SelectHdl) { DrawSample(); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 9e3097c17db1..a2318f5ff99b 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1441,7 +1441,7 @@ sal_Int32 SwFrmPage::FillPosLB(const FrmMap* _pMap, if (!_rLB.GetSelectEntryCount()) _rLB.SelectEntryPos(0); - PosHdl(&_rLB); + PosHdl(_rLB); return GetMapPos(_pMap, _rLB); } @@ -1621,7 +1621,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, _rLB.Enable( bEnable ); _rFT.Enable( bEnable ); - RelHdl(&_rLB); + RelHdl(_rLB); return nLBRelations; } @@ -1940,23 +1940,23 @@ IMPL_LINK_NOARG_TYPED(SwFrmPage, AnchorTypeHdl, Button*, void) if(bHtmlMode) { - PosHdl(m_pHorizontalDLB); - PosHdl(m_pVerticalDLB); + PosHdl(*m_pHorizontalDLB); + PosHdl(*m_pVerticalDLB); } EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment && FLY_AS_CHAR == eId) ); } -IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SwFrmPage, PosHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHorizontalDLB; + bool bHori = &rLB == m_pHorizontalDLB; ListBox *pRelLB = bHori ? m_pHoriRelationLB : m_pVertRelationLB; FixedText *pRelFT = bHori ? m_pHoriRelationFT : m_pVertRelationFT; FrmMap *pMap = bHori ? pHMap : pVMap; - const sal_Int32 nMapPos = GetMapPos(pMap, *pLB); - const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB); + const sal_Int32 nMapPos = GetMapPos(pMap, rLB); + const sal_Int16 nAlign = GetAlignment(pMap, nMapPos, rLB, *pRelLB); if (bHori) { @@ -1974,7 +1974,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) RangeModifyHdl(); sal_Int16 nRel = 0; - if (pLB->GetSelectEntryCount()) + if (rLB.GetSelectEntryCount()) { if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) @@ -2020,7 +2020,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) bSet = true; } if(bSet) - PosHdl(m_pVerticalDLB); + PosHdl(*m_pVerticalDLB); } else { @@ -2043,17 +2043,16 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) m_pHoriRelationLB->SelectEntryPos(0) ; } if(bSet) - PosHdl(m_pHorizontalDLB); + PosHdl(*m_pHorizontalDLB); } } - return 0; } // horizontal Pos -IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) +IMPL_LINK_TYPED( SwFrmPage, RelHdl, ListBox&, rLB, void ) { - bool bHori = pLB == m_pHoriRelationLB; + bool bHori = &rLB == m_pHoriRelationLB; UpdateExample(); @@ -2077,10 +2076,7 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) } } } - if (pLB) // Only when Handler was called by changing of the controller - RangeModifyHdl(); - - return 0; + RangeModifyHdl(); } IMPL_LINK_NOARG_TYPED(SwFrmPage, RealSizeHdl, Button*, void) @@ -3056,7 +3052,7 @@ void SwFrmAddPage::Reset(const SfxItemSet *rSet ) } else pNextLB->SelectEntryPos(0); - Link<> aLink(LINK(this, SwFrmAddPage, ChainModifyHdl)); + Link<ListBox&,void> aLink(LINK(this, SwFrmAddPage, ChainModifyHdl)); pPrevLB->SetSelectHdl(aLink); pNextLB->SetSelectHdl(aLink); } @@ -3214,7 +3210,7 @@ void SwFrmAddPage::SetFormatUsed(bool bFormatUsed) } } -IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwFrmAddPage, ChainModifyHdl, ListBox&, rBox, void) { OUString sCurrentPrevChain, sCurrentNextChain; if(pPrevLB->GetSelectEntryPos()) @@ -3224,7 +3220,7 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) SwFrameFormat* pFormat = pWrtSh->GetFlyFrameFormat(); if (pFormat) { - bool bNextBox = pNextLB == pBox; + bool bNextBox = pNextLB == &rBox; ListBox& rChangeLB = bNextBox ? *pPrevLB : *pNextLB; for(sal_Int32 nEntry = rChangeLB.GetEntryCount(); nEntry > 1; nEntry--) rChangeLB.RemoveEntry(nEntry - 1); @@ -3244,7 +3240,6 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox) rChangeLB.SelectEntryPos(0); } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 695387b30e69..0416f1e8e49c 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -887,14 +887,14 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(vcl::Window* pParent, const SfxItemSet& r Link<> aModifyLk = LINK(this, SwTOXSelectTabPage, ModifyHdl); m_pTitleED->SetModifyHdl(aModifyLk); m_pLevelNF->SetModifyHdl(aModifyLk); - m_pSortAlgorithmLB->SetSelectHdl(aModifyLk); + m_pSortAlgorithmLB->SetSelectHdl(LINK(this, SwTOXSelectTabPage, ModifyListBoxHdl)); aLk = LINK(this, SwTOXSelectTabPage, RadioButtonHdl); m_pFromCaptionsRB->SetClickHdl(aLk); m_pFromObjectNamesRB->SetClickHdl(aLk); RadioButtonHdl(m_pFromCaptionsRB); - m_pLanguageLB->SetSelectHdl(LINK(this, SwTOXSelectTabPage, LanguageHdl)); + m_pLanguageLB->SetSelectHdl(LINK(this, SwTOXSelectTabPage, LanguageListBoxHdl)); m_pTypeLB->SelectEntryPos(0); m_pTitleED->SaveValue(); } @@ -1005,7 +1005,7 @@ void SwTOXSelectTabPage::SelectType(TOXTypes eSet) m_pTypeLB->SelectEntryPos(m_pTypeLB->GetEntryPos(reinterpret_cast<void*>(nData))); m_pTypeFT->Enable(false); m_pTypeLB->Enable(false); - TOXTypeHdl(m_pTypeLB); + TOXTypeHdl(*m_pTypeLB); } static CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData) @@ -1293,7 +1293,7 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet* ) } m_bWaitingInitialSettings = false; - TOXTypeHdl(m_pTypeLB); + TOXTypeHdl(*m_pTypeLB); CheckBoxHdl(m_pAddStylesCB); } @@ -1316,11 +1316,11 @@ VclPtr<SfxTabPage> SwTOXSelectTabPage::Create( vcl::Window* pParent, const SfxIt return VclPtr<SwTOXSelectTabPage>::Create(pParent, *rAttrSet); } -IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwTOXSelectTabPage, TOXTypeHdl, ListBox&, rBox, void) { SwMultiTOXTabDialog* pTOXDlg = static_cast<SwMultiTOXTabDialog*>(GetTabDialog()); const sal_uInt16 nType = sal::static_int_cast< sal_uInt16 >(reinterpret_cast< sal_uIntPtr >( - pBox->GetSelectEntryData())); + rBox.GetSelectEntryData())); CurTOXType eCurType = lcl_UserData2TOXTypes(nType); pTOXDlg->SetCurrentTOXType(eCurType); @@ -1380,9 +1380,12 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox) ApplyTOXDescription(); } ModifyHdl(0); - return 0; } +IMPL_LINK_NOARG_TYPED(SwTOXSelectTabPage, ModifyListBoxHdl, ListBox&, void) +{ + ModifyHdl(0); +} IMPL_LINK_NOARG(SwTOXSelectTabPage, ModifyHdl) { if(!m_bWaitingInitialSettings) @@ -1433,7 +1436,11 @@ IMPL_LINK_NOARG_TYPED(SwTOXSelectTabPage, RadioButtonHdl, Button*, void) ModifyHdl(0); } -IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwTOXSelectTabPage, LanguageListBoxHdl, ListBox&, rBox, void) +{ + LanguageHdl(&rBox); +} +void SwTOXSelectTabPage::LanguageHdl( ListBox* pBox ) { lang::Locale aLcl( LanguageTag( m_pLanguageLB->GetSelectLanguage() ).getLocale() ); Sequence< OUString > aSeq = pIndexEntryWrapper->GetAlgorithmList( aLcl ); @@ -1470,7 +1477,6 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox) if(pBox) ModifyHdl(0); - return 0; }; IMPL_LINK_TYPED(SwTOXSelectTabPage, AddStylesHdl, Button*, pButton, void) @@ -2534,10 +2540,10 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken&, rToken, void) } } -IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwTOXEntryTabPage, StyleSelectHdl, ListBox&, rBox, void) { - OUString sEntry = pBox->GetSelectEntry(); - const sal_uInt16 nId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(pBox->GetSelectEntryData()); + OUString sEntry = rBox.GetSelectEntry(); + const sal_uInt16 nId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rBox.GetSelectEntryData()); const bool bEqualsNoCharStyle = sEntry == sNoCharStyle; m_pEditStylePB->Enable(!bEqualsNoCharStyle); if (bEqualsNoCharStyle) @@ -2553,12 +2559,11 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox) } ModifyHdl(0); - return 0; } -IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwTOXEntryTabPage, ChapterInfoHdl, ListBox&, rBox, void) { - sal_Int32 nPos = pBox->GetSelectEntryPos(); + sal_Int32 nPos = rBox.GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { Control* pCtrl = m_pTokenWIN->GetActiveControl(); @@ -2568,7 +2573,6 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox) ModifyHdl(0); } - return 0; } IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField) @@ -2584,9 +2588,9 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField) return 0; } -IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwTOXEntryTabPage, NumberFormatHdl, ListBox&, rBox, void) { - const sal_Int32 nPos = pBox->GetSelectEntryPos(); + const sal_Int32 nPos = rBox.GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { @@ -2598,7 +2602,6 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox) } ModifyHdl(0); } - return 0; } IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField) @@ -3721,7 +3724,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& ) m_pParaLayLB->InsertEntry( aStr ); } - EnableSelectHdl(m_pParaLayLB); + EnableSelectHdl(*m_pParaLayLB); } SfxTabPage::sfxpg SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/ ) @@ -3799,7 +3802,7 @@ IMPL_LINK_NOARG_TYPED(SwTOXStylesTabPage, DoubleClickHdl, ListBox&, void) } // enable only when selected -IMPL_LINK_NOARG(SwTOXStylesTabPage, EnableSelectHdl) +IMPL_LINK_NOARG_TYPED(SwTOXStylesTabPage, EnableSelectHdl, ListBox&, void) { m_pStdBT->Enable(m_pLevelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND); @@ -3809,7 +3812,6 @@ IMPL_LINK_NOARG(SwTOXStylesTabPage, EnableSelectHdl) LISTBOX_ENTRY_NOTFOUND != m_pLevelLB->GetSelectEntryPos() && (m_pLevelLB->GetSelectEntryPos() == 0 || SwMultiTOXTabDialog::IsNoNum(rSh, aTmpName))); m_pEditStyleBT->Enable(m_pParaLayLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); - return 0; } void SwTOXStylesTabPage::Modify() diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx index 17a7983f2480..8925b60e0eac 100644 --- a/sw/source/ui/index/multmrk.cxx +++ b/sw/source/ui/index/multmrk.cxx @@ -45,14 +45,13 @@ SwMultiTOXMarkDlg::SwMultiTOXMarkDlg(vcl::Window* pParent, SwTOXMgr& rTOXMgr) m_pTextFT->SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName()); } -IMPL_LINK( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwMultiTOXMarkDlg, SelectHdl, ListBox&, rBox, void ) { - if(pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) - { SwTOXMark* pMark = rMgr.GetTOXMark(pBox->GetSelectEntryPos()); + if(rBox.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) + { SwTOXMark* pMark = rMgr.GetTOXMark(rBox.GetSelectEntryPos()); m_pTextFT->SetText(pMark->GetTOXType()->GetTypeName()); - nPos = pBox->GetSelectEntryPos(); + nPos = rBox.GetSelectEntryPos(); } - return 0; } void SwMultiTOXMarkDlg::Apply() diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 879b27b470b6..af83e4a621ab 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -141,7 +141,7 @@ SwIndexMarkPane::SwIndexMarkPane(Dialog &rDialog, bool bNewDlg, m_pPrevSameBT->SetClickHdl(LINK(this,SwIndexMarkPane, PrevSameHdl)); m_pNextBT->SetClickHdl(LINK(this,SwIndexMarkPane, NextHdl)); m_pNextSameBT->SetClickHdl(LINK(this,SwIndexMarkPane, NextSameHdl)); - m_pTypeDCB->SetSelectHdl(LINK(this,SwIndexMarkPane, ModifyHdl)); + 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)); @@ -623,7 +623,11 @@ IMPL_LINK_NOARG_TYPED(SwIndexMarkPane, CloseHdl, Button*, void) } // select index type only when inserting -IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwIndexMarkPane, ModifyListBoxHdl, ListBox&, rBox, void ) +{ + ModifyHdl(&rBox); +} +IMPL_LINK( SwIndexMarkPane, ModifyHdl, void*, pBox ) { if (m_pTypeDCB == pBox) { @@ -990,7 +994,7 @@ class SwCreateAuthEntryDlg_Impl : public ModalDialog DECL_LINK(IdentifierHdl, ComboBox*); DECL_LINK(ShortNameHdl, Edit*); - DECL_LINK(EnableHdl, ListBox*); + DECL_LINK_TYPED(EnableHdl, ListBox&, void); public: SwCreateAuthEntryDlg_Impl(vcl::Window* pParent, @@ -1127,9 +1131,9 @@ static OUString lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int return OUString(); } -IMPL_LINK( SwAuthorMarkPane, CompEntryHdl, ListBox*, pBox) +IMPL_LINK_TYPED( SwAuthorMarkPane, CompEntryHdl, ListBox&, rBox, void) { - const OUString sEntry(pBox->GetSelectEntry()); + const OUString sEntry(rBox.GetSelectEntry()); if(bIsFromComponent) { if(xBibAccess.is() && !sEntry.isEmpty()) @@ -1162,14 +1166,13 @@ IMPL_LINK( SwAuthorMarkPane, CompEntryHdl, ListBox*, pBox) pEntry->GetAuthorField((ToxAuthorityField)i) : OUString(); } } - if (pBox->GetSelectEntry().isEmpty()) + if (rBox.GetSelectEntry().isEmpty()) { for(int i = 0; i < AUTH_FIELD_END; i++) m_sFields[i].clear(); } m_pAuthorFI->SetText(m_sFields[AUTH_FIELD_AUTHOR]); m_pTitleFI->SetText(m_sFields[AUTH_FIELD_TITLE]); - return 0; } IMPL_LINK_NOARG_TYPED(SwAuthorMarkPane, InsertHdl, Button*, void) @@ -1327,7 +1330,7 @@ IMPL_LINK_TYPED(SwAuthorMarkPane, ChangeSourceHdl, Button*, pButton, void) m_pEntryLB->InsertEntry(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER]); } m_pEntryLB->SelectEntryPos(0); - CompEntryHdl(m_pEntryLB); + CompEntryHdl(*m_pEntryLB); } IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) @@ -1503,7 +1506,7 @@ SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(vcl::Window* pParent, ++nRightRow; bLeft = !bLeft; } - EnableHdl(pTypeListBox); + EnableHdl(*pTypeListBox); } SwCreateAuthEntryDlg_Impl::~SwCreateAuthEntryDlg_Impl() @@ -1588,10 +1591,9 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, Edit*, pEdit) return 0; } -IMPL_LINK(SwCreateAuthEntryDlg_Impl, EnableHdl, ListBox*, pBox) +IMPL_LINK_TYPED(SwCreateAuthEntryDlg_Impl, EnableHdl, ListBox&, rBox, void) { - m_pOKBT->Enable(m_bNameAllowed && pBox->GetSelectEntryCount()); - return 0; + m_pOKBT->Enable(m_bNameAllowed && rBox.GetSelectEntryCount()); }; SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings, diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 589c55fa0ac3..86fde7dbe628 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -272,7 +272,7 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) #endif } m_pNumCountBox->SelectEntry(sSelect); - NumCountHdl(m_pNumCountBox); + NumCountHdl(*m_pNumCountBox); } int SwEndNoteOptionPage::GetNumbering() const @@ -310,7 +310,7 @@ IMPL_LINK_NOARG_TYPED(SwEndNoteOptionPage, PosPageHdl, Button*, void) m_pPageTemplBox->Enable(false); } -IMPL_LINK_NOARG(SwEndNoteOptionPage, NumCountHdl) +IMPL_LINK_NOARG_TYPED(SwEndNoteOptionPage, NumCountHdl, ListBox&, void) { bool bEnable = true; if( m_pNumCountBox->GetEntryCount() - 1 != m_pNumCountBox->GetSelectEntryPos() ) @@ -320,7 +320,6 @@ IMPL_LINK_NOARG(SwEndNoteOptionPage, NumCountHdl) } m_pOffsetLbl->Enable(bEnable); m_pOffsetField->Enable(bEnable); - return 0; } // Handler behind the button to collect the footnote at the chapter or end of diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index e7a5ab463dfd..f14a6b17930d 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -73,7 +73,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent, m_pNewPB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, NewHdl)); m_pDelPB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, DeleteHdl)); m_pNameED->SetModifyHdl(LINK(this, SwGlossaryGroupDlg, ModifyHdl)); - m_pPathLB->SetSelectHdl(LINK(this, SwGlossaryGroupDlg, ModifyHdl)); + m_pPathLB->SetSelectHdl(LINK(this, SwGlossaryGroupDlg, ModifyListBoxHdl)); m_pRenamePB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, RenameHdl)); for (size_t i = 0; i < rPathArr.size(); ++i) @@ -320,6 +320,10 @@ IMPL_LINK_NOARG_TYPED(SwGlossaryGroupDlg, RenameHdl, Button*, void) m_pGroupTLB->GetModel()->Resort(); } +IMPL_LINK_NOARG_TYPED(SwGlossaryGroupDlg, ModifyListBoxHdl, ListBox&, void) +{ + ModifyHdl(0); +} IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) { OUString sEntry(m_pNameED->GetText()); diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx index 53dd61b593cb..272b6b9861aa 100644 --- a/sw/source/ui/misc/impfnote.hxx +++ b/sw/source/ui/misc/impfnote.hxx @@ -64,7 +64,7 @@ class SwEndNoteOptionPage : public SfxTabPage DECL_LINK_TYPED(PosPageHdl, Button*, void); DECL_LINK_TYPED(PosChapterHdl, Button*, void); - DECL_LINK(NumCountHdl, void *); + DECL_LINK_TYPED(NumCountHdl, ListBox&, void); public: SwEndNoteOptionPage( vcl::Window *pParent, bool bEndNote, diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 6d7a370dd269..46708058d1e2 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -588,7 +588,7 @@ void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh) m_pIndentAtMF->SetUnit( eMetric ); } -IMPL_LINK_NOARG(SwNumPositionTabPage, EditModifyHdl) +IMPL_LINK_NOARG_TYPED(SwNumPositionTabPage, EditModifyHdl, ListBox&, void) { sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < MAXLEVEL; i++) @@ -611,32 +611,31 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, EditModifyHdl) nMask <<= 1; } SetModified(); - return 0; } -IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwNumPositionTabPage, LevelHdl, ListBox&, rBox, void ) { sal_uInt16 nSaveNumLvl = nActNumLvl; nActNumLvl = 0; - if(pBox->IsEntryPosSelected( MAXLEVEL ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) + if(rBox.IsEntryPosSelected( MAXLEVEL ) && + (rBox.GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) { nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(false); + rBox.SetUpdateMode(false); for( sal_uInt16 i = 0; i < MAXLEVEL; i++ ) - pBox->SelectEntryPos( i, false ); - pBox->SetUpdateMode(true); + rBox.SelectEntryPos( i, false ); + rBox.SetUpdateMode(true); } - else if(pBox->GetSelectEntryCount()) + else if(rBox.GetSelectEntryCount()) { sal_uInt16 nMask = 1; for( sal_uInt16 i = 0; i < MAXLEVEL; i++ ) { - if(pBox->IsEntryPosSelected( i )) + if(rBox.IsEntryPosSelected( i )) nActNumLvl |= nMask; nMask <<= 1; } - pBox->SelectEntryPos( MAXLEVEL, false ); + rBox.SelectEntryPos( MAXLEVEL, false ); } else { @@ -646,7 +645,7 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox ) { if(nActNumLvl & nMask) { - pBox->SelectEntryPos(i); + rBox.SelectEntryPos(i); break; } nMask <<=1; @@ -657,7 +656,6 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox ) InitPosAndSpaceMode(); ShowControlsDependingOnPosAndSpaceMode(); InitControls(); - return 0; } IMPL_LINK_TYPED( SwNumPositionTabPage, DistanceLoseFocusHdl, Control&, rControl, void ) @@ -762,7 +760,7 @@ IMPL_LINK_TYPED( SwNumPositionTabPage, RelativeHdl, Button *, pBox, void ) bLastRelative = bOn; } -IMPL_LINK_NOARG(SwNumPositionTabPage, LabelFollowedByHdl_Impl) +IMPL_LINK_NOARG_TYPED(SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox&, void) { // determine value to be set at the chosen list levels SvxNumberFormat::LabelFollowedBy eLabelFollowedBy = SvxNumberFormat::LISTTAB; @@ -819,8 +817,6 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, LabelFollowedByHdl_Impl) } SetModified(); - - return 0; } IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pField ) diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 66eaeda96a46..3b2c69655067 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -64,7 +64,7 @@ class SwNumNamesDlg : public ModalDialog VclPtr<OKButton> m_pOKBtn; DECL_LINK( ModifyHdl, Edit * ); - DECL_LINK( SelectHdl, ListBox * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( DoubleClickHdl, ListBox&, void ); public: @@ -91,11 +91,10 @@ void SwNumNamesDlg::dispose() // remember selected entry -IMPL_LINK( SwNumNamesDlg, SelectHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwNumNamesDlg, SelectHdl, ListBox&, rBox, void ) { - m_pFormEdit->SetText(pBox->GetSelectEntry()); + m_pFormEdit->SetText(rBox.GetSelectEntry()); m_pFormEdit->SetSelection(Selection(0, SELECTION_MAX)); - return 0; } /** set user defined names @@ -116,7 +115,7 @@ void SwNumNamesDlg::SetUserNames(const OUString *pList[]) } } m_pFormBox->SelectEntryPos(nSelect); - SelectHdl(m_pFormBox); + SelectHdl(*m_pFormBox); } // unlock OK-Button when text is in Edit @@ -143,7 +142,7 @@ SwNumNamesDlg::SwNumNamesDlg(vcl::Window *pParent) m_pFormEdit->SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl)); m_pFormBox->SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl)); m_pFormBox->SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl)); - SelectHdl(m_pFormBox); + SelectHdl(*m_pFormBox); } static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel) @@ -564,10 +563,10 @@ void SwOutlineSettingsTabPage::Update() SetModified(); } -IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwOutlineSettingsTabPage, LevelHdl, ListBox&, rBox, void ) { nActLevel = 0; - if(pBox->IsEntryPosSelected( MAXLEVEL )) + if(rBox.IsEntryPosSelected( MAXLEVEL )) { nActLevel = 0xFFFF; } @@ -576,13 +575,12 @@ IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox ) sal_uInt16 nMask = 1; for( sal_uInt16 i = 0; i < MAXLEVEL; i++ ) { - if(pBox->IsEntryPosSelected( i )) + if(rBox.IsEntryPosSelected( i )) nActLevel |= nMask; nMask <<= 1; } } Update(); - return 0; } IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pField ) @@ -603,11 +601,11 @@ IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pField ) return 0; } -IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox ) +IMPL_LINK_TYPED( SwOutlineSettingsTabPage, CollSelect, ListBox&, rBox, void ) { sal_uInt8 i; - const OUString aCollName(pBox->GetSelectEntry()); + const OUString aCollName(rBox.GetSelectEntry()); //0xFFFF not allowed here (disable) sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel); OUString sOldName( pCollNames[nTmpLevel] ); @@ -643,7 +641,6 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox ) } SetModified(); - return 0; } IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CollSelectGetFocus, Control&, void) @@ -652,10 +649,10 @@ IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CollSelectGetFocus, Control&, vo aSaveCollNames[i] = pCollNames[i]; } -IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBox ) +IMPL_LINK_TYPED( SwOutlineSettingsTabPage, NumberSelect, ListBox&, rBox, void ) { sal_uInt16 nMask = 1; - sal_Int16 nNumberType = pBox->GetSelectedNumberingType(); + sal_Int16 nNumberType = static_cast<SwNumberingTypeListBox&>(rBox).GetSelectedNumberingType(); for(sal_uInt16 i = 0; i < MAXLEVEL; i++) { if(nActLevel & nMask) @@ -668,7 +665,6 @@ IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBo nMask <<= 1; } SetModified(); - return 0; } IMPL_LINK_NOARG(SwOutlineSettingsTabPage, DelimModify) @@ -706,7 +702,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pField ) return 0; } -IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CharFormatHdl) +IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CharFormatHdl, ListBox&, void) { OUString sEntry = m_pCharFormatLB->GetSelectEntry(); sal_uInt16 nMask = 1; @@ -749,7 +745,6 @@ IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CharFormatHdl) } nMask <<= 1; } - return RET_OK; } SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage() @@ -838,7 +833,7 @@ void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& ) m_pLevelLB->SelectEntryPos(lcl_BitToLevel(nActLevel)); else m_pLevelLB->SelectEntryPos(MAXLEVEL); - LevelHdl(m_pLevelLB); + LevelHdl(*m_pLevelLB); } SfxTabPage::sfxpg SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*) diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index fd4e4ba3c20b..07a77808b10e 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -95,10 +95,9 @@ IMPL_LINK_NOARG(SwFootNotePage, LineWidthChanged_Impl) return 0; } -IMPL_LINK_NOARG(SwFootNotePage, LineColorSelected_Impl) +IMPL_LINK_NOARG_TYPED(SwFootNotePage, LineColorSelected_Impl, ListBox&, void) { m_pLineTypeBox->SetColor( m_pLineColorBox->GetSelectEntryColor() ); - return 0; } SwFootNotePage::SwFootNotePage(vcl::Window *pParent, const SfxItemSet &rSet) diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 1ac0fb2be6fd..b607f3567d7f 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -434,7 +434,7 @@ IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, SpinField*, pField) SetLinesOrCharsRanges( *m_pCharsRangeFT , m_pCharsPerLineNF->GetMax() ); } } - GridModifyHdl(0); + GridModifyHdl(*m_pColorLB); return 0; } @@ -490,7 +490,7 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, SpinField*, pField) } //rubySize is disabled } - GridModifyHdl(0); + GridModifyHdl(*m_pColorLB); return 0; } @@ -517,7 +517,7 @@ IMPL_LINK_TYPED(SwTextGridPage, GridTypeHdl, Button*, pButton, void) m_pCharWidthMF->Enable(false); } - GridModifyHdl(0); + GridModifyHdl(*m_pColorLB); } IMPL_LINK_NOARG_TYPED(SwTextGridPage, DisplayGridHdl, Button*, void) @@ -529,9 +529,9 @@ IMPL_LINK_NOARG_TYPED(SwTextGridPage, DisplayGridHdl, Button*, void) IMPL_LINK_NOARG_TYPED(SwTextGridPage, GridModifyClickHdl, Button*, void) { - GridModifyHdl(0); + GridModifyHdl(*m_pColorLB); } -IMPL_LINK_NOARG(SwTextGridPage, GridModifyHdl) +IMPL_LINK_NOARG_TYPED(SwTextGridPage, GridModifyHdl, ListBox&, void) { const SfxItemSet& rOldSet = GetItemSet(); SfxItemSet aSet(rOldSet); @@ -540,7 +540,6 @@ IMPL_LINK_NOARG(SwTextGridPage, GridModifyHdl) aSet.Put(*pExSet); PutGridItem(aSet); m_pExampleWN->UpdateExample(aSet); - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 49e6978e81d9..b314dfc10f6f 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -209,7 +209,7 @@ SwSortDlg::SwSortDlg(vcl::Window* pParent, SwWrtShell &rShell) m_pLangLB->SelectLanguage( nLang ); LanguageHdl( 0 ); - m_pLangLB->SetSelectHdl( LINK( this, SwSortDlg, LanguageHdl )); + m_pLangLB->SetSelectHdl( LINK( this, SwSortDlg, LanguageListBoxHdl )); m_pSortUp1RB->Check(bAsc1); m_pSortDn1RB->Check(!bAsc1); @@ -440,7 +440,12 @@ IMPL_LINK_TYPED( SwSortDlg, CheckHdl, Button*, pControl, void ) static_cast<CheckBox *>(pControl)->Check(); } -IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) +IMPL_LINK_TYPED( SwSortDlg, LanguageListBoxHdl, ListBox&, rLBox, void ) +{ + LanguageHdl(&rLBox); +} + +void SwSortDlg::LanguageHdl(ListBox* pLBox) { Sequence < OUString > aSeq( GetAppCollator().listCollatorAlgorithms( LanguageTag( m_pLangLB->GetSelectLanguage()).getLocale() )); @@ -489,7 +494,6 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) else if( LISTBOX_ENTRY_NOTFOUND == pL->GetSelectEntryPos() ) pL->SelectEntryPos( 0 ); } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 6c127eb1366f..b01135358ccd 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -240,7 +240,7 @@ void SwAutoFormatDlg::Init( const SwTableAutoFormat* pSelFormat ) } m_pLbFormat->SelectEntryPos( 255 != nIndex ? (nDfltStylePos + nIndex) : 0 ); - SelFormatHdl( 0 ); + SelFormatHdl( *m_pLbFormat ); } void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnable ) @@ -347,7 +347,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, AddHdl, Button*, void) bCoreDataChanged = true; } - SelFormatHdl( 0 ); + SelFormatHdl( *m_pLbFormat ); bOk = true; } } @@ -395,7 +395,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RemoveHdl, Button*, void) } pBox.reset(); - SelFormatHdl( 0 ); + SelFormatHdl( *m_pLbFormat ); } IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void) @@ -444,7 +444,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void) bCoreDataChanged = true; } - SelFormatHdl( 0 ); + SelFormatHdl( *m_pLbFormat ); bOk = true; bFormatRenamed = true; } @@ -461,7 +461,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void) } } -IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl) +IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, SelFormatHdl, ListBox&, void) { bool bBtnEnable = false; sal_uInt8 nSelPos = (sal_uInt8) m_pLbFormat->GetSelectEntryPos(), nOldIdx = nIndex; @@ -491,8 +491,6 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl) m_pBtnRemove->Enable( bBtnEnable ); m_pBtnRename->Enable( bBtnEnable ); - - return 0; } IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, OkHdl, Button*, void) diff --git a/sw/source/uibase/inc/ascfldlg.hxx b/sw/source/uibase/inc/ascfldlg.hxx index bd2b822b59c7..115e2eaf8ae5 100644 --- a/sw/source/uibase/inc/ascfldlg.hxx +++ b/sw/source/uibase/inc/ascfldlg.hxx @@ -42,7 +42,7 @@ class SwAsciiFilterDlg : public SfxModalDialog VclPtr<RadioButton> m_pLF_RB; bool m_bSaveLineStatus; - DECL_LINK( CharSetSelHdl, SvxTextEncodingBox* ); + DECL_LINK_TYPED( CharSetSelHdl, ListBox&, void ); DECL_LINK_TYPED( LineEndHdl, RadioButton&, void ); void SetCRLF( LineEnd eEnd ); LineEnd GetCRLF() const; diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 49664253dc9c..c37612cdb62d 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -52,7 +52,7 @@ class SwBreakDlg: public SvxStandardDialog bool bHtmlMode; DECL_LINK_TYPED( ClickHdl, Button*, void ); - DECL_LINK( SelectHdl, void * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( PageNumHdl, Button*, void ); DECL_LINK(PageNumModifyHdl, void *); DECL_LINK_TYPED(OkHdl, Button*, void); diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx index 0d043bf574a1..ce9c606dce1a 100644 --- a/sw/source/uibase/inc/column.hxx +++ b/sw/source/uibase/inc/column.hxx @@ -60,8 +60,9 @@ class SwColumnDlg : public SfxModalDialog bool bSelSectionChanged : 1; bool bFrameChanged : 1; - DECL_LINK(ObjectHdl, ListBox*); + DECL_LINK_TYPED(ObjectListBoxHdl, ListBox&, void); DECL_LINK_TYPED(OkHdl, Button*, void); + void ObjectHdl(ListBox*); public: SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh); @@ -147,6 +148,7 @@ class SwColumnPage : public SfxTabPage DECL_LINK_TYPED(Up, Button *, void); DECL_LINK_TYPED(Down, Button *, void); DECL_LINK( UpdateColMgr, void* ); + DECL_LINK_TYPED( UpdateColMgrListBox, ListBox&, void ); void Timeout(); void Update(MetricField *pInteractiveField); diff --git a/sw/source/uibase/inc/cption.hxx b/sw/source/uibase/inc/cption.hxx index 77927246d5ac..b4a5a9b28380 100644 --- a/sw/source/uibase/inc/cption.hxx +++ b/sw/source/uibase/inc/cption.hxx @@ -95,6 +95,7 @@ class SwCaptionDialog : public SvxStandardDialog ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > xNamed; DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectListBoxHdl, ListBox&, void); DECL_LINK(ModifyHdl, void *); DECL_LINK_TYPED(OptionHdl, Button *, void); DECL_LINK_TYPED(CaptionHdl, Button *, void); diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx index 55d5105f33c4..833d8670e983 100644 --- a/sw/source/uibase/inc/dbinsdlg.hxx +++ b/sw/source/uibase/inc/dbinsdlg.hxx @@ -126,7 +126,7 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem SwInsDBColumns aDBColumns; const SwDBData aDBData; - Link<> aOldNumFormatLnk; + Link<ListBox&,void> aOldNumFormatLnk; OUString sNoTmpl; SwView* pView; @@ -141,7 +141,7 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem DECL_LINK_TYPED( TableFormatHdl, Button*, void ); DECL_LINK_TYPED( DBFormatHdl, Button*, void ); DECL_LINK_TYPED( TableToFromHdl, Button*, void ); - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( DblClickHdl, ListBox&, void ); DECL_LINK_TYPED( HeaderHdl, Button*, void ); diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx index 511ecc76b359..c251c7ba0c51 100644 --- a/sw/source/uibase/inc/drpcps.hxx +++ b/sw/source/uibase/inc/drpcps.hxx @@ -71,7 +71,7 @@ friend class SwDropCapsPict; DECL_LINK_TYPED(ClickHdl, Button*, void); DECL_LINK( ModifyHdl, Edit * ); - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); DECL_LINK_TYPED(WholeWordHdl, Button*, void); using SfxTabPage::ActivatePage; diff --git a/sw/source/uibase/inc/envlop.hxx b/sw/source/uibase/inc/envlop.hxx index 853ffc8e6196..cce27158fc39 100644 --- a/sw/source/uibase/inc/envlop.hxx +++ b/sw/source/uibase/inc/envlop.hxx @@ -90,7 +90,7 @@ class SwEnvPage : public SfxTabPage SwWrtShell* pSh; OUString sActDBName; - DECL_LINK( DatabaseHdl, ListBox * ); + DECL_LINK_TYPED( DatabaseHdl, ListBox&, void ); DECL_LINK_TYPED(FieldHdl, Button*, void ); DECL_LINK_TYPED(SenderHdl, Button*, void ); diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx index 97d2a28c70ab..d83af39b4bae 100644 --- a/sw/source/uibase/inc/frmpage.hxx +++ b/sw/source/uibase/inc/frmpage.hxx @@ -134,8 +134,8 @@ class SwFrmPage: public SfxTabPage DECL_LINK_TYPED(RangeModifyClickHdl, Button*, void); void RangeModifyHdl(); DECL_LINK_TYPED(AnchorTypeHdl, Button*, void); - DECL_LINK( PosHdl, ListBox * ); - DECL_LINK( RelHdl, ListBox * ); + DECL_LINK_TYPED( PosHdl, ListBox&, void ); + DECL_LINK_TYPED( RelHdl, ListBox&, void ); void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel, sal_Int16 nV, sal_Int16 nVRel, long nX, long nY); @@ -305,7 +305,7 @@ class SwFrmAddPage : public SfxTabPage bool bNew; DECL_LINK(EditModifyHdl, void *); - DECL_LINK(ChainModifyHdl, ListBox*); + 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 0ca522822340..78e80933de90 100644 --- a/sw/source/uibase/inc/glosbib.hxx +++ b/sw/source/uibase/inc/glosbib.hxx @@ -95,6 +95,7 @@ protected: 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); public: diff --git a/sw/source/uibase/inc/multmrk.hxx b/sw/source/uibase/inc/multmrk.hxx index 2e9c26abaf82..41ccbb425dc1 100644 --- a/sw/source/uibase/inc/multmrk.hxx +++ b/sw/source/uibase/inc/multmrk.hxx @@ -31,7 +31,7 @@ class SwTOXMgr; // insert mark for index entry class SwMultiTOXMarkDlg : public SvxStandardDialog { - DECL_LINK( SelectHdl, ListBox * ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); VclPtr<FixedText> m_pTextFT; VclPtr<ListBox> m_pTOXLB; diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index 4e855ed1df3c..7f4ba5922ae5 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -101,7 +101,7 @@ class SwNavigationPI : public vcl::Window, void FillBox(); void MakeMark(); - DECL_LINK( DocListBoxSelectHdl, ListBox * ); + DECL_LINK_TYPED( DocListBoxSelectHdl, ListBox&, void ); DECL_LINK_TYPED( ToolBoxSelectHdl, ToolBox *, void ); DECL_LINK_TYPED( ToolBoxClickHdl, ToolBox *, void ); DECL_LINK_TYPED( ToolBoxDropdownClickHdl, ToolBox*, void ); diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx index 355eefb0d297..348242561141 100644 --- a/sw/source/uibase/inc/num.hxx +++ b/sw/source/uibase/inc/num.hxx @@ -91,8 +91,8 @@ class SwNumPositionTabPage : public SfxTabPage void InitControls(); - DECL_LINK( LevelHdl, ListBox * ); - DECL_LINK(EditModifyHdl, void *); + DECL_LINK_TYPED( LevelHdl, ListBox&, void ); + DECL_LINK_TYPED(EditModifyHdl, ListBox&, void); DECL_LINK( DistanceHdl, MetricField * ); DECL_LINK_TYPED( DistanceLoseFocusHdl, Control&, void ); DECL_LINK_TYPED( RelativeHdl, Button*, void ); @@ -101,7 +101,7 @@ class SwNumPositionTabPage : public SfxTabPage void InitPosAndSpaceMode(); void ShowControlsDependingOnPosAndSpaceMode(); - DECL_LINK(LabelFollowedByHdl_Impl, void *); + DECL_LINK_TYPED(LabelFollowedByHdl_Impl, ListBox&, void); DECL_LINK( ListtabPosHdl_Impl, MetricField* ); DECL_LINK( AlignAtHdl_Impl, MetricField* ); DECL_LINK( IndentAtHdl_Impl, MetricField* ); diff --git a/sw/source/uibase/inc/numfmtlb.hxx b/sw/source/uibase/inc/numfmtlb.hxx index 6a59a57cfefc..634c07be327c 100644 --- a/sw/source/uibase/inc/numfmtlb.hxx +++ b/sw/source/uibase/inc/numfmtlb.hxx @@ -38,7 +38,7 @@ class SW_DLLPUBLIC NumFormatListBox : public ListBox //to be shown in the number format dialog bool bUseAutomaticLanguage;//determine whether language is automatically assigned - DECL_DLLPRIVATE_LINK( SelectHdl, ListBox * ); + DECL_DLLPRIVATE_LINK_TYPED( SelectHdl, ListBox&, void ); SAL_DLLPRIVATE double GetDefValue(const short nFormatType) const; SAL_DLLPRIVATE void Init(short nFormatType, bool bUsrFormats); diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx index c80a3b46d6ad..5825f9845b67 100644 --- a/sw/source/uibase/inc/numpara.hxx +++ b/sw/source/uibase/inc/numpara.hxx @@ -54,10 +54,10 @@ class SwParagraphNumTabPage : public SfxTabPage bool bCurNumrule : 1; DECL_LINK_TYPED(NewStartHdl_Impl, Button*, void); - DECL_LINK( StyleHdl_Impl, ListBox* ); + DECL_LINK_TYPED( StyleHdl_Impl, ListBox&,void ); DECL_LINK_TYPED(LineCountHdl_Impl, Button*, void); DECL_LINK_TYPED(EditNumStyleHdl_Impl, Button*, void); - DECL_LINK(EditNumStyleSelectHdl_Impl, void *); + DECL_LINK_TYPED(EditNumStyleSelectHdl_Impl, ListBox&, void); static const sal_uInt16 aPageRg[]; diff --git a/sw/source/uibase/inc/optcomp.hxx b/sw/source/uibase/inc/optcomp.hxx index f247d6c76af1..75db09d9166a 100644 --- a/sw/source/uibase/inc/optcomp.hxx +++ b/sw/source/uibase/inc/optcomp.hxx @@ -50,7 +50,7 @@ private: sal_uLong m_nSavedOptions; // handler - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); DECL_LINK_TYPED(UseAsDefaultHdl, Button*, void); // private methods diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx index e7eb2b39d22f..9f6483273da1 100644 --- a/sw/source/uibase/inc/optload.hxx +++ b/sw/source/uibase/inc/optload.hxx @@ -59,7 +59,7 @@ private: sal_uInt16 m_nLastTab; sal_Int32 m_nOldLinkMode; - DECL_LINK(MetricHdl, void *); + DECL_LINK_TYPED(MetricHdl, ListBox&, void); DECL_LINK_TYPED(StandardizedPageCountCheckHdl, Button*, void); public: @@ -154,8 +154,9 @@ private: bool bHTMLMode; DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectListBoxHdl, ListBox&, void); DECL_LINK(ModifyHdl, void * = 0); - DECL_LINK( OrderHdl, ListBox* ); + 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 8a7a1280705c..33641c98fdc3 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -106,7 +106,7 @@ class SwAddPrinterTabPage : public SfxTabPage bool bPreview; DECL_LINK_TYPED(AutoClickHdl, Button*, void); - DECL_LINK(SelectHdl, void *); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); public: SwAddPrinterTabPage(vcl::Window* pParent, const SfxItemSet& rSet); @@ -340,9 +340,9 @@ class SwRedlineOptionsTabPage : public SfxTabPage OUString sAuthor; OUString sNone; - DECL_LINK(AttribHdl, ListBox*); - DECL_LINK(ChangedMaskPrevHdl, void* = 0); - DECL_LINK(ColorHdl, ColorListBox*); + DECL_LINK_TYPED(AttribHdl, ListBox&, void); + DECL_LINK_TYPED(ChangedMaskPrevHdl, ListBox&, void); + DECL_LINK_TYPED(ColorHdl, ListBox&, void); static void InitFontStyle(SvxFontPrevWindow& rExampleWin); diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx index aed1139d5ebb..9eb16b76bb29 100644 --- a/sw/source/uibase/inc/outline.hxx +++ b/sw/source/uibase/inc/outline.hxx @@ -102,14 +102,14 @@ class SwOutlineSettingsTabPage : public SfxTabPage OUString* pCollNames; sal_uInt16 nActLevel; - DECL_LINK( LevelHdl, ListBox * ); + DECL_LINK_TYPED( LevelHdl, ListBox&, void ); DECL_LINK( ToggleComplete, NumericField * ); - DECL_LINK( CollSelect, ListBox * ); + DECL_LINK_TYPED( CollSelect, ListBox&, void ); DECL_LINK_TYPED(CollSelectGetFocus, Control&, void); - DECL_LINK( NumberSelect, SwNumberingTypeListBox * ); + DECL_LINK_TYPED( NumberSelect, ListBox&, void ); DECL_LINK(DelimModify, void *); DECL_LINK( StartModified, NumericField * ); - DECL_LINK(CharFormatHdl, 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 ca1ff21b3f8f..a72d20e92d72 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -61,7 +61,7 @@ private: DECL_LINK_TYPED(HeightMetric, Button*, void); DECL_LINK_TYPED(HeightModify, Control&, void); DECL_LINK( LineWidthChanged_Impl, void * ); - DECL_LINK( LineColorSelected_Impl, void * ); + DECL_LINK_TYPED( LineColorSelected_Impl, ListBox&, void); long lMaxHeight; diff --git a/sw/source/uibase/inc/pggrid.hxx b/sw/source/uibase/inc/pggrid.hxx index e6548e01f1d2..95a084e47bc5 100644 --- a/sw/source/uibase/inc/pggrid.hxx +++ b/sw/source/uibase/inc/pggrid.hxx @@ -76,7 +76,7 @@ class SwTextGridPage: public SfxTabPage DECL_LINK_TYPED(CharorLineLoseFocusdHdl, Control&, void); DECL_LINK(TextSizeChangedHdl, SpinField*); DECL_LINK_TYPED(TextSizeLoseFocusHdl, Control&, void); - DECL_LINK(GridModifyHdl, void*); + DECL_LINK_TYPED(GridModifyHdl, ListBox&, void); DECL_LINK_TYPED(GridModifyClickHdl, Button*, void); DECL_LINK_TYPED(DisplayGridHdl, Button*, void); diff --git a/sw/source/uibase/inc/srtdlg.hxx b/sw/source/uibase/inc/srtdlg.hxx index 69de0e969bed..e67b47a7e7bb 100644 --- a/sw/source/uibase/inc/srtdlg.hxx +++ b/sw/source/uibase/inc/srtdlg.hxx @@ -79,7 +79,8 @@ class SwSortDlg : public SvxStandardDialog DECL_LINK_TYPED( CheckHdl, Button*, void ); DECL_LINK_TYPED( DelimHdl, Button*, void ); - DECL_LINK( LanguageHdl, ListBox* ); + DECL_LINK_TYPED( LanguageListBoxHdl, ListBox&, void ); + void LanguageHdl(ListBox*); DECL_LINK_TYPED(DelimCharHdl, Button*,void); public: diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx index ef5a227b35a5..684023fb526c 100644 --- a/sw/source/uibase/inc/swuiccoll.hxx +++ b/sw/source/uibase/inc/swuiccoll.hxx @@ -57,8 +57,9 @@ class SwCondCollPage : public SfxTabPage DECL_LINK_TYPED( AssignRemoveTreeListBoxHdl, SvTreeListBox*, bool); DECL_LINK_TYPED( AssignRemoveClickHdl, Button*, void); DECL_LINK_TYPED( SelectTreeListBoxHdl, SvTreeListBox*, void ); - DECL_LINK( SelectHdl, void* ); + DECL_LINK_TYPED( SelectListBoxHdl, ListBox&, void ); void AssignRemove(void*); + void SelectHdl(void*); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index 009c7a1a7ae0..d27e74404d9d 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -202,17 +202,18 @@ class SwTOXSelectTabPage : public SfxTabPage bool m_bWaitingInitialSettings; - DECL_LINK(TOXTypeHdl, ListBox* ); + DECL_LINK_TYPED(TOXTypeHdl, ListBox&, void ); DECL_LINK_TYPED(AddStylesHdl, Button*, void ); DECL_LINK_TYPED(MenuEnableHdl, Menu*, bool); DECL_LINK_TYPED(MenuExecuteHdl, Menu*, bool); - DECL_LINK(LanguageHdl, ListBox*); - + DECL_LINK_TYPED(LanguageListBoxHdl, ListBox&, void); + void LanguageHdl(ListBox*); DECL_LINK_TYPED(CheckBoxHdl, Button*, void ); DECL_LINK_TYPED(RadioButtonHdl, Button*, void); DECL_LINK(ModifyHdl, void*); + DECL_LINK_TYPED(ModifyListBoxHdl, ListBox&, void); - void ApplyTOXDescription(); + void ApplyTOXDescription(); void FillTOXDescription(); using SfxTabPage::ActivatePage; @@ -410,7 +411,7 @@ class SwTOXEntryTabPage : public SfxTabPage CurTOXType aLastTOXType; bool bInLevelHdl; - DECL_LINK(StyleSelectHdl, ListBox*); + DECL_LINK_TYPED(StyleSelectHdl, ListBox&, void); DECL_LINK_TYPED(EditStyleHdl, Button*, void); DECL_LINK_TYPED(InsertTokenHdl, Button*, void); DECL_LINK_TYPED(LevelHdl, SvTreeListBox*, void); @@ -420,9 +421,9 @@ class SwTOXEntryTabPage : public SfxTabPage DECL_LINK(FillCharHdl, ComboBox*); DECL_LINK_TYPED(RemoveInsertAuthHdl, Button*, void); DECL_LINK_TYPED(SortKeyHdl, Button*, void); - DECL_LINK(ChapterInfoHdl, ListBox*); + DECL_LINK_TYPED(ChapterInfoHdl, ListBox&, void); DECL_LINK(ChapterInfoOutlineHdl, NumericField*); - DECL_LINK(NumberFormatHdl, ListBox*); + DECL_LINK_TYPED(NumberFormatHdl, ListBox&, void); DECL_LINK_TYPED(AllLevelsHdl, Button*, void); @@ -467,7 +468,7 @@ class SwTOXStylesTabPage : public SfxTabPage DECL_LINK_TYPED( EditStyleHdl, Button *, void ); DECL_LINK_TYPED( StdHdl, Button*, void ); - DECL_LINK(EnableSelectHdl, void *); + DECL_LINK_TYPED(EnableSelectHdl, ListBox&, void); DECL_LINK_TYPED( DoubleClickHdl, ListBox&, void ); DECL_LINK_TYPED( AssignHdl, Button*, void ); void Modify(); diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx index 1e394b4e1ad3..4fe7e7959722 100644 --- a/sw/source/uibase/inc/swuiidxmrk.hxx +++ b/sw/source/uibase/inc/swuiidxmrk.hxx @@ -114,7 +114,8 @@ class SwIndexMarkPane DECL_LINK_TYPED(NextSameHdl, Button*, void); DECL_LINK_TYPED(PrevHdl, Button*, void); DECL_LINK_TYPED(PrevSameHdl, Button*, void); - DECL_LINK( ModifyHdl, ListBox* pBox ); + 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); @@ -208,7 +209,7 @@ class SwAuthorMarkPane DECL_LINK_TYPED(InsertHdl, Button*, void); DECL_LINK_TYPED(CloseHdl, Button*, void); DECL_LINK_TYPED(CreateEntryHdl, Button*, void); - DECL_LINK(CompEntryHdl, ListBox*); + DECL_LINK_TYPED(CompEntryHdl, ListBox&, void); DECL_LINK_TYPED(ChangeSourceHdl, Button*, void); DECL_LINK_TYPED(IsEntryAllowedHdl, Edit*, bool); DECL_LINK(EditModifyHdl, Edit*); diff --git a/sw/source/uibase/inc/tautofmt.hxx b/sw/source/uibase/inc/tautofmt.hxx index 4c619b112027..2c6b868c81b4 100644 --- a/sw/source/uibase/inc/tautofmt.hxx +++ b/sw/source/uibase/inc/tautofmt.hxx @@ -75,7 +75,7 @@ class SwAutoFormatDlg : public SfxModalDialog DECL_LINK_TYPED( AddHdl, Button*, void ); DECL_LINK_TYPED( RemoveHdl, Button*, void ); DECL_LINK_TYPED( RenameHdl, Button*, void ); - DECL_LINK( SelFormatHdl, void * ); + DECL_LINK_TYPED( SelFormatHdl, ListBox&, void ); public: SwAutoFormatDlg( vcl::Window* pParent, SwWrtShell* pShell, diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx index 1da44b0b0143..d341db8649b9 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx @@ -231,9 +231,9 @@ IMPL_LINK_NOARG_TYPED(WrapPropertyPanel, EnableContourHdl, Button*, void) mpBindings->GetDispatcher()->Execute(FN_FRAME_WRAP_CONTOUR, SfxCallMode::RECORD, &aItem, 0l); } -IMPL_LINK(WrapPropertyPanel, SpacingLBHdl, ListBox*, pBox) +IMPL_LINK_TYPED(WrapPropertyPanel, SpacingLBHdl, ListBox&, rBox, void) { - sal_uInt16 nVal = (sal_uInt16)reinterpret_cast<sal_uLong>(pBox->GetSelectEntryData()); + sal_uInt16 nVal = (sal_uInt16)reinterpret_cast<sal_uLong>(rBox.GetSelectEntryData()); SvxLRSpaceItem aLRItem(nVal, nVal, 0, 0, RES_LR_SPACE); SvxULSpaceItem aULItem(nVal, nVal, RES_UL_SPACE); @@ -241,8 +241,6 @@ IMPL_LINK(WrapPropertyPanel, SpacingLBHdl, ListBox*, pBox) nTop = nBottom = nLeft = nRight = nVal; mpBindings->GetDispatcher()->Execute(SID_ATTR_LRSPACE, SfxCallMode::RECORD, &aLRItem, 0l); mpBindings->GetDispatcher()->Execute(SID_ATTR_ULSPACE, SfxCallMode::RECORD, &aULItem, 0l); - - return 0L; } IMPL_LINK_NOARG_TYPED(WrapPropertyPanel, WrapTypeHdl, Button*, void) diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx index 960ce3b8bd93..b64b32e70740 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx @@ -98,7 +98,7 @@ namespace sw { namespace sidebar { DECL_LINK_TYPED(WrapTypeHdl, Button*, void); DECL_LINK_TYPED(EnableContourHdl, Button*, void); DECL_LINK_TYPED(EditContourHdl, Button*, void); - DECL_LINK(SpacingLBHdl, ListBox*); + DECL_LINK_TYPED(SpacingLBHdl, ListBox&, void); }; } } // end of namespace ::sw::sidebar diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 51bb694445a2..29ad1bcf791e 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -823,7 +823,7 @@ private: VclPtr<ListBox> aListBox; IFieldmark *pFieldmark; - DECL_LINK( MyListBoxHandler, ListBox * ); + DECL_LINK_TYPED( MyListBoxHandler, ListBox&, void ); public: SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM ); @@ -886,12 +886,11 @@ void SwFieldDialog::dispose() FloatingWindow::dispose(); } -IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) +IMPL_LINK_TYPED( SwFieldDialog, MyListBoxHandler, ListBox&, rBox, void ) { - short res = 0; - if ( !pBox->IsTravelSelect() ) + if ( !rBox.IsTravelSelect() ) { - sal_Int32 selection = pBox->GetSelectEntryPos(); + sal_Int32 selection = rBox.GetSelectEntryPos(); if ( selection >= 0 ) { OUString sKey = OUString( ODF_FORMDROPDOWN_RESULT ); @@ -902,9 +901,7 @@ IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) } EndPopupMode(); - res = 1; } - return res; } IMPL_LINK_NOARG_TYPED(SwView, FieldPopupModeEndHdl, FloatingWindow*, void) diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index b1fac9b59029..77643b0ff4fe 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -55,7 +55,7 @@ class SwGlossDecideDlg : public ModalDialog VclPtr<ListBox> m_pListLB; DECL_LINK_TYPED(DoubleClickHdl, ListBox&, void); - DECL_LINK(SelectHdl, void*); + DECL_LINK_TYPED(SelectHdl, ListBox&, void); public: explicit SwGlossDecideDlg(vcl::Window* pParent); @@ -93,10 +93,9 @@ IMPL_LINK_NOARG_TYPED(SwGlossDecideDlg, DoubleClickHdl, ListBox&, void) EndDialog(RET_OK); } -IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl) +IMPL_LINK_NOARG_TYPED(SwGlossDecideDlg, SelectHdl, ListBox&, void) { m_pOk->Enable(LISTBOX_ENTRY_NOTFOUND != m_pListLB->GetSelectEntryPos()); - return 0; } SwGlossaryList::SwGlossaryList() : diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 57661170b000..9d8eb3aa118c 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -124,9 +124,9 @@ static void lcl_UnSelectFrm(SwWrtShell *pSh) // Select the document view -IMPL_LINK( SwNavigationPI, DocListBoxSelectHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( SwNavigationPI, DocListBoxSelectHdl, ListBox&, rBox, void ) { - int nEntryIdx = pBox->GetSelectEntryPos(); + int nEntryIdx = rBox.GetSelectEntryPos(); SwView *pView ; pView = SwModule::GetFirstView(); while (nEntryIdx-- && pView) @@ -144,7 +144,6 @@ IMPL_LINK( SwNavigationPI, DocListBoxSelectHdl, ListBox *, pBox ) { aContentTree->SetConstantShell(pView->GetWrtShellPtr()); } - return 0; } // Filling of the list box for outline view or documents diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index f0e86d3a4dd3..90a8154c82fe 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -366,14 +366,14 @@ sal_uLong NumFormatListBox::GetFormat() const return reinterpret_cast<sal_uLong>(GetEntryData(nPos)); } -IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) +IMPL_LINK_TYPED( NumFormatListBox, SelectHdl, ListBox&, rBox, void ) { - const sal_Int32 nPos = pBox->GetSelectEntryPos(); + const sal_Int32 nPos = rBox.GetSelectEntryPos(); OUString sDefine(SW_RES( STR_DEFINE_NUMBERFORMAT )); SwView *pView = GetView(); - if( pView && nPos == pBox->GetEntryCount() - 1 && - pBox->GetEntry( nPos ) == sDefine ) + if( pView && nPos == rBox.GetEntryCount() - 1 && + rBox.GetEntry( nPos ) == sDefine ) { SwWrtShell &rSh = pView->GetWrtShell(); SvNumberFormatter* pFormatter = rSh.GetNumberFormatter(); @@ -442,7 +442,6 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) else SetDefFormat(nFormat); } - return 0; } double NumFormatListBox::GetDefValue(const short nFormatType) const diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index ac21de6c06fa..6ba93da656a5 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -262,37 +262,36 @@ void RTSPaperPage::update() } } -IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( RTSPaperPage, SelectHdl, ListBox&, rBox, void ) { const PPDKey* pKey = NULL; - if( pBox == m_pPaperBox ) + if( &rBox == m_pPaperBox ) { if( m_pParent->m_aJobData.m_pParser ) pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "PageSize" ) ); } - else if( pBox == m_pDuplexBox ) + else if( &rBox == m_pDuplexBox ) { if( m_pParent->m_aJobData.m_pParser ) pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "Duplex" ) ); } - else if( pBox == m_pSlotBox ) + else if( &rBox == m_pSlotBox ) { if( m_pParent->m_aJobData.m_pParser ) pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "InputSlot" ) ); } - else if( pBox == m_pOrientBox ) + else if( &rBox == m_pOrientBox ) { m_pParent->m_aJobData.m_eOrientation = m_pOrientBox->GetSelectEntryPos() == 0 ? orientation::Portrait : orientation::Landscape; } if( pKey ) { - PPDValue* pValue = static_cast<PPDValue*>(pBox->GetSelectEntryData()); + PPDValue* pValue = static_cast<PPDValue*>(rBox.GetSelectEntryData()); m_pParent->m_aJobData.m_aContext.setValue( pKey, pValue ); update(); } m_pParent->SetDataModified( true ); - return 0; } /* @@ -451,14 +450,14 @@ IMPL_LINK(RTSDevicePage, ModifyHdl, Edit*, pEdit) return 0; } -IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( RTSDevicePage, SelectHdl, ListBox&, rBox, void ) { - if( pBox == m_pPPDKeyBox ) + if( &rBox == m_pPPDKeyBox ) { const PPDKey* pKey = static_cast<PPDKey*>(m_pPPDKeyBox->GetSelectEntryData()); FillValueBox( pKey ); } - else if( pBox == m_pPPDValueBox ) + else if( &rBox == m_pPPDValueBox ) { const PPDKey* pKey = static_cast<PPDKey*>(m_pPPDKeyBox->GetSelectEntryData()); const PPDValue* pValue = static_cast<PPDValue*>(m_pPPDValueBox->GetSelectEntryData()); @@ -469,7 +468,6 @@ IMPL_LINK( RTSDevicePage, SelectHdl, ListBox*, pBox ) } } m_pParent->SetDataModified( true ); - return 0; } void RTSDevicePage::FillValueBox( const PPDKey* pKey ) diff --git a/vcl/generic/print/prtsetup.hxx b/vcl/generic/print/prtsetup.hxx index 5e35f60ce57b..e1e60d55b535 100644 --- a/vcl/generic/print/prtsetup.hxx +++ b/vcl/generic/print/prtsetup.hxx @@ -89,7 +89,7 @@ class RTSPaperPage : public TabPage VclPtr<FixedText> m_pSlotText; VclPtr<ListBox> m_pSlotBox; - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); public: explicit RTSPaperPage( RTSDialog* ); virtual ~RTSPaperPage(); @@ -115,7 +115,7 @@ class RTSDevicePage : public TabPage void FillValueBox( const ::psp::PPDKey* ); - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK( ModifyHdl, Edit* ); public: explicit RTSDevicePage( RTSDialog* ); diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index a5f1769cd30c..853a822ee1ab 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -240,7 +240,7 @@ namespace vcl virtual void Command( const CommandEvent& ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& ) SAL_OVERRIDE; - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_LINK_TYPED( ClickHdl, Button*, void ); DECL_LINK_TYPED( ToggleHdl, CheckBox&, void ); DECL_LINK_TYPED( ToggleRadioHdl, RadioButton&, void ); @@ -248,7 +248,7 @@ namespace vcl DECL_LINK_TYPED( UIOption_CheckHdl, CheckBox&, void ); DECL_LINK_TYPED( UIOption_RadioHdl, RadioButton&, void ); - DECL_LINK( UIOption_SelectHdl, ListBox* ); + DECL_LINK_TYPED( UIOption_SelectHdl, ListBox&, void ); DECL_LINK( UIOption_ModifyHdl, Edit* ); public: diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 1ad96bb86b9e..b2998cac4051 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -961,7 +961,7 @@ bool ListBox::PreNotify( NotifyEvent& rNEvt ) void ListBox::Select() { - ImplCallEventListenersAndHandler( VCLEVENT_LISTBOX_SELECT, [this] () { maSelectHdl.Call(this); } ); + ImplCallEventListenersAndHandler( VCLEVENT_LISTBOX_SELECT, [this] () { maSelectHdl.Call(*this); } ); } void ListBox::DoubleClick() diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index fb7798aa6258..1a725a30c818 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1002,10 +1002,9 @@ bool TabControl::ImplHandleKeyEvent( const KeyEvent& rKeyEvent ) return bRet; } -IMPL_LINK_NOARG(TabControl, ImplListBoxSelectHdl) +IMPL_LINK_NOARG_TYPED(TabControl, ImplListBoxSelectHdl, ListBox&, void) { SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectEntryPos() ) ); - return 0; } IMPL_LINK_TYPED( TabControl, ImplWindowEventListener, VclWindowEvent&, rEvent, void ) diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index b2185fcf070f..2b0996af513b 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1517,11 +1517,11 @@ void PrintDialog::updateNup() preparePreview( true, true ); } -IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) +IMPL_LINK_TYPED( PrintDialog, SelectHdl, ListBox&, rBox, void ) { - if( pBox == maJobPage.mpPrinters ) + if( &rBox == maJobPage.mpPrinters ) { - OUString aNewPrinter( pBox->GetSelectEntry() ); + OUString aNewPrinter( rBox.GetSelectEntry() ); // set new printer maPController->setPrinter( VclPtrInstance<Printer>( aNewPrinter ) ); maPController->resetPrinterOptions( maOptionsPage.mpToFileBox->IsChecked() ); @@ -1529,18 +1529,16 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) updatePrinterText(); preparePreview( true ); } - else if( pBox == maNUpPage.mpNupOrientationBox || pBox == maNUpPage.mpNupOrderBox ) + else if( &rBox == maNUpPage.mpNupOrientationBox || &rBox == maNUpPage.mpNupOrderBox ) { updateNup(); } - else if( pBox == maNUpPage.mpNupPagesBox ) + else if( &rBox == maNUpPage.mpNupPagesBox ) { if( !maNUpPage.mpPagesBtn->IsChecked() ) maNUpPage.mpPagesBtn->Check(); updateNupFromPages(); } - - return 0; } IMPL_LINK_TYPED( PrintDialog, ToggleRadioHdl, RadioButton&, rButton, void ) @@ -1796,14 +1794,14 @@ IMPL_LINK_TYPED( PrintDialog, UIOption_RadioHdl, RadioButton&, i_rBtn, void ) } } -IMPL_LINK( PrintDialog, UIOption_SelectHdl, ListBox*, i_pBox ) +IMPL_LINK_TYPED( PrintDialog, UIOption_SelectHdl, ListBox&, i_rBox, void ) { - PropertyValue* pVal = getValueForWindow( i_pBox ); + PropertyValue* pVal = getValueForWindow( &i_rBox ); if( pVal ) { - makeEnabled( i_pBox ); + makeEnabled( &i_rBox ); - sal_Int32 nVal( i_pBox->GetSelectEntryPos() ); + sal_Int32 nVal( i_rBox.GetSelectEntryPos() ); pVal->Value <<= nVal; //If we are in impress we start in print slides mode and get a @@ -1819,7 +1817,6 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, ListBox*, i_pBox ) // update preview and page settings preparePreview(); } - return 0; } IMPL_LINK( PrintDialog, UIOption_ModifyHdl, Edit*, i_pBox ) diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index ee22e6062336..b044f0ed53c3 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -114,7 +114,7 @@ public: static OString processCommand( const OString& rCommand ); DECL_LINK_TYPED( ListHdl, Button*, void ); - DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK_TYPED( SelectHdl, ListBox&, void ); DECL_STATIC_LINK_TYPED( MyWin, QuitHdl, Button*, void ); }; @@ -240,7 +240,7 @@ IMPL_STATIC_LINK_NOARG_TYPED( MyWin, QuitHdl, Button*, void) processCommand( "quit" ); } -IMPL_LINK( MyWin, SelectHdl, ListBox*, ) +IMPL_LINK_NOARG_TYPED( MyWin, SelectHdl, ListBox&, void) { OUString aEntry = m_aSvpBitmaps->GetSelectEntry(); sal_Int32 nPos = aEntry.indexOf( ": " ); @@ -267,7 +267,6 @@ IMPL_LINK( MyWin, SelectHdl, ListBox*, ) m_aImage->SetSizePixel( aFixedSize ); m_aImage->SetImage( Image( BitmapEx( aBitmap ) ) ); } - return 0; } void MyWin::MouseMove( const MouseEvent& rMEvt ) diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx index 1bd89e1d7a17..ca2571869d00 100644 --- a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx +++ b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx @@ -132,7 +132,7 @@ private: DECL_LINK_TYPED( AddLocPBHdl, Button*, void ); DECL_LINK_TYPED( RemoveLocPBHdl, Button*, void ); DECL_LINK_TYPED( TrustCertLBSelectHdl, SvTreeListBox*, void ); - DECL_LINK( TrustFileLocLBSelectHdl, void* ); + DECL_LINK_TYPED( TrustFileLocLBSelectHdl, ListBox&, void ); void FillCertLB(); void ImplCheckButtons(); diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 4e725caae7f7..ff927178c2db 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -314,10 +314,9 @@ IMPL_LINK_NOARG_TYPED(MacroSecurityTrustedSourcesTP, TrustCertLBSelectHdl, SvTre ImplCheckButtons(); } -IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl) +IMPL_LINK_NOARG_TYPED(MacroSecurityTrustedSourcesTP, TrustFileLocLBSelectHdl, ListBox&, void) { ImplCheckButtons(); - return 0; } void MacroSecurityTrustedSourcesTP::FillCertLB() |