chart2/qa/extras/chart2import.cxx | 2 +- oox/CppunitTest_oox_drawingml.mk | 1 + oox/qa/unit/drawingml.cxx | 4 ++-- sc/qa/unit/SparklineImportExportTest.cxx | 6 +++--- sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-)
New commits: commit aa5e2b24ebca3b36becf77e466eb1702e1f97301 Author: Nalini Prasad Dash <nnnalinid...@protonmail.com> AuthorDate: Sun Oct 23 22:18:40 2022 +0530 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Mon Nov 7 09:58:04 2022 +0100 tdf#141908 - CppUnittests: replace usage of sal_Int32 with colors Change-Id: Icdf2a5e7c0bd738f2cffbc0b7e99b1bd90a6dcce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141685 Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 57c8837df36b..b707b91d8c6d 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -801,7 +801,7 @@ void Chart2ImportTest::testBnc889755() awt::Gradient aTransparence; xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; CPPUNIT_ASSERT(aTransparence.StartColor != aTransparence.EndColor); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), aTransparence.StartColor); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, aTransparence.StartColor)); } void Chart2ImportTest::testBnc882383() diff --git a/oox/CppunitTest_oox_drawingml.mk b/oox/CppunitTest_oox_drawingml.mk index 4523acc4aa3d..1e47063cc3b6 100644 --- a/oox/CppunitTest_oox_drawingml.mk +++ b/oox/CppunitTest_oox_drawingml.mk @@ -26,6 +26,7 @@ $(eval $(call gb_CppunitTest_use_libraries,oox_drawingml, \ sal \ subsequenttest \ test \ + tl \ unotest \ utl \ )) diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index 6150e4499eed..5c0b17e192f6 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -183,11 +183,11 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testGradientMultiStepTransparency) xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; // Without the accompanying fix in place, this test would have failed with: - // - Expected: 16777215 (0xffffff) + // - Expected: 16777215 (COL_WHITE) // - Actual : 3487029 (0x353535) // i.e. the end transparency was not 100%, but was 21%, leading to an unexpected visible line on // the right of this shape. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), aTransparence.EndColor); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, aTransparence.EndColor)); } CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testShapeTextAlignment) diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx index 63302f79f361..e659a5af217a 100644 --- a/sc/qa/unit/SparklineImportExportTest.cxx +++ b/sc/qa/unit/SparklineImportExportTest.cxx @@ -60,8 +60,8 @@ void checkSparklines(ScDocument& rDocument) CPPUNIT_ASSERT_EQUAL(Color(0x376092), rAttributes.getColorSeries()); CPPUNIT_ASSERT_EQUAL(Color(0x00b050), rAttributes.getColorNegative()); - CPPUNIT_ASSERT_EQUAL(Color(0x000000), rAttributes.getColorAxis()); - CPPUNIT_ASSERT_EQUAL(Color(0x000000), rAttributes.getColorMarkers()); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, rAttributes.getColorAxis()); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, rAttributes.getColorMarkers()); CPPUNIT_ASSERT_EQUAL(Color(0x7030a0), rAttributes.getColorFirst()); CPPUNIT_ASSERT_EQUAL(Color(0xff0000), rAttributes.getColorLast()); CPPUNIT_ASSERT_EQUAL(Color(0x92d050), rAttributes.getColorHigh()); @@ -93,7 +93,7 @@ void checkSparklines(ScDocument& rDocument) CPPUNIT_ASSERT_EQUAL(Color(0x376092), rAttributes.getColorSeries()); CPPUNIT_ASSERT_EQUAL(Color(0xff0000), rAttributes.getColorNegative()); - CPPUNIT_ASSERT_EQUAL(Color(0x000000), rAttributes.getColorAxis()); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, rAttributes.getColorAxis()); CPPUNIT_ASSERT_EQUAL(Color(0xd00000), rAttributes.getColorMarkers()); CPPUNIT_ASSERT_EQUAL(Color(0x92d050), rAttributes.getColorFirst()); CPPUNIT_ASSERT_EQUAL(Color(0x00b0f0), rAttributes.getColorLast()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index aa6fc8406b96..bd1c93cafedd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -586,7 +586,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") xFrame.set(getShape(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(Color(0x000000), Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, aGradient.StartColor)); CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style);