diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-26 17:13:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-28 07:34:27 +0100 |
commit | e2cb154195fdc2ffccdb6f5e87cae8b29640b3eb (patch) | |
tree | 7c3d53d78e0867aa879b98d84211d1e73602520f /chart2 | |
parent | 0ea41fea75cd1ac1d81fa57c4411e75a6b4001f0 (diff) |
convert COL_ constants to be of type Color
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48
Reviewed-on: https://gerrit.libreoffice.org/50373
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/accessibility/AccessibleBase.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/RangeHighlighter.cxx | 12 | ||||
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 4 | ||||
-rw-r--r-- | chart2/source/view/axes/VPolarAngleAxis.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/OpenGLRender.cxx | 16 | ||||
-rw-r--r-- | chart2/source/view/main/OpenGLRender.hxx | 2 |
6 files changed, 19 insertions, 19 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index 784dc5096b4b..768a09e52e88 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -731,7 +731,7 @@ sal_Int32 SAL_CALL AccessibleBase::getBackground() sal_Int32 AccessibleBase::getColor( eColorType eColType ) { - sal_Int32 nResult = static_cast< sal_Int32 >( Color(COL_TRANSPARENT).GetColor()); + sal_Int32 nResult = static_cast< sal_Int32 >(COL_TRANSPARENT); if( m_bAlwaysTransparent ) return nResult; diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index 8804fa0f6d40..be15adb547a3 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -42,14 +42,14 @@ const auto defaultPreferredColor = COL_LIGHTBLUE; void lcl_fillRanges( Sequence< chart2::data::HighlightedRange > & rOutRanges, const Sequence< OUString >& aRangeStrings, - sal_Int32 nPreferredColor, + Color nPreferredColor, sal_Int32 nIndex = -1 ) { rOutRanges.realloc( aRangeStrings.getLength()); for( sal_Int32 i=0; i<aRangeStrings.getLength(); ++i ) { rOutRanges[i].RangeRepresentation = aRangeStrings[i]; - rOutRanges[i].PreferredColor = nPreferredColor; + rOutRanges[i].PreferredColor = sal_Int32(nPreferredColor); rOutRanges[i].AllowMerginigWithOtherRanges = false; rOutRanges[i].Index = nIndex; } @@ -196,7 +196,7 @@ void RangeHighlighter::fillRangesForDiagram( const Reference< chart2::XDiagram > { m_aSelectedRanges[i].RangeRepresentation = aSelectedRanges[i]; m_aSelectedRanges[i].Index = -1; - m_aSelectedRanges[i].PreferredColor = defaultPreferredColor; + m_aSelectedRanges[i].PreferredColor = sal_Int32(defaultPreferredColor); m_aSelectedRanges[i].AllowMerginigWithOtherRanges = true; } } @@ -264,7 +264,7 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface Reference< chart2::data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY ); if( xSource.is() ) { - sal_Int32 nPreferredColor = defaultPreferredColor; + Color nPreferredColor = defaultPreferredColor; std::vector< chart2::data::HighlightedRange > aHilightedRanges; Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqSeq( xSource->getDataSequences()); for( sal_Int32 i=0; i<aLSeqSeq.getLength(); ++i ) @@ -276,7 +276,7 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface aHilightedRanges.emplace_back( xLabel->getSourceRangeRepresentation(), -1, - nPreferredColor, + sal_Int32(nPreferredColor), false ); sal_Int32 nUnhiddenIndex = DataSeriesHelper::translateIndexFromHiddenToFullSequence( nIndex, xValues, !m_bIncludeHiddenCells ); @@ -284,7 +284,7 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface aHilightedRanges.emplace_back( xValues->getSourceRangeRepresentation(), nUnhiddenIndex, - nPreferredColor, + sal_Int32(nPreferredColor), false ); } m_aSelectedRanges = comphelper::containerToSequence( aHilightedRanges ); diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 2089b2705d40..adaa91b83bf3 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -700,7 +700,7 @@ bool VCartesianAxis::createTextShapes( getAxisLabelProperties(aPropNames, aPropValues, m_aAxisProperties, rAxisLabelProperties, nLimitedSpaceForText, bLimitedHeight); uno::Any* pColorAny = PropertyMapper::getValuePointer(aPropValues,aPropNames,"CharColor"); - sal_Int32 nColor = Color(COL_AUTO).GetColor(); + sal_Int32 nColor = COL_AUTO.GetColor(); if(pColorAny) *pColorAny >>= nColor; @@ -888,7 +888,7 @@ bool VCartesianAxis::createTextShapesSimple( getAxisLabelProperties(aPropNames, aPropValues, m_aAxisProperties, rAxisLabelProperties, -1, bLimitedHeight); uno::Any* pColorAny = PropertyMapper::getValuePointer(aPropValues,aPropNames,"CharColor"); - sal_Int32 nColor = Color(COL_AUTO).GetColor(); + sal_Int32 nColor = COL_AUTO.GetColor(); if(pColorAny) *pColorAny >>= nColor; diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx index ee2c7343d760..9561cf66b456 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 = Color(COL_AUTO).GetColor(); + sal_Int32 nColor = COL_AUTO.GetColor(); if(pColorAny) *pColorAny >>= nColor; diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index fb3d7e0a8df0..35fbbac1d76f 100644 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -851,11 +851,11 @@ int OpenGLRender::RenderArea2DShape() return 0; } -void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, css::drawing::FillStyle fillStyle) +void OpenGLRender::SetBackGroundColor(::Color color1, ::Color color2, css::drawing::FillStyle fillStyle) { - sal_uInt8 r = (color1 & 0x00FF0000) >> 16; - sal_uInt8 g = (color1 & 0x0000FF00) >> 8; - sal_uInt8 b = (color1 & 0x000000FF); + sal_uInt8 r = color1.GetRed(); + sal_uInt8 g = color1.GetGreen(); + sal_uInt8 b = color1.GetBlue(); m_BackgroundColor[0] = static_cast<float>(r) / 255.0f; m_BackgroundColor[1] = static_cast<float>(g) / 255.0f; @@ -867,9 +867,9 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, css: m_BackgroundColor[6] = static_cast<float>(b) / 255.0f; m_BackgroundColor[7] = fillStyle != css::drawing::FillStyle_NONE ? 1.0 : 0.0; - r = (color2 & 0x00FF0000) >> 16; - g = (color2 & 0x0000FF00) >> 8; - b = (color2 & 0x000000FF); + r = color2.GetRed(); + g = color2.GetGreen(); + b = color2.GetBlue(); m_BackgroundColor[8] = static_cast<float>(r) / 255.0f; m_BackgroundColor[9] = static_cast<float>(g) / 255.0f; @@ -880,7 +880,7 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, css: m_BackgroundColor[13] = static_cast<float>(g) / 255.0f; m_BackgroundColor[14] = static_cast<float>(b) / 255.0f; m_BackgroundColor[15] = fillStyle != css::drawing::FillStyle_NONE ? 1.0 : 0.0; - SAL_INFO("chart2.opengl", "color1 = " << color1 << ", color2 = " << color2); + SAL_INFO("chart2.opengl", "color1 = " << sal_uInt32(color1) << ", color2 = " << sal_uInt32(color2)); } diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx index d8f81a0f1799..b222a40f6647 100644 --- a/chart2/source/view/main/OpenGLRender.hxx +++ b/chart2/source/view/main/OpenGLRender.hxx @@ -106,7 +106,7 @@ public: void renderDebug(); #endif - void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2, css::drawing::FillStyle fillstyle); + void SetBackGroundColor(::Color color1, ::Color color2, css::drawing::FillStyle fillstyle); private: int m_iWidth; |