i18npool/source/transliteration/transliteration_body.cxx | 4 + sd/qa/unit/export-tests.cxx | 8 +- sw/qa/extras/globalfilter/globalfilter.cxx | 4 - sw/qa/extras/odfexport/odfexport.cxx | 48 +++++++-------- sw/qa/extras/odfimport/odfimport.cxx | 8 +- sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 8 +- sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 6 - sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 4 - sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 2 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 2 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 34 +++++----- sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 12 +-- sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 6 - sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 24 +++---- sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 4 - sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 18 ++--- sw/qa/extras/rtfexport/rtfexport.cxx | 21 +++--- sw/qa/extras/rtfexport/rtfexport3.cxx | 14 ++-- sw/qa/extras/rtfexport/rtfexport5.cxx | 13 ++-- sw/qa/extras/uiwriter/uiwriter.cxx | 2 sw/qa/extras/ww8export/ww8export.cxx | 2 sw/qa/extras/ww8export/ww8export2.cxx | 10 +-- sw/qa/extras/ww8export/ww8export3.cxx | 4 - 23 files changed, 137 insertions(+), 121 deletions(-)
New commits: commit e72bbb8d41cdf3eec86804afa1a6dd527925be04 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 2 09:06:03 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 3 13:51:11 2021 +0100 Silence spurious Werror=maybe-uninitialized in transliterateImpl only seen in optimised build Change-Id: Ibf344efa034feefdc6e03d489a0a6b28461b76e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124581 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index a64c8050bb79..e1fc11a8d70a 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -16,6 +16,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +// Silence spurious Werror=maybe-uninitialized in transliterateImpl emitted at least by GCC 11.2.0 +#if defined __GNUC__ && !defined __clang__ +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #include <rtl/ref.hxx> #include <i18nutil/casefolding.hxx> commit 7a8cbfafca1906baad2bcbf8aa6717d197ae423a Author: Rishav Chattopadhya <rishavchatterjee1...@gmail.com> AuthorDate: Sat Oct 23 15:28:14 2021 +0530 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Wed Nov 3 13:51:00 2021 +0100 tdf#141908: CppUnittests: replace usage of sal_Int32 with colors Change-Id: Idb078379c4388d7dd9525500e18064f2f873e6ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124091 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 1bcbbaf904d4..89e5f13a27c0 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -578,13 +578,13 @@ void SdExportTest::testBnc480256() xCell->getPropertyValue("FillColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0x9bc3ee), nColor); xCell->getPropertyValue("LeftBorder") >>= aBorderLine; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5597d3), aBorderLine.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x5597d3), Color(ColorTransparency, aBorderLine.Color)); xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0xc6ddff), nColor); xCell->getPropertyValue("TopBorder") >>= aBorderLine; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5597d3), aBorderLine.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x5597d3), Color(ColorTransparency, aBorderLine.Color)); pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(1)); CPPUNIT_ASSERT( pTableObj ); @@ -594,7 +594,7 @@ void SdExportTest::testBnc480256() xCell->getPropertyValue("FillColor") >>= nColor; CPPUNIT_ASSERT_EQUAL(Color(0x6bace6), nColor); xCell->getPropertyValue("LeftBorder") >>= aBorderLine; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xbecfe6), aBorderLine.Color); + CPPUNIT_ASSERT_EQUAL(Color(0xbecfe6), Color(ColorTransparency, aBorderLine.Color)); xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); xCell->getPropertyValue("FillColor") >>= nColor; @@ -602,7 +602,7 @@ void SdExportTest::testBnc480256() xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW); xCell->getPropertyValue("BottomBorder") >>= aBorderLine; - CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_AUTO), aBorderLine.Color); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(ColorTransparency, aBorderLine.Color)); xDocShRef->DoClose(); } diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index e38df1d0c479..04d24a825f27 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -1782,9 +1782,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(), sal_Int32(COL_AUTO), getProperty<sal_Int32>(getRun(getParagraph(1), 3), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), COL_AUTO, Color(ColorTransparency, getProperty<sal_Int32>(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(), sal_Int32(0xff0000), getProperty<sal_Int32>(getRun(getParagraph(1), 4), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), Color(0xff0000), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraph(1), 4), "CharColor"))); } } diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 9a039df6cc96..18447752a46f 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -391,17 +391,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(sal_Int32(0x006600), getProperty<util::Color>(xTextFrame, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x006600), Color(ColorTransparency, getProperty<util::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(sal_Int32(0x006600), getProperty<util::Color>(xTextFrame, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x006600), Color(ColorTransparency, getProperty<util::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(sal_Int32(0x579D1C), getProperty<util::Color>(xTextFrame, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x579D1C), Color(ColorTransparency, getProperty<util::Color>(xTextFrame, "FillColor"))); aGradientxTextFrame = getProperty<awt::Gradient>(xTextFrame, "FillTransparenceGradient"); CPPUNIT_ASSERT_EQUAL(css::awt::GradientStyle_LINEAR, aGradientxTextFrame.Style); //Frame 5 @@ -656,15 +656,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(sal_Int32(0xffcc99), getProperty<sal_Int32>(xStyle, "BackColorRGB")); + CPPUNIT_ASSERT_EQUAL(Color(0xffcc99), Color(ColorTransparency, getProperty<sal_Int32>(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(sal_Int32(0xffcc99), getProperty<sal_Int32>(xStyle, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xffcc99), Color(ColorTransparency, getProperty<sal_Int32>(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(sal_Int32(0xffffff), getProperty<sal_Int32>(xFrameStyle2, "BackColorRGB")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(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")); @@ -684,41 +684,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(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle1, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle1, "ParaBackColor"))); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle1, "ParaBackTransparent")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle1, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle1, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle1, "FillColor"))); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle1, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xStyle1, "CharColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(xStyle1, "CharColor"))); uno::Reference<beans::XPropertySet> xStyle2(xParaStyles->getByName( "Avis expert questions"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_TRANSPARENT), getProperty<sal_Int32>(xStyle2, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, Color(ColorTransparency, getProperty<sal_Int32>(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(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle2, "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle2, "CharColor"))); uno::Reference<beans::XPropertySet> xStyle31(xParaStyles->getByName( "avis expert questions non cadres"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x801900), getProperty<sal_Int32>(xStyle31, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x801900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle31, "ParaBackColor"))); CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xStyle31, "ParaBackTransparent")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle31, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x801900), getProperty<sal_Int32>(xStyle31, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x801900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle31, "FillColor"))); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle31, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x661900), getProperty<sal_Int32>(xStyle31, "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x661900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle31, "CharColor"))); uno::Reference<beans::XPropertySet> xStyle32(xParaStyles->getByName( "Avis expert rXponses"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_TRANSPARENT), getProperty<sal_Int32>(xStyle32, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(COL_TRANSPARENT, Color(ColorTransparency, getProperty<sal_Int32>(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(sal_Int32(0x461900), getProperty<sal_Int32>(xStyle32, "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x461900), Color(ColorTransparency, getProperty<sal_Int32>(xStyle32, "CharColor"))); if (xmlDocUniquePtr pXmlDoc = parseExport("styles.xml")) { @@ -781,15 +781,15 @@ DECLARE_ODFEXPORT_TEST(testTextframeGradient, "textframe-gradient.odt") uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); awt::Gradient aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aGradient.StartColor); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); xFrame.set(xIndexAccess->getByIndex(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aGradient.StartColor); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x666666), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); } @@ -1064,7 +1064,7 @@ DECLARE_ODFEXPORT_TEST(testCharacterBorder, "charborder.odt") // Shadow const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"CharShadowFormat"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF3333), aShadow.Color); + CPPUNIT_ASSERT_EQUAL(Color(0xFF3333), Color(ColorTransparency, aShadow.Color)); CPPUNIT_ASSERT_EQUAL(false, static_cast<bool>(aShadow.IsTransparent)); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation(2), aShadow.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(280), aShadow.ShadowWidth); @@ -2645,7 +2645,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTableStyles4) uno::Reference<beans::XPropertySet> xCell1Style; xTableStyle->getByName("first-row-start-column") >>= xCell1Style; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(xCell1Style, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, getProperty<sal_Int32>(xCell1Style, "BackColor"))); } DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTableStyles5, "table_styles_5.odt") @@ -2686,7 +2686,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(sal_Int32(0xffff00), getProperty<sal_Int32>(xStyle, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xffff00), Color(ColorTransparency, getProperty<sal_Int32>(xStyle, "BackColor"))); } DECLARE_ODFEXPORT_TEST(testTdf129568ui, "tdf129568-ui.fodt") @@ -2694,7 +2694,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(sal_Int32(0xffff00), getProperty<sal_Int32>(xStyle, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xffff00), Color(ColorTransparency, getProperty<sal_Int32>(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 e90a571d93d0..f0ca820caef0 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -686,7 +686,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf89802) uno::Reference<beans::XPropertySet> const xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); sal_Int32 nValue(0); xFrame->getPropertyValue("BackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x3f004586), nValue); + CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x3f004586), Color(ColorTransparency, nValue)); } CPPUNIT_TEST_FIXTURE(Test, testFdo37606) @@ -846,7 +846,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo81223) uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); sal_Int32 nValue(0); xFrame->getPropertyValue("BackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffffff), nValue); + CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xffffffff), Color(ColorTransparency, nValue)); } CPPUNIT_TEST_FIXTURE(Test, fdo90130_1) @@ -857,7 +857,7 @@ CPPUNIT_TEST_FIXTURE(Test, fdo90130_1) uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); sal_Int32 nValue(0); xFrame->getPropertyValue("BackColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff3333), nValue); + CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x00ff3333), Color(ColorTransparency, nValue)); } CPPUNIT_TEST_FIXTURE(Test, fdo90130_2) @@ -918,7 +918,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf96113) { load(mpTestDocumentPath, "tdf96113.odt"); // Background of the formula frame was white (0xffffff), not green. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(1), "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, getProperty<sal_Int32>(getShape(1), "BackColor"))); } CPPUNIT_TEST_FIXTURE(Test, testFdo47267) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 9f8ba44e6a2b..3b818ce98b57 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -533,7 +533,7 @@ DECLARE_OOXMLEXPORT_TEST(testWpsCharColor, "wps-char-color.docx") { uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); // This was -1, i.e. the character color was default (-1), not white. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape->getStart(), "CharColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(xShape->getStart(), "CharColor"))); } DECLARE_OOXMLEXPORT_TEST(testTableStyleCellBackColor, "table-style-cell-back-color.docx") @@ -544,7 +544,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableStyleCellBackColor, "table-style-cell-back-col uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); // This was 0xffffff. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_OOXMLEXPORT_TEST(testTableStyleBorder, "table-style-border.docx") @@ -569,7 +569,7 @@ DECLARE_OOXMLEXPORT_TEST(testTableStyleBorderExport, "table-style-border-export. uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A3"); // Bottom border was white, so this was 0xffffff. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x8064A2), getProperty<table::BorderLine2>(xCell, "BottomBorder").Color); + CPPUNIT_ASSERT_EQUAL(Color(0x8064A2), Color(ColorTransparency, getProperty<table::BorderLine2>(xCell, "BottomBorder").Color)); } DECLARE_OOXMLEXPORT_TEST(testAnchorPosition, "anchor-position.docx") @@ -890,7 +890,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97090, "tdf97090.docx") uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x95B3D7), getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x95B3D7), Color(ColorTransparency, getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor"))); uno::Reference<container::XEnumerationAccess> paraEnumAccess(xTable->getCellByName("A1"), uno::UNO_QUERY); assert( paraEnumAccess.is() ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index be18f7b47d86..35f2ccaba137 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -124,7 +124,7 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") uno::Reference<beans::XPropertySet> xPropertySet(xGroup->getByIndex(2), uno::UNO_QUERY); sal_Int32 nValue(0); xPropertySet->getPropertyValue("FillColor") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), nValue); // If fill color is right, theme import is OK + CPPUNIT_ASSERT_EQUAL(Color(0x4f81bd), Color(ColorTransparency, nValue)); // If fill color is right, theme import is OK uno::Reference<text::XTextRange> xTextRange(xGroup->getByIndex(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("Sample"), xTextRange->getString()); // Shape has text @@ -250,7 +250,7 @@ DECLARE_OOXMLEXPORT_TEST(testMceNested, "mce-nested.docx") // positionV's posOffset from the bugdoc, was 0. CPPUNIT_ASSERT(6879 <= getProperty<sal_Int32>(xShape, "VertOrientPosition")); // This was -1 (default), make sure the background color is set. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x4f81bd), Color(ColorTransparency, getProperty<sal_Int32>(xShape, "FillColor"))); uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor = getShape(2); // This was a com.sun.star.drawing.CustomShape, due to incorrect handling of wpg elements after a wps textbox. @@ -261,7 +261,7 @@ DECLARE_OOXMLEXPORT_TEST(testMceNested, "mce-nested.docx") uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText(); uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText, "[Year]"); CPPUNIT_ASSERT_EQUAL(48.f, getProperty<float>(getRun(xParagraph, 1), "CharHeight")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"))); CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(xParagraph, 1), "CharWeight")); CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xGroup->getByIndex(1), "TextVerticalAdjust")); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index c6bd56a5c03e..d79ebd7a2113 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -101,7 +101,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf116436_rowFill, "tdf116436_rowFill.odt") uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xF8DF7C), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_OOXMLEXPORT_TEST(testTdf121665_back2backColumnBreaks, "tdf121665_back2backColumnBreaks.docx") @@ -794,7 +794,7 @@ DECLARE_OOXMLEXPORT_TEST(testNoDefault, "noDefault.docx") uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); // Row 1: color directly applied to the paragraph, overrides table and style colors - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(xPara,1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x2E74B5), Color(ColorTransparency, getProperty<sal_Int32>(getRun(xPara,1), "CharColor"))); // Row2: (still part of firstRow table-style) ought to use the Normal style color, not the table-style color(5B9BD5) //xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 60c42f152d2c..7d6e0583d312 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -467,7 +467,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, "tdf118947_tableStyle.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", sal_Int32(0), getProperty<sal_Int32>(xPara, "ParaRightMargin")); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("TextBody has 1.07 line-spacing", sal_Int16(107), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height, 1); // table-style based paragraph background color - CPPUNIT_ASSERT_EQUAL_MESSAGE("Missing paragraph background color in cell A1", sal_Int32(0xCCFFCC), getProperty<sal_Int32>(xPara, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Missing paragraph background color in cell A1", Color(0xCCFFCC), Color(ColorTransparency, getProperty<sal_Int32>(xPara, "ParaBackColor"))); // This cell is affected by compatSetting overrideTableStyleFontSizeAndJustification=0 (the default value) xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index eb48b60262c0..02fb674fe977 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -215,7 +215,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Tdf133065, "tdf133065.odt") DECLARE_OOXMLEXPORT_TEST(testTdf130814model, "tdf130814.docx") { - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x1F497D), getProperty<sal_Int32>(getRun(getParagraph(2), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x1F497D), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraph(2), 1), "CharColor"))); CPPUNIT_ASSERT_EQUAL(double(16), getProperty<double>(getRun(getParagraph(2), 1), "CharHeight")); CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<sal_Int16>(getRun(getParagraph(2), 1), "CharUnderline")); CPPUNIT_ASSERT_EQUAL(OUString("Candara"), getProperty<OUString>(getRun(getParagraph(2), 1), "CharFontName")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 1b90c37a9a6f..7e4cce4ce6de 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -564,29 +564,29 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") { // After import, a TextFrame is created by the VML import. uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xFrame, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), Color(ColorTransparency, getProperty<sal_Int32>(xFrame, "BackColor"))); table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aBorder.Color); + CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, aBorder.Color)); CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), aBorder.LineWidth); table::ShadowFormat aShadowFormat = getProperty<table::ShadowFormat>(xFrame, "ShadowFormat"); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadowFormat.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x622423), Color(ColorTransparency, aShadowFormat.Color)); } else { // After export and import, the result is a shape. uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xShape, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), Color(ColorTransparency, getProperty<sal_Int32>(xShape, "FillColor"))); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), getProperty<sal_Int32>(xShape, "LineColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, getProperty<sal_Int32>(xShape, "LineColor"))); CPPUNIT_ASSERT_EQUAL(sal_Int32(35), getProperty<sal_Int32>(xShape, "LineWidth")); CPPUNIT_ASSERT_EQUAL(sal_Int32(48), getProperty<sal_Int32>(xShape, "ShadowXDistance")); CPPUNIT_ASSERT_EQUAL(sal_Int32(48), getProperty<sal_Int32>(xShape, "ShadowYDistance")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), getProperty<sal_Int32>(xShape, "ShadowColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x622423), Color(ColorTransparency, getProperty<sal_Int32>(xShape, "ShadowColor"))); } } @@ -597,15 +597,15 @@ DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); awt::Gradient aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aGradient.StartColor); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); xFrame.set(getShape(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aGradient.StartColor); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x666666), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(Color(0x000000), Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); // Left / right margin was incorrect: the attribute was missing and we @@ -703,7 +703,7 @@ DECLARE_OOXMLEXPORT_TEST(testPageBackground, "page-background.docx") { // 'Document Background' wasn't exported. uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x92D050), Color(ColorTransparency, getProperty<sal_Int32>(xPageStyle, "BackColor"))); } DECLARE_OOXMLEXPORT_TEST(testFdo65265, "fdo65265.docx") @@ -865,7 +865,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo56679, "fdo56679.docx") uno::Reference< text::XTextRange > xText = getRun( xParagraph, 2, "This is a simple sentence."); CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xText, "CharUnderlineHasColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), getProperty<sal_Int32>(xText, "CharUnderlineColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), Color(ColorTransparency, getProperty<sal_Int32>(xText, "CharUnderlineColor"))); } DECLARE_OOXMLEXPORT_TEST(testFdo65400, "fdo65400.docx") @@ -1032,11 +1032,11 @@ DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt") CPPUNIT_ASSERT_EQUAL(1, getPages()); // The shape had no background, no paragraph adjust and no font color. uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x00CFE7F5), Color(ColorTransparency, getProperty<sal_Int32>(xShape, "FillColor"))); uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText(); uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText); CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x00FF00), Color(ColorTransparency, getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"))); } DECLARE_OOXMLEXPORT_TEST(testFdo65718, "fdo65718.docx") @@ -1083,7 +1083,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo67013, "fdo67013.docx") uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "HeaderText"); uno::Reference< text::XTextRange > xHeaderParagraph = getParagraphOfText( 1, xHeaderText ); table::BorderLine2 aHeaderBottomBorder = getProperty<table::BorderLine2>(xHeaderParagraph, "BottomBorder"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aHeaderBottomBorder.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x622423), Color(ColorTransparency, aHeaderBottomBorder.Color)); CPPUNIT_ASSERT_EQUAL(sal_Int16(106), aHeaderBottomBorder.InnerLineWidth); CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aHeaderBottomBorder.LineDistance); CPPUNIT_ASSERT_EQUAL(sal_Int16(7), aHeaderBottomBorder.LineStyle); @@ -1093,7 +1093,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo67013, "fdo67013.docx") uno::Reference<text::XText> xFooterText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Standard"), "FooterText"); uno::Reference< text::XTextRange > xFooterParagraph = getParagraphOfText( 1, xFooterText ); table::BorderLine2 aFooterTopBorder = getProperty<table::BorderLine2>(xFooterParagraph, "TopBorder"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aFooterTopBorder.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x622423), Color(ColorTransparency, aFooterTopBorder.Color)); CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aFooterTopBorder.InnerLineWidth); CPPUNIT_ASSERT_EQUAL(sal_Int16(26), aFooterTopBorder.LineDistance); CPPUNIT_ASSERT_EQUAL(sal_Int16(4), aFooterTopBorder.LineStyle); @@ -1178,7 +1178,7 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") uno::Reference<drawing::XShape> xPicture = getShape(1); sal_Int32 nShadowColor = getProperty<sal_Int32>(xPicture, "ShadowColor"); sal_Int16 nShadowTransparence = getProperty<sal_Int16>(xPicture, "ShadowTransparence"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x808080), nShadowColor); + CPPUNIT_ASSERT_EQUAL(Color(0x808080), Color(ColorTransparency, nShadowColor)); CPPUNIT_ASSERT_EQUAL(sal_Int16(50), nShadowTransparence); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index f5a5c3a8f80b..f9285288b3ae 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -325,11 +325,11 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx") // TableStyle:firstRow (for header rows 1 and 2) color and size overrides document rPrDefault uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A2"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5B9BD5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x5B9BD5), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor"))); CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),1), "CharHeight")); // direct formatting in A1 uno::Reference<text::XTextRange> xCell2(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell2->getText()), 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x2E74B5), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell2->getText()), 1), "CharColor"))); CPPUNIT_ASSERT_EQUAL(20.f, getProperty<float>(getRun(getParagraphOfText(1, xCell2->getText()),1), "CharHeight")); // tdf#132149 Despite specifying portrait, the page size's specified width is greater than its height. @@ -354,10 +354,10 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar5, "calendar5.docx") uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); // text portions with direct formatting - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2E74B5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 2), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x2E74B5), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xFF0000), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 2), "CharColor"))); // default paragraph text color - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x5B9BD5), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 3), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x5B9BD5), Color(ColorTransparency, getProperty<sal_Int32>(getRun(getParagraphOfText(1, xCell->getText()), 3), "CharColor"))); // text portions with direct formatting CPPUNIT_ASSERT_EQUAL(20.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),1), "CharHeight")); CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()),2), "CharHeight")); @@ -841,7 +841,7 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlTriangle, "ooxml-triangle.docx") DECLARE_OOXMLEXPORT_TEST(testMce, "mce.docx") { // The shape is red in Word2007, green in Word2010. Check that our import follows the later. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x9bbb59), getProperty<sal_Int32>(getShape(1), "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x9bbb59), Color(ColorTransparency, getProperty<sal_Int32>(getShape(1), "FillColor"))); } CPPUNIT_TEST_FIXTURE(Test, testThemePreservation) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 989ddcb98a38..081ac3252d31 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -1057,13 +1057,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117297_tableStyle, "tdf117297_tableStyle.docx") uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); uno::Reference<text::XText> xText = xPara->getText(); CPPUNIT_ASSERT_EQUAL(OUString("Green text, default size (9), 1.5 spaced"), xPara->getString()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph1 green font", sal_Int32(0x70AD47), getProperty<sal_Int32>(getRun(xPara, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph1 green font", Color(0x70AD47), Color(ColorTransparency, getProperty<sal_Int32>(getRun(xPara, 1), "CharColor"))); CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph1 1.5 line spacing", sal_Int16(150), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); xText = xPara->getText(); CPPUNIT_ASSERT_EQUAL(OUString("TableGrid color (blue), TableGrid size (9), double spacing"), xPara->getString()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 blue font", sal_Int32(0x00B0F0), getProperty<sal_Int32>(getRun(xPara, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 blue font", Color(0x00B0F0), Color(ColorTransparency, getProperty<sal_Int32>(getRun(xPara, 1), "CharColor"))); CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 double spacing", sal_Int16(200), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); } @@ -1305,7 +1305,7 @@ DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xffffff), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index 339613d0db93..2cc4334b4a4a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -160,18 +160,18 @@ DECLARE_OOXMLEXPORT_TEST(testDMLTextFrameNoFill, "frame.fodt") // CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xShape1, "FillStyle")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape1, "FillStyle")); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xShape1, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape1, "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(xShape1, "FillColor"))); uno::Reference<beans::XPropertySet> xShape2(getShape(2), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape2, "FillStyle")); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xShape2, "FillTransparence")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xE8F2A1), getProperty<sal_Int32>(xShape2, "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xE8F2A1), Color(ColorTransparency, getProperty<sal_Int32>(xShape2, "FillColor"))); uno::Reference<beans::XPropertySet> xShape3(getShape(3), uno::UNO_QUERY); // it is re-imported as solid // CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xShape3, "FillStyle")); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xShape3, "FillStyle")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xShape3, "FillColor")); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, Color(ColorTransparency, getProperty<sal_Int32>(xShape3, "FillColor"))); CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xShape3, "FillTransparence")); } @@ -290,7 +290,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLShapeFillPattern, "dml-shape-fillpattern.docx") drawing::Hatch aHatch = getProperty<drawing::Hatch>(getShape(1), "FillHatch"); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aHatch.Angle); CPPUNIT_ASSERT_EQUAL(sal_Int32(50), aHatch.Distance); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x99FF66), aHatch.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x99FF66), Color(ColorTransparency, aHatch.Color)); CPPUNIT_ASSERT_EQUAL(drawing::HatchStyle_SINGLE, aHatch.Style); // 2nd shape: horizontal pattern (horz) @@ -834,11 +834,11 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation) OUString sFillColor = getXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:solidFill/a:srgbClr", "val"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), sFillColor.toInt32(16)); + CPPUNIT_ASSERT_EQUAL(Color(0x00b050), Color(ColorTransparency, sFillColor.toInt32(16))); sal_Int32 nLineColor = getXPath(pXmlDocument, "/w:document/w:body/w:p[5]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:solidFill/a:srgbClr", "val").toInt32(16); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), nLineColor); + CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(ColorTransparency, nLineColor)); // check direct line type assignments have been preserved sal_Int32 nLineWidth = getXPath(pXmlDocument, @@ -857,12 +857,12 @@ CPPUNIT_TEST_FIXTURE(Test, testShapeThemePreservation) uno::Reference<drawing::XShape> xShape3 = getShape(3); // check colors are properly applied to shapes on import - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape1, "FillColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfcd5b5), getProperty<sal_Int32>(xShape2, "FillColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00b050), getProperty<sal_Int32>(xShape3, "FillColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x3a5f8b), getProperty<sal_Int32>(xShape1, "LineColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f6228), getProperty<sal_Int32>(xShape2, "LineColor")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xff0000), getProperty<sal_Int32>(xShape3, "LineColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x4f81bd), Color(ColorTransparency, getProperty<sal_Int32>(xShape1, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xfcd5b5), Color(ColorTransparency, getProperty<sal_Int32>(xShape2, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x00b050), Color(ColorTransparency, getProperty<sal_Int32>(xShape3, "FillColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x3a5f8b), Color(ColorTransparency, getProperty<sal_Int32>(xShape1, "LineColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0x4f6228), Color(ColorTransparency, getProperty<sal_Int32>(xShape2, "LineColor"))); + CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(ColorTransparency, getProperty<sal_Int32>(xShape3, "LineColor"))); // check line properties are properly applied to shapes on import CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty<drawing::LineStyle>(xShape1, "LineStyle")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index d011d695d5a1..1ac07aaff0cc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -932,7 +932,7 @@ DECLARE_OOXMLEXPORT_TEST(testConditionalstylesTablelook, "conditionalstyles-tbll uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); // Background was -1. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x7F7F7F), getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x7F7F7F), Color(ColorTransparency, getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor"))); } DECLARE_OOXMLEXPORT_TEST(testFdo63685, "fdo63685.docx") @@ -1082,7 +1082,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo46361, "fdo46361.docx") // This was LEFT. CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust"))); // This was black, not green. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x008000), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x008000), Color(ColorTransparency, getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"))); // \n char was missing due to unhandled w:br. uno::Reference<text::XText> xShapeText(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_EQUAL(OUString("text\ntext"), xShapeText->getString()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index eb57341eac33..57de8c58a3ed 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -923,11 +923,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.doc uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Footnote Characters"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0x00FF00), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL( Color(0x00FF00), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); xPageStyle.set(getStyles("CharacterStyles")->getByName("Footnote anchor"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0x00FF00), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL( Color(0x00FF00), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); //tdf#118361 - in RTL locales, the footnote separator should still be left aligned. uno::Any aPageStyle = getStyles("PageStyles")->getByName("Standard"); @@ -942,30 +942,30 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx" xEndnotes->getByIndex(0) >>= xEndnote; // character properties were previously not assigned to the footnote/endnote in-text anchor. CPPUNIT_ASSERT_EQUAL( 24.0f, getProperty< float >(xEndnote->getAnchor(), "CharHeight") ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF0000), getProperty< sal_Int32 >(xEndnote->getAnchor(), "CharColor") ); + CPPUNIT_ASSERT_EQUAL( Color(0xFF0000), Color(ColorTransparency, getProperty< sal_Int32 >(xEndnote->getAnchor(), "CharColor")) ); uno::Reference<text::XText> xEndnoteText; xEndnotes->getByIndex(0) >>= xEndnoteText; // This was Endnote Symbol CPPUNIT_ASSERT_EQUAL(OUString("Endnote"), getProperty<OUString>(getParagraphOfText(1, xEndnoteText), "ParaStyleName")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x993300), getProperty<sal_Int32>(getParagraphOfText(1, xEndnoteText), "CharColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x993300), Color(ColorTransparency, getProperty<sal_Int32>(getParagraphOfText(1, xEndnoteText), "CharColor"))); uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Endnote Characters"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF00FF), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL( Color(0xFF00FF), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); xPageStyle.set(getStyles("CharacterStyles")->getByName("Endnote anchor"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF00FF), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL( Color(0xFF00FF), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); } DECLARE_OOXMLEXPORT_TEST(testTdf55427_footnote2endnote, "tdf55427_footnote2endnote.odt") { CPPUNIT_ASSERT_EQUAL(4, getPages()); uno::Reference<beans::XPropertySet> xPageStyle(getStyles("ParagraphStyles")->getByName("Footnote"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", sal_Int32(0xFF007F), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", Color(0xFF007F), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); xPageStyle.set(getStyles("ParagraphStyles")->getByName("Endnote"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", sal_Int32(0x2BD0D2), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", Color(0x2BD0D2), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); @@ -1278,7 +1278,7 @@ DECLARE_OOXMLEXPORT_TEST( testActiveXCheckbox, "activex_checkbox.docx" ) CPPUNIT_ASSERT_EQUAL( sal_Int32( 0x316AC5 ), getProperty<sal_Int32>(xPropertySet, "BackgroundColor") ); // Check Text color (active border system color) - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD4D0C8), getProperty<sal_Int32>(xPropertySet, "TextColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xD4D0C8), Color(ColorTransparency, getProperty<sal_Int32>(xPropertySet, "TextColor"))); // Check state of the checkbox CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(xPropertySet, "State")); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 0676e524376b..81cbf9723794 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -599,16 +599,17 @@ 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(sal_Int32(0xD99594), getProperty<sal_Int32>(xFrame, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), + Color(ColorTransparency, getProperty<sal_Int32>(xFrame, "BackColor"))); table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aBorder.Color); + CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, aBorder.Color)); CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), aBorder.LineWidth); table::ShadowFormat aShadowFormat = getProperty<table::ShadowFormat>(xFrame, "ShadowFormat"); CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadowFormat.Location); CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); + CPPUNIT_ASSERT_EQUAL(Color(0x622423), Color(ColorTransparency, aShadowFormat.Color)); } DECLARE_RTFEXPORT_TEST(testTextframeGradient, "textframe-gradient.rtf") @@ -622,16 +623,16 @@ DECLARE_RTFEXPORT_TEST(testTextframeGradient, "textframe-gradient.rtf") CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); awt::Gradient aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aGradient.StartColor); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(Color(0xC0504D), Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(Color(0xD99594), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); xFrame.set(xIndexAccess->getByIndex(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, getProperty<drawing::FillStyle>(xFrame, "FillStyle")); aGradient = getProperty<awt::Gradient>(xFrame, "FillGradient"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aGradient.StartColor); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x666666), aGradient.EndColor); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, Color(ColorTransparency, aGradient.StartColor)); + CPPUNIT_ASSERT_EQUAL(Color(0x666666), Color(ColorTransparency, aGradient.EndColor)); CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_AXIAL, aGradient.Style); } @@ -734,7 +735,8 @@ 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(sal_Int32(0xd8d8d8), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xd8d8d8), + Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_RTFEXPORT_TEST(testFdo68787, "fdo68787.rtf") @@ -1083,7 +1085,8 @@ 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(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x92D050), + Color(ColorTransparency, getProperty<sal_Int32>(xPageStyle, "BackColor"))); } DECLARE_RTFEXPORT_TEST(testTdf96175, "tdf96175.rtf") diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index 90982b870c83..9e1cb9578ff6 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -82,8 +82,9 @@ 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", sal_Int32(0xFF0000), - getProperty<sal_Int32>(xFootnote->getAnchor(), "CharColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Footnote Character color", Color(0xFF0000), + Color(ColorTransparency, getProperty<sal_Int32>(xFootnote->getAnchor(), "CharColor"))); } DECLARE_RTFEXPORT_TEST(testTdf130817, "tdf130817.rtf") @@ -123,12 +124,15 @@ 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(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xF8DF7C), + Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); xCell.set(xTable->getCellByName("A6")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x81D41A), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x81D41A), + Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); xCell.set(xTable->getCellByName("B6")); if (mbExported) - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFBCC), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xFFFBCC), + Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_RTFEXPORT_TEST(testTdf122589_firstSection, "tdf122589_firstSection.odt") diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx index 25f43e1148bd..28daa538f677 100644 --- a/sw/qa/extras/rtfexport/rtfexport5.cxx +++ b/sw/qa/extras/rtfexport/rtfexport5.cxx @@ -386,7 +386,8 @@ 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(sal_Int32(0xCC0000), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xCC0000), + Color(ColorTransparency, getProperty<sal_Int32>(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, @@ -495,9 +496,11 @@ 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(sal_Int32(0xff0000), getProperty<sal_Int32>(getShape(1), "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xff0000), Color(ColorTransparency, + getProperty<sal_Int32>(getShape(1), "FillColor"))); // Second (front) should be green. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(2), "FillColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x00ff00), Color(ColorTransparency, + getProperty<sal_Int32>(getShape(2), "FillColor"))); } DECLARE_RTFEXPORT_TEST(testLevelfollow, "levelfollow.rtf") @@ -530,7 +533,9 @@ DECLARE_RTFEXPORT_TEST(testLevelfollow, "levelfollow.rtf") DECLARE_RTFEXPORT_TEST(testCharColor, "char-color.rtf") { // This was -1: character color wasn't set. - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x365F91), getProperty<sal_Int32>(getParagraph(1), "CharColor")); + CPPUNIT_ASSERT_EQUAL( + Color(0x365F91), + Color(ColorTransparency, getProperty<sal_Int32>(getParagraph(1), "CharColor"))); } DECLARE_RTFEXPORT_TEST(testFdo69289, "fdo69289.rtf") diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index f155485eebd2..4325aeb1b1f5 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -3616,7 +3616,7 @@ void SwUiWriterTest::testTableBackgroundColor() //Checking cells for background color only A1 should be modified uno::Reference<table::XCell> xCell; xCell = xTable->getCellByName("A1"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF00FF), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xFF00FF), Color(ColorTransparency, getProperty<sal_Int32>(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/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 07341ff7e15e..19dffc946001 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -1276,7 +1276,7 @@ DECLARE_WW8EXPORT_TEST(testCellBgColor, "cell-bg-color.odt") uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xCC0000), getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xCC0000), Color(ColorTransparency, getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor"))); } DECLARE_WW8EXPORT_TEST(testBnc636128, "bnc636128.doc") diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index bf751ee46426..723fbf43a4c3 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -99,11 +99,11 @@ DECLARE_WW8EXPORT_TEST(testTdf116436_tableBackground, "tdf116436_tableBackground uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xF8DF7C), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); xCell.set(xTable->getCellByName("A6")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x81D41A), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0x81D41A), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); xCell.set(xTable->getCellByName("B6")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFBCC), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL(Color(0xFFFBCC), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_WW8EXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.doc") @@ -131,9 +131,9 @@ DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, "tdf49102_mergedCellNum DECLARE_WW8EXPORT_TEST(testTdf55427_footnote2endnote, "tdf55427_footnote2endnote.odt") { uno::Reference<beans::XPropertySet> xPageStyle(getStyles("ParagraphStyles")->getByName("Footnote"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", sal_Int32(0xFF007F), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote style is rose color", Color(0xFF007F), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); xPageStyle.set(getStyles("ParagraphStyles")->getByName("Endnote"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", sal_Int32(0x2BD0D2), getProperty< sal_Int32 >(xPageStyle, "CharColor") ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Endnote style is cyan3 color", Color(0x2BD0D2), Color(ColorTransparency, getProperty< sal_Int32 >(xPageStyle, "CharColor")) ); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index a7ce6a38ed75..8e894c711457 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -601,9 +601,9 @@ DECLARE_WW8EXPORT_TEST(testTdf117217_largeTableBackgrounds, "tdf117217_largeTabl uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); // Cell 22: light-red == 16711680 uno::Reference<text::XTextRange> xCell(xTable->getCellByName("V1"), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("light red", sal_Int32(0xE0C2CD), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("light red", Color(0xE0C2CD), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); xCell.set(xTable->getCellByName("Z1"), uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("light red", sal_Int32(0xE0C2CD), getProperty<sal_Int32>(xCell, "BackColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("light red", Color(0xE0C2CD), Color(ColorTransparency, getProperty<sal_Int32>(xCell, "BackColor"))); } DECLARE_WW8EXPORT_TEST(testTdf94009_zeroPgMargin, "tdf94009_zeroPgMargin.odt")