diff options
Diffstat (limited to 'chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx')
-rw-r--r-- | chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index 56d2d44f9ce6..2650e56fe8a4 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -29,8 +29,9 @@ #include <svtools/colrdlg.hxx> #include <svx/svx3ditems.hxx> #include <svx/svddef.hxx> +#include <utility> #include <vcl/svapp.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -99,7 +100,7 @@ namespace void lcl_selectColor(ColorListBox& rListBox, const Color& rColor) { rListBox.SetNoSelection(); - rListBox.SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor))); + rListBox.SelectEntry({rColor, lcl_makeColorName(rColor)}); } ::chart::LightSource lcl_getLightSourceFromProperties( @@ -138,7 +139,7 @@ namespace try { xSceneProperties->setPropertyValue( "D3DSceneLightColor" + aIndex, - uno::makeAny( rLightSource.nDiffuseColor )); + uno::Any( rLightSource.nDiffuseColor )); xSceneProperties->setPropertyValue( "D3DSceneLightDirection" + aIndex, uno::Any( rLightSource.aDirection )); xSceneProperties->setPropertyValue( "D3DSceneLightOn" + aIndex, @@ -172,7 +173,7 @@ namespace try { xSceneProperties->setPropertyValue("D3DSceneAmbientColor", - uno::makeAny( rColor )); + uno::Any( rColor )); } catch( const uno::Exception & ) { @@ -183,9 +184,9 @@ namespace ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Container* pParent, weld::Window* pTopLevel, - const uno::Reference< beans::XPropertySet > & xSceneProperties, + uno::Reference< beans::XPropertySet > xSceneProperties, const rtl::Reference<::chart::ChartModel>& xChartModel) - : m_xSceneProperties( xSceneProperties ) + : m_xSceneProperties(std::move( xSceneProperties )) , m_aTimerTriggeredControllerLock( xChartModel ) , m_bInCommitToModel( false ) , m_aModelChangeListener( LINK( this, ThreeD_SceneIllumination_TabPage, fillControlsFromModel ) ) @@ -193,14 +194,14 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Contain , m_pTopLevel(pTopLevel) , m_xBuilder(Application::CreateBuilder(pParent, "modules/schart/ui/tp_3D_SceneIllumination.ui")) , m_xContainer(m_xBuilder->weld_container("tp_3D_SceneIllumination")) - , m_xBtn_Light1(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_1"))) - , m_xBtn_Light2(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_2"))) - , m_xBtn_Light3(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_3"))) - , m_xBtn_Light4(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_4"))) - , m_xBtn_Light5(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_5"))) - , m_xBtn_Light6(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_6"))) - , m_xBtn_Light7(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_7"))) - , m_xBtn_Light8(new LightButton(m_xBuilder->weld_toggle_button("BTN_LIGHT_8"))) + , m_aBtn_Light1(m_xBuilder->weld_toggle_button("BTN_LIGHT_1")) + , m_aBtn_Light2(m_xBuilder->weld_toggle_button("BTN_LIGHT_2")) + , m_aBtn_Light3(m_xBuilder->weld_toggle_button("BTN_LIGHT_3")) + , m_aBtn_Light4(m_xBuilder->weld_toggle_button("BTN_LIGHT_4")) + , m_aBtn_Light5(m_xBuilder->weld_toggle_button("BTN_LIGHT_5")) + , m_aBtn_Light6(m_xBuilder->weld_toggle_button("BTN_LIGHT_6")) + , m_aBtn_Light7(m_xBuilder->weld_toggle_button("BTN_LIGHT_7")) + , m_aBtn_Light8(m_xBuilder->weld_toggle_button("BTN_LIGHT_8")) , m_xLB_LightSource(new ColorListBox(m_xBuilder->weld_menu_button("LB_LIGHTSOURCE"), [this]{ return m_pTopLevel; })) , m_xBtn_LightSource_Color(m_xBuilder->weld_button("BTN_LIGHTSOURCE_COLOR")) , m_xLB_AmbientLight(new ColorListBox(m_xBuilder->weld_menu_button("LB_AMBIENTLIGHT"), [this]{ return m_pTopLevel; })) @@ -213,25 +214,25 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Contain , m_xCtl_Preview(new SvxLightCtl3D(*m_xPreview, *m_xHoriScale, *m_xVertScale, *m_xBtn_Corner)) { m_pLightSourceInfoList.reset(new LightSourceInfo[8]); - m_pLightSourceInfoList[0].pButton = m_xBtn_Light1.get(); - m_pLightSourceInfoList[1].pButton = m_xBtn_Light2.get(); - m_pLightSourceInfoList[2].pButton = m_xBtn_Light3.get(); - m_pLightSourceInfoList[3].pButton = m_xBtn_Light4.get(); - m_pLightSourceInfoList[4].pButton = m_xBtn_Light5.get(); - m_pLightSourceInfoList[5].pButton = m_xBtn_Light6.get(); - m_pLightSourceInfoList[6].pButton = m_xBtn_Light7.get(); - m_pLightSourceInfoList[7].pButton = m_xBtn_Light8.get(); + m_pLightSourceInfoList[0].pButton = &m_aBtn_Light1; + m_pLightSourceInfoList[1].pButton = &m_aBtn_Light2; + m_pLightSourceInfoList[2].pButton = &m_aBtn_Light3; + m_pLightSourceInfoList[3].pButton = &m_aBtn_Light4; + m_pLightSourceInfoList[4].pButton = &m_aBtn_Light5; + m_pLightSourceInfoList[5].pButton = &m_aBtn_Light6; + m_pLightSourceInfoList[6].pButton = &m_aBtn_Light7; + m_pLightSourceInfoList[7].pButton = &m_aBtn_Light8; fillControlsFromModel(nullptr); - m_xBtn_Light1->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light2->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light3->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light4->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light5->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light6->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light7->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); - m_xBtn_Light8->connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light1.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light2.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light3.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light4.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light5.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light6.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light7.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); + m_aBtn_Light8.connect_clicked( LINK( this, ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl ) ); m_xLB_AmbientLight->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); m_xLB_LightSource->SetSelectHdl( LINK( this, ThreeD_SceneIllumination_TabPage, SelectColorHdl ) ); @@ -242,13 +243,15 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage(weld::Contain m_xCtl_Preview->SetUserInteractiveChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewChangeHdl ) ); m_xCtl_Preview->SetUserSelectionChangeCallback( LINK( this, ThreeD_SceneIllumination_TabPage, PreviewSelectHdl ) ); - ClickLightSourceButtonHdl(*m_xBtn_Light2->get_widget()); + ClickLightSourceButtonHdl(*m_aBtn_Light2.get_widget()); m_aModelChangeListener.startListening( uno::Reference< util::XModifyBroadcaster >(m_xSceneProperties, uno::UNO_QUERY) ); } ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage() { + // drop page view before the widget it paints to is destroyed + m_xPreview->ClearPageView(); } IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel, void*, void) |