accessibility/source/standard/vclxaccessiblelistitem.cxx | 4 canvas/source/vcl/spritecanvashelper.cxx | 4 chart2/source/controller/accessibility/AccessibleBase.cxx | 2 chart2/source/tools/RangeHighlighter.cxx | 12 - chart2/source/view/axes/VCartesianAxis.cxx | 4 chart2/source/view/axes/VPolarAngleAxis.cxx | 2 chart2/source/view/main/OpenGLRender.cxx | 16 +- chart2/source/view/main/OpenGLRender.hxx | 2 cppcanvas/source/mtfrenderer/implrenderer.cxx | 6 cui/source/options/optcolor.cxx | 4 cui/source/tabpages/chardlg.cxx | 2 cui/source/tabpages/numpages.cxx | 12 - drawinglayer/source/tools/wmfemfhelper.cxx | 2 editeng/source/accessibility/AccessibleComponentBase.cxx | 4 editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4 editeng/source/editeng/editeng.cxx | 2 editeng/source/items/itemtype.cxx | 2 editeng/source/items/textitem.cxx | 2 emfio/source/reader/wmfreader.cxx | 2 extensions/source/propctrlr/fontdialog.cxx | 2 extensions/source/propctrlr/standardcontrol.cxx | 2 filter/source/flash/swfwriter1.cxx | 6 filter/source/graphicfilter/eps/eps.cxx | 2 filter/source/msfilter/msdffimp.cxx | 8 - filter/source/msfilter/util.cxx | 36 ++--- filter/source/svg/svgwriter.cxx | 6 forms/source/component/formcontrolfont.cxx | 4 forms/source/component/imgprod.cxx | 4 forms/source/richtext/richtextcontrol.cxx | 2 forms/source/solar/component/navbarcontrol.cxx | 2 include/tools/color.hxx | 55 +++++++ include/tools/colordata.hxx | 51 ------- oox/source/export/drawingml.cxx | 12 - reportdesign/source/core/api/ImageControl.cxx | 2 reportdesign/source/core/api/ReportDefinition.cxx | 6 reportdesign/source/core/api/Section.cxx | 2 reportdesign/source/core/inc/ReportHelperImpl.hxx | 2 reportdesign/source/filter/xml/xmlExport.cxx | 2 reportdesign/source/ui/inspection/GeometryHandler.cxx | 8 - reportdesign/source/ui/report/FixedTextColor.cxx | 2 sc/qa/extras/new_cond_format.cxx | 16 +- sc/qa/unit/helper/qahelper.cxx | 6 sc/qa/unit/subsequent_export-test.cxx | 4 sc/qa/unit/subsequent_filters-test.cxx | 28 +-- sc/source/core/data/patattr.cxx | 6 sc/source/core/tool/appoptio.cxx | 8 - sc/source/core/tool/viewopti.cxx | 2 sc/source/filter/excel/xehelper.cxx | 2 sc/source/filter/excel/xestyle.cxx | 2 sc/source/filter/excel/xeview.cxx | 2 sc/source/filter/excel/xiescher.cxx | 2 sc/source/filter/html/htmlexp.cxx | 2 sc/source/filter/xml/xmlexprt.cxx | 4 sc/source/ui/Accessibility/AccessibleContextBase.cxx | 4 sc/source/ui/Accessibility/AccessibleDocument.cxx | 2 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 2 sc/source/ui/miscdlgs/autofmt.cxx | 2 sc/source/ui/navipi/scenwnd.cxx | 2 sc/source/ui/optdlg/tpview.cxx | 2 sc/source/ui/unoobj/condformatuno.cxx | 6 sc/source/ui/view/gridwin4.cxx | 2 sc/source/ui/view/viewdata.cxx | 6 sd/source/filter/eppt/epptso.cxx | 4 sd/source/filter/eppt/pptx-stylesheet.cxx | 4 sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 2 sd/source/ui/table/TableDesignPane.cxx | 8 - sfx2/source/control/templateviewitem.cxx | 2 slideshow/source/engine/shapes/viewmediashape.cxx | 2 starmath/source/ElementsDockingWindow.cxx | 2 svl/qa/unit/svl.cxx | 26 ++- svtools/source/config/colorcfg.cxx | 2 svtools/source/graphic/grfmgr2.cxx | 10 - svtools/source/svhtml/htmlout.cxx | 4 svtools/source/uno/unocontroltablemodel.cxx | 4 svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx | 4 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx | 2 svx/source/tbxctrls/tbxcolorupdate.cxx | 2 svx/source/xoutdev/_xoutbmp.cxx | 2 sw/inc/viewopt.hxx | 2 sw/qa/extras/inc/swmodeltestbase.hxx | 6 sw/qa/extras/mailmerge/mailmerge.cxx | 2 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 2 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 2 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 4 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 2 sw/qa/extras/rtfexport/rtfexport.cxx | 4 sw/qa/extras/rtfexport/rtfexport2.cxx | 4 sw/qa/extras/uiwriter/uiwriter.cxx | 2 sw/qa/extras/ww8export/ww8export.cxx | 4 sw/source/core/access/acccontext.cxx | 4 sw/source/core/access/accpara.cxx | 8 - sw/source/core/frmedt/fefly1.cxx | 2 sw/source/core/layout/paintfrm.cxx | 2 sw/source/core/text/inftxt.cxx | 2 sw/source/core/txtnode/fntcache.cxx | 2 sw/source/filter/html/css1atr.cxx | 2 sw/source/filter/html/htmlform.cxx | 2 sw/source/filter/html/wrthtml.cxx | 2 sw/source/filter/ww8/docxattributeoutput.cxx | 2 sw/source/filter/ww8/rtfexport.cxx | 2 sw/source/filter/ww8/wrtww8.cxx | 7 sw/source/filter/ww8/ww8atr.cxx | 2 sw/source/filter/ww8/ww8par2.cxx | 4 sw/source/filter/ww8/ww8par6.cxx | 6 sw/source/uibase/config/viewopt.cxx | 2 sw/source/uibase/docvw/HeaderFooterWin.cxx | 6 sw/source/uibase/docvw/PageBreakWin.cxx | 6 sw/source/uibase/frmdlg/colex.cxx | 2 sw/source/uibase/utlui/shdwcrsr.cxx | 2 toolkit/source/awt/vclxwindows.cxx | 2 toolkit/source/helper/formpdfexport.cxx | 12 - tools/source/generic/color.cxx | 6 vcl/backendtest/outputdevice/common.cxx | 6 vcl/headless/svpgdi.cxx | 10 - vcl/inc/quartz/salgdicommon.hxx | 10 + vcl/osx/a11ytextattributeswrapper.mm | 2 vcl/qa/cppunit/BitmapTest.cxx | 86 ++++++------ vcl/qa/cppunit/bitmapcolor.cxx | 32 ++-- vcl/qa/cppunit/canvasbitmaptest.cxx | 4 vcl/qa/cppunit/outdev.cxx | 16 +- vcl/quartz/salgdicommon.cxx | 2 vcl/source/control/combobox.cxx | 2 vcl/source/filter/igif/gifread.cxx | 4 vcl/source/filter/ixbm/xbmread.cxx | 4 vcl/source/filter/ixpm/xpmread.cxx | 4 vcl/source/gdi/alpha.cxx | 2 vcl/source/gdi/bitmap.cxx | 50 +++--- vcl/source/gdi/bitmap3.cxx | 4 vcl/source/gdi/bitmapex.cxx | 2 vcl/source/gdi/gdimtf.cxx | 4 vcl/source/gdi/pdfwriter_impl.cxx | 6 vcl/source/gdi/pngwrite.cxx | 2 vcl/source/outdev/text.cxx | 10 - vcl/source/outdev/textline.cxx | 4 vcl/source/outdev/transparent.cxx | 2 vcl/source/window/decoview.cxx | 2 vcl/source/window/window.cxx | 2 vcl/unx/generic/gdi/gdiimpl.cxx | 4 vcl/unx/generic/gdi/salbmp.cxx | 8 - vcl/workben/vcldemo.cxx | 12 - writerfilter/source/dmapper/ConversionHelper.cxx | 6 writerfilter/source/dmapper/PropertyMap.cxx | 2 writerfilter/source/rtftok/rtfdispatchvalue.cxx | 4 xmloff/source/text/txtexppr.cxx | 2 144 files changed, 478 insertions(+), 449 deletions(-)
New commits: commit e2cb154195fdc2ffccdb6f5e87cae8b29640b3eb Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon Feb 26 17:13:01 2018 +0200 convert COL_ constants to be of type Color Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> 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() ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits