sw/qa/extras/globalfilter/globalfilter.cxx | 12 ++--- sw/qa/extras/odfexport/odfexport.cxx | 62 +++++++++++++---------------- sw/qa/extras/odfimport/odfimport.cxx | 15 ++----- sw/qa/extras/rtfexport/rtfexport.cxx | 9 +--- sw/qa/extras/rtfexport/rtfexport2.cxx | 16 ++----- sw/qa/extras/rtfexport/rtfexport3.cxx | 24 ++++------- sw/qa/extras/rtfexport/rtfexport4.cxx | 20 ++++----- sw/qa/extras/rtfexport/rtfexport5.cxx | 26 ++++-------- sw/qa/extras/uiwriter/uiwriter7.cxx | 3 - sw/qa/extras/ww8export/ww8export3.cxx | 6 +- 10 files changed, 81 insertions(+), 112 deletions(-)
New commits: commit e506bf303c830e974e3b9972887d2c5ec0dbf480 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Mar 28 13:48:02 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Mar 28 22:15:26 2022 +0200 sw: use getProperty<Color> when possible Change-Id: I50339493b0034667e9cd317940102b13066f901c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132203 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 2490f071ea37..d330384ae4ac 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -691,19 +691,19 @@ void Test::testCharHighlightODF() switch (i) { case 1: // non-transparent highlight - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(64), getProperty<sal_Int32>(xRun, "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x000040), getProperty<Color>(xRun, "CharBackColor")); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xRun, "CharBackTransparent")); break; case 2: // transparent backcolor - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_TRANSPARENT), getProperty<sal_Int32>(xRun, "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xRun, "CharBackColor")); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xRun, "CharBackTransparent")); break; case 3: // non-transparent backcolor - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(128), getProperty<sal_Int32>(xRun, "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_BLUE, getProperty<Color>(xRun, "CharBackColor")); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xRun, "CharBackTransparent")); break; case 4: // non-transparent highlight again - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(64), getProperty<sal_Int32>(xRun, "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x000040), getProperty<Color>(xRun, "CharBackColor")); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xRun, "CharBackTransparent")); break; } @@ -1781,9 +1781,9 @@ void Test::testDateFormFieldCharacterFormatting() // We have one date field, first half of the field has bold character weight and second part has red character color CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 3), "CharWeight")); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_AUTO, Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraph(1), 3), "CharColor"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_AUTO, getProperty<Color>(getRun(getParagraph(1), 3), "CharColor")); CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), awt::FontWeight::NORMAL, getProperty<float>(getRun(getParagraph(1), 4), "CharWeight")); - CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), Color(0xff0000), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraph(1), 4), "CharColor"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), Color(0xff0000), getProperty<Color>(getRun(getParagraph(1), 4), "CharColor")); } } diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 4a033f80687d..9b3159fd347a 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -372,17 +372,17 @@ DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt") //Frame 2 xTextFrame = getShape(2); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xTextFrame, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x006600), Color(ColorTransparency, getProperty<util::Color>(xTextFrame, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x006600), getProperty<Color>(xTextFrame, "FillColor")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xTextFrame, "FillTransparence")); //Frame 3 xTextFrame = getShape(3); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xTextFrame, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x006600), Color(ColorTransparency, getProperty<util::Color>(xTextFrame, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x006600), getProperty<Color>(xTextFrame, "FillColor")); CPPUNIT_ASSERT_EQUAL(sal_Int32(45), getProperty<sal_Int32>(xTextFrame, "FillTransparence")); //Frame 4 xTextFrame = getShape(4); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xTextFrame, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x579D1C), Color(ColorTransparency, getProperty<util::Color>(xTextFrame, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x579D1C), getProperty<Color>(xTextFrame, "FillColor")); aGradientxTextFrame = getProperty<awt::Gradient>(xTextFrame, "FillTransparenceGradient"); CPPUNIT_ASSERT_EQUAL(css::awt::GradientStyle_LINEAR, aGradientxTextFrame.Style); //Frame 5 @@ -648,15 +648,15 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt") uno::Reference<container::XNameAccess> xStyles(getStyles("FrameStyles")); uno::Reference<beans::XPropertySet> xStyle(xStyles->getByName("encarts"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0xffcc99), Color(ColorTransparency, getProperty<sal_Int32>(xStyle, "BackColorRGB"))); + CPPUNIT_ASSERT_EQUAL(Color(0xffcc99), getProperty<Color>(xStyle, "BackColorRGB")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xStyle, "BackColorTransparency")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0xffcc99), Color(ColorTransparency, getProperty<sal_Int32>(xStyle, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xffcc99), getProperty<Color>(xStyle, "FillColor")); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle, "FillTransparence")); uno::Reference<beans::XPropertySet> xFrameStyle2(xStyles->getByName("Untitled1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(xFrameStyle2, "BackColorRGB"))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<Color>(xFrameStyle2, "BackColorRGB")); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xFrameStyle2, "BackTransparent")); CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(xFrameStyle2, "BackColorTransparency")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xFrameStyle2, "FillStyle")); @@ -676,41 +676,41 @@ DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt") uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles")); uno::Reference<beans::XPropertySet> xStyle1(xParaStyles->getByName( "Titre Avis expert"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle1, "ParaBackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), getProperty<Color>(xStyle1, "ParaBackColor")); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle1, "ParaBackTransparent")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle1, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle1, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), getProperty<Color>(xStyle1, "FillColor")); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle1, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(xStyle1, "CharColor"))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<Color>(xStyle1, "CharColor")); uno::Reference<beans::XPropertySet> xStyle2(xParaStyles->getByName( "Avis expert questions"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, Color(ColorTransparency, getProperty<sal_Int32>(xStyle2, "ParaBackColor"))); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xStyle2, "ParaBackColor")); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle2, "ParaBackTransparent")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xStyle2, "FillStyle")); // unfortunately this is actually the pool default value, which would be hard to fix - but it isn't a problem because style is NONE // CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle2, "FillColor")); // CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle2, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle2, "CharColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), getProperty<Color>(xStyle2, "CharColor")); uno::Reference<beans::XPropertySet> xStyle31(xParaStyles->getByName( "avis expert questions non cadres"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0x801900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle31, "ParaBackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x801900), getProperty<Color>(xStyle31, "ParaBackColor")); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle31, "ParaBackTransparent")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle31, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(Color(0x801900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle31, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x801900), getProperty<Color>(xStyle31, "FillColor")); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle31, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle31, "CharColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), getProperty<Color>(xStyle31, "CharColor")); uno::Reference<beans::XPropertySet> xStyle32(xParaStyles->getByName( "Avis expert rXponses"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, Color(ColorTransparency, getProperty<sal_Int32>(xStyle32, "ParaBackColor"))); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xStyle32, "ParaBackColor")); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle32, "ParaBackTransparent")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xStyle32, "FillStyle")); // unfortunately this is actually the pool default value, which would be hard to fix - but it isn't a problem because style is NONE // CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle32, "FillColor")); // CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xStyle32, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(Color(0x461900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle32, "CharColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x461900), getProperty<Color>(xStyle32, "CharColor")); if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) { @@ -1039,7 +1039,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt") // Shadow const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"ParaShadowFormat"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aShadow.Color); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, aShadow.Color)); CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aShadow.IsTransparent)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation(0), aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), aShadow.ShadowWidth); @@ -1136,7 +1136,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt") // Shadow const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aShadow.Color); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, aShadow.Color)); CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aShadow.IsTransparent)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation(3), aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(79), aShadow.ShadowWidth); @@ -2345,12 +2345,10 @@ DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt") uno::Reference<beans::XPropertySet> xCell1Style; xCellFamily->getByName("Test style.1") >>= xCell1Style; - sal_Int64 nInt64 = 0xF0F0F0; sal_Int32 nInt32 = 0xF0F0F0; table::BorderLine2 oBorder; - xCell1Style->getPropertyValue("BackColor") >>= nInt64; - CPPUNIT_ASSERT_EQUAL(sal_Int64(0xCC0000), nInt64); + CPPUNIT_ASSERT_EQUAL(Color(0xCC0000), getProperty<Color>(xCell1Style, "BackColor")); xCell1Style->getPropertyValue("WritingMode") >>= nInt32; CPPUNIT_ASSERT_EQUAL(sal_Int32(4), nInt32); xCell1Style->getPropertyValue("VertOrient") >>= nInt32; @@ -2368,11 +2366,11 @@ DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt") xCell1Style->getPropertyValue("RightBorder") >>= oBorder; CPPUNIT_ASSERT_EQUAL(sal_Int32(0), oBorder.Color); xCell1Style->getPropertyValue("LeftBorder") >>= oBorder; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), oBorder.Color); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, oBorder.Color)); xCell1Style->getPropertyValue("TopBorder") >>= oBorder; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), oBorder.Color); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, oBorder.Color)); xCell1Style->getPropertyValue("BottomBorder") >>= oBorder; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), oBorder.Color); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, oBorder.Color)); } DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") @@ -2391,7 +2389,6 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") bool bBool = true; sal_Int16 nInt16 = 0xF0; sal_Int32 nInt32 = 0xF0F0F0; - sal_Int64 nInt64 = 0xF0F0F0; OUString sString; awt::FontSlant eCharPosture; @@ -2399,8 +2396,7 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") xTableStyle->getByName("first-row-start-column") >>= xCell1Style; xCell1Style->getPropertyValue("ParaAdjust") >>= nInt32; CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nInt32); - xCell1Style->getPropertyValue("CharColor") >>= nInt64; - CPPUNIT_ASSERT_EQUAL(sal_Int64(0xFF6600), nInt64); + CPPUNIT_ASSERT_EQUAL(Color(0xFF6600), getProperty<Color>(xCell1Style, "CharColor")); xCell1Style->getPropertyValue("CharContoured") >>= bBool; CPPUNIT_ASSERT_EQUAL(false, bBool); xCell1Style->getPropertyValue("CharShadowed") >>= bBool; @@ -2464,8 +2460,7 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") xTableStyle->getByName("first-row") >>= xCell1Style; xCell1Style->getPropertyValue("ParaAdjust") >>= nInt32; CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nInt32); - xCell1Style->getPropertyValue("CharColor") >>= nInt64; - CPPUNIT_ASSERT_EQUAL(sal_Int64(0x9900FF), nInt64); + CPPUNIT_ASSERT_EQUAL(Color(0x9900FF), getProperty<Color>(xCell1Style, "CharColor")); xCell1Style->getPropertyValue("CharContoured") >>= bBool; CPPUNIT_ASSERT_EQUAL(true, bBool); xCell1Style->getPropertyValue("CharShadowed") >>= bBool; @@ -2525,8 +2520,7 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") xTableStyle->getByName("first-row-even-column") >>= xCell1Style; xCell1Style->getPropertyValue("ParaAdjust") >>= nInt32; CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nInt32); - xCell1Style->getPropertyValue("CharColor") >>= nInt64; - CPPUNIT_ASSERT_EQUAL(sal_Int64(0), nInt64); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<Color>(xCell1Style, "CharColor")); xCell1Style->getPropertyValue("CharContoured") >>= bBool; CPPUNIT_ASSERT_EQUAL(true, bBool); xCell1Style->getPropertyValue("CharShadowed") >>= bBool; @@ -2655,7 +2649,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles4) uno::Reference<beans::XPropertySet> xCell1Style; xTableStyle->getByName("first-row-start-column") >>= xCell1Style; - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, getProperty<sal_Int32>(xCell1Style, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(xCell1Style, "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, testTableStyles5) @@ -2697,7 +2691,7 @@ DECLARE_ODFEXPORT_TEST(testTdf129568, "tdf129568.fodt") // Test that export doesn't fail, and that style is imported and in use. uno::Reference<style::XStyle> xStyle(getStyles("CellStyles")->getByName("Default Style.1"), uno::UNO_QUERY); CPPUNIT_ASSERT(xStyle->isInUse()); - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), Color(ColorTransparency, getProperty<sal_Int32>(xStyle, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xffff00), getProperty<Color>(xStyle, "BackColor")); } DECLARE_ODFEXPORT_TEST(testTdf129568ui, "tdf129568-ui.fodt") @@ -2705,7 +2699,7 @@ DECLARE_ODFEXPORT_TEST(testTdf129568ui, "tdf129568-ui.fodt") // Same as above, but styles referenced by UI name. uno::Reference<style::XStyle> xStyle(getStyles("CellStyles")->getByName("Default Style.1"), uno::UNO_QUERY); CPPUNIT_ASSERT(xStyle->isInUse()); - CPPUNIT_ASSERT_EQUAL(Color(0xffff00), Color(ColorTransparency, getProperty<sal_Int32>(xStyle, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xffff00), getProperty<Color>(xStyle, "BackColor")); } DECLARE_ODFEXPORT_TEST(testTdf132642_keepWithNextTable, "tdf132642_keepWithNextTable.odt") diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 253fd16cdc9c..4088ceef8c51 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -684,9 +684,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89802) uno::Reference<container::XIndexAccess> const xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); uno::Reference<beans::XPropertySet> const xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - sal_Int32 nValue(0); - xFrame->getPropertyValue("BackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x3f004586), Color(ColorTransparency, nValue)); + CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x3f004586), getProperty<Color>(xFrame, "BackColor")); + } CPPUNIT_TEST_FIXTURE(Test, testFdo37606) @@ -844,9 +843,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo81223) uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - sal_Int32 nValue(0); - xFrame->getPropertyValue("BackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xffffffff), Color(ColorTransparency, nValue)); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xFrame, "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, fdo90130_1) @@ -855,9 +852,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo90130_1) uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - sal_Int32 nValue(0); - xFrame->getPropertyValue("BackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x00ff3333), Color(ColorTransparency, nValue)); + CPPUNIT_ASSERT_EQUAL(Color(0xff3333), getProperty<Color>(xFrame, "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, fdo90130_2) @@ -918,7 +913,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96113) { load(mpTestDocumentPath, "tdf96113.odt"); // Background of the formula frame was white (0xffffff), not green. - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, getProperty<sal_Int32>(getShape(1), "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(getShape(1), "BackColor")); } CPPUNIT_TEST_FIXTURE(Test, testFdo47267) diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index fba142c6d0cf..692fa45cbe1c 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -599,8 +599,7 @@ DECLARE_RTFEXPORT_TEST(testTextFrameBorders, "textframe-borders.rtf") uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0xD99594), - Color(ColorTransparency, getProperty<sal_Int32>(xFrame, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), getProperty<Color>(xFrame, "BackColor")); table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder"); CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, aBorder.Color)); @@ -736,8 +735,7 @@ DECLARE_RTFEXPORT_TEST(testFdo66743, "fdo66743.rtf") uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); // This was too dark, 0x7f7f7f. - CPPUNIT_ASSERT_EQUAL(Color(0xd8d8d8), - Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xd8d8d8), getProperty<Color>(xCell, "BackColor")); } DECLARE_RTFEXPORT_TEST(testFdo68787, "fdo68787.rtf") @@ -1103,8 +1101,7 @@ DECLARE_RTFEXPORT_TEST(testPageBackground, "page-background.rtf") // The problem was that \background was ignored. uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0x92D050), - Color(ColorTransparency, getProperty<sal_Int32>(xPageStyle, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x92D050), getProperty<Color>(xPageStyle, "BackColor")); } DECLARE_RTFEXPORT_TEST(testTdf96175, "tdf96175.rtf") diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 5204b503ae16..fac1ba0f762b 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -368,7 +368,7 @@ DECLARE_RTFEXPORT_TEST(testFdo48037, "fdo48037.rtf") DECLARE_RTFEXPORT_TEST(testFdo47764, "fdo47764.rtf") { // \cbpat with zero argument should mean the auto (-1) color, not a default color (black) - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getParagraph(1), "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<Color>(getParagraph(1), "ParaBackColor")); } DECLARE_RTFEXPORT_TEST(testFdo38786, "fdo38786.rtf") @@ -409,8 +409,7 @@ DECLARE_RTFEXPORT_TEST(testFdo49271, "fdo49271.rtf") DECLARE_RTFEXPORT_TEST(testFdo50539, "fdo50539.rtf") { // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black) - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), - getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<Color>(getRun(getParagraph(1), 1), "CharBackColor")); } DECLARE_RTFEXPORT_TEST(testFdo50665, "fdo50665.rtf") @@ -572,8 +571,7 @@ DECLARE_RTFEXPORT_TEST(testFdo62805, "fdo62805.rtf") DECLARE_RTFEXPORT_TEST(testFdo52475, "fdo52475.rtf") { // The problem was that \chcbpat0 resulted in no color, instead of COL_AUTO. - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), - getProperty<sal_Int32>(getRun(getParagraph(1), 3), "CharBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<Color>(getRun(getParagraph(1), 3), "CharBackColor")); } DECLARE_RTFEXPORT_TEST(testFdo55493, "fdo55493.rtf") @@ -686,7 +684,7 @@ DECLARE_RTFEXPORT_TEST(testDoDhgt, "do-dhgt.rtf") CPPUNIT_ASSERT_EQUAL(3, nShapes); for (int i = 0; i < nShapes; ++i) { - sal_Int32 nFillColor = getProperty<sal_Int32>(getShape(i + 1), "FillColor"); + Color nFillColor = getProperty<Color>(getShape(i + 1), "FillColor"); if (nFillColor == 0xc0504d) // red CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getShape(i + 1), "ZOrder")); else if (nFillColor == 0x9bbb59) // green @@ -914,8 +912,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, - Color(ColorTransparency, getProperty<sal_uInt32>(xShape, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<Color>(xShape, "FillColor")); xShape.set(getShape(3), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xShape, "ZOrder")); @@ -928,8 +925,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, Color(ColorTransparency, getProperty<sal_uInt32>(xTextRange, "CharBackColor"))); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<Color>(xTextRange, "CharBackColor")); } DECLARE_RTFEXPORT_TEST(testFdo62288, "fdo62288.rtf") diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index df7ffcca69b4..040b75a96b6e 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -55,10 +55,9 @@ DECLARE_RTFEXPORT_TEST(testTdf108949, "tdf108949_footnoteCharFormat.odt") uno::Reference<text::XText> xFootnoteText; xFootnotes->getByIndex(0) >>= xFootnoteText; // This was green (0x00A800), the character property of the footnote character, not the footnote text - CPPUNIT_ASSERT_MESSAGE( - "Footnote Text color", - sal_Int32(0x000000) >= getProperty<sal_Int32>( - getRun(getParagraphOfText(1, xFootnoteText), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Footnote Text color", COL_AUTO, + getProperty<Color>(getRun(getParagraphOfText(1, xFootnoteText), 1), "CharColor")); } DECLARE_RTFEXPORT_TEST(testTdf141964_numId0, "tdf141964_numId0.rtf") @@ -80,9 +79,8 @@ DECLARE_RTFEXPORT_TEST(testTdf108949_footnote, "tdf108949_footnote.rtf") uno::Reference<text::XFootnote> xFootnote; xFootnotes->getByIndex(0) >>= xFootnote; // The color of the footnote anchor was black (0x000000) - CPPUNIT_ASSERT_EQUAL_MESSAGE( - "Footnote Character color", Color(0xFF0000), - Color(ColorTransparency, getProperty<sal_Int32>(xFootnote->getAnchor(), "CharColor"))); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Footnote Character color", Color(0xFF0000), + getProperty<Color>(xFootnote->getAnchor(), "CharColor")); } DECLARE_RTFEXPORT_TEST(testTdf130817, "tdf130817.rtf") @@ -109,8 +107,7 @@ DECLARE_RTFEXPORT_TEST(testTdf137683_charHighlightNone, "tdf137683_charHighlight { uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY_THROW); // This test was failing with a brown charHighlight of 8421376 (0x808000), instead of COL_TRANSPARENT (0xFFFFFFFF) - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_AUTO), - getProperty<sal_Int32>(xRun, "CharHighlight")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<Color>(xRun, "CharHighlight")); } DECLARE_RTFEXPORT_TEST(testTdf116436_tableBackground, "tdf116436_tableBackground.odt") @@ -122,15 +119,12 @@ DECLARE_RTFEXPORT_TEST(testTdf116436_tableBackground, "tdf116436_tableBackground uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); if (mbExported) - CPPUNIT_ASSERT_EQUAL(Color(0xF8DF7C), - Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xF8DF7C), getProperty<Color>(xCell, "BackColor")); xCell.set(xTable->getCellByName("A6")); - CPPUNIT_ASSERT_EQUAL(Color(0x81D41A), - Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x81D41A), getProperty<Color>(xCell, "BackColor")); xCell.set(xTable->getCellByName("B6")); if (mbExported) - CPPUNIT_ASSERT_EQUAL(Color(0xFFFBCC), - Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xFFFBCC), getProperty<Color>(xCell, "BackColor")); } DECLARE_RTFEXPORT_TEST(testTdf122589_firstSection, "tdf122589_firstSection.odt") diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 73b9bcd425e7..c51c882fbcdc 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -469,33 +469,33 @@ DECLARE_RTFEXPORT_TEST(testTdf111851, "tdf111851.rtf") // No shading uno::Reference<text::XTextRange> xCell1(xTable->getCellByName("A1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell1->getString()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xCell1, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xCell1, "BackColor")); uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("B1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("b"), xCell2->getString()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xCell2, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, getProperty<Color>(xCell2, "BackColor")); // Check some random not standard shading values and ensure some non-white background color uno::Reference<text::XTextRange> xCell3(xTable->getCellByName("C1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("c"), xCell3->getString()); - sal_Int32 nShadingColor3 = getProperty<sal_Int32>(xCell3, "BackColor"); - CPPUNIT_ASSERT(0x00FFFFFF > nShadingColor3); - CPPUNIT_ASSERT(0 < nShadingColor3); + Color nShadingColor3 = getProperty<Color>(xCell3, "BackColor"); + CPPUNIT_ASSERT(COL_WHITE > nShadingColor3); + CPPUNIT_ASSERT(COL_BLACK < nShadingColor3); uno::Reference<text::XTextRange> xCell4(xTable->getCellByName("D1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("d"), xCell4->getString()); - sal_Int32 nShadingColor4 = getProperty<sal_Int32>(xCell4, "BackColor"); - CPPUNIT_ASSERT(0x00FFFFFF > nShadingColor4); - CPPUNIT_ASSERT(0 < nShadingColor4); + Color nShadingColor4 = getProperty<Color>(xCell4, "BackColor"); + CPPUNIT_ASSERT(COL_WHITE > nShadingColor4); + CPPUNIT_ASSERT(COL_BLACK < nShadingColor4); // Values 10000 and more - black uno::Reference<text::XTextRange> xCell5(xTable->getCellByName("E1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("e"), xCell5->getString()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xCell5, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<Color>(xCell5, "BackColor")); uno::Reference<text::XTextRange> xCell6(xTable->getCellByName("F1"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("f"), xCell6->getString()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xCell6, "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<Color>(xCell6, "BackColor")); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 55074102a1ec..684ae9b249ed 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -139,8 +139,7 @@ DECLARE_RTFEXPORT_TEST(testN825305, "n825305.rtf") { // The problem was that the textbox wasn't transparent, due to unimplemented fFilled == 0. uno::Reference<beans::XPropertyState> xPropertyState(getShape(2), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(100), - getProperty<sal_Int32>(getShape(2), "BackColorTransparency")); + CPPUNIT_ASSERT_EQUAL(Color(0x000064), getProperty<Color>(getShape(2), "BackColorTransparency")); beans::PropertyState ePropertyState = xPropertyState->getPropertyState("BackColorTransparency"); // Was beans::PropertyState_DEFAULT_VALUE. CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState); @@ -373,8 +372,7 @@ DECLARE_RTFEXPORT_TEST(testNestedTable, "rhbz1065629.rtf") CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, getProperty<table::BorderLine2>(xCell, "TopBorder")); CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, getProperty<table::BorderLine2>(xCell, "BottomBorder")); - CPPUNIT_ASSERT_EQUAL(Color(0xCC0000), - Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xCC0000), getProperty<Color>(xCell, "BackColor")); xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); CPPUNIT_ASSERT(xCell.is()); table::BorderLine2 halfPtSolid(sal_Int32(COL_BLACK), 0, 18, 0, table::BorderLineStyle::SOLID, @@ -517,11 +515,9 @@ DECLARE_RTFEXPORT_TEST(testShpzDhgt, "shpz-dhgt.rtf") { // Test that shpz has priority over dhgt and not the other way around. // Drawpage is sorted by ZOrder, so first should be red (back). - CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(ColorTransparency, - getProperty<sal_Int32>(getShape(1), "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xff0000), getProperty<Color>(getShape(1), "FillColor")); // Second (front) should be green. - CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, - getProperty<sal_Int32>(getShape(2), "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), getProperty<Color>(getShape(2), "FillColor")); } DECLARE_RTFEXPORT_TEST(testLevelfollow, "levelfollow.rtf") @@ -554,9 +550,7 @@ DECLARE_RTFEXPORT_TEST(testLevelfollow, "levelfollow.rtf") DECLARE_RTFEXPORT_TEST(testCharColor, "char-color.rtf") { // This was -1: character color wasn't set. - CPPUNIT_ASSERT_EQUAL( - Color(0x365F91), - Color(ColorTransparency, getProperty<sal_Int32>(getParagraph(1), "CharColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x365F91), getProperty<Color>(getParagraph(1), "CharColor")); } DECLARE_RTFEXPORT_TEST(testFdo69289, "fdo69289.rtf") @@ -725,8 +719,7 @@ DECLARE_RTFEXPORT_TEST(testFdo86761, "fdo86761.rtf") DECLARE_RTFEXPORT_TEST(testFdo82859, "fdo82859.rtf") { // This was 0: "0xffffff" was converted to 0, i.e. the background was black instead of the default. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), - getProperty<sal_Int32>(getShape(1), "BackColor")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<Color>(getShape(1), "BackColor")); } DECLARE_RTFEXPORT_TEST(testFdo82076, "fdo82076.rtf") @@ -827,8 +820,9 @@ DECLARE_RTFEXPORT_TEST(testTdf91074, "tdf91074.rtf") { // The file failed to load, as the border color was imported using the LineColor UNO property. uno::Reference<drawing::XShape> xShape = getShape(1); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(COL_LIGHTRED), - getProperty<table::BorderLine2>(xShape, "TopBorder").Color); + CPPUNIT_ASSERT_EQUAL( + COL_LIGHTRED, + Color(ColorTransparency, getProperty<table::BorderLine2>(xShape, "TopBorder").Color)); } CPPUNIT_TEST_FIXTURE(Test, testTdf90260Nopar) @@ -1340,7 +1334,7 @@ DECLARE_RTFEXPORT_TEST(testTdf131234, "tdf131234.rtf") // Ensure that text has default font attrs in spite of style referenced // E.g. 12pt, Times New Roman, black, no bold, no italic, no underline CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(xRun, "CharHeight")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xRun, "CharColor")); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, getProperty<Color>(xRun, "CharColor")); CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), getProperty<OUString>(xRun, "CharFontName")); CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xRun, "CharWeight")); CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::NONE, getProperty<sal_Int16>(xRun, "CharUnderline")); diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index 38554544e212..15c51075c1eb 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -1739,8 +1739,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTableBackgroundColor) //Checking cells for background color only A1 should be modified uno::Reference<table::XCell> xCell; xCell = xTable->getCellByName("A1"); - CPPUNIT_ASSERT_EQUAL(Color(0xFF00FF), - Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xFF00FF), getProperty<Color>(xCell, "BackColor")); xCell = xTable->getCellByName("A2"); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xCell, "BackColor")); xCell = xTable->getCellByName("A3"); diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index cf26c2d2447f..ccd850864b87 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -568,9 +568,9 @@ DECLARE_WW8EXPORT_TEST(testTdf132094_transparentPageImage, "tdf132094_transparen DECLARE_WW8EXPORT_TEST(testTdf112618_textbox_no_bg, "tdf112618_textbox_no_bg.doc") { - sal_uInt16 nTransparence = getProperty<sal_Int16>(getShape(2), "FillTransparence"); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(100), nTransparence); - CPPUNIT_ASSERT_EQUAL(nTransparence, getProperty<sal_uInt16>(getShape(2), "BackColorTransparency")); + Color nTransparence = getProperty<Color>(getShape(2), "FillTransparence"); + CPPUNIT_ASSERT_EQUAL(Color(0x000064), nTransparence); + CPPUNIT_ASSERT_EQUAL(nTransparence, getProperty<Color>(getShape(2), "BackColorTransparency")); } DECLARE_WW8EXPORT_TEST(testTdf101826_xattrTextBoxFill, "tdf101826_xattrTextBoxFill.doc")