From db380aab1063e8a5e40111c40ee9f7921aa82601 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Sat, 5 Nov 2016 13:28:17 -0500 Subject: Reverts a commit series that cripple windows ci. Revert "SvxShadowTabPage::Construct was removed" f9a2c1c12ecad833c63b894c89d6008907477eb5. Revert "replace OColorPopup with SvxColorWindow" f300754bb1c6a347c92bb9548be7a65237176542. Revert "drop AutoColorInvalid/SID_ATTR_AUTO_COLOR_INVALID" 347c2c334589b18cc62af292674bb3df1dd54b71. Revert "replace last ColorLB use with a listbox of colors" 604b35bf55351751a396e34dcca3f85e75860fd5. Revert "simplify, its just a vector of colors" 351a97ce6bda3075677b59fa1387ba3d1ab17d7a. Revert "replace user draw with an Image of the color" df738e0f8ceedb4bad756960be14d9c41adc165d. Revert "strip down to the used pieces" commit 08d6cd788f2584ce10ab8fa10665245e953c59d9. Revert "move now combined ColorLB to location of last user" a19b18ad7c9eb0197c10e6d7e451ec4542e4bc9e. Revert "fold ColorListBox and ColorLB together" a989a0b1f2b425f05b58d0e44ce2de31c842ed65. Revert "move ColorListBox beside sole thing that uses it" 760a198e697f3070a5e0e029e4eff7be220eb9cd. Revert "extensions leaks out details of Color Selector, patch it up" 8bea644d6117a49405e6426dc97214220fc869d1. Revert "inherit FillAttrLB from ListBox not ColorListBox" d2ce812f1d3a7a2aad89ca0bd11948b63d2db7b0. Revert "unify color selectors" 43bc3031483d172eccd72c3804e2d4fc2ef37de4. --- 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, 36 insertions(+), 25 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx index 7cfd50f41fd1..eb0150b1ad7a 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) +View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XModel > & xChartModel, const XColorListRef &pColorTable ) : 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); + m_pIllumination = VclPtr::Create(m_pTabControl,xSceneProperties,xChartModel,pColorTable); 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 40f2857859bb..bdd53ff10d21 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -22,7 +22,6 @@ #include "Bitmaps.hrc" #include "CommonConverters.hxx" -#include #include "svx/dialogs.hrc" #include #include @@ -104,7 +103,7 @@ void LightSourceInfo::initButtonFromSource() namespace { - OUString lcl_makeColorName(const Color& rColor) + OUString lcl_makeColorName( Color rColor ) { OUString aStr = SVX_RESSTR(RID_SVXFLOAT3D_FIX_R) + OUString::number(rColor.GetRed()) + @@ -116,11 +115,15 @@ namespace OUString::number(rColor.GetBlue()); return aStr; } - - void lcl_selectColor(SvxColorListBox& rListBox, const Color& rColor) + void lcl_selectColor( ColorListBox& rListBox, const Color& rColor ) { rListBox.SetNoSelection(); - rListBox.SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor))); + rListBox.SelectEntry( rColor ); + if( rListBox.GetSelectEntryCount() == 0 ) + { + const sal_Int32 nPos = rListBox.InsertEntry( rColor, lcl_makeColorName( rColor ) ); + rListBox.SelectEntryPos( nPos ); + } } ::chart::LightSource lcl_getLightSourceFromProperties( @@ -212,7 +215,8 @@ namespace ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( vcl::Window* pWindow , const uno::Reference< beans::XPropertySet > & xSceneProperties - , const uno::Reference< frame::XModel >& xChartModel ) + , const uno::Reference< frame::XModel >& xChartModel + , const XColorListRef & pColorTable ) : TabPage ( pWindow ,"tp_3D_SceneIllumination" ,"modules/schart/ui/tp_3D_SceneIllumination.ui") @@ -238,6 +242,14 @@ 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; @@ -396,7 +408,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); - SvxColorListBox* pListBox = ( bIsAmbientLight ? m_pLB_AmbientLight : m_pLB_LightSource); + ColorLB* pListBox = ( bIsAmbientLight ? m_pLB_AmbientLight : m_pLB_LightSource); SvColorDialog aColorDlg( this ); aColorDlg.SetColor( pListBox->GetSelectEntryColor() ); @@ -429,9 +441,9 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ColorDialogHdl, Button*, pButton, v } } -IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, rBox, void ) +IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, ListBox&, rBox, void ) { - SvxColorListBox* pListBox = &rBox; + ColorLB* pListBox = static_cast(&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 42517359f6fc..515ace16b8e4 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -29,8 +29,6 @@ #include #include -class SvxColorListBox; - namespace chart { @@ -54,13 +52,14 @@ public: ThreeD_SceneIllumination_TabPage( vcl::Window* pWindow, const css::uno::Reference< css::beans::XPropertySet > & xSceneProperties, - const css::uno::Reference< css::frame::XModel >& xChartModel ); + const css::uno::Reference< css::frame::XModel >& xChartModel, + const XColorListRef &pColorTable ); virtual ~ThreeD_SceneIllumination_TabPage() override; virtual void dispose() override; private: DECL_LINK( ClickLightSourceButtonHdl, Button*, void ); - DECL_LINK( SelectColorHdl, SvxColorListBox&, void ); + DECL_LINK( SelectColorHdl, ListBox&, void ); DECL_LINK( ColorDialogHdl, Button*, void ); DECL_LINK( PreviewChangeHdl, SvxLightCtl3D*, void ); DECL_LINK( PreviewSelectHdl, SvxLightCtl3D*, void ); @@ -82,10 +81,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 a5646ab535bc..b63ece7bea10 100644 --- a/chart2/source/controller/inc/dlg_View3D.hxx +++ b/chart2/source/controller/inc/dlg_View3D.hxx @@ -38,7 +38,8 @@ class View3DDialog : public TabDialog { public: View3DDialog( vcl::Window* pWindow, - const css::uno::Reference< css::frame::XModel > & xChartModel ); + const css::uno::Reference< css::frame::XModel > & xChartModel, + const XColorListRef &pColorTable ); 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 7636aa982176..00e7294f824a 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()); + ScopedVclPtrInstance< View3DDialog > aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() ); if( aDlg->Execute() == RET_OK ) aUndoGuard.commit(); } diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx index ee931d06503f..b2ff6196916d 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 NamedColor& rColor) +void ChartColorWrapper::operator()(const OUString& , const Color& rColor) { css::uno::Reference xPropSet = getPropSet(mxModel); assert(xPropSet.is()); - xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.first.GetColor())); + xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.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 b98750312c16..68fb5141b564 100644 --- a/chart2/source/controller/sidebar/ChartColorWrapper.hxx +++ b/chart2/source/controller/sidebar/ChartColorWrapper.hxx @@ -12,7 +12,6 @@ #include #include -#include class SvxColorToolBoxControl; @@ -27,7 +26,7 @@ public: SvxColorToolBoxControl* pControl, const OUString& rPropertyName); - void operator()(const OUString& rCommand, const NamedColor& rColor); + void operator()(const OUString& rCommand, const Color& 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 e445660771bd..7ff9fbf4d097 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