canvas/source/vcl/spritehelper.cxx | 2 - lotuswordpro/qa/cppunit/import_test.cxx | 4 +-- oox/qa/unit/drawingml.cxx | 2 - oox/qa/unit/shape.cxx | 14 ++++------ oox/qa/unit/wpc_drawing_canvas.cxx | 5 ++- sc/qa/extras/macros-test.cxx | 4 +-- sc/qa/unit/SparklineImportExportTest.cxx | 4 +-- sc/qa/unit/screenshots/screenshots.cxx | 2 - sc/qa/unit/subsequent_filters_test2.cxx | 8 +++--- sc/qa/unit/subsequent_filters_test3.cxx | 8 +++--- sc/qa/unit/subsequent_filters_test4.cxx | 8 +++--- sd/qa/unit/activex-controls-tests.cxx | 30 +++++++++++------------ sd/qa/unit/export-tests-ooxml1.cxx | 16 ++++++------ sd/qa/unit/export-tests-ooxml2.cxx | 2 - sd/qa/unit/export-tests-ooxml3.cxx | 2 - sd/qa/unit/export-tests-ooxml4.cxx | 2 - sd/qa/unit/import-tests.cxx | 10 +++---- sd/qa/unit/import-tests2.cxx | 14 +++++----- sd/qa/unit/misc-tests.cxx | 8 +++--- sd/qa/unit/uiimpress.cxx | 6 ++-- sw/qa/core/draw/draw.cxx | 2 - sw/qa/extras/globalfilter/globalfilter.cxx | 4 +-- sw/qa/extras/htmlexport/htmlexport.cxx | 4 +-- sw/qa/extras/odfexport/odfexport.cxx | 8 +++--- sw/qa/extras/odfimport/odfimport.cxx | 4 +-- sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 2 - sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 2 - sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 8 +++--- sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 2 - sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 4 +-- sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 3 -- sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 10 +++---- sw/qa/extras/rtfexport/rtfexport3.cxx | 4 +-- sw/qa/extras/rtfexport/rtfexport5.cxx | 4 +-- sw/qa/extras/uiwriter/uiwriter4.cxx | 4 +-- sw/qa/extras/uiwriter/uiwriter7.cxx | 2 - vcl/qa/cppunit/BackendTest.cxx | 4 +-- vcl/qa/cppunit/BitmapExTest.cxx | 6 ++-- vcl/qa/cppunit/GraphicTest.cxx | 4 +-- vcl/qa/cppunit/bitmapcolor.cxx | 2 - vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 4 +-- vcl/qa/cppunit/gen/gen.cxx | 2 - vcl/qa/cppunit/outdev.cxx | 7 +++-- xmloff/qa/unit/style.cxx | 8 +++--- 44 files changed, 127 insertions(+), 128 deletions(-)
New commits: commit c8b8a2c2cb34a1ae0b0aeee0564b39260258f184 Author: Rafał Dobrakowski <dobrakowskira...@gmail.com> AuthorDate: Thu Feb 15 21:07:59 2024 +0100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Thu Mar 14 02:33:03 2024 +0100 tdf#141908 - CppUnittests: replace usage of sal_Int32 with colors Conversion of hex/dec colour notation (example entry Color( 255, 255, 255), Color(0xFFFFFF) - COL_WHITE) For the other available colour definitions. Change-Id: I9eed0cd64adcbc8d25e1c22143a000906a457586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163729 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index f188526930a0..7b3384c934e7 100644 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.cxx @@ -166,7 +166,7 @@ namespace vclcanvas if( mbShowSpriteBounds ) { // Paint green sprite clip area - rTargetSurface.SetLineColor( Color( 0,255,0 ) ); + rTargetSurface.SetLineColor( COL_LIGHTGREEN ); rTargetSurface.SetFillColor(); rTargetSurface.DrawPolyPolygon(::tools::PolyPolygon(aClipPoly)); // #i76339# diff --git a/lotuswordpro/qa/cppunit/import_test.cxx b/lotuswordpro/qa/cppunit/import_test.cxx index 08d4c1bd39c1..9514395a02df 100644 --- a/lotuswordpro/qa/cppunit/import_test.cxx +++ b/lotuswordpro/qa/cppunit/import_test.cxx @@ -221,7 +221,7 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, paragraphProperties) uno::Reference<beans::XPropertySet> xPropertySet7(xParagraph7, uno::UNO_QUERY); Color nParaBackColor; xPropertySet7->getPropertyValue("ParaBackColor") >>= nParaBackColor; - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), nParaBackColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nParaBackColor); table::BorderLine2 aTopBorder; xPropertySet7->getPropertyValue("TopBorder") >>= aTopBorder; @@ -295,7 +295,7 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, paragraphProperties) uno::Reference<beans::XPropertySet> xPropertySet13(xParagraph13, uno::UNO_QUERY); Color nCharColor; xPropertySet13->getPropertyValue("CharColor") >>= nCharColor; - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), nCharColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, nCharColor); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index fa3e39c1bbff..2a41416e5484 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -304,7 +304,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow) CPPUNIT_ASSERT(bShadow); Color nColor; CPPUNIT_ASSERT(xShape->getPropertyValue("ShadowColor") >>= nColor); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); }; loadFromFile(u"table-shadow.pptx"); // Without the accompanying fix in place, this test would have failed, because shadow on a table diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx index 4119c6c80db8..d0089a556904 100644 --- a/oox/qa/unit/shape.cxx +++ b/oox/qa/unit/shape.cxx @@ -389,8 +389,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork) CPPUNIT_ASSERT_EQUAL(uno::Any(u"mso-spt158"_ustr), aGeoPropMap.getValue(u"Type"_ustr)); // Are properties correctly copied to shape? - CPPUNIT_ASSERT_EQUAL(uno::Any(Color(0, 0, 255)), - xShapeProps->getPropertyValue(u"FillColor"_ustr)); + CPPUNIT_ASSERT_EQUAL(uno::Any(COL_LIGHTBLUE), xShapeProps->getPropertyValue(u"FillColor"_ustr)); CPPUNIT_ASSERT_EQUAL(uno::Any(drawing::FillStyle_SOLID), xShapeProps->getPropertyValue(u"FillStyle"_ustr)); @@ -483,7 +482,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork3) CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x0000ff), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); CPPUNIT_ASSERT_EQUAL(Color(0xf79646), Color(aColorStops[1].getStopColor())); @@ -509,7 +508,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork3) CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.40000000000000002)); CPPUNIT_ASSERT_EQUAL(Color(0xf79646), Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x0000ff), Color(aColorStops[1].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(aColorStops[1].getStopColor())); CPPUNIT_ASSERT_EQUAL(sal_Int16(900), aGradient.Angle); CPPUNIT_ASSERT_EQUAL(sal_Int16(50), aGradient.XOffset); @@ -533,7 +532,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontwork3) CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); CPPUNIT_ASSERT_EQUAL(Color(0xf79646), Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x0000ff), Color(aColorStops[1].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(aColorStops[1].getStopColor())); CPPUNIT_ASSERT_EQUAL(sal_Int16(900), aGradient.Angle); CPPUNIT_ASSERT_EQUAL(sal_Int16(100), aGradient.XOffset); @@ -567,8 +566,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontworkNonAccentColor) uno::Reference<beans::XPropertySet> xShape1Props(xDrawPage->getByIndex(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int16(0)), xShape1Props->getPropertyValue(u"FillColorTheme"_ustr)); - CPPUNIT_ASSERT_EQUAL(uno::Any(Color(255, 0, 0)), - xShape1Props->getPropertyValue(u"FillColor"_ustr)); + CPPUNIT_ASSERT_EQUAL(uno::Any(COL_LIGHTRED), xShape1Props->getPropertyValue(u"FillColor"_ustr)); // background 2 = lt2 = ID 3 uno::Reference<beans::XPropertySet> xShape2Props(xDrawPage->getByIndex(2), uno::UNO_QUERY); @@ -703,7 +701,7 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testImportWordArtGradient) // Transparency is encoded in gray color. CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_GRAY7, Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); CPPUNIT_ASSERT_EQUAL(Color(0x4d4d4d), Color(aColorStops[1].getStopColor())); diff --git a/oox/qa/unit/wpc_drawing_canvas.cxx b/oox/qa/unit/wpc_drawing_canvas.cxx index eadd1a26446b..6c087c473b34 100644 --- a/oox/qa/unit/wpc_drawing_canvas.cxx +++ b/oox/qa/unit/wpc_drawing_canvas.cxx @@ -7,6 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <tools/color.hxx> #include <test/unoapixml_test.hxx> #include <docmodel/color/ComplexColor.hxx> @@ -127,7 +128,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_Glow) CPPUNIT_ASSERT_EQUAL(sal_Int32(564), nGlowEffectRad); // 16 pt = 564.444... mm/100 Color nGlowEffectColor; xShapeProps->getPropertyValue(u"GlowEffectColor"_ustr) >>= nGlowEffectColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFFFF00), nGlowEffectColor); // "Yellow" + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, nGlowEffectColor); sal_Int16 nGlowEffectTransparency = 0; xShapeProps->getPropertyValue(u"GlowEffectTransparency"_ustr) >>= nGlowEffectTransparency; CPPUNIT_ASSERT_EQUAL(sal_Int16(10), nGlowEffectTransparency); // 10% @@ -253,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_Shadow) CPPUNIT_ASSERT_EQUAL(sal_Int32(224), nValue); Color nColor; xShapeProps->getPropertyValue(UNO_NAME_SHADOWCOLOR) >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x808080), nColor); + CPPUNIT_ASSERT_EQUAL(COL_GRAY, nColor); } CPPUNIT_TEST_FIXTURE(TestWPC, WPC_tdf158339_shape_text_in_group) diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 61c7fdad12a5..765c2f1cb715 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -724,7 +724,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf107572) const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem); const Color& rColor = rBackground.GetColor(); - CPPUNIT_ASSERT_EQUAL(Color(0x0, 0x0, 0x80), rColor); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, rColor); } for (SCROW i = 1; i < 13; ++i) @@ -741,7 +741,7 @@ CPPUNIT_TEST_FIXTURE(ScMacrosTest, testTdf107572) const SvxBrushItem& rBackground2 = static_cast<const SvxBrushItem&>(rItem2); const Color& rColor2 = rBackground2.GetColor(); - CPPUNIT_ASSERT_EQUAL(Color(0xcc, 0xcc, 0xcc), rColor2); + CPPUNIT_ASSERT_EQUAL(COL_GRAY3, rColor2); } } diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx index 67b139052c82..d10245949218 100644 --- a/sc/qa/unit/SparklineImportExportTest.cxx +++ b/sc/qa/unit/SparklineImportExportTest.cxx @@ -62,7 +62,7 @@ void checkSparklines(ScDocument& rDocument) CPPUNIT_ASSERT_EQUAL(COL_BLACK, rAttributes.getColorAxis().getFinalColor()); CPPUNIT_ASSERT_EQUAL(COL_BLACK, rAttributes.getColorMarkers().getFinalColor()); CPPUNIT_ASSERT_EQUAL(Color(0x7030a0), rAttributes.getColorFirst().getFinalColor()); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), rAttributes.getColorLast().getFinalColor()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, rAttributes.getColorLast().getFinalColor()); CPPUNIT_ASSERT_EQUAL(Color(0x92d050), rAttributes.getColorHigh().getFinalColor()); CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), rAttributes.getColorLow().getFinalColor()); @@ -91,7 +91,7 @@ void checkSparklines(ScDocument& rDocument) CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Column, rAttributes.getType()); CPPUNIT_ASSERT_EQUAL(Color(0x376092), rAttributes.getColorSeries().getFinalColor()); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), rAttributes.getColorNegative().getFinalColor()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, rAttributes.getColorNegative().getFinalColor()); CPPUNIT_ASSERT_EQUAL(COL_BLACK, rAttributes.getColorAxis().getFinalColor()); CPPUNIT_ASSERT_EQUAL(Color(0xd00000), rAttributes.getColorMarkers().getFinalColor()); CPPUNIT_ASSERT_EQUAL(Color(0x92d050), rAttributes.getColorFirst().getFinalColor()); diff --git a/sc/qa/unit/screenshots/screenshots.cxx b/sc/qa/unit/screenshots/screenshots.cxx index 19e93c95fce7..006556904f88 100644 --- a/sc/qa/unit/screenshots/screenshots.cxx +++ b/sc/qa/unit/screenshots/screenshots.cxx @@ -203,7 +203,7 @@ VclPtr<VclAbstractDialog> ScScreenshotTest::createDialogByID(sal_uInt32 nID) { pReturnDialog = mpFact->CreateScTabBgColorDlg(mpViewShell->GetFrameWeld(), ScResId(SCSTR_SET_TAB_BG_COLOR), - ScResId(SCSTR_NO_TAB_BG_COLOR), Color(0xff00ff) ); + ScResId(SCSTR_NO_TAB_BG_COLOR), COL_LIGHTMAGENTA ); break; } diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index 7f6dae6df6ee..f66a297d39a5 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -837,7 +837,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf130132) const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem); const Color& rColor = rBackground.GetColor(); // background colour is yellow - CPPUNIT_ASSERT_EQUAL(Color(255, 255, 0), rColor); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, rColor); } } @@ -856,7 +856,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf133327) // Without the fix in place, this test would have failed with // - Expected: Color: R:255 G:255 B: 0 // - Actual : Color: R:255 G:255 B: 255 - CPPUNIT_ASSERT_EQUAL(Color(255, 255, 0), rColor); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, rColor); } CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testColumnStyle2XLSX) @@ -1313,9 +1313,9 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testBackgroundColorStandardXLSXML) const std::vector<Check> aChecks = { { 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("Red"), COL_WHITE, COL_LIGHTRED }, { OUString("Orange"), COL_WHITE, Color(255, 192, 0) }, - { OUString("Yellow"), COL_WHITE, Color(255, 255, 0) }, + { OUString("Yellow"), COL_WHITE, COL_YELLOW }, { 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) }, diff --git a/sc/qa/unit/subsequent_filters_test3.cxx b/sc/qa/unit/subsequent_filters_test3.cxx index b30a9b40eccf..fdf1602b5512 100644 --- a/sc/qa/unit/subsequent_filters_test3.cxx +++ b/sc/qa/unit/subsequent_filters_test3.cxx @@ -77,7 +77,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testBorderColorsXLSXML) const editeng::SvxBorderLine* pLine = pPat->GetItem(ATTR_BORDER).GetRight(); CPPUNIT_ASSERT(pLine); CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, pLine->GetBorderLineStyle()); - CPPUNIT_ASSERT_EQUAL(Color(255, 0, 0), pLine->GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, pLine->GetColor()); // B4 - blue pPat = pDoc->GetPattern(ScAddress(1, 3, 0)); @@ -102,7 +102,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testBorderColorsXLSXML) pLine = pPat->GetItem(ATTR_BORDER).GetLeft(); CPPUNIT_ASSERT(pLine); CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, pLine->GetBorderLineStyle()); - CPPUNIT_ASSERT_EQUAL(Color(255, 255, 0), pLine->GetColor()); // yellow + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, pLine->GetColor()); pLine = pPat->GetItem(ATTR_BORDER).GetRight(); CPPUNIT_ASSERT(pLine); @@ -1706,7 +1706,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf129789) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_HATCH, rStyleItemK2.GetValue()); const XFillHatchItem& rHatchItem = pCaptionK2->GetMergedItem(XATTR_FILLHATCH); - CPPUNIT_ASSERT_EQUAL(Color(0x000080), rHatchItem.GetHatchValue().GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, rHatchItem.GetHatchValue().GetColor()); SdrCaptionObj* const pCaptionK9 = checkCaption(*pDoc, ScAddress(10, 8, 0), false); @@ -1714,7 +1714,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf129789) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_HATCH, rStyleItemK9.GetValue()); const XFillHatchItem& rHatchItem2 = pCaptionK9->GetMergedItem(XATTR_FILLHATCH); - CPPUNIT_ASSERT_EQUAL(Color(0x000080), rHatchItem2.GetHatchValue().GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, rHatchItem2.GetHatchValue().GetColor()); } { diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx index 91f1a43c1186..d9019a04c8fa 100644 --- a/sc/qa/unit/subsequent_filters_test4.cxx +++ b/sc/qa/unit/subsequent_filters_test4.cxx @@ -1124,7 +1124,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface) pBoxItem = static_cast<const SvxBoxItem*>(pItem); CPPUNIT_ASSERT_EQUAL(COL_BLACK, pBoxItem->GetLeft()->GetColor()); - CPPUNIT_ASSERT_EQUAL(Color(255, 0, 0), pBoxItem->GetRight()->GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, pBoxItem->GetRight()->GetColor()); CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, pBoxItem->GetLeft()->GetBorderLineStyle()); CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, pBoxItem->GetRight()->GetBorderLineStyle()); ASSERT_DOUBLES_EQUAL_MESSAGE("Error with left width", 0, pBoxItem->GetLeft()->GetWidth()); @@ -1232,7 +1232,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface) pStyleSheet->GetItemSet().HasItem(ATTR_FONT_COLOR, &pItem)); const SvxColorItem* pFontColorItem = static_cast<const SvxColorItem*>(pItem); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font Color", Color(128, 128, 128), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font Color", COL_GRAY, pFontColorItem->GetValue()); CPPUNIT_ASSERT_MESSAGE("Style Name6 : Doesn't have Attribute Underline, but it should have.", @@ -1241,8 +1241,8 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface) const SvxUnderlineItem* pUnderlineItem = static_cast<const SvxUnderlineItem*>(pItem); CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font Underline Style", LINESTYLE_SINGLE, pUnderlineItem->GetLineStyle()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font Underline Color", - Color(128, 128, 128), pUnderlineItem->GetColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name6 :Error with Font Underline Color", COL_GRAY, + pUnderlineItem->GetColor()); /* Test for Style Name "7" * Has strikethrough single diff --git a/sd/qa/unit/activex-controls-tests.cxx b/sd/qa/unit/activex-controls-tests.cxx index 44e4257cd5b5..0fff05795482 100644 --- a/sd/qa/unit/activex-controls-tests.cxx +++ b/sd/qa/unit/activex-controls-tests.cxx @@ -169,14 +169,14 @@ void SdActiveXControlsTest::testLabelProperties() CPPUNIT_ASSERT_EQUAL(Color(0xE0E0E0), nColor); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x0000FF), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, nColor); xPropertySet->getPropertyValue("Border") >>= nBorderStyle; CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nBorderStyle); Color nBorderColor; xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor; - CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), nBorderColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, nBorderColor); xPropertySet->getPropertyValue("Align") >>= nAlign; CPPUNIT_ASSERT_EQUAL(sal_Int16(awt::TextAlign::CENTER), nAlign); @@ -382,7 +382,7 @@ void SdActiveXControlsTest::testSpinButtonProperties() CPPUNIT_ASSERT_EQUAL(false, bEnabled); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFFFF00), nColor); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, nColor); xPropertySet->getPropertyValue("SpinValueMax") >>= nMax; CPPUNIT_ASSERT_EQUAL(sal_Int32(320), nMax); @@ -400,7 +400,7 @@ void SdActiveXControlsTest::testSpinButtonProperties() CPPUNIT_ASSERT_EQUAL(sal_Int32(123), nDelay); xPropertySet->getPropertyValue("SymbolColor") >>= nArrowColor; - CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), nArrowColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, nArrowColor); xPropertySet->getPropertyValue("Orientation") >>= nOrientation; CPPUNIT_ASSERT_EQUAL(sal_Int32(awt::ScrollBarOrientation::VERTICAL), nOrientation); @@ -465,7 +465,7 @@ void SdActiveXControlsTest::testCommandButtonProperties() CPPUNIT_ASSERT_EQUAL(true, bMultiLine); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x0000FF), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, nColor); xPropertySet->getPropertyValue("TextColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0xFFFF80), nColor); @@ -548,10 +548,10 @@ void SdActiveXControlsTest::testScrollBarProperties() CPPUNIT_ASSERT_EQUAL(false, bEnabled); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x00FFFF), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTCYAN, nColor); xPropertySet->getPropertyValue("SymbolColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); xPropertySet->getPropertyValue("RepeatDelay") >>= nDelay; CPPUNIT_ASSERT_EQUAL(sal_Int32(230), nDelay); @@ -645,7 +645,7 @@ void SdActiveXControlsTest::testCheckBoxProperties() CPPUNIT_ASSERT_EQUAL(false, bEnabled); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); xPropertySet->getPropertyValue("TextColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0xFF80FF), nColor); @@ -732,10 +732,10 @@ void SdActiveXControlsTest::testOptionButtonProperties() CPPUNIT_ASSERT_EQUAL(false, bEnabled); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x00FFFF), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTCYAN, nColor); xPropertySet->getPropertyValue("TextColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); xPropertySet->getPropertyValue("MultiLine") >>= bMultiLine; CPPUNIT_ASSERT_EQUAL(false, bMultiLine); @@ -826,7 +826,7 @@ void SdActiveXControlsTest::testComboBoxProperties() CPPUNIT_ASSERT_EQUAL(false, bEnabled); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x800000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_RED, nColor); xPropertySet->getPropertyValue("TextColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(COL_WHITE, nColor); @@ -930,16 +930,16 @@ void SdActiveXControlsTest::testListBoxProperties() CPPUNIT_ASSERT_EQUAL(false, bEnabled); xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFFFF00), nColor); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, nColor); xPropertySet->getPropertyValue("TextColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); xPropertySet->getPropertyValue("Border") >>= nBorderStyle; CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nBorderStyle); xPropertySet->getPropertyValue("BorderColor") >>= nBorderColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF00FF), nBorderColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTMAGENTA, nBorderColor); xPropertySet->getPropertyValue("MultiSelection") >>= bMultiSelection; CPPUNIT_ASSERT_EQUAL(true, bMultiSelection); @@ -1017,7 +1017,7 @@ void SdActiveXControlsTest::testToggleButtonProperties() CPPUNIT_ASSERT_EQUAL(Color(0xFF80FF), nColor); xPropertySet->getPropertyValue("TextColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0x808080), nColor); + CPPUNIT_ASSERT_EQUAL(COL_GRAY, nColor); xPropertySet->getPropertyValue("Toggle") >>= bToggle; CPPUNIT_ASSERT_EQUAL(true, bToggle); diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 895623514c3c..48e760edfc51 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -413,7 +413,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc887230) // Without the fix in place, this test would have failed with //- Expected: 255 //- Actual : 13421823 - checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR); + checkFontAttributes<Color, SvxColorItem>(pObj, COL_LIGHTBLUE, EE_CHAR_COLOR); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_1) @@ -428,14 +428,14 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_1) // First shape has red, bold font { const SdrTextObj* pObj = DynCastSdrTextObj(pPage->GetObj(0)); - checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xff0000), EE_CHAR_COLOR); + checkFontAttributes<Color, SvxColorItem>(pObj, COL_LIGHTRED, EE_CHAR_COLOR); checkFontAttributes<FontWeight, SvxWeightItem>(pObj, WEIGHT_BOLD, EE_CHAR_WEIGHT); } // Second shape has blue, italic font { const SdrTextObj* pObj = DynCastSdrTextObj(pPage->GetObj(1)); - checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR); + checkFontAttributes<Color, SvxColorItem>(pObj, COL_LIGHTBLUE, EE_CHAR_COLOR); checkFontAttributes<FontItalic, SvxPostureItem>(pObj, ITALIC_NORMAL, EE_CHAR_ITALIC); } } @@ -454,7 +454,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_2) const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(0)); CPPUNIT_ASSERT(pObjGroup); const SdrTextObj* pObj = DynCastSdrTextObj(pObjGroup->GetSubList()->GetObj(1)); - checkFontAttributes<Color, SvxColorItem>(pObj, Color(0x0000ff), EE_CHAR_COLOR); + checkFontAttributes<Color, SvxColorItem>(pObj, COL_LIGHTBLUE, EE_CHAR_COLOR); } // Second smart art has "dk2" font color (style) @@ -470,7 +470,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc870233_2) const SdrObjGroup* pObjGroup = dynamic_cast<SdrObjGroup*>(pPage->GetObj(2)); CPPUNIT_ASSERT(pObjGroup); const SdrTextObj* pObj = DynCastSdrTextObj(pObjGroup->GetSubList()->GetObj(1)); - checkFontAttributes<Color, SvxColorItem>(pObj, Color(0xffffff), EE_CHAR_COLOR); + checkFontAttributes<Color, SvxColorItem>(pObj, COL_WHITE, EE_CHAR_COLOR); } } @@ -686,14 +686,14 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBnc880763) const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(1); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( - Color(0x0000ff), + COL_LIGHTBLUE, (static_cast<const XColorItem&>(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue()); // Second object at the front has green background color pObj = pPage->GetObj(1); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( - Color(0x00ff00), + COL_LIGHTGREEN, (static_cast<const XColorItem&>(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue()); } @@ -956,7 +956,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testBulletColor) const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); CPPUNIT_ASSERT(pNumFmt); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's color is wrong!", Color(0xff0000), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's color is wrong!", COL_LIGHTRED, pNumFmt->GetNumRule().GetLevel(0).GetBulletColor()); } diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 8c51a1a06b9f..ee8d9998fe83 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1036,7 +1036,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf105739) CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); CPPUNIT_ASSERT_EQUAL(Color(0x00b050), Color(aColorStops[1].getStopColor())); CPPUNIT_ASSERT_EQUAL(int(awt::GradientStyle_LINEAR), static_cast<int>(aFillGradient.Style)); diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 106073c47816..a64f90df8dd6 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -440,7 +440,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf111789) CPPUNIT_ASSERT_EQUAL(static_cast<double>(274), fShadowDist); Color nColor; xShape->getPropertyValue("ShadowColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nColor); sal_Int32 nTransparency = 0; xShape->getPropertyValue("ShadowTransparence") >>= nTransparency; CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7), nTransparency); diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index 50146d6b5e19..be6b86f88b88 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -349,7 +349,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127379) CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); CPPUNIT_ASSERT_EQUAL(Color(0x2a6099), Color(aColorStops[1].getStopColor())); } diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 428b282fcef3..a1353eadcecf 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -824,7 +824,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testHyperlinkColor) // Hyperlink colors should be blue, red, green. CPPUNIT_ASSERT_EQUAL(Color(0x4472c4), nCharColorBlue); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), nCharColorRed); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nCharColorRed); CPPUNIT_ASSERT_EQUAL(Color(0x548235), nCharColorGreen); } @@ -1359,7 +1359,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testPredefinedTableStyle) xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillColor") >>= nColor; - CPPUNIT_ASSERT_EQUAL(Color(0xcccccc), nColor); + CPPUNIT_ASSERT_EQUAL(COL_GRAY3, nColor); xCell.set(xTable->getCellByPosition(0, 2), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillColor") >>= nColor; @@ -1524,7 +1524,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testBnc904423) const XFillStyleItem& rStyleItem = pObj->GetMergedItem(XATTR_FILLSTYLE); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue()); const XFillColorItem& rColorItem = pObj->GetMergedItem(XATTR_FILLCOLOR); - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), rColorItem.GetColorValue()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, rColorItem.GetColorValue()); } } @@ -1544,7 +1544,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testShapeLineStyle) CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_DASH, rStyleItem.GetValue()); const XLineColorItem& rColorItem = pObj->GetMergedItem(XATTR_LINECOLOR); - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), rColorItem.GetColorValue()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, rColorItem.GetColorValue()); const XLineWidthItem& rWidthItem = pObj->GetMergedItem(XATTR_LINEWIDTH); CPPUNIT_ASSERT_EQUAL(sal_Int32(132), rWidthItem.GetValue()); @@ -1884,7 +1884,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf127129) // Without the accompanying fix in place, the highlight would be -1 Color nCharBackColor; xPropSet->getPropertyValue("CharBackColor") >>= nCharBackColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF00), nCharBackColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, nCharBackColor); } CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf93097) { diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 564006b02d32..bf3cfee14dad 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -343,7 +343,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf103876) // Check character color Color nCharColor; xShape->getPropertyValue("CharColor") >>= nCharColor; - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), nCharColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nCharColor); } CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf79007) @@ -488,7 +488,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf104015) const XFillStyleItem& rStyleItem = pObj->GetMergedItem(XATTR_FILLSTYLE); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue()); const XFillColorItem& rColorItem = pObj->GetMergedItem(XATTR_FILLCOLOR); - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), rColorItem.GetColorValue()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, rColorItem.GetColorValue()); } // Should have a blue line { @@ -496,7 +496,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf104015) CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, rStyleItem.GetValue()); const XLineColorItem& rColorItem = pObj->GetMergedItem(XATTR_LINECOLOR); - CPPUNIT_ASSERT_EQUAL(Color(0x0000FF), rColorItem.GetColorValue()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, rColorItem.GetColorValue()); } // Should have some shadow { @@ -521,7 +521,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf104201) const XFillStyleItem& rStyleItem = pObj->GetMergedItem(XATTR_FILLSTYLE); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue()); const XFillColorItem& rColorItem = pObj->GetMergedItem(XATTR_FILLCOLOR); - CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), rColorItem.GetColorValue()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, rColorItem.GetColorValue()); } // Second shape has blue fill, but this should be overwritten by green group fill { @@ -530,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf104201) const XFillStyleItem& rStyleItem = pObj->GetMergedItem(XATTR_FILLSTYLE); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rStyleItem.GetValue()); const XFillColorItem& rColorItem = pObj->GetMergedItem(XATTR_FILLCOLOR); - CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), rColorItem.GetColorValue()); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, rColorItem.GetColorValue()); } } @@ -645,8 +645,8 @@ bool checkPatternValues(std::vector<sal_uInt8>& rExpected, Bitmap& rBitmap) { bool bResult = true; - const Color aFGColor(0xFF0000); - const Color aBGColor(0xFFFFFF); + const Color aFGColor(COL_LIGHTRED); + const Color aBGColor(COL_WHITE); BitmapScopedReadAccess pAccess(rBitmap); for (tools::Long y = 0; y < pAccess->Height(); ++y) diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index 342f720a6e6e..69cd0205dc4d 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -273,8 +273,8 @@ void SdMiscTest::testFillGradient() uno::Reference<beans::XPropertySet> xPropSet(xShape1, uno::UNO_QUERY_THROW); // Set FillStyle and FillGradient awt::Gradient aGradient; - aGradient.StartColor = sal_Int32(Color(255, 0, 0)); - aGradient.EndColor = sal_Int32(Color(0, 255, 0)); + aGradient.StartColor = sal_Int32(COL_LIGHTRED); + aGradient.EndColor = sal_Int32(COL_LIGHTGREEN); xPropSet->setPropertyValue("FillStyle", uno::Any(drawing::FillStyle_GRADIENT)); xPropSet->setPropertyValue("FillGradient", uno::Any(aGradient)); // Add the rectangle to the page. @@ -296,9 +296,9 @@ void SdMiscTest::testFillGradient() CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(aColorStops[0].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(aColorStops[1].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, Color(aColorStops[1].getStopColor())); } void SdMiscTest::testTdf44774() diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index d03e85dab6c8..4d92f892065f 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -807,7 +807,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillColor) CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, eXFS); Color aColor = rPageAttr.GetItem(XATTR_FILLCOLOR)->GetColorValue(); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), aColor); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, aColor); } CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillGradient) @@ -841,9 +841,9 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillGradient) CPPUNIT_ASSERT_EQUAL(size_t(2), rColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(rColorStops[0].getStopOffset(), 0.0)); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(rColorStops[0].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(rColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(rColorStops[1].getStopOffset(), 1.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x0000ff), Color(rColorStops[1].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(rColorStops[1].getStopColor())); } CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf134053) diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx index 0cb50649a652..3879a0642e3c 100644 --- a/sw/qa/core/draw/draw.cxx +++ b/sw/qa/core/draw/draw.cxx @@ -134,7 +134,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(127), nBorderWidth); // Without patch it failed with Expected Color: R:0 G:0 B:255 A:0, Actual Color: R:0 G:0 B:0 A:0. // Default border color was used. - CPPUNIT_ASSERT_EQUAL(Color(0x0000ff), Color(ColorTransparency, aBorder.Color)); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTBLUE, Color(ColorTransparency, aBorder.Color)); } CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testSdtTextboxHeader) diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 92f1fbc3a878..79b9d71c7265 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -2185,7 +2185,7 @@ void Test::testDateFormFieldCharacterFormatting() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 3), "CharWeight")); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_AUTO, getProperty<Color>(getRun(getParagraph(1), 3), "CharColor")); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), awt::FontWeight::NORMAL, getProperty<float>(getRun(getParagraph(1), 4), "CharWeight")); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), Color(0xff0000), getProperty<Color>(getRun(getParagraph(1), 4), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_LIGHTRED, getProperty<Color>(getRun(getParagraph(1), 4), "CharColor")); } else { @@ -2210,7 +2210,7 @@ void Test::testDateFormFieldCharacterFormatting() CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_AUTO, getProperty<Color>(xTextPortion, "CharColor")); xTextPortion.set(xContentControlEnum->nextElement(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), awt::FontWeight::NORMAL, getProperty<float>(xTextPortion, "CharWeight")); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), Color(0xff0000), getProperty<Color>(xTextPortion, "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_LIGHTRED, getProperty<Color>(xTextPortion, "CharColor")); } } } diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 9ac7b8f35e12..54b803fc6fbb 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -2284,13 +2284,13 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testTableBackground) /*nRowsToRepeat=*/0); pWrtShell->InsertTable(aInsertTableOptions, /*nRows=*/1, /*nCols=*/1); pWrtShell->MoveTable(GotoPrevTable, fnTableStart); - SvxBrushItem aBrush(Color(0xff0000), RES_BACKGROUND); + SvxBrushItem aBrush(COL_LIGHTRED, RES_BACKGROUND); pWrtShell->SetTabBackground(aBrush); pWrtShell->Down(/*bSelect=*/false); pWrtShell->SplitNode(); pWrtShell->InsertTable(aInsertTableOptions, /*nRows=*/2, /*nCols=*/1); pWrtShell->MoveTable(GotoPrevTable, fnTableStart); - aBrush.SetColor(0x00ff00); + aBrush.SetColor(COL_LIGHTGREEN); pWrtShell->SetRowBackground(aBrush); pWrtShell->Down(/*bSelect=*/false); // Second row has an explicit transparent background. diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 3ae06a8d109b..032ce1760d88 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -794,7 +794,7 @@ DECLARE_ODFEXPORT_TEST(testTextframeGradient, "textframe-gradient.odt") CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aColorStops[0].getStopColor())); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 1.0)); - CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(aColorStops[1].getStopColor())); + CPPUNIT_ASSERT_EQUAL(COL_GRAY7, Color(aColorStops[1].getStopColor())); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); } @@ -2621,7 +2621,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles4) uno::Reference<beans::XPropertySet> xCell1Style; xTableStyle->getByName("first-row-start-column") >>= xCell1Style; - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(xCell1Style, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty<Color>(xCell1Style, "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, testTableStyles5) @@ -2676,7 +2676,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129568) // Test that export doesn't fail, and that style is imported and in use. uno::Reference<style::XStyle> xStyle(getStyles("CellStyles")->getByName("Default Style.1"), uno::UNO_QUERY); CPPUNIT_ASSERT(xStyle->isInUse()); - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), getProperty<Color>(xStyle, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getProperty<Color>(xStyle, "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, testTdf129568ui) @@ -2685,7 +2685,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf129568ui) // Same as above, but styles referenced by UI name. uno::Reference<style::XStyle> xStyle(getStyles("CellStyles")->getByName("Default Style.1"), uno::UNO_QUERY); CPPUNIT_ASSERT(xStyle->isInUse()); - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), getProperty<Color>(xStyle, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getProperty<Color>(xStyle, "BackColor")); } DECLARE_ODFEXPORT_TEST(testTdf132642_keepWithNextTable, "tdf132642_keepWithNextTable.odt") diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 355f4611686b..82d73ab5b8dc 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -647,7 +647,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo75872_aoo40) createSwDoc("fdo75872_aoo40.odt"); // graphics default style: line color and fill color changed uno::Reference<drawing::XShape> xShape = getShape(1); - CPPUNIT_ASSERT_EQUAL(Color(0x808080), + CPPUNIT_ASSERT_EQUAL(COL_GRAY, getProperty<Color>(xShape, "LineColor")); CPPUNIT_ASSERT_EQUAL(Color(0xcfe7f5), getProperty<Color>(xShape, "FillColor")); @@ -945,7 +945,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96113) { createSwDoc("tdf96113.odt"); // Background of the formula frame was white (0xffffff), not green. - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(getShape(1), "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty<Color>(getShape(1), "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, testFdo47267) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ca81f4373d28..38c1313155b1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -414,7 +414,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableStyleCellBackColor, "table-style-cell-back-col uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); // This was 0xffffff. - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty<Color>(xCell, "BackColor")); } DECLARE_OOXMLEXPORT_TEST(testTableStyleBorder, "table-style-border.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 005dd52b07d7..045638f01b63 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -840,7 +840,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf152310, "ColorOverwritten.docx") { uno::Reference<text::XText> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(getParagraphOfText(1, xShape), "CharColor")); CPPUNIT_ASSERT_EQUAL(Color(0x00b050), getProperty<Color>(getParagraphOfText(2, xShape), "CharColor")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 72072bc5bb03..f847c56361f1 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -585,7 +585,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); aGradient = getProperty<awt::Gradient2>(xFrame, "FillGradient"); CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, aGradient.StartColor)); - CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(ColorTransparency, aGradient.EndColor)); + CPPUNIT_ASSERT_EQUAL(COL_GRAY7, Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); // Left / right margin was incorrect: the attribute was missing and we @@ -796,7 +796,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo56679, "fdo56679.docx") uno::Reference< text::XTextRange > xText = getRun( xParagraph, 2, "This is a simple sentence."); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xText, "CharUnderlineHasColor")); - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), getProperty<Color>(xText, "CharUnderlineColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(xText, "CharUnderlineColor")); } DECLARE_OOXMLEXPORT_TEST(testFdo65400, "fdo65400.docx") @@ -965,7 +965,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo60990) uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText(); uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText); CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); - CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), getProperty<Color>(getRun(xParagraph, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty<Color>(getRun(xParagraph, 1), "CharColor")); } DECLARE_OOXMLEXPORT_TEST(testFdo65718, "fdo65718.docx") @@ -1106,7 +1106,7 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") { uno::Reference<drawing::XShape> xPicture = getShape(1); sal_Int16 nShadowTransparence = getProperty<sal_Int16>(xPicture, "ShadowTransparence"); - CPPUNIT_ASSERT_EQUAL(Color(0x808080), getProperty<Color>(xPicture, "ShadowColor")); + CPPUNIT_ASSERT_EQUAL(COL_GRAY, getProperty<Color>(xPicture, "ShadowColor")); CPPUNIT_ASSERT_EQUAL(sal_Int16(50), nShadowTransparence); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 2b87533b51b9..d772d8917fb4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -339,7 +339,7 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar5, "calendar5.docx") uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); // text portions with direct formatting CPPUNIT_ASSERT_EQUAL(Color(0x2E74B5), getProperty<Color>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor")); - CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), getProperty<Color>(getRun(getParagraphOfText(1, xCell->getText()), 2), "CharColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(getRun(getParagraphOfText(1, xCell->getText()), 2), "CharColor")); // default paragraph text color CPPUNIT_ASSERT_EQUAL(Color(0x5B9BD5), getProperty<Color>(getRun(getParagraphOfText(1, xCell->getText()), 3), "CharColor")); // text portions with direct formatting diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index a7f63f811b2a..2e33d4cbc424 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -836,7 +836,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation) sal_Int32 nLineColor = getXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr"_ostr, "val"_ostr).toInt32(16); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(ColorTransparency, nLineColor)); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, Color(ColorTransparency, nLineColor)); // check direct line type assignments have been preserved sal_Int32 nLineWidth = getXPath(pXmlDocument, @@ -860,7 +860,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation) CPPUNIT_ASSERT_EQUAL(Color(0x00b050), getProperty<Color>(xShape3, "FillColor")); CPPUNIT_ASSERT_EQUAL(Color(0x3a5f8b), getProperty<Color>(xShape1, "LineColor")); CPPUNIT_ASSERT_EQUAL(Color(0x4f6228), getProperty<Color>(xShape2, "LineColor")); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), getProperty<Color>(xShape3, "LineColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(xShape3, "LineColor")); // check line properties are properly applied to shapes on import CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty<drawing::LineStyle>(xShape1, "LineStyle")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 4ab893ab2483..614c0faf4c46 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -1075,8 +1075,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo46361, "fdo46361.docx") static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>( getParagraphOfText(1, xTextBox->getText()), "ParaAdjust"))); // This was BLACK - CPPUNIT_ASSERT_EQUAL( - Color(0x008000), + CPPUNIT_ASSERT_EQUAL(COL_GREEN, getProperty<Color>(getRun(getParagraphOfText(1, xTextBox->getText()), 1), "CharColor")); // Count the paragraphs diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index e14177d61e6d..0a914500b526 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -840,11 +840,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.doc uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Footnote Characters"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( Color(0x00FF00), getProperty<Color>(xPageStyle, "CharColor")); + CPPUNIT_ASSERT_EQUAL( COL_LIGHTGREEN, getProperty<Color>(xPageStyle, "CharColor")); xPageStyle.set(getStyles("CharacterStyles")->getByName("Footnote anchor"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( Color(0x00FF00), getProperty<Color>(xPageStyle, "CharColor")); + CPPUNIT_ASSERT_EQUAL( COL_LIGHTGREEN, getProperty<Color>(xPageStyle, "CharColor")); //tdf#118361 - in RTL locales, the footnote separator should still be left aligned. uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); @@ -859,7 +859,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx" xEndnotes->getByIndex(0) >>= xEndnote; // character properties were previously not assigned to the footnote/endnote in-text anchor. CPPUNIT_ASSERT_EQUAL( 24.0f, getProperty< float >(xEndnote->getAnchor(), "CharHeight") ); - CPPUNIT_ASSERT_EQUAL( Color(0xFF0000), getProperty<Color>(xEndnote->getAnchor(), "CharColor")); + CPPUNIT_ASSERT_EQUAL( COL_LIGHTRED, getProperty<Color>(xEndnote->getAnchor(), "CharColor")); uno::Reference<text::XText> xEndnoteText; xEndnotes->getByIndex(0) >>= xEndnoteText; @@ -869,11 +869,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx" uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Endnote Characters"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( Color(0xFF00FF), getProperty<Color>(xPageStyle, "CharColor")); + CPPUNIT_ASSERT_EQUAL( COL_LIGHTMAGENTA, getProperty<Color>(xPageStyle, "CharColor")); xPageStyle.set(getStyles("CharacterStyles")->getByName("Endnote anchor"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( Color(0xFF00FF), getProperty<Color>(xPageStyle, "CharColor")); + CPPUNIT_ASSERT_EQUAL( COL_LIGHTMAGENTA, getProperty<Color>(xPageStyle, "CharColor")); } CPPUNIT_TEST_FIXTURE(Test, testTdf55427_footnote2endnote) diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 263af642b39f..25dfdab95973 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -93,7 +93,7 @@ DECLARE_RTFEXPORT_TEST(testTdf108949_footnote, "tdf108949_footnote.rtf") uno::Reference<text::XFootnote> xFootnote; xFootnotes->getByIndex(0) >>= xFootnote; // The color of the footnote anchor was black (0x000000) - CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote Character color", Color(0xFF0000), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote Character color", COL_LIGHTRED, getProperty<Color>(xFootnote->getAnchor(), "CharColor")); } @@ -294,7 +294,7 @@ DECLARE_RTFEXPORT_TEST(testTdf112520, "tdf112520.docx") return; // Assert that the white shape is on top of the yellow one. - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), getProperty<Color>(getShape(2), "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getProperty<Color>(getShape(2), "FillColor")); CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(2), "AnchorType")); CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<Color>(getShape(3), "FillColor")); diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 37bcf66149af..18ff21848af8 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -552,9 +552,9 @@ DECLARE_RTFEXPORT_TEST(testShpzDhgt, "shpz-dhgt.rtf") { // Test that shpz has priority over dhgt and not the other way around. // Drawpage is sorted by ZOrder, so first should be red (back). - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), getProperty<Color>(getShape(1), "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(getShape(1), "FillColor")); // Second (front) should be green. - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(getShape(2), "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTGREEN, getProperty<Color>(getShape(2), "FillColor")); } DECLARE_RTFEXPORT_TEST(testLevelfollow, "levelfollow.rtf") diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index 98fcbcae2225..7757ceb9701e 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -1147,7 +1147,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableStyleUndo) sal_Int32 nStyleCount = pDoc->GetTableStyles().size(); SwTableAutoFormat* pStyle = pDoc->MakeTableStyle("Test Style"); - SvxBrushItem aBackground(Color(0xFF00FF), RES_BACKGROUND); + SvxBrushItem aBackground(COL_LIGHTMAGENTA, RES_BACKGROUND); pStyle->GetBoxFormat(0).SetBackground(aBackground); CPPUNIT_ASSERT_EQUAL(sal_Int32(pDoc->GetTableStyles().size()), nStyleCount + 1); @@ -1179,7 +1179,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTableStyleUndo) CPPUNIT_ASSERT(bool(pStyle->GetBoxFormat(0).GetBackground() == aBackground)); SwTableAutoFormat aNewStyle("Test Style2"); - SvxBrushItem aBackground2(Color(0x00FF00), RES_BACKGROUND); + SvxBrushItem aBackground2(COL_LIGHTGREEN, RES_BACKGROUND); aNewStyle.GetBoxFormat(0).SetBackground(aBackground2); pDoc->ChgTableStyle("Test Style", aNewStyle); diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 16afe5f205c0..fe873d8cfb3b 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -1739,7 +1739,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTableBackgroundColor) //Checking cells for background color only A1 should be modified uno::Reference<table::XCell> xCell; xCell = xTable->getCellByName("A1"); - CPPUNIT_ASSERT_EQUAL(Color(0xFF00FF), getProperty<Color>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTMAGENTA, getProperty<Color>(xCell, "BackColor")); xCell = xTable->getCellByName("A2"); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xCell, "BackColor")); xCell = xTable->getCellByName("A3"); diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx index c1aefba502d2..a90a96e3110e 100644 --- a/vcl/qa/cppunit/BackendTest.cxx +++ b/vcl/qa/cppunit/BackendTest.cxx @@ -665,7 +665,7 @@ public: aMatrix.scale(16, 16); device->DrawTransformedBitmapEx(aMatrix, aBitmapEx, 0.5); BitmapEx result = device->GetBitmapEx(Point(0, 0), Size(16, 16)); - CPPUNIT_ASSERT_EQUAL(Color(0x80, 0x80, 0x80), result.GetPixelColor(0, 0)); + CPPUNIT_ASSERT_EQUAL(COL_GRAY, result.GetPixelColor(0, 0)); CPPUNIT_ASSERT_EQUAL(COL_WHITE, result.GetPixelColor(15, 15)); // Draw rotated and move to the bottom-left corner. device->Erase(); @@ -676,7 +676,7 @@ public: device->DrawTransformedBitmapEx(aMatrix, aBitmapEx, 0.5); result = device->GetBitmap(Point(0, 0), Size(16, 16)); CPPUNIT_ASSERT_EQUAL(COL_WHITE, result.GetPixelColor(0, 0)); - CPPUNIT_ASSERT_EQUAL(Color(0x80, 0x80, 0x80), result.GetPixelColor(0, 15)); + CPPUNIT_ASSERT_EQUAL(COL_GRAY, result.GetPixelColor(0, 15)); } void testClipRectangle() diff --git a/vcl/qa/cppunit/BitmapExTest.cxx b/vcl/qa/cppunit/BitmapExTest.cxx index 9b40df6cafbe..56b91afe5049 100644 --- a/vcl/qa/cppunit/BitmapExTest.cxx +++ b/vcl/qa/cppunit/BitmapExTest.cxx @@ -206,11 +206,11 @@ void BitmapExTest::testCombineMaskOr() AlphaMask aAlphaBitmap(Size(3, 3)); { BitmapScopedWriteAccess pWriteAccess(aAlphaBitmap); - pWriteAccess->Erase(Color(0xff, 0xff, 0xff)); + pWriteAccess->Erase(COL_WHITE); for (int i = 1; i < 3; ++i) { - pWriteAccess->SetPixel(i, 0, Color(0x00, 0x00, 0x00)); - pWriteAccess->SetPixel(i, 1, Color(0x80, 0x80, 0x80)); + pWriteAccess->SetPixel(i, 0, COL_BLACK); + pWriteAccess->SetPixel(i, 1, COL_GRAY); pWriteAccess->SetPixel(i, 0, Color(0xef, 0xef, 0xef)); } } diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index 557ac41df2ef..f3ec0cdcb566 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -132,12 +132,12 @@ bool checkBitmap(Graphic& rGraphic) { sal_uInt32 nIndex = pReadAccess->GetPixelIndex(y, x); Color aColor = pReadAccess->GetPaletteColor(nIndex); - bResult &= (aColor == Color(0xff, 0x00, 0x00)); + bResult &= (aColor == COL_LIGHTRED); } else { Color aColor = pReadAccess->GetPixel(y, x); - bResult &= (aColor == Color(0xff, 0x00, 0x00)); + bResult &= (aColor == COL_LIGHTRED); } } } diff --git a/vcl/qa/cppunit/bitmapcolor.cxx b/vcl/qa/cppunit/bitmapcolor.cxx index 3c3f60931aff..cd981c70c538 100644 --- a/vcl/qa/cppunit/bitmapcolor.cxx +++ b/vcl/qa/cppunit/bitmapcolor.cxx @@ -125,7 +125,7 @@ void BitmapColorTest::colorClassConstructor() } { - BitmapColor aBmpColor(Color(255, 255, 255)); + BitmapColor aBmpColor(COL_WHITE); CPPUNIT_ASSERT_EQUAL_MESSAGE("Red wrong", static_cast<sal_uInt8>(255), aBmpColor.GetRed()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Green wrong", static_cast<sal_uInt8>(255), diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx index 991f202cefe1..a8f7ffd0ea1a 100644 --- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx +++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx @@ -165,8 +165,8 @@ void BitmapRenderTest::testDrawAlphaBitmapEx() pVDev->DrawBitmapEx(Point(), aBitmapEx); - CPPUNIT_ASSERT_EQUAL(Color(0xFF, 0xFF, 0xFF), pVDev->GetPixel(Point(0, 0))); - CPPUNIT_ASSERT_EQUAL(Color(0xFF, 0xFF, 0x00), pVDev->GetPixel(Point(1, 1))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0, 0))); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, pVDev->GetPixel(Point(1, 1))); #if defined(_WIN32) || defined(MACOSX) || defined(IOS) // sometimes on Windows we get rounding error in blending so let's ignore this on Windows for now. diff --git a/vcl/qa/cppunit/gen/gen.cxx b/vcl/qa/cppunit/gen/gen.cxx index bcef6c16b57f..6be7abb68098 100644 --- a/vcl/qa/cppunit/gen/gen.cxx +++ b/vcl/qa/cppunit/gen/gen.cxx @@ -64,7 +64,7 @@ CPPUNIT_TEST_FIXTURE(GenTest, testTdf107966) aMapMode.SetMapUnit(MapUnit::MapTwip); pVirtualDevice->SetMapMode(aMapMode); pVirtualDevice->SetOutputSizePixel(Size(90, 15)); - pVirtualDevice->SetFillColor(Color(255, 255, 255)); + pVirtualDevice->SetFillColor(COL_WHITE); pVirtualDevice->DrawRect(tools::Rectangle(Point(), Size(1350, 225))); pVirtualDevice->SetFillColor(COL_BLACK); AntialiasingFlags nOldAA = pVirtualDevice->GetAntialiasing(); diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 12f1dea4e582..491869f8af0d 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -7,6 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <tools/color.hxx> #include <test/bootstrapfixture.hxx> #include <test/outputdevice.hxx> @@ -486,7 +487,7 @@ CPPUNIT_TEST_FIXTURE(VclOutdevTest, testDefaultFillColor) aMtf.Record(pVDev.get()); CPPUNIT_ASSERT(pVDev->IsFillColor()); - CPPUNIT_ASSERT_EQUAL(Color(0xFF, 0xFF, 0xFF), pVDev->GetFillColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetFillColor()); pVDev->SetFillColor(); CPPUNIT_ASSERT(!pVDev->IsFillColor()); @@ -507,7 +508,7 @@ CPPUNIT_TEST_FIXTURE(VclOutdevTest, testTransparentFillColor) aMtf.Record(pVDev.get()); CPPUNIT_ASSERT(pVDev->IsFillColor()); - CPPUNIT_ASSERT_EQUAL(Color(0xFF, 0xFF, 0xFF), pVDev->GetFillColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetFillColor()); pVDev->SetFillColor(COL_TRANSPARENT); CPPUNIT_ASSERT(!pVDev->IsFillColor()); @@ -528,7 +529,7 @@ CPPUNIT_TEST_FIXTURE(VclOutdevTest, testFillColor) aMtf.Record(pVDev.get()); CPPUNIT_ASSERT(pVDev->IsFillColor()); - CPPUNIT_ASSERT_EQUAL(Color(0xFF, 0xFF, 0xFF), pVDev->GetFillColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetFillColor()); pVDev->SetFillColor(COL_RED); CPPUNIT_ASSERT(pVDev->IsFillColor()); diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx index eef9200bd855..5da0c51d73ea 100644 --- a/xmloff/qa/unit/style.cxx +++ b/xmloff/qa/unit/style.cxx @@ -379,12 +379,12 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_OldToNew) { awt::ColorStop aColorStop = aColorStopSeq[0]; CPPUNIT_ASSERT_EQUAL(0.0, aColorStop.StopOffset); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), asColor(aColorStop.StopColor)); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, asColor(aColorStop.StopColor)); } { awt::ColorStop aColorStop = aColorStopSeq[1]; CPPUNIT_ASSERT_EQUAL(1.0, aColorStop.StopOffset); - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), asColor(aColorStop.StopColor)); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, asColor(aColorStop.StopColor)); } } @@ -506,7 +506,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_threeStops) { awt::ColorStop aColorStop = aColorStopSeq[0]; CPPUNIT_ASSERT_EQUAL(0.0, aColorStop.StopOffset); - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), asColor(aColorStop.StopColor)); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, asColor(aColorStop.StopColor)); } { awt::ColorStop aColorStop = aColorStopSeq[1]; @@ -516,7 +516,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_threeStops) { awt::ColorStop aColorStop = aColorStopSeq[2]; CPPUNIT_ASSERT_EQUAL(1.0, aColorStop.StopOffset); - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), asColor(aColorStop.StopColor)); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, asColor(aColorStop.StopColor)); } }