From 64a708cba9b954afe3331f63c58218eb53b3d0ce Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 5 Nov 2016 20:28:27 +0000 Subject: Revert "Reverts a commit series that cripple windows ci." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with addition of... - svxlo-SvxColorListBox + svxcorelo-SvxColorListBox This reverts commit db380aab1063e8a5e40111c40ee9f7921aa82601. Change-Id: I3af7aa0abb1a430bce64188244404fcbd480b128 Reviewed-on: https://gerrit.libreoffice.org/30598 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- chart2/source/controller/dialogs/dlg_View3D.cxx | 4 +-- .../controller/dialogs/tp_3D_SceneIllumination.cxx | 30 +++++++--------------- .../controller/dialogs/tp_3D_SceneIllumination.hxx | 11 ++++---- chart2/source/controller/inc/dlg_View3D.hxx | 3 +-- .../controller/main/ChartController_Properties.cxx | 2 +- .../controller/sidebar/ChartColorWrapper.cxx | 4 +-- .../controller/sidebar/ChartColorWrapper.hxx | 3 ++- chart2/uiconfig/ui/tp_3D_SceneIllumination.ui | 4 +-- 8 files changed, 25 insertions(+), 36 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx index eb0150b1ad7a..7cfd50f41fd1 100644 --- a/chart2/source/controller/dialogs/dlg_View3D.cxx +++ b/chart2/source/controller/dialogs/dlg_View3D.cxx @@ -39,7 +39,7 @@ using namespace ::com::sun::star::chart2; sal_uInt16 View3DDialog::m_nLastPageId = 0; -View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XModel > & xChartModel, const XColorListRef &pColorTable ) +View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XModel > & xChartModel) : TabDialog(pParent, "3DViewDialog", "modules/schart/ui/3dviewdialog.ui") , m_pGeometry(nullptr) , m_pAppearance(nullptr) @@ -51,7 +51,7 @@ View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XM uno::Reference< beans::XPropertySet > xSceneProperties( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY ); m_pGeometry = VclPtr::Create(m_pTabControl,xSceneProperties,m_aControllerLocker); m_pAppearance = VclPtr::Create(m_pTabControl,xChartModel,m_aControllerLocker); - m_pIllumination = VclPtr::Create(m_pTabControl,xSceneProperties,xChartModel,pColorTable); + m_pIllumination = VclPtr::Create(m_pTabControl,xSceneProperties,xChartModel); m_pTabControl->InsertPage( TP_3D_SCENEGEOMETRY, SCH_RESSTR(STR_PAGE_PERSPECTIVE) ); m_pTabControl->InsertPage( TP_3D_SCENEAPPEARANCE, SCH_RESSTR(STR_PAGE_APPEARANCE) ); 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 #include "svx/dialogs.hrc" #include #include @@ -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(&rBox); + SvxColorListBox* pListBox = &rBox; if(pListBox==m_pLB_AmbientLight) { m_bInCommitToModel = true; diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx index 515ace16b8e4..42517359f6fc 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -29,6 +29,8 @@ #include #include +class SvxColorListBox; + namespace chart { @@ -52,14 +54,13 @@ public: ThreeD_SceneIllumination_TabPage( vcl::Window* pWindow, const css::uno::Reference< css::beans::XPropertySet > & xSceneProperties, - const css::uno::Reference< css::frame::XModel >& xChartModel, - const XColorListRef &pColorTable ); + const css::uno::Reference< css::frame::XModel >& xChartModel ); virtual ~ThreeD_SceneIllumination_TabPage() override; virtual void dispose() override; private: DECL_LINK( ClickLightSourceButtonHdl, Button*, void ); - DECL_LINK( SelectColorHdl, ListBox&, void ); + DECL_LINK( SelectColorHdl, SvxColorListBox&, void ); DECL_LINK( ColorDialogHdl, Button*, void ); DECL_LINK( PreviewChangeHdl, SvxLightCtl3D*, void ); DECL_LINK( PreviewSelectHdl, SvxLightCtl3D*, void ); @@ -81,10 +82,10 @@ private: VclPtr m_pBtn_Light7; VclPtr m_pBtn_Light8; - VclPtr m_pLB_LightSource; + VclPtr m_pLB_LightSource; VclPtr m_pBtn_LightSource_Color; - VclPtr m_pLB_AmbientLight; + VclPtr m_pLB_AmbientLight; VclPtr m_pBtn_AmbientLight_Color; VclPtr m_pCtl_Preview; diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx index b63ece7bea10..a5646ab535bc 100644 --- a/chart2/source/controller/inc/dlg_View3D.hxx +++ b/chart2/source/controller/inc/dlg_View3D.hxx @@ -38,8 +38,7 @@ class View3DDialog : public TabDialog { public: View3DDialog( vcl::Window* pWindow, - const css::uno::Reference< css::frame::XModel > & xChartModel, - const XColorListRef &pColorTable ); + const css::uno::Reference< css::frame::XModel > & xChartModel ); virtual ~View3DDialog() override; virtual void dispose() override; diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 00e7294f824a..7636aa982176 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -823,7 +823,7 @@ void ChartController::executeDispatch_View3D() //open dialog SolarMutexGuard aSolarGuard; - ScopedVclPtrInstance< View3DDialog > aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() ); + ScopedVclPtrInstance< View3DDialog > aDlg(m_pChartWindow, getModel()); if( aDlg->Execute() == RET_OK ) aUndoGuard.commit(); } diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx index b2ff6196916d..ee931d06503f 100644 --- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx +++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx @@ -67,12 +67,12 @@ ChartColorWrapper::ChartColorWrapper( { } -void ChartColorWrapper::operator()(const OUString& , const Color& rColor) +void ChartColorWrapper::operator()(const OUString& , const NamedColor& rColor) { css::uno::Reference xPropSet = getPropSet(mxModel); assert(xPropSet.is()); - xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.GetColor())); + xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.first.GetColor())); } void ChartColorWrapper::updateModel(const css::uno::Reference& xModel) diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.hxx b/chart2/source/controller/sidebar/ChartColorWrapper.hxx index 68fb5141b564..b98750312c16 100644 --- a/chart2/source/controller/sidebar/ChartColorWrapper.hxx +++ b/chart2/source/controller/sidebar/ChartColorWrapper.hxx @@ -12,6 +12,7 @@ #include #include +#include class SvxColorToolBoxControl; @@ -26,7 +27,7 @@ public: SvxColorToolBoxControl* pControl, const OUString& rPropertyName); - void operator()(const OUString& rCommand, const Color& rColor); + void operator()(const OUString& rCommand, const NamedColor& rColor); void updateModel(const css::uno::Reference& xModel); diff --git a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui index 7ff9fbf4d097..626124a9c580 100644 --- a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui +++ b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui @@ -236,7 +236,7 @@ False 12 - + True False @@ -310,7 +310,7 @@ False 12 - + True False -- cgit