diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-07 08:48:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-07 10:01:26 +0100 |
commit | 36c88900c56cb7c34da83e7b2d8fe88f3c8ee345 (patch) | |
tree | 4b08160b83277ccdb3499f028eea313ffe7ef437 /chart2/source | |
parent | 74a027f927289911b3b712c1ea0f350cf631b0ae (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')
27 files changed, 100 insertions, 99 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) diff --git a/chart2/source/inc/NumberFormatterWrapper.hxx b/chart2/source/inc/NumberFormatterWrapper.hxx index a978b2b33c91..2553941c54dd 100644 --- a/chart2/source/inc/NumberFormatterWrapper.hxx +++ b/chart2/source/inc/NumberFormatterWrapper.hxx @@ -38,7 +38,7 @@ public: const css::uno::Reference< css::util::XNumberFormatsSupplier >& getNumberFormatsSupplier() { return m_xNumberFormatsSupplier; }; - OUString getFormattedString( sal_Int32 nNumberFormatKey, double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const; + OUString getFormattedString( sal_Int32 nNumberFormatKey, double fValue, Color& rLabelColor, bool& rbColorChanged ) const; Date getNullDate() const; private: //private member @@ -56,7 +56,7 @@ public: , sal_Int32 nNumberFormatKey ); ~FixedNumberFormatter(); - OUString getFormattedString( double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const; + OUString getFormattedString( double fValue, Color& rLabelColor, bool& rbColorChanged ) const; private: NumberFormatterWrapper m_aNumberFormatterWrapper; diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index 0fb965d14706..724f3b2276ba 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -178,7 +178,7 @@ void ExplicitCategoriesProvider::convertCategoryAnysToText( uno::Sequence< OUStr xAxis, xCooSysModel, uno::Reference<chart2::XChartDocument>(static_cast< ::cppu::OWeakObject* >(&rModel), uno::UNO_QUERY), false ); } - sal_Int32 nLabelColor; + Color nLabelColor; bool bColorChanged = false; NumberFormatterWrapper aNumberFormatterWrapper( rModel.getNumberFormatsSupplier() ); diff --git a/chart2/source/tools/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx index b5ff0c2e0028..01da37fce6ff 100644 --- a/chart2/source/tools/NumberFormatterWrapper.cxx +++ b/chart2/source/tools/NumberFormatterWrapper.cxx @@ -42,7 +42,7 @@ FixedNumberFormatter::~FixedNumberFormatter() { } -OUString FixedNumberFormatter::getFormattedString( double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const +OUString FixedNumberFormatter::getFormattedString( double fValue, Color& rLabelColor, bool& rbColorChanged ) const { return m_aNumberFormatterWrapper.getFormattedString( m_nNumberFormatKey, fValue, rLabelColor, rbColorChanged ); @@ -84,7 +84,7 @@ Date NumberFormatterWrapper::getNullDate() const } OUString NumberFormatterWrapper::getFormattedString( sal_Int32 nNumberFormatKey, double fValue, - sal_Int32& rLabelColor, bool& rbColorChanged ) const + Color& rLabelColor, bool& rbColorChanged ) const { OUString aText; Color* pTextColor = nullptr; @@ -115,7 +115,7 @@ OUString NumberFormatterWrapper::getFormattedString( sal_Int32 nNumberFormatKey, if(pTextColor) { rbColorChanged = true; - rLabelColor = pTextColor->GetColor(); + rLabelColor = *pTextColor; } else rbColorChanged = false; diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index be15adb547a3..111d0ee01079 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -37,7 +37,7 @@ using ::com::sun::star::uno::Sequence; namespace { -const auto defaultPreferredColor = COL_LIGHTBLUE; +const Color defaultPreferredColor = COL_LIGHTBLUE; void lcl_fillRanges( Sequence< chart2::data::HighlightedRange > & rOutRanges, diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index dd5593c66476..d139b4d937c0 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -411,7 +411,7 @@ bool lcl_hasWordBreak( const Reference<drawing::XShape>& xShape ) OUString getTextLabelString( const FixedNumberFormatter& rFixedNumberFormatter, const uno::Sequence<OUString>* pCategories, - const TickInfo* pTickInfo, bool bComplexCat, sal_Int32& rExtraColor, bool& rHasExtraColor ) + const TickInfo* pTickInfo, bool bComplexCat, Color& rExtraColor, bool& rHasExtraColor ) { if (pCategories) { @@ -744,7 +744,7 @@ bool VCartesianAxis::createTextShapes( getAxisLabelProperties(aPropNames, aPropValues, m_aAxisProperties, rAxisLabelProperties, nLimitedSpaceForText, bLimitedHeight); uno::Any* pColorAny = PropertyMapper::getValuePointer(aPropValues,aPropNames,"CharColor"); - sal_Int32 nColor = COL_AUTO.GetColor(); + Color nColor = COL_AUTO; if(pColorAny) *pColorAny >>= nColor; @@ -808,7 +808,7 @@ bool VCartesianAxis::createTextShapes( } bool bHasExtraColor=false; - sal_Int32 nExtraColor=0; + Color nExtraColor; OUString aLabel = getTextLabelString( aFixedNumberFormatter, pCategories, pTickInfo, isComplexCategoryAxis(), @@ -932,7 +932,7 @@ bool VCartesianAxis::createTextShapesSimple( getAxisLabelProperties(aPropNames, aPropValues, m_aAxisProperties, rAxisLabelProperties, -1, bLimitedHeight); uno::Any* pColorAny = PropertyMapper::getValuePointer(aPropValues,aPropNames,"CharColor"); - sal_Int32 nColor = COL_AUTO.GetColor(); + Color nColor = COL_AUTO; if(pColorAny) *pColorAny >>= nColor; @@ -974,7 +974,7 @@ bool VCartesianAxis::createTextShapesSimple( } bool bHasExtraColor=false; - sal_Int32 nExtraColor=0; + Color nExtraColor; OUString aLabel = getTextLabelString( aFixedNumberFormatter, pCategories, pTickInfo, isComplexCategoryAxis(), diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx index 9561cf66b456..404db2e4c0b8 100644 --- a/chart2/source/view/axes/VPolarAngleAxis.cxx +++ b/chart2/source/view/axes/VPolarAngleAxis.cxx @@ -67,7 +67,7 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis( , rAxisLabelProperties.m_aFontReferenceSize ); uno::Any* pColorAny = PropertyMapper::getValuePointer(aPropValues,aPropNames,"CharColor"); - sal_Int32 nColor = COL_AUTO.GetColor(); + Color nColor = COL_AUTO; if(pColorAny) *pColorAny >>= nColor; @@ -96,7 +96,7 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis( { //create single label bool bHasExtraColor=false; - sal_Int32 nExtraColor=0; + Color nExtraColor; OUString aLabel; if(pLabels) diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index bd34a611e75c..86d4fb3e6d5c 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -690,14 +690,14 @@ void GL3DBarChart::create3DShapes(const std::vector<std::unique_ptr<VDataSeries> p->setPosition(aTopLeft, aTopRight, aBottomRight); } - sal_Int32 nColor = aSeriesColor[nSeriesIndex % SAL_N_ELEMENTS(aSeriesColor)].GetColor(); + Color nColor = aSeriesColor[nSeriesIndex % SAL_N_ELEMENTS(aSeriesColor)]; for(sal_Int32 nIndex = 0; nIndex < nPointCount; ++nIndex) { if(bMappedFillProperty) { double nPropVal = rDataSeries->getValueByProperty(nIndex, "FillColor"); if(!rtl::math::isNan(nPropVal)) - nColor = static_cast<sal_uInt32>(nPropVal); + nColor = Color(static_cast<sal_uInt32>(nPropVal)); } float nVal = rDataSeries->getYValue(nIndex); @@ -716,7 +716,7 @@ void GL3DBarChart::create3DShapes(const std::vector<std::unique_ptr<VDataSeries> recordBarHistory(nId, nVal); if (mbBenchMarkMode) { - std::map<sal_uInt32, sal_uInt32>::const_iterator it = maBarColorMap.find(nId); + auto it = maBarColorMap.find(nId); if (it == maBarColorMap.end()) { maBarColorMap[nId] = nColor; @@ -919,7 +919,7 @@ sal_uInt32 GL3DBarChart::barIdAtPosition(const Point& rPos) mpWindow->getContext().makeCurrent(); mpRenderer->SetPickingMode(true); renderFrame(); - nId = mpRenderer->GetPixelColorFromPoint(rPos.X(), rPos.Y()); + nId = sal_uInt32(mpRenderer->GetPixelColorFromPoint(rPos.X(), rPos.Y())); mpRenderer->SetPickingMode(false); mpWindow->getContext().resetCurrent(); } @@ -1454,10 +1454,10 @@ void GL3DBarChart::updateScroll() } } -void GL3DBarChart::processAutoFly(sal_uInt32 nId, sal_uInt32 nColor) +void GL3DBarChart::processAutoFly(sal_uInt32 nId, Color nColor) { //record the color - sal_uInt32 nPreColor = maBarColorMap[nId]; + Color nPreColor = maBarColorMap[nId]; maBarColorMap[nId] = nColor; //if has manul event, just record the color and process manul event first if (maRenderEvent != EVENT_NONE) @@ -1465,7 +1465,7 @@ void GL3DBarChart::processAutoFly(sal_uInt32 nId, sal_uInt32 nColor) return; } //calc the percentage of color change - int nColorRate = (nColor - nPreColor) * 100 / nPreColor; + int nColorRate = (sal_uInt32(nColor) - sal_uInt32(nPreColor)) * 100 / sal_uInt32(nPreColor); nColorRate = abs(nColorRate); if (nColorRate >= FLY_THRESHOLD) { diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 0ebb883ca9a0..e90444006105 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -382,7 +382,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries const & rDataSeries if(nNumberFormatKey<0) nNumberFormatKey=0; - sal_Int32 nLabelCol = 0; + Color nLabelCol; bool bColChanged; aNumber = m_apNumberFormatterWrapper->getFormattedString( nNumberFormatKey, fValue, nLabelCol, bColChanged ); @@ -1353,7 +1353,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes( double fR( xRegressionCurveCalculator->getCorrelationCoefficient()); if( m_apNumberFormatterWrapper.get()) { - sal_Int32 nLabelCol = 0; + Color nLabelCol; bool bColChanged; aFormula.append( m_apNumberFormatterWrapper->getFormattedString( diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx index 052fd1dd2783..432137747424 100644 --- a/chart2/source/view/inc/3DChartObjects.hxx +++ b/chart2/source/view/inc/3DChartObjects.hxx @@ -62,7 +62,7 @@ protected: class Bar : public Renderable3DObject { public: - Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_uInt32 nColor, sal_uInt32 nId); + Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, Color nColor, sal_uInt32 nId); virtual void render() override; private: diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx index c1350f47b231..0c244a335b5a 100644 --- a/chart2/source/view/inc/GL3DBarChart.hxx +++ b/chart2/source/view/inc/GL3DBarChart.hxx @@ -116,7 +116,7 @@ private: static void swapVector(int i, int j, std::vector<sal_uInt32> &vectorNearest); void getNearestBars(std::vector<sal_uInt32> &vectorNearest); void updateScroll(); - void processAutoFly(sal_uInt32 nId, sal_uInt32 nColor); + void processAutoFly(sal_uInt32 nId, Color nColor); void getNeighborBarID(sal_uInt32 nSelectBarId, sal_uInt32 *pNeighborBarId); void addMovementScreenText(sal_uInt32 nBarId); css::uno::Reference<css::chart2::XChartType> mxChartType; @@ -184,7 +184,7 @@ private: std::map<sal_uInt32, std::deque<float> > maBarHistory; std::vector<sal_uInt32> maVectorNearest; std::map<sal_uInt32, float> maDistanceMap; - std::map<sal_uInt32, sal_uInt32> maBarColorMap; + std::map<sal_uInt32, Color> maBarColorMap; int mnColorRate; bool mbBenchMarkMode; sal_uInt32 mnHistoryCounter; diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx index 141621c1bc70..9dc860229aee 100644 --- a/chart2/source/view/inc/GL3DRenderer.hxx +++ b/chart2/source/view/inc/GL3DRenderer.hxx @@ -181,16 +181,16 @@ public: ~OpenGL3DRenderer(); void init(); - void Set3DSenceInfo(sal_uInt32 color, bool twoSidesLighting = true); - void SetLightInfo(bool lightOn, sal_uInt32 color, const glm::vec4& direction); - void AddShapePolygon3DObject(sal_uInt32 color, bool lineOnly, sal_uInt32 lineColor, + void Set3DSenceInfo(Color color, bool twoSidesLighting = true); + void SetLightInfo(bool lightOn, Color color, const glm::vec4& direction); + void AddShapePolygon3DObject(Color color, bool lineOnly, Color lineColor, long fillStyle, sal_uInt32 specular, sal_uInt32 nUniqueId); void EndAddShapePolygon3DObject(); void AddPolygon3DObjectNormalPoint(float x, float y, float z); void EndAddPolygon3DObjectNormalPoint(); void AddPolygon3DObjectPoint(float x, float y, float z); void EndAddPolygon3DObjectPoint(); - void AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 color, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId); + void AddShape3DExtrudeObject(bool roundedCorner, Color color, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId); void EndAddShape3DExtrudeObject(); void SetSize(const Size& rSize); void SetCameraInfo(const glm::vec3& pos, const glm::vec3& direction, const glm::vec3& up); @@ -207,7 +207,7 @@ public: void SetPickingMode(bool bPickingMode); - sal_uInt32 GetPixelColorFromPoint(long nX, long nY); + Color GetPixelColorFromPoint(long nX, long nY); void ReleaseShapes(); void ReleaseScreenTextShapes(); diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx index aaad77e2748c..f4dcd0d3a62c 100644 --- a/chart2/source/view/main/3DChartObjects.cxx +++ b/chart2/source/view/main/3DChartObjects.cxx @@ -30,7 +30,7 @@ void Renderable3DObject::render() (void) mnUniqueId; } -Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_uInt32 aColor, sal_uInt32 nId) +Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, Color aColor, sal_uInt32 nId) : Renderable3DObject(pRenderer, nId) , maPos(rPosition) , maColor(aColor) @@ -40,7 +40,7 @@ Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_uInt32 aCo void Bar::render() { - mpRenderer->AddShape3DExtrudeObject(true/*RoundedCorners*/, maColor.GetColor(), 0xFFFFFF, maPos, mnUniqueId); + mpRenderer->AddShape3DExtrudeObject(true/*RoundedCorners*/, maColor, 0xFFFFFF, maPos, mnUniqueId); mpRenderer->EndAddShape3DExtrudeObject(); } @@ -51,7 +51,7 @@ Line::Line(OpenGL3DRenderer* pRenderer, sal_uInt32 nId): void Line::render() { - mpRenderer->AddShapePolygon3DObject(0, true, maLineColor.GetColor(), 0, 0, mnUniqueId); + mpRenderer->AddShapePolygon3DObject(Color(0), true, maLineColor, 0, 0, mnUniqueId); mpRenderer->AddPolygon3DObjectPoint(maPosBegin.x, maPosBegin.y, maPosBegin.z); mpRenderer->AddPolygon3DObjectPoint(maPosEnd.x, maPosEnd.y, maPosEnd.z); mpRenderer->EndAddPolygon3DObjectPoint(); @@ -159,7 +159,7 @@ void Rectangle::render() glm::vec3 dir1 = maBottomRight - maTopLeft; glm::vec3 dir2 = maTopRight - maTopLeft; glm::vec3 normal = glm::normalize(glm::cross(dir1, dir2)); - mpRenderer->AddShapePolygon3DObject(maColor.GetColor(), false, 0, 1, 0xFFFFFF, mnUniqueId); + mpRenderer->AddShapePolygon3DObject(maColor, false, Color(0), 1, 0xFFFFFF, mnUniqueId); glm::vec3 bottomLeft = maBottomRight - dir2; //set polygon points and normals mpRenderer->AddPolygon3DObjectPoint(maBottomRight.x, maBottomRight.y, maBottomRight.z); @@ -174,9 +174,9 @@ void Rectangle::render() mpRenderer->EndAddPolygon3DObjectNormalPoint(); mpRenderer->EndAddShapePolygon3DObject(); //we should render the edge if the edge color is different from the fill color - if (maColor.GetColor() != maLineColor.GetColor()) + if (maColor != maLineColor) { - mpRenderer->AddShapePolygon3DObject(0, true, maLineColor.GetColor(), 0, 0xFFFFFF, mnUniqueId); + mpRenderer->AddShapePolygon3DObject(Color(0), true, maLineColor, 0, 0xFFFFFF, mnUniqueId); mpRenderer->AddPolygon3DObjectPoint(maBottomRight.x, maBottomRight.y, maBottomRight.z); mpRenderer->AddPolygon3DObjectPoint(maTopRight.x, maTopRight.y, maTopRight.z); mpRenderer->AddPolygon3DObjectPoint(maTopLeft.x, maTopLeft.y, maTopLeft.z); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index a743c60ad9f8..23dd1ce0f668 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2443,7 +2443,7 @@ void lcl_createButtons(const uno::Reference<drawing::XShapes>& xPageShapes, pButton->setPosition(aNewPosition); pButton->setSize(aSize); if (rPageFieldEntry.HasHiddenMembers) - pButton->setArrowColor(0x0000FF); + pButton->setArrowColor(Color(0x0000FF)); pButton->createShapes(xModelPage); x += aSize.Width + 100; @@ -2470,11 +2470,11 @@ void lcl_createButtons(const uno::Reference<drawing::XShapes>& xPageShapes, pButton->setSize(aSize); if ( rRowFieldEntry.Name == "Data" ) { - pButton->setBGColor( 0x00F6F6F6 ); + pButton->setBGColor( Color(0x00F6F6F6) ); pButton->showArrow( false ); } else if (rRowFieldEntry.HasHiddenMembers) - pButton->setArrowColor(0x0000FF); + pButton->setArrowColor(Color(0x0000FF)); pButton->createShapes(xModelPage); x += aSize.Width + 100; } diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index c9f9ac6e0bd8..71cd47206b2d 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -675,7 +675,7 @@ void DummyRectangle::render() if(itr != maProperties.end()) { uno::Any co = itr->second; - sal_Int32 nColorValue = co.get<sal_Int32>(); + Color nColorValue(co.get<sal_Int32>()); //here FillStyle works for background color and gradients pChart->m_GLRender.SetBackGroundColor(nColorValue, nColorValue, eStyle); } @@ -725,7 +725,7 @@ struct FontAttribSetter else if(rPropName == "CharColor") { sal_Int32 nColor = rProp.second.get<sal_Int32>(); - mrFont.SetFillColor(nColor); + mrFont.SetFillColor(Color(nColor)); } else if(rPropName == "CharHeight") { diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index 9067553dd588..fc7917f6883d 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -42,13 +42,12 @@ GLfloat texCoords[] = { 0.0f, 0.0f }; -glm::vec4 getColorAsVector(sal_uInt32 nColor) +glm::vec4 getColorAsVector(Color nColor) { - auto red = ((nColor & 0x00FF0000) >> 16) / 255.0f; - auto green = ((nColor & 0x0000FF00) >> 8) / 255.0f; - auto blue = (nColor & 0x000000FF) / 255.0f; - auto alpha = (0xFF - ((nColor & 0xFF000000) >> 24)) / 255.0; - return glm::vec4(red, green, blue, alpha); + return glm::vec4(nColor.GetRed() / 255.0f, + nColor.GetGreen() / 255.0f, + nColor.GetBlue() / 255.0f, + (0xFF - nColor.GetTransparency())/255.0); } } @@ -435,7 +434,7 @@ void OpenGL3DRenderer::init() m_TextInfoBatch.batchNum = 512; CHECK_GL_ERROR(); glViewport(0, 0, m_iWidth, m_iHeight); - Set3DSenceInfo(0xFFFFFF); + Set3DSenceInfo(Color(0xFFFFFF)); m_GlobalScaleMatrix = glm::scale(glm::vec3(0.01f, 0.01f, 0.01f)); } @@ -1085,7 +1084,7 @@ void OpenGL3DRenderer::RenderPolygon3DObject() glDepthMask(GL_TRUE); } -void OpenGL3DRenderer::Set3DSenceInfo(sal_uInt32 nColor, bool twoSidesLighting) +void OpenGL3DRenderer::Set3DSenceInfo(Color nColor, bool twoSidesLighting) { m_Polygon3DInfo.material.twoSidesLighting = twoSidesLighting; if (maResources.m_b330Support) @@ -1098,13 +1097,13 @@ void OpenGL3DRenderer::Set3DSenceInfo(sal_uInt32 nColor, bool twoSidesLighting) m_iLightNum = 0; m_Ambient = getColorAsVector(nColor); } - SetLightInfo(true, 0xFFFFFF, glm::vec4(-1.0, -1.0, 1.0, 0.0)); - SetLightInfo(true, 0xFFFFFF, glm::vec4(-1.0, 1.0, 1.0, 0.0)); - SetLightInfo(true, 0xFFFFFF, glm::vec4(1.0, -1.0, 1.0, 0.0)); - SetLightInfo(true, 0xFFFFFF, glm::vec4(1.0, 1.0, 1.0, 0.0)); + SetLightInfo(true, Color(0xFFFFFF), glm::vec4(-1.0, -1.0, 1.0, 0.0)); + SetLightInfo(true, Color(0xFFFFFF), glm::vec4(-1.0, 1.0, 1.0, 0.0)); + SetLightInfo(true, Color(0xFFFFFF), glm::vec4(1.0, -1.0, 1.0, 0.0)); + SetLightInfo(true, Color(0xFFFFFF), glm::vec4(1.0, 1.0, 1.0, 0.0)); } -void OpenGL3DRenderer::SetLightInfo(bool lightOn, sal_uInt32 nColor, const glm::vec4& direction) +void OpenGL3DRenderer::SetLightInfo(bool lightOn, Color nColor, const glm::vec4& direction) { if (lightOn) { @@ -1133,10 +1132,10 @@ void OpenGL3DRenderer::SetLightInfo(bool lightOn, sal_uInt32 nColor, const glm:: } } -void OpenGL3DRenderer::AddShapePolygon3DObject(sal_uInt32 nColor, bool lineOnly, sal_uInt32 nLineColor,long fillStyle, sal_uInt32 specular, sal_uInt32 nUniqueId) +void OpenGL3DRenderer::AddShapePolygon3DObject(Color nColor, bool lineOnly, Color nLineColor,long fillStyle, sal_uInt32 specular, sal_uInt32 nUniqueId) { m_Polygon3DInfo.polygonColor = getColorAsVector(nColor); - m_Polygon3DInfo.id = getColorAsVector(nUniqueId); + m_Polygon3DInfo.id = getColorAsVector(Color(nUniqueId)); m_Polygon3DInfo.material.materialColor = m_Polygon3DInfo.polygonColor;//material color seems to be the same for all parts, so we use the polygon color //line or Polygon m_Polygon3DInfo.lineOnly = lineOnly; @@ -1151,7 +1150,7 @@ void OpenGL3DRenderer::AddShapePolygon3DObject(sal_uInt32 nColor, bool lineOnly, m_Polygon3DInfo.fillStyle= fillStyle; //material specular; - m_Polygon3DInfo.material.specular = getColorAsVector(specular); + m_Polygon3DInfo.material.specular = getColorAsVector(Color(specular)); m_Polygon3DInfo.material.diffuse = glm::vec4(1.0, 1.0, 1.0, 1.0); @@ -1208,9 +1207,9 @@ void OpenGL3DRenderer::EndAddPolygon3DObjectPoint() m_Polygon3DInfo.vertices = nullptr; } -void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nColor, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId) +void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, Color nColor, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId) { - m_Extrude3DInfo.id = getColorAsVector(nUniqueId); + m_Extrude3DInfo.id = getColorAsVector(Color(nUniqueId)); m_Extrude3DInfo.orgID = nUniqueId; glm::vec4 tranform = modelMatrix * glm::vec4(0.0, 0.0, 0.0, 1.0); glm::vec4 DirX = modelMatrix * glm::vec4(1.0, 0.0, 0.0, 0.0); @@ -1228,7 +1227,7 @@ void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nC m_Extrude3DInfo.material.materialColor = m_Extrude3DInfo.extrudeColor;//material color seems to be the same for all parts, so we use the polygon color //material specular; - m_Extrude3DInfo.material.specular = getColorAsVector(specular); + m_Extrude3DInfo.material.specular = getColorAsVector(Color(specular)); m_Extrude3DInfo.material.diffuse = glm::vec4(1.0, 1.0, 1.0, 1.0); @@ -1715,7 +1714,7 @@ void OpenGL3DRenderer::CreateScreenTextTexture( long bmpHeight = rSizePixels.Height(); TextInfo aTextInfo; - aTextInfo.id = getColorAsVector(nUniqueId); + aTextInfo.id = getColorAsVector(Color(nUniqueId)); aTextInfo.uniqueId = nUniqueId; aTextInfo.vertex[0] = vBottomRight.x; aTextInfo.vertex[1] = vBottomRight.y; @@ -1766,7 +1765,7 @@ void OpenGL3DRenderer::CreateTextTextureSingle(const boost::shared_array<sal_uIn long bmpHeight = rSizePixels.Height(); TextInfo aTextInfo; - aTextInfo.id = getColorAsVector(nUniqueId); + aTextInfo.id = getColorAsVector(Color(nUniqueId)); aTextInfo.vertex[0] = vBottomRight.x; aTextInfo.vertex[1] = vBottomRight.y; aTextInfo.vertex[2] = vBottomRight.z; @@ -1809,7 +1808,7 @@ void OpenGL3DRenderer::CreateTextTextureBatch(const boost::shared_array<sal_uInt { long bmpWidth = rSizePixels.Width(); long bmpHeight = rSizePixels.Height(); - glm::vec4 id = getColorAsVector(nUniqueId); + glm::vec4 id = getColorAsVector(Color(nUniqueId)); m_TextInfoBatch.idList.push_back(id); m_TextInfoBatch.vertexList.emplace_back(vBottomRight.x, vBottomRight.y, vBottomRight.z); m_TextInfoBatch.vertexList.emplace_back(vTopRight.x, vTopRight.y, vTopRight.z); @@ -2234,7 +2233,7 @@ void OpenGL3DRenderer::SetPickingMode(bool bPickingMode) } } -sal_uInt32 OpenGL3DRenderer::GetPixelColorFromPoint(long nX, long nY) +Color OpenGL3DRenderer::GetPixelColorFromPoint(long nX, long nY) { static sal_uInt32 nId = 0; OUString aFileName = "/home/moggi/work/picking_" + OUString::number(nId++) + ".png"; @@ -2242,7 +2241,7 @@ sal_uInt32 OpenGL3DRenderer::GetPixelColorFromPoint(long nX, long nY) std::unique_ptr<sal_uInt8[]> buf(new sal_uInt8[4]); glReadPixels(nX, m_iHeight-nY, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, buf.get()); Color aColor(255-buf[3], buf[2], buf[1], buf[0]); - return aColor.GetColor(); + return aColor; } void OpenGL3DRenderer::ReleaseBatchBarInfo() diff --git a/chart2/source/view/main/VButton.cxx b/chart2/source/view/main/VButton.cxx index 0f4e2bd534ae..54dfdbfe202b 100644 --- a/chart2/source/view/main/VButton.cxx +++ b/chart2/source/view/main/VButton.cxx @@ -85,7 +85,7 @@ uno::Reference<drawing::XShape> VButton::createTriangle(awt::Size aSize) xProperies->setPropertyValue("Name", uno::makeAny(m_sCID)); xProperies->setPropertyValue(UNO_NAME_POLYPOLYGON, uno::Any(PolyToPointSequence(aPolyPolygon))); xProperies->setPropertyValue("LineStyle", uno::makeAny(drawing::LineStyle_NONE)); - xProperies->setPropertyValue("FillColor", uno::Any(m_nArrowColor)); + xProperies->setPropertyValue("FillColor", uno::makeAny(m_nArrowColor)); return xShape; } diff --git a/chart2/source/view/main/VButton.hxx b/chart2/source/view/main/VButton.hxx index adb53282b85a..4d87b3db7342 100644 --- a/chart2/source/view/main/VButton.hxx +++ b/chart2/source/view/main/VButton.hxx @@ -13,6 +13,7 @@ #include <com/sun/star/drawing/XShapes.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <tools/color.hxx> namespace chart { @@ -28,8 +29,8 @@ private: css::awt::Point m_aPosition; css::awt::Size m_aSize; bool m_bShowArrow; - sal_Int32 m_nArrowColor; - sal_Int32 m_nBGColor; + Color m_nArrowColor; + Color m_nBGColor; css::uno::Reference<css::drawing::XShape> createTriangle(css::awt::Size aSize); @@ -46,11 +47,11 @@ public: { m_bShowArrow = bShowArrow; } - void setArrowColor(sal_Int32 nArrowColor) + void setArrowColor(Color nArrowColor) { m_nArrowColor = nArrowColor; } - void setBGColor(sal_Int32 nBGColor) + void setBGColor(Color nBGColor) { m_nBGColor = nBGColor; } diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 9f37d5237d04..f1b06799bed9 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -1116,7 +1116,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN sal_uInt8 b = aOldColor.GetBlue() + (aColor.GetBlue() - aOldColor.GetBlue()) * mnPercent; sal_uInt8 t = aOldColor.GetTransparency() + (aColor.GetTransparency() - aOldColor.GetTransparency()) * mnPercent; Color aRet(t, r, g, b); - return aRet.GetColor(); + return sal_uInt32(aRet); } return fOldValue + (fValue - fOldValue) * mnPercent; } diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 497c23acaec4..601e143edaa2 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -804,10 +804,10 @@ std::vector<std::shared_ptr<VButton>> lcl_createButtons( if (sColumnFieldEntry.Name == "Data") { pButton->showArrow(false); - pButton->setBGColor(0x00F6F6F6); + pButton->setBGColor(Color(0x00F6F6F6)); } if (sColumnFieldEntry.HasHiddenMembers) - pButton->setArrowColor(0x0000FF); + pButton->setArrowColor(Color(0x0000FF)); if (bPlaceButtonsVertically) y += aSize.Height + 100; |