summaryrefslogtreecommitdiff
path: root/chart2/source/controller
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 08:48:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 10:01:26 +0100
commit36c88900c56cb7c34da83e7b2d8fe88f3c8ee345 (patch)
tree4b08160b83277ccdb3499f028eea313ffe7ef437 /chart2/source/controller
parent74a027f927289911b3b712c1ea0f350cf631b0ae (diff)
use more Color in chart2
Change-Id: I23fc16cdc34a06486bcaaac63bfb313f1ddc95bf Reviewed-on: https://gerrit.libreoffice.org/50862 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller')
-rw-r--r--chart2/source/controller/accessibility/AccessibleBase.cxx8
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx4
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx28
-rw-r--r--chart2/source/controller/inc/AccessibleBase.hxx2
-rw-r--r--chart2/source/controller/inc/DataPointItemConverter.hxx3
-rw-r--r--chart2/source/controller/inc/TabPageNotifiable.hxx2
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.cxx2
8 files changed, 26 insertions, 25 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 8c26f4629229..3f910e5914ef 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -716,17 +716,17 @@ void SAL_CALL AccessibleBase::grabFocus()
sal_Int32 SAL_CALL AccessibleBase::getForeground()
{
- return getColor( ACC_BASE_FOREGROUND );
+ return sal_Int32(getColor( ACC_BASE_FOREGROUND ));
}
sal_Int32 SAL_CALL AccessibleBase::getBackground()
{
- return getColor( ACC_BASE_BACKGROUND );
+ return sal_Int32(getColor( ACC_BASE_BACKGROUND ));
}
-sal_Int32 AccessibleBase::getColor( eColorType eColType )
+Color AccessibleBase::getColor( eColorType eColType )
{
- sal_Int32 nResult = static_cast< sal_Int32 >(COL_TRANSPARENT);
+ Color nResult = COL_TRANSPARENT;
if( m_bAlwaysTransparent )
return nResult;
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 547b453d3b94..9f82483f5e66 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -657,7 +657,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
if( m_apDataBrowserModel->getCellType( nColIndex ) == DataBrowserModel::NUMBER )
{
double fData( m_apDataBrowserModel->getCellNumber( nColIndex, nRow ));
- sal_Int32 nLabelColor;
+ Color nLabelColor;
if( ! ::rtl::math::isNan( fData ) &&
m_spNumberFormatterWrapper.get() )
@@ -685,7 +685,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
// guess work.
sal_Int32 nNumberFormat = DiagramHelper::getDateTimeInputNumberFormat(
Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY), fDouble );
- sal_Int32 nLabelColor;
+ Color nLabelColor;
bool bColorChanged = false;
aResult = m_spNumberFormatterWrapper->getFormattedString(
nNumberFormat, fDouble, nLabelColor, bColorChanged );
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 5eb4b6bb8f76..072db4f18d45 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -105,7 +105,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
- sal_Int32 nLabelColor = 0;//dummy
+ Color nLabelColor;//dummy
bool bColorChanged;//dummy
for(sal_Int32 nN = aDataSequences.getLength();nN--;)
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 4e759a59ed24..48009fc146b0 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -64,7 +64,7 @@ void LightButton::switchLightOn(bool bOn)
struct LightSource
{
- long nDiffuseColor;
+ Color nDiffuseColor;
css::drawing::Direction3D aDirection;
bool bIsEnabled;
@@ -88,7 +88,7 @@ LightSourceInfo::LightSourceInfo()
: pButton(nullptr)
, aLightSource()
{
- aLightSource.nDiffuseColor = 0xffffff; // white
+ aLightSource.nDiffuseColor = Color(0xffffff); // white
aLightSource.aDirection = drawing::Direction3D(1,1,1);
aLightSource.bIsEnabled = false;
}
@@ -158,7 +158,7 @@ namespace
try
{
xSceneProperties->setPropertyValue( "D3DSceneLightColor" + aIndex,
- uno::Any( rLightSource.nDiffuseColor ));
+ uno::makeAny( rLightSource.nDiffuseColor ));
xSceneProperties->setPropertyValue( "D3DSceneLightDirection" + aIndex,
uno::Any( rLightSource.aDirection ));
xSceneProperties->setPropertyValue( "D3DSceneLightOn" + aIndex,
@@ -193,7 +193,7 @@ namespace
try
{
xSceneProperties->setPropertyValue("D3DSceneAmbientColor",
- uno::Any( rColor.GetColor()));
+ uno::makeAny( rColor ));
}
catch( const uno::Exception & ex )
{
@@ -330,42 +330,42 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, PreviewChangeHdl, SvxLightCtl3
const SfxItemSet a3DLightAttributes(m_pCtl_Preview->GetSvx3DLightControl().Get3DAttributes());
LightSourceInfo* pInfo = &m_pLightSourceInfoList[0];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_1).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1).GetValue());
pInfo = &m_pLightSourceInfoList[1];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_2).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2).GetValue());
pInfo = &m_pLightSourceInfoList[2];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_3).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3).GetValue());
pInfo = &m_pLightSourceInfoList[3];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_4).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4).GetValue());
pInfo = &m_pLightSourceInfoList[4];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_5).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5).GetValue());
pInfo = &m_pLightSourceInfoList[5];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_6).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6).GetValue());
pInfo = &m_pLightSourceInfoList[6];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_7).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7).GetValue());
pInfo = &m_pLightSourceInfoList[7];
- pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8).GetValue().GetColor();
+ pInfo->aLightSource.nDiffuseColor = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8).GetValue();
pInfo->aLightSource.bIsEnabled = a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTON_8).GetValue();
pInfo->aLightSource.aDirection = B3DVectorToDirection3D(a3DLightAttributes.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8).GetValue());
@@ -427,7 +427,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, r
if(pListBox==m_pLB_AmbientLight)
{
m_bInCommitToModel = true;
- lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor().GetColor());
+ lcl_setAmbientColor( m_xSceneProperties, pListBox->GetSelectEntryColor());
m_bInCommitToModel = false;
}
else if(pListBox==m_pLB_LightSource)
@@ -444,7 +444,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, SelectColorHdl, SvxColorListBox&, r
}
if(pInfo)
{
- pInfo->aLightSource.nDiffuseColor = pListBox->GetSelectEntryColor().GetColor();
+ pInfo->aLightSource.nDiffuseColor = pListBox->GetSelectEntryColor();
applyLightSourceToModel( nL );
}
}
diff --git a/chart2/source/controller/inc/AccessibleBase.hxx b/chart2/source/controller/inc/AccessibleBase.hxx
index 5055f7b009b5..0217283d9925 100644
--- a/chart2/source/controller/inc/AccessibleBase.hxx
+++ b/chart2/source/controller/inc/AccessibleBase.hxx
@@ -285,7 +285,7 @@ private:
ACC_BASE_FOREGROUND,
ACC_BASE_BACKGROUND
};
- sal_Int32 getColor( eColorType eColType );
+ Color getColor( eColorType eColType );
private:
/** type of the vector containing the accessible children
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx
index 61b91abe8f68..63dcbbd00782 100644
--- a/chart2/source/controller/inc/DataPointItemConverter.hxx
+++ b/chart2/source/controller/inc/DataPointItemConverter.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <tools/color.hxx>
#include <vector>
@@ -70,7 +71,7 @@ private:
bool m_bDataSeries;
bool m_bOverwriteLabelsForAttributedDataPointsAlso;
bool m_bUseSpecialFillColor;
- sal_Int32 m_nSpecialFillColor;
+ Color m_nSpecialFillColor;
sal_Int32 m_nNumberFormat;
sal_Int32 m_nPercentNumberFormat;
css::uno::Sequence<sal_Int32> m_aAvailableLabelPlacements;
diff --git a/chart2/source/controller/inc/TabPageNotifiable.hxx b/chart2/source/controller/inc/TabPageNotifiable.hxx
index ea067f667531..6ad7335d989e 100644
--- a/chart2/source/controller/inc/TabPageNotifiable.hxx
+++ b/chart2/source/controller/inc/TabPageNotifiable.hxx
@@ -25,7 +25,7 @@
// color to use as foreground for an invalid range
#define RANGE_SELECTION_INVALID_RANGE_FOREGROUND_COLOR COL_WHITE
// color to use as background for an invalid range
-#define RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR 0xff6563
+#define RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR Color(0xff6563)
namespace chart
{
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index b67b44610e5d..f345e205194d 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -72,7 +72,7 @@ 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::Any(rColor.first.GetColor()));
+ xPropSet->setPropertyValue(maPropertyName, css::uno::makeAny(rColor.first));
}
void ChartColorWrapper::updateModel(const css::uno::Reference<css::frame::XModel>& xModel)