oox/qa/unit/drawingml.cxx                 |    4 ++--
 svx/qa/unit/unodraw.cxx                   |    4 ++--
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |    2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |    6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit b370357b40b55cece8407eea2dc0014a5aec0d17
Author:     varshneydevansh <[email protected]>
AuthorDate: Wed Feb 7 14:23:50 2024 +0530
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Sat Feb 10 11:47:05 2024 +0100

    tdf#141908: replace usage of sal_Int32 with colors
    
    Change-Id: I71d94239c155f41d4535c023ea3aa8f974fcf2da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163082
    Tested-by: Jenkins
    Tested-by: Ilmari Lauhakangas <[email protected]>
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index 6ae4d08f48a6..fa3e39c1bbff 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -378,13 +378,13 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, 
testChartThemeOverride)
                                                         uno::UNO_QUERY);
     uno::Reference<beans::XPropertySet> 
xPortion(xPara->createEnumeration()->nextElement(),
                                                  uno::UNO_QUERY);
-    sal_Int32 nActual{ 0 };
+    Color nActual{ 0 };
     xPortion->getPropertyValue("CharColor") >>= nActual;
     // Without the accompanying fix in place, this test would have failed with:
     // - Expected: 4485828 (0x4472c4)
     // - Actual  : 16711680 (0xff0000)
     // i.e. the text color was red, not blue.
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x4472C4), nActual);
+    CPPUNIT_ASSERT_EQUAL(Color(0x4472C4), nActual);
 }
 
 CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme)
diff --git a/svx/qa/unit/unodraw.cxx b/svx/qa/unit/unodraw.cxx
index a7417356e13a..0d6f35e5c9cd 100644
--- a/svx/qa/unit/unodraw.cxx
+++ b/svx/qa/unit/unodraw.cxx
@@ -120,10 +120,10 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testTableShadowDirect)
     // Without the accompanying fix in place, this test would have failed with 
throwing a
     // beans.UnknownPropertyException, as shadow-as-direct-formatting on 
tables were not possible.
     xShapeProps->setPropertyValue("Shadow", uno::Any(true));
-    sal_Int32 nRed = 0xff0000;
+    Color nRed = COL_LIGHTRED;
     xShapeProps->setPropertyValue("ShadowColor", uno::Any(nRed));
     CPPUNIT_ASSERT(xShapeProps->getPropertyValue("ShadowColor") >>= nRed);
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xff0000), nRed);
+    CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, nRed);
 
     // Add text.
     uno::Reference<table::XCellRange> 
xTable(xShapeProps->getPropertyValue("Model"),
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 9efc4ac15a97..ca81f4373d28 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -763,7 +763,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf88583)
     loadAndReload("tdf88583.odt");
     CPPUNIT_ASSERT_EQUAL(1, getPages());
     CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, 
getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle"));
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), 
getProperty<sal_Int32>(getParagraph(1), "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(Color(0x00cc00), getProperty<Color>(getParagraph(1), 
"FillColor"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf97090, "tdf97090.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index ad3bba49df49..e14177d61e6d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -1289,15 +1289,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf109184, 
"tdf109184.docx")
 
     // Before table background color was white, should be transparent (auto).
     uno::Reference<text::XTextRange> xCell1(xTable->getCellByName("A1"), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), 
getProperty<sal_Int32>(xCell1, "BackColor"));
+    CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xCell1, 
"BackColor"));
 
     // Cell with auto color but with 15% fill, shouldn't be transparent.
     uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xd8d8d8), 
getProperty<sal_Int32>(xCell2, "BackColor"));
+    CPPUNIT_ASSERT_EQUAL(Color(0xd8d8d8), getProperty<Color>(xCell2, 
"BackColor"));
 
     // Cell with color defined (red).
     uno::Reference<text::XTextRange> xCell3(xTable->getCellByName("A2"), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xff0000), 
getProperty<sal_Int32>(xCell3, "BackColor"));
+    CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(xCell3, 
"BackColor"));
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf111964)

Reply via email to