diff options
Diffstat (limited to 'chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx')
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index bdd53ff10d21..40f2857859bb 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -22,6 +22,7 @@ #include "Bitmaps.hrc" #include "CommonConverters.hxx" +#include <svx/colorbox.hxx> #include "svx/dialogs.hrc" #include <svx/dialmgr.hxx> #include <rtl/math.hxx> @@ -103,7 +104,7 @@ void LightSourceInfo::initButtonFromSource() namespace { - OUString lcl_makeColorName( Color rColor ) + OUString lcl_makeColorName(const Color& rColor) { OUString aStr = SVX_RESSTR(RID_SVXFLOAT3D_FIX_R) + OUString::number(rColor.GetRed()) + @@ -115,15 +116,11 @@ namespace OUString::number(rColor.GetBlue()); return aStr; } - void lcl_selectColor( ColorListBox& rListBox, const Color& rColor ) + + void lcl_selectColor(SvxColorListBox& rListBox, const Color& rColor) { rListBox.SetNoSelection(); - rListBox.SelectEntry( rColor ); - if( rListBox.GetSelectEntryCount() == 0 ) - { - const sal_Int32 nPos = rListBox.InsertEntry( rColor, lcl_makeColorName( rColor ) ); - rListBox.SelectEntryPos( nPos ); - } + rListBox.SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor))); } ::chart::LightSource lcl_getLightSourceFromProperties( @@ -215,8 +212,7 @@ namespace ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( vcl::Window* pWindow , const uno::Reference< beans::XPropertySet > & xSceneProperties - , const uno::Reference< frame::XModel >& xChartModel - , const XColorListRef & pColorTable ) + , const uno::Reference< frame::XModel >& xChartModel ) : TabPage ( pWindow ,"tp_3D_SceneIllumination" ,"modules/schart/ui/tp_3D_SceneIllumination.ui") @@ -242,14 +238,6 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( vcl::Window* get(m_pCtl_Preview, "CTL_LIGHT_PREVIEW"); - if( pColorTable.is() ) - { - m_pLB_AmbientLight->Fill( pColorTable ); - m_pLB_LightSource->Fill( pColorTable ); - } - m_pLB_AmbientLight->SetDropDownLineCount(10); - m_pLB_LightSource->SetDropDownLineCount(10); - m_pLightSourceInfoList = new LightSourceInfo[8]; m_pLightSourceInfoList[0].pButton = m_pBtn_Light1; m_pLightSourceInfoList[1].pButton = m_pBtn_Light2; @@ -408,7 +396,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewSelectHdl, SvxLightCtl3 IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton, void ) { bool bIsAmbientLight = (pButton==m_pBtn_AmbientLight_Color); - ColorLB* pListBox = ( bIsAmbientLight ? m_pLB_AmbientLight : m_pLB_LightSource); + SvxColorListBox* pListBox = ( bIsAmbientLight ? m_pLB_AmbientLight : m_pLB_LightSource); SvColorDialog aColorDlg( this ); aColorDlg.SetColor( pListBox->GetSelectEntryColor() ); @@ -441,9 +429,9 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton, v } } -IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ListBox&, rBox, void ) +IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, rBox, void ) { - ColorLB* pListBox = static_cast<ColorLB*>(&rBox); + SvxColorListBox* pListBox = &rBox; if(pListBox==m_pLB_AmbientLight) { m_bInCommitToModel = true; |