From 7d01ce4021bafde8184355f46d1cbe2c370767e1 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 18 Aug 2018 19:35:01 +0300 Subject: tdf#57589 writerfilter: support hash-encoded colors Previously, a hash-encoded value would simply fail to zero and thus the color would be dark black. The unit test covers two conditions. Paragraph 1 has a valid encoding, and pararaph 2 has an invalid coding (which is ignored and fails to COL_AUTO). Change-Id: I68940f5c4b0975a87feb6cab8fb3572b7546a077 Reviewed-on: https://gerrit.libreoffice.org/59295 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx | Bin 0 -> 11515 bytes sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx (limited to 'sw/qa/extras/ooxmlexport') diff --git a/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx b/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx new file mode 100644 index 000000000000..d12b85b2da9c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 6974cb776550..263959520851 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -45,6 +45,14 @@ protected: } }; +DECLARE_OOXMLEXPORT_TEST(testTdf57589_hashColor, "tdf57589_hashColor.docx") +{ + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty(getParagraph(1), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTMAGENTA, Color(getProperty(getParagraph(1), "ParaBackColor"))); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty(getParagraph(2), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty(getParagraph(2), "ParaBackColor"))); +} + DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") { CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty(getParagraph(1), "FillStyle")); -- cgit