sw/qa/extras/ooxmlexport/ooxmlexport.cxx  |    2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx |    4 ++--
 sw/qa/extras/rtfexport/rtfexport.cxx      |    3 +--
 sw/qa/extras/rtfexport/rtfexport3.cxx     |    6 ++----
 sw/qa/extras/rtfexport/rtfexport5.cxx     |    4 ++--
 5 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 00937d1207394433970a4711fa4f51b072341290
Author:     Tushar Jham <jhamtusha...@gmail.com>
AuthorDate: Mon Mar 7 22:59:23 2022 +0530
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Mar 16 19:37:41 2022 +0100

    tdf#141908:CppUnittests: replace usage of sal_Int32 with Color
    
    Change-Id: I8ce73250da932d2c308a93a9268170ba9a120301
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131125
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 7ff6b11f1baa..1e5a00d25bfb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -890,7 +890,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97090, "tdf97090.docx")
     uno::Reference<beans::XPropertySet> 
paragraphProperties(paraEnum->nextElement(), uno::UNO_QUERY);
     assert( paragraphProperties.is() );
     CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, 
getProperty<drawing::FillStyle>(paragraphProperties, "FillStyle"));
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff), 
getProperty<sal_Int32>(paragraphProperties, "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(Color(0xffffff), 
getProperty<Color>(paragraphProperties, "FillColor"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf89791, "tdf89791.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index a8ecf1e0fa3f..3d0b23f9e71e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -185,9 +185,9 @@ xray image.FillColor
 */
     uno::Reference<drawing::XShape> image = getShape(1);
     uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
-    sal_Int32 fillColor;
+    Color fillColor;
     imageProperties->getPropertyValue( "FillColor" ) >>= fillColor;
-    CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor );
+    CPPUNIT_ASSERT_EQUAL( Color( 0xc0504d ), fillColor );
 }
 
 DECLARE_OOXMLEXPORT_TEST(testN747461, "n747461.docx")
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 9ae339bc8907..2b824d83a71e 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1001,8 +1001,7 @@ DECLARE_RTFEXPORT_TEST(testTdf108955, "tdf108955.rtf")
     CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID,
                          getProperty<drawing::FillStyle>(getParagraph(1), 
"FillStyle"));
     // This was 0xffffff, i.e. non-white background was overwritten from the 
paragraph style.
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffff99),
-                         getProperty<sal_Int32>(getParagraph(1), "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(Color(0xffff99), getProperty<Color>(getParagraph(1), 
"FillColor"));
 }
 
 DECLARE_RTFEXPORT_TEST(testTdf80708, "tdf80708.rtf")
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx 
b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 3e95b14793c4..7f6c3fc4d30e 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -264,12 +264,10 @@ DECLARE_RTFEXPORT_TEST(testTdf112520, "tdf112520.docx")
         return;
 
     // Assert that the white shape is on top of the yellow one.
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffff00),
-                         getProperty<sal_Int32>(getShape(2), "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(Color(0xffff00), getProperty<Color>(getShape(2), 
"FillColor"));
     CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,
                          getProperty<text::TextContentAnchorType>(getShape(2), 
"AnchorType"));
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffff),
-                         getProperty<sal_Int32>(getShape(3), "FillColor"));
+    CPPUNIT_ASSERT_EQUAL(Color(0xffffff), getProperty<Color>(getShape(3), 
"FillColor"));
     // Without the accompanying fix in place, this test would have failed with
     // 'expected: 4, actual: 2'.
     // This means the draw page was 0/at-char/white, 1/at-char/yellow, 
2/at-page/white,
diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx 
b/sw/qa/extras/rtfexport/rtfexport5.cxx
index d29c34514d07..c7aa87f7838d 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -71,8 +71,8 @@ DECLARE_RTFEXPORT_TEST(testFdo63023, "fdo63023.rtf")
         getStyles("PageStyles")->getByName("Standard"), "HeaderText");
     // Back color was black (0) in the header, due to missing color table in 
the substream.
     CPPUNIT_ASSERT_EQUAL(
-        sal_Int32(0xFFFF99),
-        getProperty<sal_Int32>(getRun(getParagraphOfText(1, xHeaderText), 1), 
"CharBackColor"));
+        Color(0xFFFF99),
+        getProperty<Color>(getRun(getParagraphOfText(1, xHeaderText), 1), 
"CharBackColor"));
 }
 
 DECLARE_RTFEXPORT_TEST(testFdo42109, "fdo42109.rtf")

Reply via email to