diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-26 17:13:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-28 07:34:27 +0100 |
commit | e2cb154195fdc2ffccdb6f5e87cae8b29640b3eb (patch) | |
tree | 7c3d53d78e0867aa879b98d84211d1e73602520f /sw/qa | |
parent | 0ea41fea75cd1ac1d81fa57c4411e75a6b4001f0 (diff) |
convert COL_ constants to be of type Color
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48
Reviewed-on: https://gerrit.libreoffice.org/50373
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/mailmerge/mailmerge.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport2.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 4 |
10 files changed, 19 insertions, 13 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 07f46710825c..1d1529b1aa63 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -929,6 +929,12 @@ inline void assertBorderEqual( #define CPPUNIT_ASSERT_BORDER_EQUAL(aExpected, aActual) \ assertBorderEqual( aExpected, aActual, CPPUNIT_SOURCELINE() ) \ +inline std::ostream& operator<<(std::ostream& rStrm, const Color& rColor) +{ + rStrm << "Color: R:" << static_cast<int>(rColor.GetRed()) << " G:" << static_cast<int>(rColor.GetGreen()) << " B: " << static_cast<int>(rColor.GetBlue()); + return rStrm; +} + #endif // INCLUDED_SW_QA_EXTRAS_INC_SWMODELTESTBASE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 0a0f40bb4cf3..d961216fb8a8 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -401,7 +401,7 @@ DECLARE_FILE_MAILMERGE_TEST(testMissingDefaultLineColor, "missing-default-line-c CPPUNIT_ASSERT( xDefaults.is()); uno::Reference< beans::XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo()); CPPUNIT_ASSERT( xInfo->hasPropertyByName( "LineColor" )); - sal_uInt32 lineColor; + Color lineColor; xDefaults->getPropertyValue( "LineColor" ) >>= lineColor; // And the default value is black (wasn't copied properly by mailmerge). CPPUNIT_ASSERT_EQUAL( COL_BLACK, lineColor ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 81bf7d99600d..4960c87bd9d0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -46,7 +46,7 @@ protected: DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") { CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); - CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor"))); } DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index dfb0a118ebfb..d796e58e88ee 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -1028,7 +1028,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaShadow, "para-shadow.docx") { // The problem was that in w:pBdr, child elements had a w:shadow attribute, but that was ignored. table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); // w:sz="48" is in eights of a point, 1 pt is 20 twips. CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(24/8*20)), aShadow.ShadowWidth); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 0303237aece2..bfab921a26ae 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -153,7 +153,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") width: any -> border width */ { const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } @@ -163,7 +163,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt") { uno::Reference<beans::XPropertySet> xMiddleRun(getRun(getParagraph(2),2), uno::UNO_QUERY); const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xMiddleRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 8bb8f3ecf4b5..9cd5aff5546f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -946,7 +946,7 @@ DECLARE_OOXMLEXPORT_TEST(testPageBorderShadow, "page-border-shadow.docx") { // The problem was that in w:pgBorders, child elements had a w:shadow attribute, but that was ignored. table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getStyles("PageStyles")->getByName("Standard"), "ShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); // w:sz="48" is in eights of a point, 1 pt is 20 twips. CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(48/8*20)), aShadow.ShadowWidth); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 2e5dd994b01b..cd0b7d962f45 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -697,7 +697,7 @@ DECLARE_RTFEXPORT_TEST(testParaShadow, "para-shadow.rtf") // The problem was that \brdrsh was ignored. table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(60)), aShadow.ShadowWidth); } @@ -739,7 +739,7 @@ DECLARE_RTFEXPORT_TEST(testCharacterBorder, "charborder.odt") { const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index a83ba3916674..06b46172cbd2 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -969,7 +969,7 @@ DECLARE_RTFEXPORT_TEST(testDoDhgtOld, "do-dhgt-old.rtf") xShape.set(getShape(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder")); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<sal_uInt32>(xShape, "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(getProperty<sal_uInt32>(xShape, "FillColor"))); xShape.set(getShape(3), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xShape, "ZOrder")); @@ -982,7 +982,7 @@ DECLARE_RTFEXPORT_TEST(testFdo61909, "fdo61909.rtf") // Was the Writer default font. CPPUNIT_ASSERT_EQUAL(OUString("Courier New"), getProperty<OUString>(xTextRange, "CharFontName")); - CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(xTextRange, "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xTextRange, "CharBackColor"))); } DECLARE_RTFEXPORT_TEST(testFdo62288, "fdo62288.rtf") diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index b7c2160aaa05..d6838d8acf89 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -4085,7 +4085,7 @@ void SwUiWriterTest::testTdf87922() // Make sure that automatic color on black background is white, not black. vcl::Font aFont; aDrawTextInfo.ApplyAutoColor(&aFont); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, aFont.GetColor().GetColor()); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, aFont.GetColor()); } #if HAVE_MORE_FONTS diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index f3ad01808c09..d5a84b2b1ded 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -764,7 +764,7 @@ DECLARE_WW8EXPORT_TEST(testFdo45724, "fdo45724.odt") // The text and background color of the control shape was not correct. uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY); uno::Reference<form::validation::XValidatableFormComponent> xComponent(xControlShape->getControl(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<sal_uInt32>(xComponent, "BackgroundColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(getProperty<sal_uInt32>(xComponent, "BackgroundColor"))); CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get<OUString>()); } @@ -867,7 +867,7 @@ DECLARE_WW8EXPORT_TEST(testCharacterBorder, "charborder.odt") width: any -> border width */ { const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xRun, "CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(aShadow.Color)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(318), aShadow.ShadowWidth); } |