summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx30
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx11
-rw-r--r--chart2/source/controller/inc/dlg_View3D.hxx3
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx2
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.cxx4
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.hxx3
-rw-r--r--chart2/uiconfig/ui/tp_3D_SceneIllumination.ui4
8 files changed, 36 insertions, 25 deletions
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<ThreeD_SceneGeometry_TabPage>::Create(m_pTabControl,xSceneProperties,m_aControllerLocker);
m_pAppearance = VclPtr<ThreeD_SceneAppearance_TabPage>::Create(m_pTabControl,xChartModel,m_aControllerLocker);
- m_pIllumination = VclPtr<ThreeD_SceneIllumination_TabPage>::Create(m_pTabControl,xSceneProperties,xChartModel);
+ m_pIllumination = VclPtr<ThreeD_SceneIllumination_TabPage>::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 <svx/colorbox.hxx>
#include "svx/dialogs.hrc"
#include <svx/dialmgr.hxx>
#include <rtl/math.hxx>
@@ -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<ColorLB*>(&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 <svx/dlgctrl.hxx>
#include <svx/dlgctl3d.hxx>
-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<LightButton> m_pBtn_Light7;
VclPtr<LightButton> m_pBtn_Light8;
- VclPtr<SvxColorListBox> m_pLB_LightSource;
+ VclPtr<ColorLB> m_pLB_LightSource;
VclPtr<PushButton> m_pBtn_LightSource_Color;
- VclPtr<SvxColorListBox> m_pLB_AmbientLight;
+ VclPtr<ColorLB> m_pLB_AmbientLight;
VclPtr<PushButton> m_pBtn_AmbientLight_Color;
VclPtr<SvxLightCtl3D> 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<css::beans::XPropertySet> 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<css::frame::XModel>& 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 <com/sun/star/frame/XFramesSupplier.hpp>
#include <tools/color.hxx>
-#include <svx/Palette.hxx>
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<css::frame::XModel>& 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 @@
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
- <object class="svxlo-SvxColorListBox" id="LB_LIGHTSOURCE">
+ <object class="svxlo-ColorLB" id="LB_LIGHTSOURCE">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -310,7 +310,7 @@
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
- <object class="svxlo-SvxColorListBox" id="LB_AMBIENTLIGHT">
+ <object class="svxlo-ColorLB" id="LB_AMBIENTLIGHT">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>