summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-05 20:28:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-07 21:04:50 +0000
commit64a708cba9b954afe3331f63c58218eb53b3d0ce (patch)
treeddc1bea3b63f32a1c6d377c1d1dd7aee0803fb70 /chart2
parentf01c49c4a89ecad2376fd0023625186e5cac642e (diff)
Revert "Reverts a commit series that cripple windows ci."
with addition of... - svxlo-SvxColorListBox + svxcorelo-SvxColorListBox This reverts commit db380aab1063e8a5e40111c40ee9f7921aa82601. Change-Id: I3af7aa0abb1a430bce64188244404fcbd480b128 Reviewed-on: https://gerrit.libreoffice.org/30598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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, 25 insertions, 36 deletions
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<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,pColorTable);
+ m_pIllumination = VclPtr<ThreeD_SceneIllumination_TabPage>::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 <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;
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 <svx/dlgctrl.hxx>
#include <svx/dlgctl3d.hxx>
+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<LightButton> m_pBtn_Light7;
VclPtr<LightButton> m_pBtn_Light8;
- VclPtr<ColorLB> m_pLB_LightSource;
+ VclPtr<SvxColorListBox> m_pLB_LightSource;
VclPtr<PushButton> m_pBtn_LightSource_Color;
- VclPtr<ColorLB> m_pLB_AmbientLight;
+ VclPtr<SvxColorListBox> 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 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<css::beans::XPropertySet> 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<css::frame::XModel>& 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 <com/sun/star/frame/XFramesSupplier.hpp>
#include <tools/color.hxx>
+#include <svx/Palette.hxx>
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<css::frame::XModel>& 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 @@
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
- <object class="svxlo-ColorLB" id="LB_LIGHTSOURCE">
+ <object class="svxcorelo-SvxColorListBox" 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-ColorLB" id="LB_AMBIENTLIGHT">
+ <object class="svxcorelo-SvxColorListBox" id="LB_AMBIENTLIGHT">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>