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/source/engine3d | |
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/source/engine3d')
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 180 |
1 files changed, 88 insertions, 92 deletions
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(); } |