diff options
-rw-r--r-- | svx/inc/svx/float3d.hxx | 6 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 67 | ||||
-rwxr-xr-x | unusedcode.easy | 2 |
3 files changed, 28 insertions, 47 deletions
diff --git a/svx/inc/svx/float3d.hxx b/svx/inc/svx/float3d.hxx index b13cb6fd995b..576965759172 100644 --- a/svx/inc/svx/float3d.hxx +++ b/svx/inc/svx/float3d.hxx @@ -230,9 +230,7 @@ private: DECL_LINK( ClickColorHdl, PushButton * ); DECL_LINK( SelectHdl, void * ); DECL_LINK( ModifyHdl, void * ); - DECL_LINK( ClickLightHdl, PushButton * ); - - DECL_LINK( DoubleClickHdl, void * ); + void ClickLight(PushButton &rBtn); DECL_LINK( ChangeLightCallbackHdl, void * ); DECL_LINK( ChangeSelectionCallbackHdl, void * ); @@ -244,7 +242,7 @@ private: SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn = NULL ); SVX_DLLPRIVATE ColorLB* GetLbByButton( const PushButton* pBtn = NULL ); - SVX_DLLPRIVATE bool GetUILightState( ImageButton& aBtn ) const; + SVX_DLLPRIVATE bool GetUILightState( const ImageButton& rBtn ) const; SVX_DLLPRIVATE void SetUILightState( ImageButton& aBtn, bool bState ); protected: diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 0162c2e3c75f..2518c009f27c 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -483,9 +483,9 @@ void Svx3DWin::Reset() aCtlLightPreview.GetSvx3DLightControl().SelectLight(0); } -bool Svx3DWin::GetUILightState( ImageButton& aBtn ) const +bool Svx3DWin::GetUILightState( const ImageButton& rBtn ) const { - return (aBtn.GetModeImage() == aImgLightOn); + return (rBtn.GetModeImage() == aImgLightOn); } void Svx3DWin::SetUILightState( ImageButton& aBtn, bool bState ) @@ -2718,7 +2718,7 @@ IMPL_LINK( Svx3DWin, ClickHdl, PushButton *, pBtn ) aBtnLightColor.Enable( bEnable ); pLb->Enable( bEnable ); - ClickLightHdl( pBtn ); + ClickLight(*pBtn); bUpdatePreview = sal_True; } // Textures @@ -2950,45 +2950,30 @@ IMPL_LINK( Svx3DWin, ModifyHdl, void*, pField ) // ----------------------------------------------------------------------- -IMPL_LINK( Svx3DWin, ClickLightHdl, PushButton*, pBtn ) +void Svx3DWin::ClickLight(PushButton& rBtn) { - - if( pBtn ) - { - sal_uInt16 nLightSource = GetLightSource( pBtn ); - ColorLB* pLb = GetLbByButton( pBtn ); - Color aColor( pLb->GetSelectEntryColor() ); - SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes()); - const bool bOnOff(GetUILightState( *(ImageButton*)pBtn )); - - switch(nLightSource) - { - case 0: aLightItemSet.Put(Svx3DLightcolor1Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff1Item(bOnOff)); break; - case 1: aLightItemSet.Put(Svx3DLightcolor2Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff2Item(bOnOff)); break; - case 2: aLightItemSet.Put(Svx3DLightcolor3Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff3Item(bOnOff)); break; - case 3: aLightItemSet.Put(Svx3DLightcolor4Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff4Item(bOnOff)); break; - case 4: aLightItemSet.Put(Svx3DLightcolor5Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff5Item(bOnOff)); break; - case 5: aLightItemSet.Put(Svx3DLightcolor6Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff6Item(bOnOff)); break; - case 6: aLightItemSet.Put(Svx3DLightcolor7Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff7Item(bOnOff)); break; - default: - case 7: aLightItemSet.Put(Svx3DLightcolor8Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff8Item(bOnOff)); break; - } - - aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aLightItemSet); - aCtlLightPreview.GetSvx3DLightControl().SelectLight(nLightSource); - aCtlLightPreview.CheckSelection(); - } - return( 0L ); -} - - -// ----------------------------------------------------------------------- -IMPL_LINK_NOARG(Svx3DWin, DoubleClickHdl) -{ - // and assign - ClickAssignHdl( NULL ); - - return( 0L ); + sal_uInt16 nLightSource = GetLightSource( &rBtn ); + ColorLB* pLb = GetLbByButton( &rBtn ); + Color aColor( pLb->GetSelectEntryColor() ); + SfxItemSet aLightItemSet(aCtlLightPreview.GetSvx3DLightControl().Get3DAttributes()); + const bool bOnOff(GetUILightState( (const ImageButton&)rBtn )); + + switch(nLightSource) + { + case 0: aLightItemSet.Put(Svx3DLightcolor1Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff1Item(bOnOff)); break; + case 1: aLightItemSet.Put(Svx3DLightcolor2Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff2Item(bOnOff)); break; + case 2: aLightItemSet.Put(Svx3DLightcolor3Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff3Item(bOnOff)); break; + case 3: aLightItemSet.Put(Svx3DLightcolor4Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff4Item(bOnOff)); break; + case 4: aLightItemSet.Put(Svx3DLightcolor5Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff5Item(bOnOff)); break; + case 5: aLightItemSet.Put(Svx3DLightcolor6Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff6Item(bOnOff)); break; + case 6: aLightItemSet.Put(Svx3DLightcolor7Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff7Item(bOnOff)); break; + default: + case 7: aLightItemSet.Put(Svx3DLightcolor8Item(aColor)); aLightItemSet.Put(Svx3DLightOnOff8Item(bOnOff)); break; + } + + aCtlLightPreview.GetSvx3DLightControl().Set3DAttributes(aLightItemSet); + aCtlLightPreview.GetSvx3DLightControl().SelectLight(nLightSource); + aCtlLightPreview.CheckSelection(); } // ----------------------------------------------------------------------- diff --git a/unusedcode.easy b/unusedcode.easy index 54e66860d50b..e9ee73bef1bc 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -201,8 +201,6 @@ SvXMLTokenMap_Impl::Insert(SvXMLTokenMapEntry_Impl* const*, unsigned short) SvXMLTokenMap_Impl::Insert(SvXMLTokenMap_Impl const*, unsigned short, unsigned short) SvXMLTokenMap_Impl::Remove(SvXMLTokenMapEntry_Impl* const&, unsigned short) SvXMLTokenMap_Impl::Remove(unsigned short, unsigned short) -Svx3DWin::LinkStubClickLightHdl(void*, void*) -Svx3DWin::LinkStubDoubleClickHdl(void*, void*) SvxAreaTabPage::LinkStubClickBitmapHdl_Impl(void*, void*) SvxAreaTabPage::LinkStubClickColorHdl_Impl(void*, void*) SvxAreaTabPage::LinkStubClickGradientHdl_Impl(void*, void*) |