diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-04 15:05:38 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 10:48:13 +0000 |
commit | 3c99f8500f657ed84b316390d5175a6f5e56bc69 (patch) | |
tree | 749f16652560a50d409b12a23bf1a5d93b3cd2d5 /svx | |
parent | bbadb38539eb233ac45b267034066a7274181c65 (diff) |
convert Link<> to typed
Change-Id: Iec15042138e0715459b2c9e872a7464d75a6b1eb
Reviewed-on: https://gerrit.libreoffice.org/19305
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
27 files changed, 321 insertions, 365 deletions
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 ); |