sc/qa/unit/subsequent_filters_test4.cxx |    2 +-
 sd/qa/unit/activex-controls-tests.cxx   |    5 +++--
 sd/qa/unit/export-tests-ooxml1.cxx      |    5 +++--
 sd/qa/unit/export-tests-ooxml4.cxx      |    5 +++--
 sd/qa/unit/import-tests.cxx             |   13 +++++++------
 sd/qa/unit/import-tests2.cxx            |    3 ++-
 sw/qa/extras/odfexport/odfexport.cxx    |    3 ++-
 sw/qa/extras/rtfexport/rtfexport.cxx    |    2 +-
 vcl/qa/cppunit/bitmapcolor.cxx          |    3 ++-
 vcl/qa/cppunit/gen/gen.cxx              |    3 ++-
 xmloff/qa/unit/style.cxx                |    3 ++-
 11 files changed, 28 insertions(+), 19 deletions(-)

New commits:
commit 72f1800ad2f3717192287ae2678e8209e66e35d1
Author:     Rafał Dobrakowski <dobrakowskira...@gmail.com>
AuthorDate: Thu Feb 15 20:08:38 2024 +0100
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Mar 13 07:19:03 2024 +0100

    tdf#141908 - CppUnittests: replace usage of sal_Int32 with colors
    
    Conversion of only one colour, Color(0, 0, 0), Color(0x000000) - COL_BLACK
    
    Change-Id: I4ba2412929522532d32304734b0269c70d75e5ae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163460
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sc/qa/unit/subsequent_filters_test4.cxx 
b/sc/qa/unit/subsequent_filters_test4.cxx
index d82267c9feca..91f1a43c1186 100644
--- a/sc/qa/unit/subsequent_filters_test4.cxx
+++ b/sc/qa/unit/subsequent_filters_test4.cxx
@@ -1123,7 +1123,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, 
testOrcusODSStyleInterface)
                            pStyleSheet->GetItemSet().HasItem(ATTR_BORDER, 
&pItem));
 
     pBoxItem = static_cast<const SvxBoxItem*>(pItem);
-    CPPUNIT_ASSERT_EQUAL(Color(0, 0, 0), pBoxItem->GetLeft()->GetColor());
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, pBoxItem->GetLeft()->GetColor());
     CPPUNIT_ASSERT_EQUAL(Color(255, 0, 0), pBoxItem->GetRight()->GetColor());
     CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::SOLID, 
pBoxItem->GetLeft()->GetBorderLineStyle());
     CPPUNIT_ASSERT_EQUAL(SvxBorderLineStyle::DOTTED, 
pBoxItem->GetRight()->GetBorderLineStyle());
diff --git a/sd/qa/unit/activex-controls-tests.cxx 
b/sd/qa/unit/activex-controls-tests.cxx
index ec40a5981f80..44e4257cd5b5 100644
--- a/sd/qa/unit/activex-controls-tests.cxx
+++ b/sd/qa/unit/activex-controls-tests.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "sdmodeltestbase.hxx"
+#include <tools/color.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/drawing/XControlShape.hpp>
@@ -90,12 +91,12 @@ void SdActiveXControlsTest::testBackgroundColor()
         0xECE9D8, // Button Face
         0xACA899, // Button Shadow
         0xACA899, // Disabled Text
-        0x000000, // Button Text
+        COL_BLACK, // Button Text
         0xD8E4F8, // Inactive Title Bar Text
         0xFFFFFF, // Button Highlight
         0x716F64, // Button Dark Shadow
         0xF1EFE2, // Button Light Shadow
-        0x000000, // Tooltip Text
+        COL_BLACK, // Tooltip Text
         0xFFFFE1, // Tooltip
         0xFF0000, // Custom red color
     };
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 99b78e468d72..895623514c3c 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -9,6 +9,7 @@
 
 #include <officecfg/Office/Common.hxx>
 #include "sdmodeltestbase.hxx"
+#include <tools/color.hxx>
 #include <Outliner.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/editobj.hxx>
@@ -1246,9 +1247,9 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest1, testTdf94238)
     // was incorrect.
     CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
     CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 
0.0));
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), 
Color(aColorStops[0].getStopColor()));
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aColorStops[0].getStopColor()));
     CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 
0.39000000000000001));
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), 
Color(aColorStops[1].getStopColor()));
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aColorStops[1].getStopColor()));
     CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[2].getStopOffset(), 
1.0));
     CPPUNIT_ASSERT_EQUAL(Color(0x8b8b8b), 
Color(aColorStops[2].getStopColor()));
 }
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index 4c1e2ad1bccd..50146d6b5e19 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "sdmodeltestbase.hxx"
+#include <tools/color.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/editobj.hxx>
@@ -315,9 +316,9 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127372)
 
     CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
     CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 
0.0));
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), 
Color(aColorStops[0].getStopColor()));
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aColorStops[0].getStopColor()));
     CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[1].getStopOffset(), 
1.0));
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), 
Color(aColorStops[1].getStopColor()));
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aColorStops[1].getStopColor()));
 }
 
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf127379)
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index bd98d1191b72..428b282fcef3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -10,6 +10,7 @@
 #include <config_poppler.h>
 
 #include "sdmodeltestbase.hxx"
+#include <tools/color.hxx>
 
 #include <editeng/eeitem.hxx>
 #include <editeng/editobj.hxx>
@@ -228,7 +229,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle)
     xRunPropSet->getPropertyValue("CharColor") >>= nCharColor;
     xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight;
     xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine;
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor);
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, nCharColor);
     CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("The bottom border is missing!", true, 
aBorderLine.LineWidth > 0);
 
@@ -238,7 +239,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle)
     xRunPropSet.set(xRun, uno::UNO_QUERY_THROW);
     xRunPropSet->getPropertyValue("CharColor") >>= nCharColor;
     xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight;
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor);
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, nCharColor);
     CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight);
 
     xCellPropSet.set(xTable->getCellByPosition(2, 0), uno::UNO_QUERY_THROW);
@@ -247,7 +248,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle)
     xRunPropSet.set(xRun, uno::UNO_QUERY_THROW);
     xRunPropSet->getPropertyValue("CharColor") >>= nCharColor;
     xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight;
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor);
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, nCharColor);
     CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight);
 
     xCellPropSet.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW);
@@ -257,7 +258,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle)
     xRunPropSet->getPropertyValue("CharColor") >>= nCharColor;
     xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight;
     xCellPropSet->getPropertyValue("FillColor") >>= nFillColor;
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor);
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, nCharColor);
     CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight);
     CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor);
 
@@ -268,7 +269,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle)
     xRunPropSet->getPropertyValue("CharColor") >>= nCharColor;
     xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight;
     xCellPropSet->getPropertyValue("FillColor") >>= nFillColor;
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor);
+    CPPUNIT_ASSERT_EQUAL(COL_BLACK, nCharColor);
     CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight);
     CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor);
 }
@@ -948,7 +949,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testN862510_4)
         {
             const SvxColorItem* pC = dynamic_cast<const 
SvxColorItem*>((*it).pAttr);
             CPPUNIT_ASSERT_MESSAGE("gradfill for text color not handled!",
-                                   !(pC && pC->GetValue() == Color(0)));
+                                   !(pC && pC->GetValue() == COL_BLACK));
         }
     }
 }
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 242fe82ea1bf..564006b02d32 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -10,6 +10,7 @@
 #include <sdpage.hxx>
 
 #include "sdmodeltestbase.hxx"
+#include <tools/color.hxx>
 
 #include <editeng/eeitem.hxx>
 #include <editeng/editobj.hxx>
@@ -545,7 +546,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf103477)
     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(0x000000),
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Bullet's color is wrong!", COL_BLACK,
                                  
pNumFmt->GetNumRule().GetLevel(1).GetBulletColor());
 }
 
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index dbebd8b8b755..3ae06a8d109b 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <tools/color.hxx>
 #include <algorithm>
 #include <memory>
 #include <swmodeltestbase.hxx>
@@ -791,7 +792,7 @@ DECLARE_ODFEXPORT_TEST(testTextframeGradient, 
"textframe-gradient.odt")
 
     CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size());
     CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 
0.0));
-    CPPUNIT_ASSERT_EQUAL(Color(0x000000), 
Color(aColorStops[0].getStopColor()));
+    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(awt::GradientStyle_AXIAL, aGradient.Style);
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 4ef9ebc9e8f3..ac196f7bf5bf 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -632,7 +632,7 @@ DECLARE_RTFEXPORT_TEST(testTextframeGradient, 
"textframe-gradient.rtf")
     const Color aColA(0xd99594);
     const Color aColB(0xc0504d);
     const Color aColC(0x666666);
-    const Color aColD(0x000000);
+    const Color aColD(COL_BLACK);
 
     CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style);
     CPPUNIT_ASSERT_EQUAL(aColB, Color(ColorTransparency, 
aGradient.StartColor));
diff --git a/vcl/qa/cppunit/bitmapcolor.cxx b/vcl/qa/cppunit/bitmapcolor.cxx
index f62e19dabcd5..3c3f60931aff 100644
--- a/vcl/qa/cppunit/bitmapcolor.cxx
+++ b/vcl/qa/cppunit/bitmapcolor.cxx
@@ -18,6 +18,7 @@
  */
 
 // bootstrap stuff
+#include <tools/color.hxx>
 #include <test/bootstrapfixture.hxx>
 
 #include <vcl/BitmapColor.hxx>
@@ -101,7 +102,7 @@ void BitmapColorTest::colorValueConstructor()
 void BitmapColorTest::colorClassConstructor()
 {
     {
-        BitmapColor aBmpColor(Color(0, 0, 0));
+        BitmapColor aBmpColor(COL_BLACK);
 
         CPPUNIT_ASSERT_EQUAL_MESSAGE("Red wrong", static_cast<sal_uInt8>(0), 
aBmpColor.GetRed());
         CPPUNIT_ASSERT_EQUAL_MESSAGE("Green wrong", static_cast<sal_uInt8>(0),
diff --git a/vcl/qa/cppunit/gen/gen.cxx b/vcl/qa/cppunit/gen/gen.cxx
index 56a9d5b6ea19..bcef6c16b57f 100644
--- a/vcl/qa/cppunit/gen/gen.cxx
+++ b/vcl/qa/cppunit/gen/gen.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <tools/color.hxx>
 #include <test/unoapi_test.hxx>
 
 #include <sfx2/objsh.hxx>
@@ -65,7 +66,7 @@ CPPUNIT_TEST_FIXTURE(GenTest, testTdf107966)
     pVirtualDevice->SetOutputSizePixel(Size(90, 15));
     pVirtualDevice->SetFillColor(Color(255, 255, 255));
     pVirtualDevice->DrawRect(tools::Rectangle(Point(), Size(1350, 225)));
-    pVirtualDevice->SetFillColor(Color(0, 0, 0));
+    pVirtualDevice->SetFillColor(COL_BLACK);
     AntialiasingFlags nOldAA = pVirtualDevice->GetAntialiasing();
     pVirtualDevice->SetAntialiasing(nOldAA & ~AntialiasingFlags::Enable);
 
diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx
index f8dbecfea033..eef9200bd855 100644
--- a/xmloff/qa/unit/style.cxx
+++ b/xmloff/qa/unit/style.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <tools/color.hxx>
 #include <sal/config.h>
 
 #include <test/unoapixml_test.hxx>
@@ -443,7 +444,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, 
testMCGR_OldToNew_opacity)
     {
         awt::ColorStop aColorStop = aColorStopSeq[1];
         CPPUNIT_ASSERT_EQUAL(1.0, aColorStop.StopOffset);
-        CPPUNIT_ASSERT_EQUAL(Color(0x000000), asColor(aColorStop.StopColor));
+        CPPUNIT_ASSERT_EQUAL(COL_BLACK, asColor(aColorStop.StopColor));
     }
 }
 

Reply via email to