diff options
144 files changed, 478 insertions, 449 deletions
diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index d64852f4e0e8..fe298428ca7f 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -605,7 +605,7 @@ void SAL_CALL VCLXAccessibleListItem::removeAccessibleEventListener( const Refer // the color that is actually used. sal_Int32 SAL_CALL VCLXAccessibleListItem::getForeground() { - return COL_BLACK; + return sal_Int32(COL_BLACK); } // AF (Oct. 29 2002): Return white as constant background color. This is an @@ -613,7 +613,7 @@ sal_Int32 SAL_CALL VCLXAccessibleListItem::getForeground() // the color that is actually used. sal_Int32 SAL_CALL VCLXAccessibleListItem::getBackground() { - return COL_WHITE; + return sal_Int32(COL_WHITE); } diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx index 00136c59aba0..18af2752d3d7 100644 --- a/canvas/source/vcl/spritecanvashelper.cxx +++ b/canvas/source/vcl/spritecanvashelper.cxx @@ -104,10 +104,10 @@ namespace vclcanvas { vcl::Font aVCLFont; aVCLFont.SetFontHeight( 20 ); - aVCLFont.SetColor( Color( INFO_COLOR ) ); + aVCLFont.SetColor( INFO_COLOR ); rOutDev.SetTextAlign(ALIGN_TOP); - rOutDev.SetTextColor( Color( INFO_COLOR ) ); + rOutDev.SetTextColor( INFO_COLOR ); rOutDev.SetFont( aVCLFont ); rOutDev.DrawText( rPos, rStr ); 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; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index fa08f0325714..5d45c82b0f59 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -887,7 +887,7 @@ namespace cppcanvas // determine shadow color (from outdev3.cxx) ::Color aTextColor = vcl::unotools::doubleSequenceToColor( rState.textColor, xColorSpace ); - bool bIsDark = (aTextColor.GetColor() == COL_BLACK) + bool bIsDark = (aTextColor == COL_BLACK) || (aTextColor.GetLuminance() < 8); aShadowColor = bIsDark ? COL_LIGHTGRAY : COL_BLACK; @@ -917,7 +917,7 @@ namespace cppcanvas // we don't have a automatic color, so black is always // drawn on white (literally copied from // vcl/source/gdi/outdev3.cxx) - if( aTextColor.GetColor() == COL_BLACK ) + if( aTextColor == COL_BLACK ) { aTextColor = ::COL_WHITE; rParms.mrStates.getState().textColor = @@ -925,7 +925,7 @@ namespace cppcanvas aTextColor, xColorSpace ); } - if( aTextColor.GetColor() == COL_WHITE ) + if( aTextColor == COL_WHITE ) aReliefColor = ::COL_BLACK; aReliefColor.SetTransparency( aTextColor.GetTransparency() ); } diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 9bb88e7c412b..d40a46766302 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -431,7 +431,7 @@ void ColorConfigWindow_Impl::Entry::ColorChanged ( ) { Color aColor = m_pColorList->GetSelectEntryColor(); rValue.setColor(aColor.GetColor()); - if (aColor.GetColor() == COL_AUTO) + if (aColor == COL_AUTO) { rValue.setColor(rValue.getDefaultColor()); } @@ -745,7 +745,7 @@ void ColorConfigWindow_Impl::DataChanged (DataChangedEvent const& rDCEvt) { StyleSettings const& rStyleSettings = GetSettings().GetStyleSettings(); bool const bHighContrast = rStyleSettings.GetHighContrastMode(); - Wallpaper const aBackWall(Color(bHighContrast ? COL_TRANSPARENT : COL_LIGHTGRAY)); + Wallpaper const aBackWall(bHighContrast ? COL_TRANSPARENT : COL_LIGHTGRAY); for (auto const & i: vChapters) i->SetBackground(aBackWall); SetBackground(Wallpaper(rStyleSettings.GetWindowColor())); diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 497dae51e59b..ccde96ffc44f 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1369,7 +1369,7 @@ void SvxCharEffectsPage::EnableNoneFontColor() Color SvxCharEffectsPage::GetPreviewFontColor(const Color& rColor) const { - if (rColor.GetColor() == COL_AUTO) + if (rColor == COL_AUTO) return COL_BLACK; if (m_bEnableNoneFontColor && rColor == COL_NONE_COLOR) return COL_BLACK; diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 31217781f427..330da2a248cc 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -2268,8 +2268,8 @@ static long lcl_DrawBullet(VirtualDevice* pVDev, aFont.SetFontSize(aTmpSize); aFont.SetTransparent(true); Color aBulletColor = rFmt.GetBulletColor(); - if(aBulletColor.GetColor() == COL_AUTO) - aBulletColor = Color(pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK); + if(aBulletColor == COL_AUTO) + aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK; else if(aBulletColor == pVDev->GetFillColor()) aBulletColor.Invert(); aFont.SetColor(aBulletColor); @@ -2406,8 +2406,8 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool vcl::Font aSaveFont = pVDev->GetFont(); vcl::Font aColorFont(aSaveFont); Color aTmpBulletColor = rFmt.GetBulletColor(); - if (aTmpBulletColor.GetColor() == COL_AUTO) - aTmpBulletColor = Color(aBackColor.IsDark() ? COL_WHITE : COL_BLACK); + if (aTmpBulletColor == COL_AUTO) + aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK; else if (aTmpBulletColor == aBackColor) aTmpBulletColor.Invert(); aColorFont.SetColor(aTmpBulletColor); @@ -2526,8 +2526,8 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool { vcl::Font aColorFont(aStdFont); Color aTmpBulletColor = rFmt.GetBulletColor(); - if (aTmpBulletColor.GetColor() == COL_AUTO) - aTmpBulletColor = Color(aBackColor.IsDark() ? COL_WHITE : COL_BLACK); + if (aTmpBulletColor == COL_AUTO) + aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK; else if (aTmpBulletColor == aBackColor) aTmpBulletColor.Invert(); aColorFont.SetColor(aTmpBulletColor); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index 1f4762472996..adfbc4549e80 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -106,7 +106,7 @@ namespace wmfemfhelper maMapUnit(MapUnit::Map100thMM), maLineColor(), maFillColor(), - maTextColor(COL_BLACK), + maTextColor(sal_uInt32(COL_BLACK)), maTextFillColor(), maTextLineColor(), maOverlineColor(), diff --git a/editeng/source/accessibility/AccessibleComponentBase.cxx b/editeng/source/accessibility/AccessibleComponentBase.cxx index ae43a2c55b42..69052ea4dd65 100644 --- a/editeng/source/accessibility/AccessibleComponentBase.cxx +++ b/editeng/source/accessibility/AccessibleComponentBase.cxx @@ -108,13 +108,13 @@ void SAL_CALL AccessibleComponentBase::grabFocus() sal_Int32 SAL_CALL AccessibleComponentBase::getForeground() { - return Color(COL_BLACK).GetColor(); + return sal_Int32(COL_BLACK); } sal_Int32 SAL_CALL AccessibleComponentBase::getBackground() { - return Color(COL_WHITE).GetColor(); + return sal_Int32(COL_WHITE); } diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index ecaf8445eea0..90859aac7a73 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1485,7 +1485,7 @@ namespace accessibility else { Color cr(xComponent->getBackground()); - crChar = cr.IsDark() ? COL_WHITE : COL_BLACK; + crChar = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); anyChar <<= crChar; } } @@ -1516,7 +1516,7 @@ namespace accessibility else { Color cr(xComponent->getBackground()); - crCharUnderLine = cr.IsDark() ? COL_WHITE : COL_BLACK; + crCharUnderLine = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); anyCharUnderLine <<= crCharUnderLine; } } diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 0e5fdd3e596a..bacf77c21767 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1027,7 +1027,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v P2.AdjustX(n20 ); P2.AdjustY(nH ); pEditView->GetWindow()->SetLineColor(); - pEditView->GetWindow()->SetFillColor( Color( (n%2) ? COL_YELLOW : COL_LIGHTGREEN ) ); + pEditView->GetWindow()->SetFillColor( (n%2) ? COL_YELLOW : COL_LIGHTGREEN ); pEditView->GetWindow()->DrawRect( tools::Rectangle( P1, P2 ) ); aPos.AdjustY(nH ); } diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx index 3167a5996870..1fd3d600933b 100644 --- a/editeng/source/items/itemtype.cxx +++ b/editeng/source/items/itemtype.cxx @@ -141,7 +141,7 @@ OUString GetSvxString(const char* pId) OUString GetColorString( const Color& rCol ) { - if (rCol.GetColor() == COL_AUTO) + if (rCol == COL_AUTO) return EditResId(RID_SVXSTR_AUTOMATIC); static const Color aColAry[] = { diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index a5d8b7925558..ed64f8392891 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1726,7 +1726,7 @@ SvStream& SvxColorItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const { if( VERSION_USEAUTOCOLOR == nItemVersion && COL_AUTO == mColor.GetColor() ) - WriteColor( rStrm, Color(COL_BLACK) ); + WriteColor( rStrm, COL_BLACK ); else WriteColor( rStrm, mColor ); return rStrm; diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 483c6ba95841..7b5d8c6eb7ac 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -727,7 +727,7 @@ namespace emfio { if ( x < nWidth ) { - aBmp.SetPixel( y, x, Color(((nEightPixels>>i)&1) ? COL_BLACK : COL_WHITE) ); + aBmp.SetPixel( y, x, ((nEightPixels>>i)&1) ? COL_BLACK : COL_WHITE ); } x++; } diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index 86b0258a536b..025389b345c2 100644 --- a/extensions/source/propctrlr/fontdialog.cxx +++ b/extensions/source/propctrlr/fontdialog.cxx @@ -213,7 +213,7 @@ namespace pcr sal_Int16 nFontLineStyle = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_UNDERLINE, aDefaultFont.Underline); sal_Int16 nFontStrikeout = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_STRIKEOUT, aDefaultFont.Strikeout); - sal_Int32 nTextLineColor = aPropExtractor.getInt32FontProperty(PROPERTY_TEXTLINECOLOR, COL_AUTO); + sal_Int32 nTextLineColor = aPropExtractor.getInt32FontProperty(PROPERTY_TEXTLINECOLOR, sal_uInt32(COL_AUTO)); sal_Int16 nFontRelief = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_RELIEF, static_cast<sal_Int16>(aDefaultVCLFont.GetRelief())); sal_Int16 nFontEmphasisMark = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_EMPHASIS_MARK, static_cast<sal_uInt16>(aDefaultVCLFont.GetEmphasisMark())); diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 76417c0a1216..0a318526dfb9 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -651,7 +651,7 @@ namespace pcr void SAL_CALL OColorControl::setValue( const Any& _rValue ) { - css::util::Color nColor = COL_TRANSPARENT; + css::util::Color nColor = sal_uInt32(COL_TRANSPARENT); if (_rValue.hasValue()) _rValue >>= nColor; getTypedControlWindow()->SelectEntry(::Color(sal_uInt32(nColor))); diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index bab13eea44cb..a0c6951312d7 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -400,10 +400,10 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon Color aReliefColor( COL_LIGHTGRAY ); Color aTextColor( mpVDev->GetTextColor() ); - if ( aTextColor.GetColor() == COL_BLACK ) + if ( aTextColor == COL_BLACK ) aTextColor = COL_WHITE; - if ( aTextColor.GetColor() == COL_WHITE ) + if ( aTextColor == COL_WHITE ) aReliefColor = COL_BLACK; @@ -433,7 +433,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon Color aTextColor( mpVDev->GetTextColor() ); Color aShadowColor( COL_BLACK ); - if ( (aTextColor.GetColor() == COL_BLACK) || (aTextColor.GetLuminance() < 8) ) + if ( (aTextColor == COL_BLACK) || (aTextColor.GetLuminance() < 8) ) aShadowColor = COL_LIGHTGRAY; Point aPos( rPos ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 4643533770c4..9a1a81b71269 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -495,7 +495,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) nLines *= aSizeBitmap.Height(); ImplWriteLong( nLines ); sal_Int32 nCount2, nCount = 4; - const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color(COL_BLACK) ) ); + const BitmapColor aBlack( pAcc->GetBestMatchingColor( COL_BLACK ) ); for ( long nY = 0; nY < aSizeBitmap.Height(); nY++ ) { nCount2 = 0; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 218a1bb177a6..96c29b639302 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -1093,8 +1093,8 @@ void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& r } if ( rShadeColors.empty() ) { - rShadeColors.emplace_back( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ), 0 ); - rShadeColors.emplace_back( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ), 1 ); + rShadeColors.emplace_back( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillBackColor, sal_uInt32(COL_WHITE) ), DFF_Prop_fillBackColor ), 0 ); + rShadeColors.emplace_back( rManager.MSO_CLR_ToColor( rProperties.GetPropertyValue( DFF_Prop_fillColor, sal_uInt32(COL_WHITE) ), DFF_Prop_fillColor ), 1 ); } rIn.Seek( nPos ); } @@ -2853,8 +2853,8 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet,MSO_FillType eMSO_ default: break; } - Color aCol1( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor, COL_WHITE ), DFF_Prop_fillColor ) ); - Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, COL_WHITE ), DFF_Prop_fillBackColor ) ); + Color aCol1( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor, sal_uInt32(COL_WHITE) ), DFF_Prop_fillColor ) ); + Color aCol2( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor, sal_uInt32(COL_WHITE) ), DFF_Prop_fillBackColor ) ); if ( nChgColors ) { //Swap start and end color diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 0a4446984dbd..f0e3694176bb 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -133,7 +133,7 @@ OString ConvertColor( const Color &rColor, bool bAutoColor ) if (bAutoColor && rColor.GetColor() == OOXML_COLOR_AUTO) return color; - if ( rColor.GetColor() != COL_AUTO ) + if ( rColor != COL_AUTO ) { const char pHexDigits[] = "0123456789ABCDEF"; char pBuffer[] = "000000"; @@ -1299,23 +1299,23 @@ sal_uInt8 TransColToIco( const Color& rCol ) sal_uInt8 nCol = 0; // ->Auto switch( rCol.GetColor() ) { - case COL_BLACK: nCol = 1; break; - case COL_BLUE: nCol = 9; break; - case COL_GREEN: nCol = 11; break; - case COL_CYAN: nCol = 10; break; - case COL_RED: nCol = 13; break; - case COL_MAGENTA: nCol = 12; break; - case COL_BROWN: nCol = 14; break; - case COL_GRAY: nCol = 15; break; - case COL_LIGHTGRAY: nCol = 16; break; - case COL_LIGHTBLUE: nCol = 2; break; - case COL_LIGHTGREEN: nCol = 4; break; - case COL_LIGHTCYAN: nCol = 3; break; - case COL_LIGHTRED: nCol = 6; break; - case COL_LIGHTMAGENTA: nCol = 5; break; - case COL_YELLOW: nCol = 7; break; - case COL_WHITE: nCol = 8; break; - case COL_AUTO: nCol = 0; break; + case sal_uInt32(COL_BLACK): nCol = 1; break; + case sal_uInt32(COL_BLUE): nCol = 9; break; + case sal_uInt32(COL_GREEN): nCol = 11; break; + case sal_uInt32(COL_CYAN): nCol = 10; break; + case sal_uInt32(COL_RED): nCol = 13; break; + case sal_uInt32(COL_MAGENTA): nCol = 12; break; + case sal_uInt32(COL_BROWN): nCol = 14; break; + case sal_uInt32(COL_GRAY): nCol = 15; break; + case sal_uInt32(COL_LIGHTGRAY): nCol = 16; break; + case sal_uInt32(COL_LIGHTBLUE): nCol = 2; break; + case sal_uInt32(COL_LIGHTGREEN): nCol = 4; break; + case sal_uInt32(COL_LIGHTCYAN): nCol = 3; break; + case sal_uInt32(COL_LIGHTRED): nCol = 6; break; + case sal_uInt32(COL_LIGHTMAGENTA): nCol = 5; break; + case sal_uInt32(COL_YELLOW): nCol = 7; break; + case sal_uInt32(COL_WHITE): nCol = 8; break; + case sal_uInt32(COL_AUTO): nCol = 0; break; default: static const Color aColArr[ 16 ] = { diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 441ea483898c..8a51f687ce4e 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2458,10 +2458,10 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, Color aReliefColor( COL_LIGHTGRAY ); Color aTextColor( mpVDev->GetTextColor() ); - if ( aTextColor.GetColor() == COL_BLACK ) + if ( aTextColor == COL_BLACK ) aTextColor = COL_WHITE; - if ( aTextColor.GetColor() == COL_WHITE ) + if ( aTextColor == COL_WHITE ) aReliefColor = COL_BLACK; @@ -2491,7 +2491,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, Color aTextColor( mpVDev->GetTextColor() ); Color aShadowColor( COL_BLACK ); - if ( (aTextColor.GetColor() == COL_BLACK) || (aTextColor.GetLuminance() < 8) ) + if ( (aTextColor == COL_BLACK) || (aTextColor.GetLuminance() < 8) ) aShadowColor = COL_LIGHTGRAY; Point aPos( rPos ); diff --git a/forms/source/component/formcontrolfont.cxx b/forms/source/component/formcontrolfont.cxx index d2c63d077193..c23f598e3976 100644 --- a/forms/source/component/formcontrolfont.cxx +++ b/forms/source/component/formcontrolfont.cxx @@ -172,7 +172,7 @@ namespace frm sal_Int32 FontControlModel::getTextColor( ) const { - sal_Int32 nColor = COL_TRANSPARENT; + sal_Int32 nColor(COL_TRANSPARENT); m_aTextColor >>= nColor; return nColor; } @@ -180,7 +180,7 @@ namespace frm sal_Int32 FontControlModel::getTextLineColor( ) const { - sal_Int32 nColor = COL_TRANSPARENT; + sal_Int32 nColor(COL_TRANSPARENT); m_aTextLineColor >>= nColor; return nColor; } diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx index 3985351032a1..3b161e3d6d2c 100644 --- a/forms/source/component/imgprod.cxx +++ b/forms/source/component/imgprod.cxx @@ -428,7 +428,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic ) if( pBmpAcc->HasPalette() ) { - const BitmapColor aWhite( pMskAcc->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aWhite( pMskAcc->GetBestMatchingColor( COL_WHITE ) ); if( mnTransIndex < 256 ) { @@ -479,7 +479,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic ) else { css::uno::Sequence<sal_Int32> aData( nPartWidth * nPartHeight ); - const BitmapColor aWhite( pMskAcc->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aWhite( pMskAcc->GetBestMatchingColor( COL_WHITE ) ); sal_Int32* pTmp = aData.getArray(); for( long nY = nStartY; nY <= nEndY; nY++ ) diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 08238d452db8..3939e1778160 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -357,7 +357,7 @@ namespace frm } else { - sal_Int32 nColor = COL_TRANSPARENT; + sal_Int32 nColor(COL_TRANSPARENT); _rValue >>= nColor; pControl->SetBackgroundColor( Color( nColor ) ); } diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx index 9c3d538340cb..e74d921a4b82 100644 --- a/forms/source/solar/component/navbarcontrol.cxx +++ b/forms/source/solar/component/navbarcontrol.cxx @@ -271,7 +271,7 @@ namespace frm bool bVoid = !_rValue.hasValue(); bool bBoolValue = false; - sal_Int32 nColor = COL_TRANSPARENT; + sal_Int32 nColor(COL_TRANSPARENT); // TODO: more generic mechanisms for this (the grid control implementation, // when used herein, will do the same stuff for lot of these) diff --git a/include/tools/color.hxx b/include/tools/color.hxx index 29d202908128..7f3005aaf7c0 100644 --- a/include/tools/color.hxx +++ b/include/tools/color.hxx @@ -35,7 +35,7 @@ class SAL_WARN_UNUSED TOOLS_DLLPUBLIC Color final public: constexpr Color() - : mnColor(COL_BLACK) + : mnColor(0) // black {} constexpr Color(ColorData nColor) : mnColor(nColor) @@ -226,6 +226,59 @@ namespace com { namespace sun { namespace star { namespace uno { } } } } } +// Color types + +constexpr ::Color COL_BLACK ( 0x00, 0x00, 0x00 ); +constexpr ::Color COL_BLUE ( 0x00, 0x00, 0x80 ); +constexpr ::Color COL_GREEN ( 0x00, 0x80, 0x00 ); +constexpr ::Color COL_CYAN ( 0x00, 0x80, 0x80 ); +constexpr ::Color COL_RED ( 0x80, 0x00, 0x00 ); +constexpr ::Color COL_RED_FONTCOLOR ( 0xCE, 0x18, 0x1E ); +constexpr ::Color COL_MAGENTA ( 0x80, 0x00, 0x80 ); +constexpr ::Color COL_BROWN ( 0x80, 0x80, 0x00 ); +constexpr ::Color COL_GRAY ( 0x80, 0x80, 0x80 ); +constexpr ::Color COL_GRAY3 ( 0xCC, 0xCC, 0xCC ); +constexpr ::Color COL_GRAY7 ( 0x66, 0x66, 0x66 ); +constexpr ::Color COL_LIGHTGRAY ( 0xC0, 0xC0, 0xC0 ); +constexpr ::Color COL_LIGHTBLUE ( 0x00, 0x00, 0xFF ); +constexpr ::Color COL_LIGHTGREEN ( 0x00, 0xFF, 0x00 ); +constexpr ::Color COL_LIGHTCYAN ( 0x00, 0xFF, 0xFF ); +constexpr ::Color COL_LIGHTRED ( 0xFF, 0x00, 0x00 ); +constexpr ::Color COL_LIGHTMAGENTA ( 0xFF, 0x00, 0xFF ); +constexpr ::Color COL_LIGHTGRAYBLUE ( 0xE0, 0xE0, 0xFF ); +constexpr ::Color COL_YELLOW ( 0xFF, 0xFF, 0x00 ); +constexpr ::Color COL_YELLOW_HIGHLIGHT ( 0xFF, 0xF2, 0x00 ); +constexpr ::Color COL_WHITE ( 0xFF, 0xFF, 0xFF ); +constexpr ::Color COL_TRANSPARENT ( 0xFF, 0xFF, 0xFF, 0xFF ); +constexpr ::Color COL_AUTO ( 0xFF, 0xFF, 0xFF, 0xFF ); +constexpr ::Color COL_AUTHOR1_DARK ( 198, 146, 0 ); +constexpr ::Color COL_AUTHOR1_NORMAL ( 255, 255, 158 ); +constexpr ::Color COL_AUTHOR1_LIGHT ( 255, 255, 195 ); +constexpr ::Color COL_AUTHOR2_DARK ( 6, 70, 162 ); +constexpr ::Color COL_AUTHOR2_NORMAL ( 216, 232, 255 ); +constexpr ::Color COL_AUTHOR2_LIGHT ( 233, 242, 255 ); +constexpr ::Color COL_AUTHOR3_DARK ( 87, 157, 28 ); +constexpr ::Color COL_AUTHOR3_NORMAL ( 218, 248, 193 ); +constexpr ::Color COL_AUTHOR3_LIGHT ( 226, 250, 207 ); +constexpr ::Color COL_AUTHOR4_DARK ( 105, 43, 157 ); +constexpr ::Color COL_AUTHOR4_NORMAL ( 228, 210, 245 ); +constexpr ::Color COL_AUTHOR4_LIGHT ( 239, 228, 248 ); +constexpr ::Color COL_AUTHOR5_DARK ( 197, 0, 11 ); +constexpr ::Color COL_AUTHOR5_NORMAL ( 254, 205, 208 ); +constexpr ::Color COL_AUTHOR5_LIGHT ( 255, 227, 229 ); +constexpr ::Color COL_AUTHOR6_DARK ( 0, 128, 128 ); +constexpr ::Color COL_AUTHOR6_NORMAL ( 210, 246, 246 ); +constexpr ::Color COL_AUTHOR6_LIGHT ( 230, 250, 250 ); +constexpr ::Color COL_AUTHOR7_DARK ( 140, 132, 0 ); +constexpr ::Color COL_AUTHOR7_NORMAL ( 237, 252, 163 ); +constexpr ::Color COL_AUTHOR7_LIGHT ( 242, 254, 181 ); +constexpr ::Color COL_AUTHOR8_DARK ( 53, 85, 107 ); +constexpr ::Color COL_AUTHOR8_NORMAL ( 211, 222, 232 ); +constexpr ::Color COL_AUTHOR8_LIGHT ( 226, 234, 241 ); +constexpr ::Color COL_AUTHOR9_DARK ( 209, 118, 0 ); +constexpr ::Color COL_AUTHOR9_NORMAL ( 255, 226, 185 ); +constexpr ::Color COL_AUTHOR9_LIGHT ( 255, 231, 199 ); + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/tools/colordata.hxx b/include/tools/colordata.hxx index b77dea1af881..6159e49b947d 100644 --- a/include/tools/colordata.hxx +++ b/include/tools/colordata.hxx @@ -41,57 +41,6 @@ constexpr ColorData RGB_COLORDATA(sal_uInt8 r, sal_uInt8 g, sal_uInt8 b) { #define COLORDATA_TRANSPARENCY( n ) (static_cast<sal_uInt8>((n)>>24)) #define COLORDATA_RGB( n ) (static_cast<ColorData>((n) & 0x00FFFFFF)) -#define COL_BLACK RGB_COLORDATA( 0x00, 0x00, 0x00 ) -#define COL_BLUE RGB_COLORDATA( 0x00, 0x00, 0x80 ) -#define COL_GREEN RGB_COLORDATA( 0x00, 0x80, 0x00 ) -#define COL_CYAN RGB_COLORDATA( 0x00, 0x80, 0x80 ) -#define COL_RED RGB_COLORDATA( 0x80, 0x00, 0x00 ) -#define COL_RED_FONTCOLOR RGB_COLORDATA( 0xCE, 0x18, 0x1E ) -#define COL_MAGENTA RGB_COLORDATA( 0x80, 0x00, 0x80 ) -#define COL_BROWN RGB_COLORDATA( 0x80, 0x80, 0x00 ) -#define COL_GRAY RGB_COLORDATA( 0x80, 0x80, 0x80 ) -#define COL_GRAY3 RGB_COLORDATA( 0xCC, 0xCC, 0xCC ) -#define COL_GRAY7 RGB_COLORDATA( 0x66, 0x66, 0x66 ) -#define COL_LIGHTGRAY RGB_COLORDATA( 0xC0, 0xC0, 0xC0 ) -#define COL_LIGHTBLUE RGB_COLORDATA( 0x00, 0x00, 0xFF ) -#define COL_LIGHTGREEN RGB_COLORDATA( 0x00, 0xFF, 0x00 ) -#define COL_LIGHTCYAN RGB_COLORDATA( 0x00, 0xFF, 0xFF ) -#define COL_LIGHTRED RGB_COLORDATA( 0xFF, 0x00, 0x00 ) -#define COL_LIGHTMAGENTA RGB_COLORDATA( 0xFF, 0x00, 0xFF ) -#define COL_LIGHTGRAYBLUE RGB_COLORDATA( 0xE0, 0xE0, 0xFF ) -#define COL_YELLOW RGB_COLORDATA( 0xFF, 0xFF, 0x00 ) -#define COL_YELLOW_HIGHLIGHT RGB_COLORDATA( 0xFF, 0xF2, 0x00 ) -#define COL_WHITE RGB_COLORDATA( 0xFF, 0xFF, 0xFF ) -#define COL_TRANSPARENT TRGB_COLORDATA( 0xFF, 0xFF, 0xFF, 0xFF ) -#define COL_AUTO ColorData(0xFFFFFFFF) -#define COL_AUTHOR1_DARK RGB_COLORDATA(198, 146, 0) -#define COL_AUTHOR1_NORMAL RGB_COLORDATA(255, 255, 158) -#define COL_AUTHOR1_LIGHT RGB_COLORDATA(255, 255, 195) -#define COL_AUTHOR2_DARK RGB_COLORDATA(6, 70, 162) -#define COL_AUTHOR2_NORMAL RGB_COLORDATA(216, 232, 255) -#define COL_AUTHOR2_LIGHT RGB_COLORDATA(233, 242, 255) -#define COL_AUTHOR3_DARK RGB_COLORDATA(87, 157, 28) -#define COL_AUTHOR3_NORMAL RGB_COLORDATA(218, 248, 193) -#define COL_AUTHOR3_LIGHT RGB_COLORDATA(226, 250, 207) -#define COL_AUTHOR4_DARK RGB_COLORDATA(105, 43, 157) -#define COL_AUTHOR4_NORMAL RGB_COLORDATA(228, 210, 245) -#define COL_AUTHOR4_LIGHT RGB_COLORDATA(239, 228, 248) -#define COL_AUTHOR5_DARK RGB_COLORDATA(197, 0, 11) -#define COL_AUTHOR5_NORMAL RGB_COLORDATA(254, 205, 208) -#define COL_AUTHOR5_LIGHT RGB_COLORDATA(255, 227, 229) -#define COL_AUTHOR6_DARK RGB_COLORDATA(0, 128, 128) -#define COL_AUTHOR6_NORMAL RGB_COLORDATA(210, 246, 246) -#define COL_AUTHOR6_LIGHT RGB_COLORDATA(230, 250, 250) -#define COL_AUTHOR7_DARK RGB_COLORDATA(140, 132, 0) -#define COL_AUTHOR7_NORMAL RGB_COLORDATA(237, 252, 163) -#define COL_AUTHOR7_LIGHT RGB_COLORDATA(242, 254, 181) -#define COL_AUTHOR8_DARK RGB_COLORDATA(53, 85, 107) -#define COL_AUTHOR8_NORMAL RGB_COLORDATA(211, 222, 232) -#define COL_AUTHOR8_LIGHT RGB_COLORDATA(226, 234, 241) -#define COL_AUTHOR9_DARK RGB_COLORDATA(209, 118, 0) -#define COL_AUTHOR9_NORMAL RGB_COLORDATA(255, 226, 185) -#define COL_AUTHOR9_LIGHT RGB_COLORDATA(255, 231, 199) - constexpr sal_uInt8 ColorChannelMerge(sal_uInt8 nDst, sal_uInt8 nSrc, sal_uInt8 nSrcTrans) { return static_cast<sal_uInt8>(((static_cast<sal_Int32>(nDst)-nSrc)*nSrcTrans+((nSrc<<8)|nDst))>>8); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 9cc62a072abc..e055ca52a87a 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1313,7 +1313,7 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs WriteColor(rHatch.Color); mpFS->endElementNS( XML_a , XML_fgClr ); - sal_uInt32 nColor = COL_WHITE; + ::Color nColor = COL_WHITE; sal_Int32 nAlpha = 0; bool isBackgroundFilled = false; @@ -1332,7 +1332,7 @@ void DrawingML::WritePattFill(const Reference<XPropertySet>& rXPropSet, const cs } mpFS->startElementNS( XML_a , XML_bgClr, FSEND ); - WriteColor(nColor, nAlpha); + WriteColor(sal_uInt32(nColor), nAlpha); mpFS->endElementNS( XML_a , XML_bgClr ); mpFS->endElementNS( XML_a , XML_pattFill ); @@ -1739,11 +1739,11 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool if( CGETAD( CharColor ) ) { sal_uInt32 color = *o3tl::doAccess<sal_uInt32>(mAny); - SAL_INFO("oox.shape", "run color: " << color << " auto: " << COL_AUTO); + SAL_INFO("oox.shape", "run color: " << color << " auto: " << sal_uInt32(COL_AUTO)); // tdf#104219 In LibreOffice and MS Office, there are two types of colors: // Automatic and Fixed. OOXML is setting automatic color, by not providing color. - if( color != COL_AUTO ) + if( color != sal_uInt32(COL_AUTO) ) { color &= 0xffffff; // TODO: special handle embossed/engraved @@ -1755,7 +1755,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool { sal_uInt32 color = *o3tl::doAccess<sal_uInt32>(mAny); // if color is automatic, then we shouldn't write information about color but to take color from character - if( color != COL_AUTO ) + if( color != sal_uInt32(COL_AUTO) ) { mpFS->startElementNS( XML_a, XML_uFill, FSEND); WriteSolidFill( color ); @@ -2196,7 +2196,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS { if(bHasBulletColor) { - if (nBulletColor == COL_AUTO ) + if (nBulletColor == sal_uInt32(COL_AUTO) ) { nBulletColor = mbIsBackgroundDark ? 0xffffff : 0x000000; } diff --git a/reportdesign/source/core/api/ImageControl.cxx b/reportdesign/source/core/api/ImageControl.cxx index 94a919465ae5..363995cc16c0 100644 --- a/reportdesign/source/core/api/ImageControl.cxx +++ b/reportdesign/source/core/api/ImageControl.cxx @@ -237,7 +237,7 @@ void SAL_CALL OImageControl::setHyperLinkName(const OUString & the_value) ::sal_Int32 SAL_CALL OImageControl::getControlBackground() { ::osl::MutexGuard aGuard(m_aMutex); - return m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor; + return sal_Int32(m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor); } void SAL_CALL OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor ) diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index d30dc28d8568..d1d24803159c 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -291,7 +291,7 @@ OStyle::OStyle() sal_Int32 i = 0; registerPropertyNoMember( PROPERTY_NAME, ++i, nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString("Default")) ); - registerPropertyNoMember(PROPERTY_BACKCOLOR, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(COL_TRANSPARENT)); + registerPropertyNoMember(PROPERTY_BACKCOLOR, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny(COL_TRANSPARENT)); registerPropertyNoMember(PROPERTY_BACKGRAPHICLOCATION, ++i,nBound, cppu::UnoType<style::GraphicLocation>::get(), css::uno::Any(style::GraphicLocation_NONE)); registerPropertyNoMember(PROPERTY_BACKTRANSPARENT, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(true)); @@ -300,7 +300,7 @@ OStyle::OStyle() registerPropertyNoMember(SC_UNO_PAGE_BOTTBRDDIST, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0)); registerPropertyNoMember(PROPERTY_BOTTOMMARGIN, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::Any(nMargin)); registerPropertyNoMember("DisplayName", ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString())); - registerPropertyNoMember(SC_UNO_PAGE_FTRBACKCOL, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(COL_TRANSPARENT)); + registerPropertyNoMember(SC_UNO_PAGE_FTRBACKCOL, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny(COL_TRANSPARENT)); registerPropertyNoMember(SC_UNO_PAGE_FTRGRFFILT, ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString())); registerPropertyNoMember(SC_UNO_PAGE_FTRGRFLOC, ++i,nBound, cppu::UnoType<style::GraphicLocation>::get(), css::uno::Any(style::GraphicLocation_NONE)); registerPropertyNoMember(SC_UNO_PAGE_FTRGRFURL, ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString())); @@ -323,7 +323,7 @@ OStyle::OStyle() registerPropertyNoMember(SC_UNO_PAGE_FTRTOPBOR, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2())); registerPropertyNoMember(SC_UNO_PAGE_FTRTOPBDIS, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0)); - registerPropertyNoMember(SC_UNO_PAGE_HDRBACKCOL, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(COL_TRANSPARENT)); + registerPropertyNoMember(SC_UNO_PAGE_HDRBACKCOL, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny(COL_TRANSPARENT)); registerPropertyNoMember(SC_UNO_PAGE_HDRGRFFILT, ++i,nBound|nMayBeVoid, cppu::UnoType<OUString>::get(), css::uno::Any(OUString())); registerPropertyNoMember(SC_UNO_PAGE_HDRGRFLOC, ++i,nBound|nMayBeVoid, cppu::UnoType<style::GraphicLocation>::get(), css::uno::Any(style::GraphicLocation_NONE)); registerPropertyNoMember(SC_UNO_PAGE_HDRGRFURL, ++i,nBound|nMayBeVoid, cppu::UnoType<OUString>::get(), css::uno::Any(OUString())); diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 62b1892f16ca..f1c4163e783e 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -252,7 +252,7 @@ void SAL_CALL OSection::setHeight( ::sal_uInt32 _height ) ::sal_Int32 SAL_CALL OSection::getBackColor() { ::osl::MutexGuard aGuard(m_aMutex); - return m_bBacktransparent ? COL_TRANSPARENT : m_nBackgroundColor; + return sal_Int32(m_bBacktransparent ? COL_TRANSPARENT : m_nBackgroundColor); } void SAL_CALL OSection::setBackColor( ::sal_Int32 _backgroundcolor ) diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx index fa59c9c8a80f..6e581347856f 100644 --- a/reportdesign/source/core/inc/ReportHelperImpl.hxx +++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx @@ -153,7 +153,7 @@ void SAL_CALL clazz::setDetailFields( const css::uno::Sequence< OUString >& )\ ::sal_Int32 SAL_CALL clazz::getControlBackground() \ { \ ::osl::MutexGuard aGuard(m_aMutex); \ - return varName.m_bBackgroundTransparent ? COL_TRANSPARENT : varName.nBackgroundColor; \ + return varName.m_bBackgroundTransparent ? sal_Int32(COL_TRANSPARENT) : varName.nBackgroundColor; \ } \ \ void SAL_CALL clazz::setControlBackground( ::sal_Int32 _backgroundcolor )\ diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 120d00537962..54620e910d53 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1134,7 +1134,7 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted { uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet(); table::BorderLine2 aValue; - aValue.Color = COL_BLACK; + aValue.Color = sal_uInt32(COL_BLACK); aValue.InnerLineWidth = aValue.LineDistance = 0; aValue.OuterLineWidth = DEFAULT_LINE_WIDTH; aValue.LineStyle = table::BorderLineStyle::SOLID; diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 70f08c27a500..7643320646fb 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -421,8 +421,8 @@ uno::Any SAL_CALL GeometryHandler::getPropertyValue(const OUString & PropertyNam case PROPERTY_ID_CONTROLBACKGROUND: { aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName ); - sal_Int32 nColor = COL_TRANSPARENT; - if ( (aPropertyValue >>= nColor) && static_cast<sal_Int32>(COL_TRANSPARENT) == nColor ) + Color nColor = COL_TRANSPARENT; + if ( (aPropertyValue >>= nColor) && COL_TRANSPARENT == nColor ) aPropertyValue.clear(); } break; @@ -1263,8 +1263,8 @@ uno::Any SAL_CALL GeometryHandler::convertToControlValue(const OUString & Proper case PROPERTY_ID_BACKCOLOR: case PROPERTY_ID_CONTROLBACKGROUND: { - sal_Int32 nColor = COL_TRANSPARENT; - if ( (aPropertyValue >>= nColor) && static_cast<sal_Int32>(COL_TRANSPARENT) == nColor ) + Color nColor = COL_TRANSPARENT; + if ( (aPropertyValue >>= nColor) && COL_TRANSPARENT == nColor ) aPropertyValue.clear(); } SAL_FALLTHROUGH; diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx index 0e99b2083eaf..643fc3407bef 100644 --- a/reportdesign/source/ui/report/FixedTextColor.cxx +++ b/reportdesign/source/ui/report/FixedTextColor.cxx @@ -104,7 +104,7 @@ namespace rptui { bool bIsDark = false; const sal_Int32 nBackColor( xFixedText->getControlBackground() ); - if (static_cast<sal_uInt32>(nBackColor) == COL_TRANSPARENT) + if (nBackColor == sal_Int32(COL_TRANSPARENT)) { uno::Reference <report::XSection> xSection(xFixedText->getParent(), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx index ee0a0e60e6b1..b6587e6059e7 100644 --- a/sc/qa/extras/new_cond_format.cxx +++ b/sc/qa/extras/new_cond_format.cxx @@ -23,6 +23,12 @@ using namespace css; +inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) +{ + rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); + return rStrm; +} + namespace sc_apitest { class ScConditionalFormatTest : public CalcUnoApiTest @@ -350,10 +356,10 @@ void ScConditionalFormatTest::testDataBarProperties() namespace { void testColorScaleEntry(uno::Reference<sheet::XColorScaleEntry> const & xEntry, - sal_Int32 nType, const OUString& rString, sal_uInt32 nColor) + sal_Int32 nType, const OUString& rString, Color nColor) { CPPUNIT_ASSERT_EQUAL(nType, xEntry->getType()); - CPPUNIT_ASSERT_EQUAL(nColor, sal_uInt32(xEntry->getColor())); + CPPUNIT_ASSERT_EQUAL(nColor, Color(xEntry->getColor())); switch (nType) { case sheet::ColorScaleEntryType::COLORSCALE_VALUE: @@ -370,9 +376,9 @@ void testColorScaleEntry(uno::Reference<sheet::XColorScaleEntry> const & xEntry, } void testColorScaleEntries(uno::Reference<beans::XPropertySet> const & xPropSet, sal_Int32 nEntries, - sal_Int32 nMinType, const OUString& rMinString, sal_uInt32 nMinColor, - sal_Int32 nMediumType, const OUString& rMediumString, sal_uInt32 nMediumColor, - sal_Int32 nMaxType, const OUString& rMaxString, sal_uInt32 nMaxColor) + sal_Int32 nMinType, const OUString& rMinString, Color nMinColor, + sal_Int32 nMediumType, const OUString& rMediumString, Color nMediumColor, + sal_Int32 nMaxType, const OUString& rMaxString, Color nMaxColor) { uno::Any aAny = xPropSet->getPropertyValue("ColorScaleEntries"); CPPUNIT_ASSERT(aAny.hasValue()); diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 90f37a89db56..f99d23df203e 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -179,7 +179,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) vcl::Font aFont; pPattern->GetFont(aFont,SC_AUTOCOL_RAW); CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetFontSize().getHeight()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("font color should be black", COL_AUTO, aFont.GetColor().GetColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("font color should be black", COL_AUTO, aFont.GetColor()); pPattern = pDoc->GetPattern(0,1,1); pPattern->GetFont(aFont, SC_AUTOCOL_RAW); CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 12", 240l, aFont.GetFontSize().getHeight()); @@ -191,7 +191,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight()); pPattern = pDoc->GetPattern(1,0,1); pPattern->GetFont(aFont, SC_AUTOCOL_RAW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be blue", COL_BLUE, aFont.GetColor().GetColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be blue", COL_BLUE, aFont.GetColor()); pPattern = pDoc->GetPattern(1,1,1); pPattern->GetFont(aFont, SC_AUTOCOL_RAW); CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be striked out with a single line", STRIKEOUT_SINGLE, aFont.GetStrikeout()); @@ -224,7 +224,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) } pPattern = pDoc->GetPattern(1,4,1); Color aColor = pPattern->GetItem(ATTR_BACKGROUND).GetColor(); - CPPUNIT_ASSERT_EQUAL_MESSAGE("background color should be green", Color(COL_LIGHTGREEN), aColor); + CPPUNIT_ASSERT_EQUAL_MESSAGE("background color should be green", COL_LIGHTGREEN, aColor); pPattern = pDoc->GetPattern(2,0,1); SvxCellHorJustify eHorJustify = pPattern->GetItem(ATTR_HOR_JUSTIFY).GetValue(); CPPUNIT_ASSERT_EQUAL_MESSAGE("cell content should be aligned centre horizontally", SvxCellHorJustify::Center, eHorJustify); diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 8899e6861811..47ed37c4ee76 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -1178,7 +1178,7 @@ void ScExportTest::testMiscRowHeightExport() namespace { -void setAttribute( ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nType, sal_uInt32 nColor = COL_BLACK ) +void setAttribute( ScFieldEditEngine& rEE, sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nType, Color nColor = COL_BLACK ) { ESelection aSel; aSel.nStartPara = aSel.nEndPara = nPara; @@ -1438,7 +1438,7 @@ void ScExportTest::testRichTextExportODS() return false; } - static bool isColor(const editeng::Section& rAttr, sal_uInt32 nColor) + static bool isColor(const editeng::Section& rAttr, Color nColor) { if (rAttr.maAttributes.empty()) return false; diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 38a3950df7fc..be17f2ad3f50 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -989,7 +989,7 @@ void ScFiltersTest::testBorderODS() CPPUNIT_ASSERT(pRight); CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, pRight->GetBorderLineStyle()); CPPUNIT_ASSERT_EQUAL(5L, pRight->GetWidth()); - CPPUNIT_ASSERT_EQUAL(Color(COL_BLUE), pRight->GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, pRight->GetColor()); xDocSh->DoClose(); } @@ -2179,7 +2179,7 @@ void ScFiltersTest::testCondFormatThemeColorXLSX() CPPUNIT_ASSERT_EQUAL(Color(157, 195, 230), pDataBarFormatData->maPositiveColor); CPPUNIT_ASSERT(pDataBarFormatData->mpNegativeColor.get()); - CPPUNIT_ASSERT_EQUAL(Color(COL_LIGHTRED), *pDataBarFormatData->mpNegativeColor.get()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, *pDataBarFormatData->mpNegativeColor.get()); CPPUNIT_ASSERT_EQUAL(size_t(1), rDoc.GetCondFormList(1)->size()); pFormat = rDoc.GetCondFormat(0, 0, 1); @@ -3563,17 +3563,17 @@ void ScFiltersTest::testBackgroundColorStandardXLSXML() const std::vector<Check> aChecks = { - { OUString("Background Color"), Color(COL_BLACK), Color(COL_TRANSPARENT) }, - { OUString("Dark Red"), Color(COL_WHITE), Color(192, 0, 0) }, - { OUString("Red"), Color(COL_WHITE), Color(255, 0, 0) }, - { OUString("Orange"), Color(COL_WHITE), Color(255, 192, 0) }, - { OUString("Yellow"), Color(COL_WHITE), Color(255, 255, 0) }, - { OUString("Light Green"), Color(COL_WHITE), Color(146, 208, 80) }, - { OUString("Green"), Color(COL_WHITE), Color( 0, 176, 80) }, - { OUString("Light Blue"), Color(COL_WHITE), Color( 0, 176, 240) }, - { OUString("Blue"), Color(COL_WHITE), Color( 0, 112, 192) }, - { OUString("Dark Blue"), Color(COL_WHITE), Color( 0, 32, 96) }, - { OUString("Purple"), Color(COL_WHITE), Color(112, 48, 160) }, + { OUString("Background Color"), COL_BLACK, COL_TRANSPARENT }, + { OUString("Dark Red"), COL_WHITE, Color(192, 0, 0) }, + { OUString("Red"), COL_WHITE, Color(255, 0, 0) }, + { OUString("Orange"), COL_WHITE, Color(255, 192, 0) }, + { OUString("Yellow"), COL_WHITE, Color(255, 255, 0) }, + { OUString("Light Green"), COL_WHITE, Color(146, 208, 80) }, + { OUString("Green"), COL_WHITE, Color( 0, 176, 80) }, + { OUString("Light Blue"), COL_WHITE, Color( 0, 176, 240) }, + { OUString("Blue"), COL_WHITE, Color( 0, 112, 192) }, + { OUString("Dark Blue"), COL_WHITE, Color( 0, 32, 96) }, + { OUString("Purple"), COL_WHITE, Color(112, 48, 160) }, }; for (size_t nRow = 0; nRow < aChecks.size(); ++nRow) @@ -3728,7 +3728,7 @@ void ScFiltersTest::testBorderDirectionsXLSXML() return false; } - if (Color(COL_BLACK) != pLine->GetColor()) + if (COL_BLACK != pLine->GetColor()) { std::cout << "Border color was expected to be black, but is not." << std::endl; return false; diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index ba41d58fef4d..3cc8c729bc1c 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -354,7 +354,7 @@ void ScPatternAttr::GetFont( // determine effective font color - if ( ( aColor.GetColor() == COL_AUTO && eAutoMode != SC_AUTOCOL_RAW ) || + if ( ( aColor == COL_AUTO && eAutoMode != SC_AUTOCOL_RAW ) || eAutoMode == SC_AUTOCOL_IGNOREFONT || eAutoMode == SC_AUTOCOL_IGNOREALL ) { if ( eAutoMode == SC_AUTOCOL_BLACK ) @@ -704,7 +704,7 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r // put items into EditEngine ItemSet - if ( aColorItem.GetValue().GetColor() == COL_AUTO ) + if ( aColorItem.GetValue() == COL_AUTO ) { // When cell attributes are converted to EditEngine paragraph attributes, // don't create a hard item for automatic color, because that would be converted @@ -1081,7 +1081,7 @@ bool ScPatternAttr::IsVisible() const eState = rSet.GetItemState( ATTR_BACKGROUND, true, &pItem ); if ( eState == SfxItemState::SET ) - if ( static_cast<const SvxBrushItem*>(pItem)->GetColor().GetColor() != COL_TRANSPARENT ) + if ( static_cast<const SvxBrushItem*>(pItem)->GetColor() != COL_TRANSPARENT ) return true; eState = rSet.GetItemState( ATTR_BORDER, true, &pItem ); diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 0331f7a896d0..f291105c04fe 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -72,10 +72,10 @@ void ScAppOptions::SetDefaults() pLRUList[4] = SC_OPCODE_IF; nLRUFuncCount = 5; - nTrackContentColor = COL_TRANSPARENT; - nTrackInsertColor = COL_TRANSPARENT; - nTrackDeleteColor = COL_TRANSPARENT; - nTrackMoveColor = COL_TRANSPARENT; + nTrackContentColor = sal_uInt32(COL_TRANSPARENT); + nTrackInsertColor = sal_uInt32(COL_TRANSPARENT); + nTrackDeleteColor = sal_uInt32(COL_TRANSPARENT); + nTrackMoveColor = sal_uInt32(COL_TRANSPARENT); eLinkMode = LM_ON_DEMAND; nDefaultObjectSizeWidth = 8000; diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index 483c3045f853..6d4d4bf05789 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -129,7 +129,7 @@ void ScViewOptions::SetDefaults() aModeArr[VOBJ_TYPE_CHART] = VOBJ_MODE_SHOW; aModeArr[VOBJ_TYPE_DRAW ] = VOBJ_MODE_SHOW; - aGridCol = Color( SC_STD_GRIDCOLOR ); + aGridCol = SC_STD_GRIDCOLOR; aGridColName = ScGlobal::GetRscString( STR_GRIDCOLOR ); aGridOpt.SetDefaults(); diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 3da3b4d32536..d9f7e3806e28 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -497,7 +497,7 @@ XclExpStringRef lclCreateFormattedString( // add escapement aFont.SetEscapement( nEsc ); // modify automatic font color for hyperlinks - if( bIsHyperlink && aItemSet.Get( ATTR_FONT_COLOR ).GetValue().GetColor() == COL_AUTO) + if( bIsHyperlink && aItemSet.Get( ATTR_FONT_COLOR ).GetValue() == COL_AUTO) aFont.SetColor( COL_LIGHTBLUE ); // insert font into buffer diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 2262a448d1ec..a8f7d6b1bcfc 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -332,7 +332,7 @@ XclExpPaletteImpl::XclExpPaletteImpl( const XclDefaultPalette& rDefPal ) : sal_uInt32 XclExpPaletteImpl::InsertColor( const Color& rColor, XclExpColorType eType, sal_uInt16 nAutoDefault ) { - if( rColor.GetColor() == COL_AUTO ) + if( rColor == COL_AUTO ) return GetColorIdFromIndex( nAutoDefault ); sal_uInt32 nFoundIdx = 0; diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 38146f00a1ad..f0c7b503a172 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -362,7 +362,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc // grid color const Color& rGridColor = rTabSett.maGridColor; - maData.mbDefGridColor = rGridColor.GetColor() == COL_AUTO; + maData.mbDefGridColor = rGridColor == COL_AUTO; if( !maData.mbDefGridColor ) { if( GetBiff() == EXC_BIFF8 ) diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 5e5b1d12f490..947fc2598ae3 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -715,7 +715,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillDa XOBitmap aXOBitmap( aBitmap ); aXOBitmap.Bitmap2Array(); - if( aXOBitmap.GetBackgroundColor().GetColor() == COL_BLACK ) + if( aXOBitmap.GetBackgroundColor() == COL_BLACK ) ::std::swap( aPattColor, aBackColor ); aXOBitmap.SetPixelColor( aPattColor ); aXOBitmap.SetBackgroundColor( aBackColor ); diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index c31dd38517a8..abb85f513d63 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -1136,7 +1136,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) Color aColor = rColorItem.GetValue(); // always export automatic text color as black - if ( aColor.GetColor() == COL_AUTO ) + if ( aColor == COL_AUTO ) aColor = COL_BLACK; aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_color). diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index c149fd1b2bad..e02f32f8c7bd 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1102,7 +1102,7 @@ const SvxFieldData* toXMLPropertyStates( if (!static_cast<const SvxColorItem*>(p)->QueryValue(aAny, pEntry->mnFlag)) continue; - sal_uInt32 nColor = 0; + ::Color nColor; if ( aAny >>= nColor ) { sal_Int32 nIndexColor = ( nColor == COL_AUTO ) ? xMapper->GetEntryIndex( @@ -4455,7 +4455,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) else { OUStringBuffer aBuffer; - ::sax::Converter::convertColor(aBuffer, COL_LIGHTRED); + ::sax::Converter::convertColor(aBuffer, sal_Int32(COL_LIGHTRED)); AddAttribute(XML_NAMESPACE_CALC_EXT, XML_NEGATIVE_COLOR, aBuffer.makeStringAndClear()); } } diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 4ba1d4f935cd..9ff271df2863 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -213,12 +213,12 @@ void SAL_CALL ScAccessibleContextBase::grabFocus( ) sal_Int32 SAL_CALL ScAccessibleContextBase::getForeground( ) { - return COL_BLACK; + return sal_Int32(COL_BLACK); } sal_Int32 SAL_CALL ScAccessibleContextBase::getBackground( ) { - return COL_WHITE; + return sal_Int32(COL_WHITE); } //===== XAccessibleContext ================================================== diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 2aed5a341243..cf062dd513dd 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -2437,7 +2437,7 @@ css::uno::Sequence< css::uno::Any > sal_Int32 SAL_CALL ScAccessibleDocument::getForeground( ) { - return COL_BLACK; + return sal_Int32(COL_BLACK); } sal_Int32 SAL_CALL ScAccessibleDocument::getBackground( ) diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index edaa96b58b57..0111d548bc69 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -994,7 +994,7 @@ void SAL_CALL ScAccessibleSpreadsheet::grabFocus( ) sal_Int32 SAL_CALL ScAccessibleSpreadsheet::getForeground( ) { - return COL_BLACK; + return sal_Int32(COL_BLACK); } sal_Int32 SAL_CALL ScAccessibleSpreadsheet::getBackground( ) diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 129cf1df71ce..80d4daf69a7a 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -139,7 +139,7 @@ void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font lcl_SetFontProperties( rCTLFont, *pCTLFontItem, *pCTLWeightItem, *pCTLPostureItem ); Color aColor( pColorItem->GetValue() ); - if( aColor.GetColor() == COL_TRANSPARENT ) + if( aColor == COL_TRANSPARENT ) aColor = GetSettings().GetStyleSettings().GetWindowTextColor(); #define SETONALLFONTS( MethodName, Value ) \ diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index b035b5e35412..ab93cb559397 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -215,7 +215,7 @@ ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_Li aLbScenario->SetQuickHelpText(aQH_List); aEdComment->SetQuickHelpText(aQH_Comment); - aEdComment->SetBackground( Color(COL_LIGHTGRAY) ); + aEdComment->SetBackground( COL_LIGHTGRAY ); SfxViewFrame* pViewFrm = SfxViewFrame::Current(); if (pViewFrm) diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index 7a4b999cf969..39d420f7f827 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -309,7 +309,7 @@ void ScTpContentOptions::InitGridOpt() OUString aName; Color aCol = pLocalOptions->GetGridColor( &aName ); - if (aName.trim().isEmpty() && aCol == Color(SC_STD_GRIDCOLOR)) + if (aName.trim().isEmpty() && aCol == SC_STD_GRIDCOLOR) aName = ScGlobal::GetRscString(STR_GRIDCOLOR); pColorLB->SelectEntry(std::make_pair(aCol, aName)); diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index 9b473c7ab909..b3078655ffc6 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -1211,7 +1211,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( break; case DataBar_Color: { - sal_Int32 nColor = COL_AUTO; + Color nColor = COL_AUTO; if (aValue >>= nColor) { getCoreObject()->GetDataBarData()->maPositiveColor = nColor; @@ -1220,7 +1220,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( break; case AxisColor: { - sal_Int32 nAxisColor = COL_AUTO; + Color nAxisColor = COL_AUTO; if (aValue >>= nAxisColor) { getCoreObject()->GetDataBarData()->maAxisColor = nAxisColor; @@ -1229,7 +1229,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( break; case NegativeColor: { - sal_Int32 nNegativeColor = COL_AUTO; + Color nNegativeColor = COL_AUTO; if (!(aValue >>= nNegativeColor) || !getCoreObject()->GetDataBarData()->mbNeg) throw lang::IllegalArgumentException(); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index c8190c608992..81f9bf233f01 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -535,7 +535,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI const svtools::ColorConfig& rColorCfg = pScMod->GetColorConfig(); Color aGridColor( rColorCfg.GetColorValue( svtools::CALCGRID, false ).nColor ); - if ( aGridColor.GetColor() == COL_TRANSPARENT ) + if ( aGridColor == COL_TRANSPARENT ) { // use view options' grid color only if color config has "automatic" color aGridColor = rOpts.GetGridColor(); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 4c42ecad42fc..52c6f456d97b 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -3077,7 +3077,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const if( pOptions ) { const Color& rGridColor = pOptions->GetGridColor(); - if( rGridColor.GetColor() != SC_STD_GRIDCOLOR ) + if( rGridColor != SC_STD_GRIDCOLOR ) rTabSett.maGridColor = rGridColor; } rTabSett.mbShowGrid = pViewTab->bShowGrid; @@ -3238,7 +3238,7 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) if( pOptions ) { Color aGridColor( rTabSett.maGridColor ); - if( aGridColor.GetColor() == COL_AUTO ) + if( aGridColor == COL_AUTO ) aGridColor = SC_STD_GRIDCOLOR; pOptions->SetGridColor( aGridColor, EMPTY_OUSTRING ); } @@ -3459,7 +3459,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue> { Color aColor(static_cast<sal_uInt32>(nColor)); // #i47435# set automatic grid color explicitly - if( aColor.GetColor() == COL_AUTO ) + if( aColor == COL_AUTO ) aColor = SC_STD_GRIDCOLOR; pOptions->SetGridColor(aColor, OUString()); } diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 3124929fe615..53ce26cfce89 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -746,7 +746,7 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) if ( nPropertyFlags & 0x20 ) { sal_uInt32 nBulletColor = pPara->nBulletColor; - if ( nBulletColor == COL_AUTO ) + if ( nBulletColor == sal_uInt32(COL_AUTO) ) { bool bIsDark = false; css::uno::Any aAny; @@ -799,7 +799,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj ) sal_uInt32 nCharAttr = rPortion.mnCharAttr; sal_uInt32 nCharColor = rPortion.mnCharColor; - if ( nCharColor == COL_AUTO ) // nCharColor depends to the background color + if ( nCharColor == sal_uInt32(COL_AUTO) ) // nCharColor depends to the background color { bool bIsDark = false; css::uno::Any aAny; diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx index d71241ec9de6..e848deb77820 100644 --- a/sd/source/filter/eppt/pptx-stylesheet.cxx +++ b/sd/source/filter/eppt/pptx-stylesheet.cxx @@ -103,7 +103,7 @@ void PPTExCharSheet::Write( SvStream& rSt, sal_uInt16 nLev, bool bSimpleText, .WriteUInt16( rLev.mnFont ); sal_uInt32 nFontColor = rLev.mnFontColor; - if ( nFontColor == COL_AUTO ) + if ( nFontColor == sal_uInt32(COL_AUTO) ) { bool bIsDark = false; css::uno::Any aAny; @@ -346,7 +346,7 @@ void PPTExParaSheet::Write( SvStream& rSt, sal_uInt16 nLev, bool bSimpleText, if ( bSimpleText ) nParaFlags &= 0x7fff; sal_uInt32 nBulletColor = rLev.mnBulletColor; - if ( nBulletColor == COL_AUTO ) + if ( nBulletColor == sal_uInt32(COL_AUTO) ) { bool bIsDark = false; css::uno::Any aAny; diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index 5d1f3db27f0d..690c69e7f952 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -829,7 +829,7 @@ css::uno::Sequence< css::uno::Any > sal_Int32 SAL_CALL AccessibleDocumentViewBase::getForeground( ) { - return COL_BLACK; + return sal_Int32(COL_BLACK); } sal_Int32 SAL_CALL AccessibleDocumentViewBase::getBackground( ) diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 4b6203418f5c..c686ebab5305 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -104,7 +104,7 @@ TableDesignWidget::TableDesignWidget( VclBuilderContainer* pParent, ViewShellBas else { m_pValueSet->SetColor( COL_WHITE ); - m_pValueSet->SetBackground( Color(COL_WHITE) ); + m_pValueSet->SetBackground( COL_WHITE ); } m_pValueSet->SetSelectHdl (LINK(this, TableDesignWidget, implValueSetHdl)); @@ -619,7 +619,7 @@ const BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle Size aBmpSize(nBitmapWidth, nBitmapHeight); pVirDev->SetOutputSizePixel(aBmpSize); - pVirDev->SetBackground( Color( bIsPageDark ? COL_BLACK : COL_WHITE ) ); + pVirDev->SetBackground( bIsPageDark ? COL_BLACK : COL_WHITE ); pVirDev->Erase(); // first draw cell background and text line previews @@ -638,7 +638,7 @@ const BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle // fill cell background const ::tools::Rectangle aRect( nX, nY, nX + nCellWidth - 1, nY + nCellHeight - 1 ); - if( xCellInfo->maCellColor.GetColor() != COL_TRANSPARENT ) + if( xCellInfo->maCellColor != COL_TRANSPARENT ) { pVirDev->SetFillColor( xCellInfo->maCellColor ); pVirDev->DrawRect( aRect ); @@ -648,7 +648,7 @@ const BitmapEx CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle } // draw text preview line - if( aTextColor.GetColor() == COL_AUTO ) + if( aTextColor == COL_AUTO ) aTextColor = bIsPageDark ? COL_WHITE : COL_BLACK; pVirDev->SetLineColor( aTextColor ); const Point aPnt1( nX + 2, nY + ((nCellHeight - 1 ) >> 1) ); diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx index bbb2a2d30c99..49c495d74894 100644 --- a/sfx2/source/control/templateviewitem.cxx +++ b/sfx2/source/control/templateviewitem.cxx @@ -94,7 +94,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces aBounds.setClosed(true); aSeq[1] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonColorPrimitive2D( - B2DPolyPolygon(aBounds), Color(COL_WHITE).getBColor())); + B2DPolyPolygon(aBounds), COL_WHITE.getBColor())); aSeq[2] = drawinglayer::primitive2d::Primitive2DReference( new FillGraphicPrimitive2D( createTranslateB2DHomMatrix(maPrev1Pos.X(),maPrev1Pos.Y()), diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 48e0d426bb44..dd7b2b039a95 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -451,7 +451,7 @@ namespace slideshow mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ), Size( aAWTRect.Width, aAWTRect.Height ) ); } - mpMediaWindow->SetBackground( Color(COL_BLACK) ); + mpMediaWindow->SetBackground( COL_BLACK ); mpMediaWindow->SetParentClipMode( ParentClipMode::NoClip ); mpMediaWindow->EnableEraseBackground( false ); mpMediaWindow->EnablePaint( false ); diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index bccb590094c6..f3ac0899627d 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -727,7 +727,7 @@ SmElementsDockingWindow::SmElementsDockingWindow(SfxBindings* pInputBindings, Sf mpElementListBox->SetSelectHdl(LINK(this, SmElementsDockingWindow, ElementSelectedHandle)); mpElementListBox->SelectEntry(SmResId(RID_CATEGORY_UNARY_BINARY_OPERATORS)); - mpElementsControl->SetBackground( Color(COL_WHITE) ); + mpElementsControl->SetBackground( COL_WHITE ); mpElementsControl->SetTextColor( COL_BLACK ); mpElementsControl->setElementSetId(RID_CATEGORY_UNARY_BINARY_OPERATORS); mpElementsControl->SetSelectHdl(LINK(this, SmElementsDockingWindow, SelectClickHandler)); diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 7f10e5f0a4e1..633e82b75eb2 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -46,6 +46,12 @@ using namespace ::com::sun::star; using namespace svl; +inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) +{ + rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); + return rStrm; +} + namespace { class Test : public CppUnit::TestFixture { @@ -1562,16 +1568,16 @@ void Test::testStandardColorIntegrity() CPPUNIT_ASSERT_EQUAL( nMaxDefaultColors, size_t(NF_KEY_LASTCOLOR) - size_t(NF_KEY_FIRSTCOLOR) + 1 ); CPPUNIT_ASSERT_EQUAL( nMaxDefaultColors, rStandardColors.size() ); // Colors must follow same order as in sEnglishKeyword - CPPUNIT_ASSERT_EQUAL( rStandardColors[0].GetColor(), COL_BLACK ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[1].GetColor(), COL_LIGHTBLUE ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[2].GetColor(), COL_LIGHTGREEN ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[3].GetColor(), COL_LIGHTCYAN ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[4].GetColor(), COL_LIGHTRED ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[5].GetColor(), COL_LIGHTMAGENTA ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[6].GetColor(), COL_BROWN ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[7].GetColor(), COL_GRAY ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[8].GetColor(), COL_YELLOW ); - CPPUNIT_ASSERT_EQUAL( rStandardColors[9].GetColor(), COL_WHITE ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[0], COL_BLACK ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[1], COL_LIGHTBLUE ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[2], COL_LIGHTGREEN ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[3], COL_LIGHTCYAN ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[4], COL_LIGHTRED ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[5], COL_LIGHTMAGENTA ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[6], COL_BROWN ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[7], COL_GRAY ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[8], COL_YELLOW ); + CPPUNIT_ASSERT_EQUAL( rStandardColors[9], COL_WHITE ); } void Test::testColorNamesConversion() diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index de54a88c64d7..038c1623b3ad 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -396,7 +396,7 @@ ColorConfig::~ColorConfig() Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry) { - static const sal_Int32 aAutoColors[] = + static const Color aAutoColors[] = { COL_WHITE, // DOCCOLOR COL_LIGHTGRAY, // DOCBOUNDARIES diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 61d587ea089a..2351564f439e 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -685,7 +685,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib } else // scaleByAveraging { - const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( COL_WHITE ) ); BitmapColor aResultColor( 0 ); double aSum, aCount; @@ -746,7 +746,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib } else { - const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( COL_WHITE ) ); BitmapColor aAlphaVal( 0 ); for( long nY = 0; nY < aTargetHeight; nY++ ) @@ -802,8 +802,8 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if( pWriteAccess ) { Bitmap aMsk( rBmpEx.GetMask() ); - const BitmapColor aB( pWriteAccess->GetBestMatchingColor( Color(COL_BLACK) ) ); - const BitmapColor aW( pWriteAccess->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aB( pWriteAccess->GetBestMatchingColor( COL_BLACK ) ); + const BitmapColor aW( pWriteAccess->GetBestMatchingColor( COL_WHITE ) ); BitmapReadAccess* pMAcc = nullptr; if( !aMsk || ( ( pMAcc = aMsk.AcquireReadAccess() ) != nullptr ) ) @@ -813,7 +813,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib BitmapColor aTestB; if( pMAcc ) - aTestB = pMAcc->GetBestMatchingColor( Color(COL_BLACK) ); + aTestB = pMAcc->GetBestMatchingColor( COL_BLACK ); // create new horizontal mapping table for( long nX = 0; nX < aUnrotatedWidth; nX++ ) diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 6147e8cf2595..e756e5c5e316 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -583,7 +583,7 @@ SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nL SvStream& HTMLOutFuncs::Out_Color( SvStream& rStream, const Color& rColor ) { rStream.WriteCharPtr( "\"#" ); - if( rColor.GetColor() == COL_AUTO ) + if( rColor == COL_AUTO ) { rStream.WriteCharPtr( "000000" ); } @@ -992,7 +992,7 @@ void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, const OString &aAttri { OStringBuffer sBuffer; - if( rColor.GetColor() == COL_AUTO ) + if( rColor == COL_AUTO ) { sBuffer.append("#000000"); } diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index fd982321debd..36226892970b 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -544,10 +544,10 @@ namespace svt { namespace table o_convertedColor.reset(); else { - sal_Int32 nColor = COL_TRANSPARENT; + Color nColor = COL_TRANSPARENT; if ( i_color >>= nColor ) { - o_convertedColor.reset( ::Color( nColor ) ); + o_convertedColor.reset( nColor ); } else { diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx index 3573eecc0d06..5d09653ab14c 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx @@ -119,13 +119,13 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfSdrOle2Obj::c drawinglayer::attribute::HatchStyle::Single, // single hatch 125.0, // 1.25 mm 45.0 * F_PI180, // 45 degree diagonal - Color(COL_BLACK).getBColor(), // black color + COL_BLACK.getBColor(), // black color 3, // same default as VCL, a minimum of three discrete units (pixels) offset false); // no filling const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D( basegfx::B2DPolyPolygon(aObjectOutline), - Color(COL_BLACK).getBColor(), + COL_BLACK.getBColor(), aFillHatch)); xRetval.push_back(xReference); diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index 6760043bdc08..40b099f32457 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -132,7 +132,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageBackgroun { aInitColor = pPageView->GetApplicationDocumentColor(); - if(Color(COL_AUTO) == aInitColor) + if(COL_AUTO == aInitColor) { const svtools::ColorConfig aColorConfig; aInitColor = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor; diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index ef002fee8652..3529584cc3ae 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -78,7 +78,7 @@ namespace svx Color aColor(rColor); // !!! #109290# Workaround for SetFillColor with COL_AUTO - if (aColor.GetColor() == COL_AUTO) + if (aColor == COL_AUTO) aColor = COL_TRANSPARENT; if ((maCurColor == aColor) && !bSizeChanged && !bDisplayModeChanged && !bForceUpdate) diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 9f83fcb319c1..1220a72f93bd 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -567,7 +567,7 @@ tools::Polygon XOutBitmap::GetContour( const Bitmap& rBmp, const XOutFlags nFlag std::unique_ptr<Point[]> pPoints2; long nX, nY; sal_uInt16 nPolyPos = 0; - const BitmapColor aBlack = pAcc->GetBestMatchingColor( Color(COL_BLACK) ); + const BitmapColor aBlack = pAcc->GetBestMatchingColor( COL_BLACK ); if( nFlags & XOutFlags::ContourVert ) { diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 2f51b526cfb2..97108c59d0ca 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -435,7 +435,7 @@ public: sal_uInt16 GetZoom() const { return m_nZoom; } void SetZoom( sal_uInt16 n ){ m_nZoom = n; } - static void DrawRect( OutputDevice* pOut, const SwRect &rRect, long nCol ); + static void DrawRect( OutputDevice* pOut, const SwRect &rRect, ::Color nCol ); static void DrawRectPrinter( OutputDevice* pOut, const SwRect& rRect ); SwViewOption& operator=( const SwViewOption &rOpt ); diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 07f46710825c..1d1529b1aa63 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -929,6 +929,12 @@ inline void assertBorderEqual( #define CPPUNIT_ASSERT_BORDER_EQUAL(aExpected, aActual) \ assertBorderEqual( aExpected, aActual, CPPUNIT_SOURCELINE() ) \ +inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) +{ + rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); + return rStrm; +} + #endif // INCLUDED_SW_QA_EXTRAS_INC_SWMODELTESTBASE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 0a0f40bb4cf3..d961216fb8a8 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -401,7 +401,7 @@ DECLARE_FILE_MAILMERGE_TEST(testMissingDefaultLineColor, "missing-default-line-c CPPUNIT_ASSERT( xDefaults.is()); uno::Reference< beans::XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo()); CPPUNIT_ASSERT( xInfo->hasPropertyByName( "LineColor" )); - sal_uInt32 lineColor; + Color lineColor; xDefaults->getPropertyValue( "LineColor" ) >>= lineColor; // And the default value is black (wasn't copied properly by mailmerge). CPPUNIT_ASSERT_EQUAL( COL_BLACK, lineColor ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 81bf7d99600d..4960c87bd9d0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -46,7 +46,7 @@ protected: DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") { CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); - CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"))); } DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index dfb0a118ebfb..d796e58e88ee 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -1028,7 +1028,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaShadow, "para-shadow.docx") { // The problem was that in w:pBdr, child elements had a w:shadow attribute, but that was ignored. table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); // w:sz="48" is in eights of a point, 1 pt is 20 twips. CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(24/8*20)), aShadow.ShadowWidth); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 0303237aece2..bfab921a26ae 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -153,7 +153,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") width: any -> border width */ { const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } @@ -163,7 +163,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") { uno::Reference<beans::XPropertySet> xMiddleRun(getRun(getParagraph(2),2), uno::UNO_QUERY); const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xMiddleRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 8bb8f3ecf4b5..9cd5aff5546f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -946,7 +946,7 @@ DECLARE_OOXMLEXPORT_TEST(testPageBorderShadow, "page-border-shadow.docx") { // The problem was that in w:pgBorders, child elements had a w:shadow attribute, but that was ignored. table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getStyles("PageStyles")->getByName("Standard"), "ShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); // w:sz="48" is in eights of a point, 1 pt is 20 twips. CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(48/8*20)), aShadow.ShadowWidth); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 2e5dd994b01b..cd0b7d962f45 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -697,7 +697,7 @@ DECLARE_RTFEXPORT_TEST(testParaShadow, "para-shadow.rtf") // The problem was that \brdrsh was ignored. table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(60)), aShadow.ShadowWidth); } @@ -739,7 +739,7 @@ DECLARE_RTFEXPORT_TEST(testCharacterBorder, "charborder.odt") { const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index a83ba3916674..06b46172cbd2 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -969,7 +969,7 @@ DECLARE_RTFEXPORT_TEST(testDoDhgtOld, "do-dhgt-old.rtf") xShape.set(getShape(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<sal_uInt32>(xShape, "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(getProperty<sal_uInt32>(xShape, "FillColor"))); xShape.set(getShape(3), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xShape, "ZOrder")); @@ -982,7 +982,7 @@ DECLARE_RTFEXPORT_TEST(testFdo61909, "fdo61909.rtf") // Was the Writer default font. CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty<OUString>(xTextRange, "CharFontName")); - CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(xTextRange, "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xTextRange, "CharBackColor"))); } DECLARE_RTFEXPORT_TEST(testFdo62288, "fdo62288.rtf") diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index b7c2160aaa05..d6838d8acf89 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -4085,7 +4085,7 @@ void SwUiWriterTest::testTdf87922() // Make sure that automatic color on black background is white, not black. vcl::Font aFont; aDrawTextInfo.ApplyAutoColor(&aFont); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, aFont.GetColor().GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, aFont.GetColor()); } #if HAVE_MORE_FONTS diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index f3ad01808c09..d5a84b2b1ded 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -764,7 +764,7 @@ DECLARE_WW8EXPORT_TEST(testFdo45724, "fdo45724.odt") // The text and background color of the control shape was not correct. uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); uno::Reference<form::validation::XValidatableFormComponent> xComponent(xControlShape->getControl(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<sal_uInt32>(xComponent, "BackgroundColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(getProperty<sal_uInt32>(xComponent, "BackgroundColor"))); CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get<OUString>()); } @@ -867,7 +867,7 @@ DECLARE_WW8EXPORT_TEST(testCharacterBorder, "charborder.odt") width: any -> border width */ { const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 9a4c36659c20..628ad727dc47 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -970,12 +970,12 @@ void SAL_CALL SwAccessibleContext::grabFocus() sal_Int32 SAL_CALL SwAccessibleContext::getForeground() { - return COL_BLACK; + return sal_Int32(COL_BLACK); } sal_Int32 SAL_CALL SwAccessibleContext::getBackground() { - return COL_WHITE; + return sal_Int32(COL_WHITE); } sal_Bool SAL_CALL SwAccessibleContext::supportsService (const OUString& ServiceName) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 6f206aff32cb..0b35cdf968c9 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1029,11 +1029,11 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getForeground() { if ( aBackgroundCol.IsDark() ) { - return COL_WHITE; + return sal_Int32(COL_WHITE); } else { - return COL_BLACK; + return sal_Int32(COL_BLACK); } } @@ -2181,7 +2181,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if (xComponent.is()) { Color cr(xComponent->getBackground()); - crChar = cr.IsDark() ? COL_WHITE : COL_BLACK; + crChar = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); rValue.Value <<= crChar; } } @@ -2237,7 +2237,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if (xComponent.is()) { Color cr(xComponent->getBackground()); - crUnderline = cr.IsDark() ? COL_WHITE : COL_BLACK; + crUnderline = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK); rValue.Value <<= crUnderline; } } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index b43ec2dfe50d..f6b731ba2be1 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -597,7 +597,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) MakeVisible( aTmpRect ); #if OSL_DEBUG_LEVEL > 0 //TODO: That doesn't seem to be intended - if( Color(COL_TRANSPARENT) != GetOut()->GetLineColor() ) + if( COL_TRANSPARENT != GetOut()->GetLineColor() ) { OSL_FAIL( "Hey, Joe: Where's my Null Pen?" ); GetOut()->SetLineColor( COL_TRANSPARENT ); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index a4b10585e6b3..9acc1debd096 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3736,7 +3736,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const { if ( pSectionTOXColor && (pSectionTOXColor->GetTransparency() != 0) && - (pSectionTOXColor->GetColor() != COL_TRANSPARENT) ) + (*pSectionTOXColor != COL_TRANSPARENT) ) { bBackgroundTransparent = true; } diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 814d7fad91a4..ee3cb8a82b0e 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -541,7 +541,7 @@ static bool lcl_IsDarkBackground( const SwTextPaintInfo& rInf ) pCol = &pItem->GetColor(); // Determined color <pCol> can be <COL_TRANSPARENT>. Thus, check it. - if ( pCol->GetColor() == COL_TRANSPARENT) + if ( *pCol == COL_TRANSPARENT) pCol = nullptr; } else diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 40768a132e84..599452c0b5a3 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2528,7 +2528,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) /// OD 30.08.2002 #99657# /// determined color <pCol> can be <COL_TRANSPARENT>. Thus, check it. - if ( pCol->GetColor() == COL_TRANSPARENT) + if ( *pCol == COL_TRANSPARENT) pCol = nullptr; } else diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 6d23a4a60ce9..4232fdfdedd4 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3135,7 +3135,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, // get the color bool bColor = false; /// set <bTransparent> to true, if color is "no fill"/"auto fill" - bool bTransparent = (rColor.GetColor() == COL_TRANSPARENT); + bool bTransparent = (rColor == COL_TRANSPARENT); Color aColor; if( !bTransparent ) { diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 2e6d38e42666..598b1dc4bde9 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -954,7 +954,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( { const Color &rColor = static_cast<const SvxBrushItem *>(pItem)->GetColor(); /// copy color, if color is not "no fill"/"auto fill" - if( rColor.GetColor() != COL_TRANSPARENT ) + if( rColor != COL_TRANSPARENT ) { /// copy complete color with transparency aTmp <<= static_cast<sal_Int32>(rColor.GetColor()); diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index c7256f05a8c0..717365e535de 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1208,7 +1208,7 @@ void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic const Color &rBackColor = pBrushItem->GetColor(); /// check, if background color is not "no fill"/"auto fill", instead of /// only checking, if transparency is not set. - if( rBackColor.GetColor() != COL_TRANSPARENT ) + if( rBackColor != COL_TRANSPARENT ) { OStringBuffer sOut; sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append('='); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2f1301b354a4..e472319cc4b8 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4257,7 +4257,7 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) bMustWrite = static_cast< const SvxCaseMapItem& >(rHt).GetCaseMap() != SvxCaseMap::NotMapped; break; case RES_CHRATR_COLOR: - bMustWrite = static_cast< const SvxColorItem& >(rHt).GetValue().GetColor() != COL_AUTO; + bMustWrite = static_cast< const SvxColorItem& >(rHt).GetValue() != COL_AUTO; break; case RES_CHRATR_CONTOUR: bMustWrite = static_cast< const SvxContourItem& >(rHt).GetValue(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 50044b5241f4..848a11f28715 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1127,7 +1127,7 @@ void RtfExport::InsColor(const Color& rCol) if (rEntry.second == COL_AUTO) bAutoColorInTable = true; } - if (rCol.GetColor() == COL_AUTO) + if (rCol == COL_AUTO) // COL_AUTO gets value 0 n = 0; else diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index cfc7123e3673..7287557f8780 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1531,7 +1531,7 @@ boost::optional<SvxBrushItem> MSWordExportBase::getBackground() if (SfxItemState::SET == eState) { // The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX - if (aBrush.GetColor().GetColor() != COL_AUTO) + if (aBrush.GetColor() != COL_AUTO) oRet.reset(aBrush); } return oRet; @@ -2635,11 +2635,10 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t WW8SHDLong aSHD; aSHD.setCvFore( 0xFF000000 ); - sal_uInt32 nBgColor = aColor.GetColor(); - if ( nBgColor == COL_AUTO ) + if ( aColor == COL_AUTO ) aSHD.setCvBack( 0xFF000000 ); else - aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) ); + aSHD.setCvBack( wwUtility::RGBToBGR( aColor.GetColor() ) ); aSHD.Write( m_rWW8Export ); } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 2c187e610522..9480ce32ba80 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1537,7 +1537,7 @@ bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd) sal_uInt32 SuitableBGColor(sal_uInt32 nIn) { - if (nIn == COL_AUTO) + if (nIn == sal_uInt32(COL_AUTO)) return 0xFF000000; return wwUtility::RGBToBGR(nIn); } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 7da1c54edc82..04856eb181db 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1564,7 +1564,7 @@ void WW8TabBandDesc::ReadNewShd(const sal_uInt8* pS, bool bVer67) pNewSHDs[i++] = SwWW8ImplReader::ExtractColour(pS, bVer67); while (i < nWwCols) - pNewSHDs[i++] = COL_AUTO; + pNewSHDs[i++] = sal_uInt32(COL_AUTO); } void WW8TabBandDesc::setcelldefaults(WW8_TCell *pCells, short nCols) @@ -3035,7 +3035,7 @@ void WW8TabDesc::SetTabShades( SwTableBox* pBox, short nWwIdx ) return; // faked cells -> no color bool bFound=false; - if (m_pActBand->pNewSHDs && m_pActBand->pNewSHDs[nWwIdx] != COL_AUTO) + if (m_pActBand->pNewSHDs && m_pActBand->pNewSHDs[nWwIdx] != sal_uInt32(COL_AUTO)) { Color aColor(m_pActBand->pNewSHDs[nWwIdx]); pBox->GetFrameFormat()->SetFormatAttr(SvxBrushItem(aColor, RES_BACKGROUND)); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index a9a9ee0cdbfe..1384a7738c69 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2539,7 +2539,7 @@ void SwWW8ImplReader::StopApo() */ const SfxPoolItem &rItm = pNd->SwContentNode::GetAttr(RES_BACKGROUND); const SvxBrushItem &rBrush = static_cast<const SvxBrushItem&>(rItm); - if (rBrush.GetColor().GetColor() != COL_AUTO) + if (rBrush.GetColor() != COL_AUTO) aBg = rBrush.GetColor(); if (m_pLastAnchorPos.get()) @@ -4818,8 +4818,8 @@ sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67) //Being a transparent background colour doesn't actually show the page //background through, it merely acts like white if (nBack == 0xFF000000) - nBack = COL_AUTO; - OSL_ENSURE(nBack == COL_AUTO || !(nBack & 0xFF000000), + nBack = sal_uInt32(COL_AUTO); + OSL_ENSURE(nBack == sal_uInt32(COL_AUTO) || !(nBack & 0xFF000000), "ww8: don't know what to do with such a transparent bg colour, report"); SwWW8Shade aShade(nFore, nBack, nIndex); return aShade.aColor.GetColor(); diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index e8b436894ed9..f568247cb4d7 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -101,7 +101,7 @@ bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const } void SwViewOption::DrawRect( OutputDevice *pOut, - const SwRect &rRect, long nCol ) + const SwRect &rRect, ::Color nCol ) { if ( pOut->GetOutDevType() != OUTDEV_PRINTER ) { diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index 007184220816..a45ce53b8bbd 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -348,9 +348,9 @@ void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const ::tools: aSign.setClosed(true); } - BColor aSignColor = Color(COL_BLACK).getBColor(); + BColor aSignColor = COL_BLACK.getBColor(); if (Application::GetSettings().GetStyleSettings().GetHighContrastMode()) - aSignColor = Color(COL_WHITE).getBColor(); + aSignColor = COL_WHITE.getBColor(); aSeq.push_back( drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( @@ -366,7 +366,7 @@ void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const ::tools: double nFadeRate = double(m_nFadeRate) / 100.0; const basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(), + new basegfx::BColorModifier_interpolate(COL_WHITE.getBColor(), 1.0 - nFadeRate)); aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference( diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index c93a863cf7f0..a629f2cc5742 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -192,9 +192,9 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re aTriangle.append(B2DPoint((nLeft + nRight) / 2.0, nBottom)); aTriangle.setClosed(true); - BColor aTriangleColor = Color(COL_BLACK).getBColor(); + BColor aTriangleColor = COL_BLACK.getBColor(); if (Application::GetSettings().GetStyleSettings().GetHighContrastMode()) - aTriangleColor = Color(COL_WHITE).getBColor(); + aTriangleColor = COL_WHITE.getBColor(); aSeq.emplace_back(); aSeq.back().set( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( @@ -203,7 +203,7 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re drawinglayer::primitive2d::Primitive2DContainer aGhostedSeq(1); double nFadeRate = double(m_nFadeRate) / 100.0; const basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(), + new basegfx::BColorModifier_interpolate(COL_WHITE.getBColor(), 1.0 - nFadeRate)); aGhostedSeq[0].set( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( aSeq, aBColorModifier)); diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 5a4a67bb9c11..f3ae1b67b49d 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -516,7 +516,7 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point //paint the grid now Color aLineColor = pGridItem->GetColor(); - if (aLineColor.GetColor() == COL_AUTO) + if (aLineColor == COL_AUTO) { aLineColor = rRenderContext.GetFillColor(); aLineColor.Invert(); diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx index 47e6613af6b0..6e5c715789f7 100644 --- a/sw/source/uibase/utlui/shdwcrsr.cxx +++ b/sw/source/uibase/utlui/shdwcrsr.cxx @@ -76,7 +76,7 @@ void SwShadowCursor::DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMod pWin->SetMapMode(MapMode(MapUnit::MapPixel)); pWin->SetRasterOp( RasterOp::Xor ); - pWin->SetLineColor( Color( aCol.GetColor() ^ COL_WHITE ) ); + pWin->SetLineColor( Color( aCol.GetColor() ^ sal_uInt32(COL_WHITE) ) ); // 1. The Line: pWin->DrawLine( Point( rPt.X(), rPt.Y() + 1), diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index e0d435abdf7c..b03e081767d9 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -129,7 +129,7 @@ namespace toolkit aStyleSettings.SetCheckedColor( aBackground ); sal_Int32 nBackgroundLuminance = Color( nBackgroundColor ).GetLuminance(); - sal_Int32 nWhiteLuminance = Color(COL_WHITE).GetLuminance(); + sal_Int32 nWhiteLuminance = COL_WHITE.GetLuminance(); Color aLightShadow( nBackgroundColor ); aLightShadow.IncreaseLuminance( static_cast<sal_uInt8>( ( nWhiteLuminance - nBackgroundLuminance ) * 2 / 3 ) ); diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx index 567f0a0d91e2..3d790c70b11e 100644 --- a/toolkit/source/helper/formpdfexport.cxx +++ b/toolkit/source/helper/formpdfexport.cxx @@ -314,9 +314,9 @@ namespace toolkitform OUString sBorderColorPropertyName( "BorderColor" ); if ( xPSI->hasPropertyByName( sBorderColorPropertyName ) ) { - sal_Int32 nBorderColor = COL_TRANSPARENT; + Color nBorderColor = COL_TRANSPARENT; if ( xModelProps->getPropertyValue( sBorderColorPropertyName ) >>= nBorderColor ) - Descriptor->BorderColor = Color( nBorderColor ); + Descriptor->BorderColor = nBorderColor; else Descriptor->BorderColor = COL_BLACK; } @@ -328,10 +328,10 @@ namespace toolkitform static const char FM_PROP_BACKGROUNDCOLOR[] = "BackgroundColor"; if ( xPSI->hasPropertyByName( FM_PROP_BACKGROUNDCOLOR ) ) { - sal_Int32 nBackColor = COL_TRANSPARENT; + Color nBackColor = COL_TRANSPARENT; xModelProps->getPropertyValue( FM_PROP_BACKGROUNDCOLOR ) >>= nBackColor; Descriptor->Background = true; - Descriptor->BackgroundColor = Color( nBackColor ); + Descriptor->BackgroundColor = nBackColor; } @@ -339,9 +339,9 @@ namespace toolkitform static const char FM_PROP_TEXTCOLOR[] = "TextColor"; if ( xPSI->hasPropertyByName( FM_PROP_TEXTCOLOR ) ) { - sal_Int32 nTextColor = COL_TRANSPARENT; + Color nTextColor = COL_TRANSPARENT; xModelProps->getPropertyValue( FM_PROP_TEXTCOLOR ) >>= nTextColor; - Descriptor->TextColor = Color( nTextColor ); + Descriptor->TextColor = nTextColor; } diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx index 9f88f2c111b3..9abc74141728 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -224,7 +224,7 @@ SvStream& ReadColor( SvStream& rIStream, Color& rColor ) } else { - static const ColorData aColAry[] = + static const Color aColAry[] = { COL_BLACK, // COL_BLACK COL_BLUE, // COL_BLUE @@ -260,9 +260,9 @@ SvStream& ReadColor( SvStream& rIStream, Color& rColor ) }; if ( nColorName < SAL_N_ELEMENTS( aColAry ) ) - rColor.mnColor = aColAry[nColorName]; + rColor = aColAry[nColorName]; else - rColor.mnColor = COL_BLACK; + rColor = COL_BLACK; } return rIStream; diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 256aede7e863..ac2646498642 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -35,19 +35,19 @@ void checkValue(Bitmap::ScopedWriteAccess& pAccess, int x, int y, Color aExpecte if (nColorDelta <= nColorDeltaThresh) { if (bColorize) - pAccess->SetPixel(y, x, Color(COL_LIGHTGREEN)); + pAccess->SetPixel(y, x, COL_LIGHTGREEN); } else if (bQuirkMode) { nNumberOfQuirks++; if (bColorize) - pAccess->SetPixel(y, x, Color(COL_YELLOW)); + pAccess->SetPixel(y, x, COL_YELLOW); } else { nNumberOfErrors++; if (bColorize) - pAccess->SetPixel(y, x, Color(COL_LIGHTRED)); + pAccess->SetPixel(y, x, COL_LIGHTRED); } } diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 2c6dd2486ff5..a532ce7c2358 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -123,7 +123,7 @@ namespace void Toggle1BitTransparency(const BitmapBuffer& rBuf) { - assert(rBuf.maPalette.GetBestIndex(BitmapColor(Color(COL_BLACK))) == 0); + assert(rBuf.maPalette.GetBestIndex(BitmapColor(COL_BLACK)) == 0); // TODO: make upper layers use standard alpha if (getCairoFormat(rBuf) == CAIRO_FORMAT_A1) { @@ -329,7 +329,7 @@ namespace pAlphaBits.reset( new unsigned char[nImageSize] ); memcpy(pAlphaBits.get(), pMaskBuf->mpBits, nImageSize); - const sal_Int32 nBlackIndex = pMaskBuf->maPalette.GetBestIndex(BitmapColor(Color(COL_BLACK))); + const sal_Int32 nBlackIndex = pMaskBuf->maPalette.GetBestIndex(BitmapColor(COL_BLACK)); if (nBlackIndex == 0) { // TODO: make upper layers use standard alpha @@ -1073,7 +1073,7 @@ void SvpSalGraphics::applyColor(cairo_t *cr, SalColor aColor) } else { - double fSet = aColor == COL_BLACK ? 1.0 : 0.0; + double fSet = aColor == sal_uInt32(COL_BLACK) ? 1.0 : 0.0; cairo_set_source_rgba(cr, 1, 1, 1, fSet); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); } @@ -1301,8 +1301,8 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh if (GetBitCount() == 1) { aPal.SetEntryCount(2); - aPal[0] = Color(COL_BLACK); - aPal[1] = Color(COL_WHITE); + aPal[0] = COL_BLACK; + aPal[1] = COL_WHITE; } if (!pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), aPal)) diff --git a/vcl/inc/quartz/salgdicommon.hxx b/vcl/inc/quartz/salgdicommon.hxx index 47cbd9cb7c75..c73e07516cf0 100644 --- a/vcl/inc/quartz/salgdicommon.hxx +++ b/vcl/inc/quartz/salgdicommon.hxx @@ -30,12 +30,14 @@ #endif #include <postmac.h> +#include <tools/color.hxx> #include <vcl/salgtype.hxx> // abstracting quartz color instead of having to use an CGFloat[] array class RGBAColor { public: + RGBAColor( ::Color ); RGBAColor( SalColor ); RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET const CGFloat* AsArray() const { return m_fRGBA; } @@ -58,6 +60,14 @@ inline RGBAColor::RGBAColor( SalColor nSalColor ) m_fRGBA[3] = 1.0; // opaque } +inline RGBAColor::RGBAColor( ::Color nColor ) +{ + m_fRGBA[0] = nColor.GetRed() * (1.0/255); + m_fRGBA[1] = nColor.GetGreen() * (1.0/255); + m_fRGBA[2] = nColor.GetBlue() * (1.0/255); + m_fRGBA[3] = 1.0; // opaque +} + inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ) { m_fRGBA[0] = fRed; diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm index 8605405d9454..1af27ad4f247 100644 --- a/vcl/osx/a11ytextattributeswrapper.mm +++ b/vcl/osx/a11ytextattributeswrapper.mm @@ -168,7 +168,7 @@ using namespace ::com::sun::star::uno; } +(void)addColor:(SalColor)nSalColor forAttribute:(NSString *)attribute andRange:(NSRange)range toString:(NSMutableAttributedString *)string { - if( nSalColor == COL_TRANSPARENT ) + if( nSalColor == sal_uInt32(COL_TRANSPARENT) ) return; const RGBAColor aRGBAColor( nSalColor); CGColorRef aColorRef = CGColorCreate ( CGColorSpaceCreateWithName ( kCGColorSpaceGenericRGB ), aRGBAColor.AsArray() ); diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index 12a03e5aa524..726ce8bf524e 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -176,64 +176,64 @@ void BitmapTest::testMonochrome() BitmapWriteAccess aBmpAccess(aBmp); // row 1 - aBmpAccess.SetPixel(0, 0, BitmapColor(Color(COL_BLACK))); - aBmpAccess.SetPixel(0, 1, BitmapColor(Color(COL_BLUE))); - aBmpAccess.SetPixel(0, 2, BitmapColor(Color(COL_GREEN))); - aBmpAccess.SetPixel(0, 3, BitmapColor(Color(COL_CYAN))); + aBmpAccess.SetPixel(0, 0, BitmapColor(COL_BLACK)); + aBmpAccess.SetPixel(0, 1, BitmapColor(COL_BLUE)); + aBmpAccess.SetPixel(0, 2, BitmapColor(COL_GREEN)); + aBmpAccess.SetPixel(0, 3, BitmapColor(COL_CYAN)); // row 2 - aBmpAccess.SetPixel(1, 0, BitmapColor(Color(COL_RED))); - aBmpAccess.SetPixel(1, 1, BitmapColor(Color(COL_MAGENTA))); - aBmpAccess.SetPixel(1, 2, BitmapColor(Color(COL_BROWN))); - aBmpAccess.SetPixel(1, 3, BitmapColor(Color(COL_GRAY))); + aBmpAccess.SetPixel(1, 0, BitmapColor(COL_RED)); + aBmpAccess.SetPixel(1, 1, BitmapColor(COL_MAGENTA)); + aBmpAccess.SetPixel(1, 2, BitmapColor(COL_BROWN)); + aBmpAccess.SetPixel(1, 3, BitmapColor(COL_GRAY)); // row 3 - aBmpAccess.SetPixel(2, 0, BitmapColor(Color(COL_LIGHTGRAY))); - aBmpAccess.SetPixel(2, 1, BitmapColor(Color(COL_LIGHTBLUE))); - aBmpAccess.SetPixel(2, 2, BitmapColor(Color(COL_LIGHTGREEN))); - aBmpAccess.SetPixel(2, 3, BitmapColor(Color(COL_LIGHTCYAN))); + aBmpAccess.SetPixel(2, 0, BitmapColor(COL_LIGHTGRAY)); + aBmpAccess.SetPixel(2, 1, BitmapColor(COL_LIGHTBLUE)); + aBmpAccess.SetPixel(2, 2, BitmapColor(COL_LIGHTGREEN)); + aBmpAccess.SetPixel(2, 3, BitmapColor(COL_LIGHTCYAN)); // row 4 - aBmpAccess.SetPixel(3, 0, BitmapColor(Color(COL_LIGHTRED))); - aBmpAccess.SetPixel(3, 1, BitmapColor(Color(COL_LIGHTMAGENTA))); - aBmpAccess.SetPixel(3, 2, BitmapColor(Color(COL_YELLOW))); - aBmpAccess.SetPixel(3, 3, BitmapColor(Color(COL_WHITE))); + aBmpAccess.SetPixel(3, 0, BitmapColor(COL_LIGHTRED)); + aBmpAccess.SetPixel(3, 1, BitmapColor(COL_LIGHTMAGENTA)); + aBmpAccess.SetPixel(3, 2, BitmapColor(COL_YELLOW)); + aBmpAccess.SetPixel(3, 3, BitmapColor(COL_WHITE)); aBmp.MakeMonochrome(63); BitmapReadAccess aBmpReadAccess(aBmp); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Black pixel wrong monochrome value", - BitmapColor(Color(COL_BLACK)), aBmpReadAccess.GetColor(0, 0)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue pixel wrong monochrome value", BitmapColor(Color(COL_BLACK)), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Black pixel wrong monochrome value", BitmapColor(COL_BLACK), + aBmpReadAccess.GetColor(0, 0)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue pixel wrong monochrome value", BitmapColor(COL_BLACK), aBmpReadAccess.GetColor(0, 1)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Green pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(0, 2)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Cyan pixel wrong monochrome value", BitmapColor(Color(COL_WHITE)), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Green pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(0, 2)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cyan pixel wrong monochrome value", BitmapColor(COL_WHITE), aBmpReadAccess.GetColor(0, 3)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Red pixel wrong monochrome value", BitmapColor(Color(COL_BLACK)), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Red pixel wrong monochrome value", BitmapColor(COL_BLACK), aBmpReadAccess.GetColor(1, 0)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Magenta pixel wrong monochrome value", - BitmapColor(Color(COL_BLACK)), aBmpReadAccess.GetColor(1, 1)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Brown pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(1, 2)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Gray pixel wrong monochrome value", BitmapColor(Color(COL_WHITE)), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Magenta pixel wrong monochrome value", BitmapColor(COL_BLACK), + aBmpReadAccess.GetColor(1, 1)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Brown pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(1, 2)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Gray pixel wrong monochrome value", BitmapColor(COL_WHITE), aBmpReadAccess.GetColor(1, 3)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Light gray pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(2, 0)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Light blue pixel wrong monochrome value", - BitmapColor(Color(COL_BLACK)), aBmpReadAccess.GetColor(2, 1)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Light green pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(2, 2)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Light cyan pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(2, 3)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Light red pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(3, 0)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Light gray pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(2, 0)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Light blue pixel wrong monochrome value", BitmapColor(COL_BLACK), + aBmpReadAccess.GetColor(2, 1)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Light green pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(2, 2)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Light cyan pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(2, 3)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Light red pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(3, 0)); CPPUNIT_ASSERT_EQUAL_MESSAGE("Light magenta pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(3, 1)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Yellow pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(3, 2)); - CPPUNIT_ASSERT_EQUAL_MESSAGE("White pixel wrong monochrome value", - BitmapColor(Color(COL_WHITE)), aBmpReadAccess.GetColor(3, 3)); + BitmapColor(COL_WHITE), aBmpReadAccess.GetColor(3, 1)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Yellow pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(3, 2)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("White pixel wrong monochrome value", BitmapColor(COL_WHITE), + aBmpReadAccess.GetColor(3, 3)); } void BitmapTest::testConvert() diff --git a/vcl/qa/cppunit/bitmapcolor.cxx b/vcl/qa/cppunit/bitmapcolor.cxx index d03aa2960953..d4594fa22c02 100644 --- a/vcl/qa/cppunit/bitmapcolor.cxx +++ b/vcl/qa/cppunit/bitmapcolor.cxx @@ -162,82 +162,82 @@ void BitmapColorTest::invert() void BitmapColorTest::getLuminance() { { - BitmapColor aBmpColor(Color(COL_BLACK)); + BitmapColor aBmpColor(COL_BLACK); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(0), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_BLUE)); + BitmapColor aBmpColor(COL_BLUE); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(14), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_GREEN)); + BitmapColor aBmpColor(COL_GREEN); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(75), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_CYAN)); + BitmapColor aBmpColor(COL_CYAN); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(89), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_RED)); + BitmapColor aBmpColor(COL_RED); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(38), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_MAGENTA)); + BitmapColor aBmpColor(COL_MAGENTA); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(52), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_BROWN)); + BitmapColor aBmpColor(COL_BROWN); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(114), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_GRAY)); + BitmapColor aBmpColor(COL_GRAY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(128), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_LIGHTGRAY)); + BitmapColor aBmpColor(COL_LIGHTGRAY); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(192), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_LIGHTBLUE)); + BitmapColor aBmpColor(COL_LIGHTBLUE); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(27), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_LIGHTGREEN)); + BitmapColor aBmpColor(COL_LIGHTGREEN); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(150), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_LIGHTCYAN)); + BitmapColor aBmpColor(COL_LIGHTCYAN); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(178), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_LIGHTRED)); + BitmapColor aBmpColor(COL_LIGHTRED); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(76), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_LIGHTMAGENTA)); + BitmapColor aBmpColor(COL_LIGHTMAGENTA); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(104), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_YELLOW)); + BitmapColor aBmpColor(COL_YELLOW); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(227), aBmpColor.GetLuminance()); } { - BitmapColor aBmpColor(Color(COL_WHITE)); + BitmapColor aBmpColor(COL_WHITE); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(255), aBmpColor.GetLuminance()); } } diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 475db74c94a3..192aa1d58c1f 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -653,8 +653,8 @@ void CanvasBitmapTest::runTest() } else { - aBlack = Color(COL_BLACK); - aWhite = Color(COL_WHITE); + aBlack = COL_BLACK; + aWhite = COL_WHITE; } pAcc->SetFillColor(COL_GREEN); pAcc->FillRect(tools::Rectangle(0,0,100,100)); diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index c2004f6ef012..07f056326a8f 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -56,21 +56,21 @@ void VclOutdevTest::testVirtualDevice() } #endif - CPPUNIT_ASSERT_EQUAL(Color(COL_WHITE), pVDev->GetPixel(Point(0,0))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0,0))); #if defined LINUX //TODO: various failures on Mac and Windows tinderboxes - CPPUNIT_ASSERT_EQUAL(Color(COL_BLUE), pVDev->GetPixel(Point(1,2))); - CPPUNIT_ASSERT_EQUAL(Color(COL_RED), pVDev->GetPixel(Point(31,30))); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, pVDev->GetPixel(Point(1,2))); + CPPUNIT_ASSERT_EQUAL(COL_RED, pVDev->GetPixel(Point(31,30))); #endif - CPPUNIT_ASSERT_EQUAL(Color(COL_WHITE), pVDev->GetPixel(Point(30,31))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(30,31))); // Gotcha: y and x swap for BitmapReadAccess: deep joy. Bitmap::ScopedReadAccess pAcc(aBmp); - CPPUNIT_ASSERT_EQUAL(Color(COL_WHITE), pAcc->GetPixel(0,0).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pAcc->GetPixel(0,0).GetColor()); #if defined LINUX //TODO: various failures on Mac and Windows tinderboxes - CPPUNIT_ASSERT_EQUAL(Color(COL_BLUE), pAcc->GetPixel(2,1).GetColor()); - CPPUNIT_ASSERT_EQUAL(Color(COL_RED), pAcc->GetPixel(30,31).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, pAcc->GetPixel(2,1).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_RED, pAcc->GetPixel(30,31).GetColor()); #endif - CPPUNIT_ASSERT_EQUAL(Color(COL_WHITE), pAcc->GetPixel(31,30).GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pAcc->GetPixel(31,30).GetColor()); #if 0 VclPtr<vcl::Window> pWin = VclPtr<WorkWindow>::Create( (vcl::Window *)nullptr ); diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index d8c539a79d98..bbac31eb1f65 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -1493,7 +1493,7 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY ) if( !mxLayer || (nX < 0) || (nX >= mnWidth) || (nY < 0) || (nY >= mnHeight)) { - return COL_BLACK; + return sal_uInt32(COL_BLACK); } // prepare creation of matching a CGBitmapContext #if defined OSL_BIGENDIAN diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 91f37289f8a2..7b14c8da64c2 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1335,7 +1335,7 @@ const Wallpaper& ComboBox::GetDisplayBackground() const const Wallpaper& rBack = m_pImpl->m_pSubEdit->GetBackground(); if( ! rBack.IsBitmap() && ! rBack.IsGradient() && - rBack.GetColor().GetColor() == COL_TRANSPARENT + rBack.GetColor() == COL_TRANSPARENT ) return Control::GetDisplayBackground(); return rBack; diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 7b73b990233e..30ba1116eeb6 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -300,10 +300,10 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) // if possible accommodate some standard colours if( nCount < 256 ) { - (*pPal)[ 255UL ] = Color(COL_WHITE); + (*pPal)[ 255UL ] = COL_WHITE; if( nCount < 255 ) - (*pPal)[ 254UL ] = Color(COL_BLACK); + (*pPal)[ 254UL ] = COL_BLACK; } } } diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index a8e88e9c48ee..950bbb5c0f09 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -327,8 +327,8 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) if( pAcc1 ) { - aWhite = pAcc1->GetBestMatchingColor( Color(COL_WHITE) ); - aBlack = pAcc1->GetBestMatchingColor( Color(COL_BLACK) ); + aWhite = pAcc1->GetBestMatchingColor( COL_WHITE ); + aBlack = pAcc1->GetBestMatchingColor( COL_BLACK ); bStatus = ParseData( &rIStm, aLine, eFormat ); } else diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index 1d51fa0d6752..d627bd31db08 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -298,8 +298,8 @@ bool XPMReader::ImplGetScanLine( sal_uLong nY ) { if ( mpMaskAcc ) { - aWhite = mpMaskAcc->GetBestMatchingColor( Color(COL_WHITE) ); - aBlack = mpMaskAcc->GetBestMatchingColor( Color(COL_BLACK) ); + aWhite = mpMaskAcc->GetBestMatchingColor( COL_WHITE ); + aBlack = mpMaskAcc->GetBestMatchingColor( COL_BLACK ); } if ( mnStringSize != ( mnWidth * mnCpp )) bStatus = false; diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx index 899795675405..05207c39256f 100644 --- a/vcl/source/gdi/alpha.cxx +++ b/vcl/source/gdi/alpha.cxx @@ -95,7 +95,7 @@ bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency ) const BitmapColor aReplace( cReplaceTransparency ); const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); - const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( COL_WHITE ) ); for( long nY = 0; nY < nHeight; nY++ ) { diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index e631d0593999..bf670f20ffce 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -65,28 +65,28 @@ Bitmap::Bitmap( const Size& rSizePixel, sal_uInt16 nBitCount, const BitmapPalett if( 1 == nBitCount ) { aPal.SetEntryCount( 2 ); - aPal[ 0 ] = Color(COL_BLACK); - aPal[ 1 ] = Color(COL_WHITE); + aPal[ 0 ] = COL_BLACK; + aPal[ 1 ] = COL_WHITE; } else if( ( 4 == nBitCount ) || ( 8 == nBitCount ) ) { aPal.SetEntryCount( 1 << nBitCount ); - aPal[ 0 ] = Color(COL_BLACK); - aPal[ 1 ] = Color(COL_BLUE); - aPal[ 2 ] = Color(COL_GREEN); - aPal[ 3 ] = Color(COL_CYAN); - aPal[ 4 ] = Color(COL_RED); - aPal[ 5 ] = Color(COL_MAGENTA); - aPal[ 6 ] = Color(COL_BROWN); - aPal[ 7 ] = Color(COL_GRAY); - aPal[ 8 ] = Color(COL_LIGHTGRAY); - aPal[ 9 ] = Color(COL_LIGHTBLUE); - aPal[ 10 ] = Color(COL_LIGHTGREEN); - aPal[ 11 ] = Color(COL_LIGHTCYAN); - aPal[ 12 ] = Color(COL_LIGHTRED); - aPal[ 13 ] = Color(COL_LIGHTMAGENTA); - aPal[ 14 ] = Color(COL_YELLOW); - aPal[ 15 ] = Color(COL_WHITE); + aPal[ 0 ] = COL_BLACK; + aPal[ 1 ] = COL_BLUE; + aPal[ 2 ] = COL_GREEN; + aPal[ 3 ] = COL_CYAN; + aPal[ 4 ] = COL_RED; + aPal[ 5 ] = COL_MAGENTA; + aPal[ 6 ] = COL_BROWN; + aPal[ 7 ] = COL_GRAY; + aPal[ 8 ] = COL_LIGHTGRAY; + aPal[ 9 ] = COL_LIGHTBLUE; + aPal[ 10 ] = COL_LIGHTGREEN; + aPal[ 11 ] = COL_LIGHTCYAN; + aPal[ 12 ] = COL_LIGHTRED; + aPal[ 13 ] = COL_LIGHTMAGENTA; + aPal[ 14 ] = COL_YELLOW; + aPal[ 15 ] = COL_WHITE; // Create dither palette if( 8 == nBitCount ) @@ -1187,7 +1187,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uInt8 nTol ) const ScopedReadAccess pReadAcc(const_cast<Bitmap&>(*this)); if (!nTol && pReadAcc && (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal || pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal) - && pReadAcc->GetBestMatchingColor(Color(COL_WHITE)) == pReadAcc->GetBestMatchingColor(rTransColor)) + && pReadAcc->GetBestMatchingColor(COL_WHITE) == pReadAcc->GetBestMatchingColor(rTransColor)) { //if we're a 1 bit pixel already, and the transcolor matches the color that would replace it already, then just return a copy return *this; @@ -1201,8 +1201,8 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uInt8 nTol ) const { const long nWidth = pReadAcc->Width(); const long nHeight = pReadAcc->Height(); - const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color(COL_BLACK) ) ); - const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( COL_BLACK ) ); + const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( COL_WHITE ) ); if( !nTol ) { @@ -1510,7 +1510,7 @@ bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor ) { const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); - const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( COL_WHITE ) ); BitmapColor aReplace; if( pAcc->HasPalette() ) @@ -1830,7 +1830,7 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine ) const Color aColBlack( COL_BLACK ); BitmapColor aPixel; BitmapColor aMaskPixel; - const BitmapColor aWhite( pAcc->GetBestMatchingColor( Color(COL_WHITE) ) ); + const BitmapColor aWhite( pAcc->GetBestMatchingColor( COL_WHITE ) ); const BitmapColor aBlack( pAcc->GetBestMatchingColor( aColBlack ) ); const BitmapColor aMaskBlack( pMaskAcc->GetBestMatchingColor( aColBlack ) ); @@ -1925,8 +1925,8 @@ bool Bitmap::MakeMonochrome(sal_uInt8 cThreshold) if( pWriteAcc ) { - const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) ) ); - const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); + const BitmapColor aBlack( pWriteAcc->GetBestMatchingColor( COL_BLACK ) ); + const BitmapColor aWhite( pWriteAcc->GetBestMatchingColor( COL_WHITE ) ); const long nWidth = pWriteAcc->Width(); const long nHeight = pWriteAcc->Height(); diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 0380e85ca37d..9c9b528bfe90 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -549,8 +549,8 @@ bool Bitmap::ImplConvertDown(sal_uInt16 nBitCount, Color const * pExtColor) if (aPalette.GetEntryCount() < (nCount - 1)) { aPalette.SetEntryCount(aPalette.GetEntryCount() + 2); - aPalette[aPalette.GetEntryCount() - 2] = Color(COL_BLACK); - aPalette[aPalette.GetEntryCount() - 1] = Color(COL_WHITE); + aPalette[aPalette.GetEntryCount() - 2] = COL_BLACK; + aPalette[aPalette.GetEntryCount() - 1] = COL_WHITE; } pWriteAcc->SetPalette(aPalette); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index ec6b504a9e79..ea883d0be6eb 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -401,7 +401,7 @@ bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor ) if( !!aBitmap ) { - const bool bTransRotate = ( Color(COL_TRANSPARENT) == rFillColor ); + const bool bTransRotate = ( COL_TRANSPARENT == rFillColor ); if( bTransRotate ) { diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 99b5067270db..a9996b08d105 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1774,8 +1774,8 @@ BitmapEx GDIMetaFile::ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpPa { BitmapPalette aPal( 3 ); - aPal[ 0 ] = Color(COL_BLACK); - aPal[ 1 ] = Color(COL_WHITE); + aPal[ 0 ] = COL_BLACK; + aPal[ 1 ] = COL_WHITE; aPal[ 2 ] = static_cast<const ImplBmpMonoParam*>(pBmpParam)->aColor; Bitmap aBmp( rBmpEx.GetSizePixel(), 4, &aPal ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 0a7e32a4cf6f..defecaa88642 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9500,9 +9500,9 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) // #i47395# 1 bit bitmaps occasionally have an inverted grey palette sal_uInt16 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( COL_BLACK ) ); assert( nBlackIndex == 0 || nBlackIndex == 1); - sal_uInt16 nWhiteIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color(COL_WHITE) ) ); + sal_uInt16 nWhiteIndex = pAccess->GetBestPaletteIndex( BitmapColor( COL_WHITE ) ); if( pAccess->GetPalette()[nBlackIndex] == BitmapColor( COL_BLACK ) && - pAccess->GetPalette()[nWhiteIndex] == BitmapColor( Color(COL_WHITE) ) ) + pAccess->GetPalette()[nWhiteIndex] == BitmapColor( COL_WHITE ) ) { // It is black and white if( nBlackIndex == 1 ) @@ -9573,7 +9573,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) if( aBitmap.GetBitCount() == 1 ) { aLine.append( "/ImageMask true\n" ); - sal_Int32 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( Color(COL_BLACK) ) ); + sal_Int32 nBlackIndex = pAccess->GetBestPaletteIndex( BitmapColor( COL_BLACK ) ); SAL_WARN_IF( nBlackIndex != 0 && nBlackIndex != 1, "vcl.pdfwriter", "wrong black index" ); if( nBlackIndex ) aLine.append( "/Decode[ 1 0 ]\n" ); diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index 0448cb1dee79..b5c6178eb1bd 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -562,7 +562,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo } else { - const BitmapColor aTrans(mpMaskAccess->GetBestMatchingColor(Color(COL_WHITE))); + const BitmapColor aTrans(mpMaskAccess->GetBestMatchingColor(COL_WHITE)); Scanline pScanline = mpAccess->GetScanline( nY ); Scanline pScanlineMask = mpMaskAccess->GetScanline( nY ); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 695ebf1b69af..c897afeb6f10 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -322,16 +322,16 @@ void OutputDevice::ImplDrawSpecialText( SalLayout& rSalLayout ) Color aOverlineColor( aOldOverlineColor ); // we don't have a automatic color, so black is always drawn on white - if ( aTextColor.GetColor() == COL_BLACK ) + if ( aTextColor == COL_BLACK ) aTextColor = COL_WHITE; - if ( aTextLineColor.GetColor() == COL_BLACK ) + if ( aTextLineColor == COL_BLACK ) aTextLineColor = COL_WHITE; - if ( aOverlineColor.GetColor() == COL_BLACK ) + if ( aOverlineColor == COL_BLACK ) aOverlineColor = COL_WHITE; // relief-color is black for white text, in all other cases // we set this to LightGray - if ( aTextColor.GetColor() == COL_WHITE ) + if ( aTextColor == COL_WHITE ) aReliefColor = COL_BLACK; SetTextLineColor( aReliefColor ); SetOverlineColor( aReliefColor ); @@ -373,7 +373,7 @@ void OutputDevice::ImplDrawSpecialText( SalLayout& rSalLayout ) nOff++; SetTextLineColor(); SetOverlineColor(); - if ( (GetTextColor().GetColor() == COL_BLACK) + if ( (GetTextColor() == COL_BLACK) || (GetTextColor().GetLuminance() < 8) ) SetTextColor( COL_LIGHTGRAY ); else diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index be8f55e902cf..a15b788f8b01 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -850,7 +850,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor ) } if( (mnDrawMode & DrawModeFlags::GhostedText) && - (aColor.GetColor() != COL_TRANSPARENT) ) + (aColor != COL_TRANSPARENT) ) { aColor = Color( (aColor.GetRed() >> 1) | 0x80, (aColor.GetGreen() >> 1) | 0x80, @@ -907,7 +907,7 @@ void OutputDevice::SetOverlineColor( const Color& rColor ) } if( (mnDrawMode & DrawModeFlags::GhostedText) && - (aColor.GetColor() != COL_TRANSPARENT) ) + (aColor != COL_TRANSPARENT) ) { aColor = Color( (aColor.GetRed() >> 1) | 0x80, (aColor.GetGreen() >> 1) | 0x80, diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 4b7f72c6017f..8d52a27bd4c6 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -475,7 +475,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, { BitmapColor aPixCol; const BitmapColor aFillCol( GetFillColor() ); - const BitmapColor aBlack( pR->GetBestMatchingColor( Color(COL_BLACK) ) ); + const BitmapColor aBlack( pR->GetBestMatchingColor( COL_BLACK ) ); const long nWidth = pW->Width(); const long nHeight = pW->Height(); const long nR = aFillCol.GetRed(); diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 65d9b995530b..7d007b4d6dd7 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -794,7 +794,7 @@ void DecorationView::DrawSymbol( const tools::Rectangle& rRect, SymbolType eType if ( nStyle & DrawSymbolFlags::Mono ) { // Monochrome: set color to black if enabled, to gray if disabled - nColor = Color( ( nStyle & DrawSymbolFlags::Disable ) ? COL_GRAY : COL_BLACK ); + nColor = ( nStyle & DrawSymbolFlags::Disable ) ? COL_GRAY : COL_BLACK; } else { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index a7c50c793969..51861d6c3dff 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3115,7 +3115,7 @@ const Wallpaper& Window::GetDisplayBackground() const const Wallpaper& rBack = GetBackground(); if( ! rBack.IsBitmap() && ! rBack.IsGradient() && - rBack.GetColor().GetColor() == COL_TRANSPARENT && + rBack.GetColor()== COL_TRANSPARENT && mpWindowImpl->mpParent ) return mpWindowImpl->mpParent->GetDisplayBackground(); return rBack; diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 823d4ca9018d..27f024348ed5 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -109,10 +109,10 @@ namespace const BitmapPalette& rPalette = pBitmapBuffer->maPalette; if (rPalette.GetEntryCount() == 2) { - const BitmapColor aWhite(rPalette[rPalette.GetBestIndex(Color(COL_WHITE))]); + const BitmapColor aWhite(rPalette[rPalette.GetBestIndex(COL_WHITE)]); rValues.foreground = rColMap.GetPixel(ImplColorToSal(aWhite.GetColor())); - const BitmapColor aBlack(rPalette[rPalette.GetBestIndex(Color(COL_BLACK))]); + const BitmapColor aBlack(rPalette[rPalette.GetBestIndex(COL_BLACK)]); rValues.background = rColMap.GetPixel(ImplColorToSal(aBlack.GetColor())); } rBitmap.ReleaseBuffer(pBitmapBuffer, BitmapAccessMode::Read); diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 68f4a2c4ea75..a04da99dd9f0 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -355,8 +355,8 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( rPal.SetEntryCount( 2 ); pDstPal = &rPal; - rPal[ 0 ] = Color(COL_BLACK); - rPal[ 1 ] = Color(COL_WHITE); + rPal[ 0 ] = COL_BLACK; + rPal[ 1 ] = COL_WHITE; } else if( pImage->depth == 8 && bGrey ) { @@ -518,8 +518,8 @@ XImage* X11SalBitmap::ImplCreateXImage( if( pImage->depth == 1 ) { xPal.reset(new BitmapPalette( 2 )); - (*xPal)[ 0 ] = Color(COL_BLACK); - (*xPal)[ 1 ] = Color(COL_WHITE); + (*xPal)[ 0 ] = COL_BLACK; + (*xPal)[ 1 ] = COL_WHITE; } else if( pImage->depth == 8 && mbGrey ) { diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 3b502340bd53..cd65c2c379dc 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -409,7 +409,7 @@ public: std::vector<OUString> aFontNames; - sal_uInt32 const nCols[] = { + Color const nCols[] = { COL_BLACK, COL_BLUE, COL_GREEN, COL_CYAN, COL_RED, COL_MAGENTA, COL_BROWN, COL_GRAY, COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTGREEN, COL_LIGHTCYAN, COL_LIGHTRED, COL_LIGHTMAGENTA, COL_YELLOW, COL_WHITE @@ -450,7 +450,7 @@ public: nFontColorIndex=(i % aFontNames.size()); } - rDev.SetTextColor(Color(nCols[nFontColorIndex])); + rDev.SetTextColor(nCols[nFontColorIndex]); vcl::Font aFont( aFontNames[nFontIndex], Size(0, nFontHeight )); if (bRotate) @@ -777,13 +777,13 @@ public: if (rCtx.meStyle == RENDER_EXPANDED) { std::vector<tools::Rectangle> aRegions(DemoRenderer::partition(rCtx,5, 4)); - sal_uInt32 nStartCols[] = { + Color nStartCols[] = { COL_RED, COL_RED, COL_RED, COL_GREEN, COL_GREEN, COL_BLUE, COL_BLUE, COL_BLUE, COL_CYAN, COL_CYAN, COL_BLACK, COL_LIGHTGRAY, COL_WHITE, COL_BLUE, COL_CYAN, COL_WHITE, COL_WHITE, COL_WHITE, COL_BLACK, COL_BLACK }; - sal_uInt32 nEndCols[] = { + Color nEndCols[] = { COL_WHITE, COL_WHITE, COL_WHITE, COL_BLACK, COL_BLACK, COL_RED, COL_RED, COL_RED, COL_GREEN, COL_GREEN, COL_GRAY, COL_GRAY, COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTCYAN, @@ -818,8 +818,8 @@ public: { tools::Rectangle aSub = aRegions[i]; Gradient aGradient; - aGradient.SetStartColor(Color(nStartCols[i])); - aGradient.SetEndColor(Color(nEndCols[i])); + aGradient.SetStartColor(nStartCols[i]); + aGradient.SetEndColor(nEndCols[i]); aGradient.SetStyle(eStyles[i]); aGradient.SetAngle(nAngles[i]); aGradient.SetBorder(nBorders[i]); diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index 91b1fb47266f..81916a8c224d 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -241,11 +241,11 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineToken, sal_Int32 nLineColor, table::BorderLine2& rToFill, bool bIsOOXML ) { - static const sal_Int32 aBorderDefColor[] = + static const Color aBorderDefColor[] = { // The first item means automatic color (COL_AUTO), but we // do not use it anyway (see the next statement) .-) - 0, COL_BLACK, COL_LIGHTBLUE, COL_LIGHTCYAN, COL_LIGHTGREEN, + COL_AUTO, COL_BLACK, COL_LIGHTBLUE, COL_LIGHTCYAN, COL_LIGHTGREEN, COL_LIGHTMAGENTA, COL_LIGHTRED, COL_YELLOW, COL_WHITE, COL_BLUE, COL_CYAN, COL_GREEN, COL_MAGENTA, COL_RED, COL_BROWN, COL_GRAY, COL_LIGHTGRAY @@ -254,7 +254,7 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineToken, if(!nLineColor) ++nLineColor; if(!bIsOOXML && sal::static_int_cast<sal_uInt32>(nLineColor) < SAL_N_ELEMENTS(aBorderDefColor)) - nLineColor = aBorderDefColor[nLineColor]; + nLineColor = sal_Int32(aBorderDefColor[nLineColor]); sal_Int32 nLineType = lcl_convertBorderStyleFromToken(nLineToken); diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 8cbb6c6eff4b..d20adca936fa 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -634,7 +634,7 @@ table::ShadowFormat PropertyMap::getShadowFromBorder( const table::BorderLine2& // property of the page style, with shadow location, distance and // color. See SwWW8ImplReader::SetShadow(). table::ShadowFormat aFormat; - aFormat.Color = COL_BLACK; + aFormat.Color = sal_Int32(COL_BLACK); aFormat.Location = table::ShadowLocation_BOTTOM_RIGHT; aFormat.ShadowWidth = rBorder.LineWidth; return aFormat; diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index efe8a1ef0c1f..3408375884a1 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -506,7 +506,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) case RTF_CHCBPAT: { auto pValue - = std::make_shared<RTFValue>(nParam ? sal_uInt32(getColorTable(nParam)) : COL_AUTO); + = std::make_shared<RTFValue>(sal_uInt32(nParam ? getColorTable(nParam) : COL_AUTO)); putNestedAttribute(m_aStates.top().aCharacterSprms, NS_ooxml::LN_EG_RPrBase_shd, NS_ooxml::LN_CT_Shd_fill, pValue); } @@ -536,7 +536,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) case RTF_HIGHLIGHT: { auto pValue - = std::make_shared<RTFValue>(nParam ? sal_uInt32(getColorTable(nParam)) : COL_AUTO); + = std::make_shared<RTFValue>(sal_uInt32(nParam ? getColorTable(nParam) : COL_AUTO)); m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_highlight, pValue); } break; diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 6fd0bc24af1e..a40cee944fd4 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -1133,7 +1133,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( if( pCharHighlight && pCharBackground ) { assert(pCharBackgroundTransparency); // always together - sal_uInt32 nColor = COL_TRANSPARENT; + Color nColor = COL_TRANSPARENT; pCharHighlight->maValue >>= nColor; if( nColor == COL_TRANSPARENT ) { |