diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-08-18 19:35:01 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-09-12 09:56:11 +0200 |
commit | 5063d9e7e677b0812ecfd81a5c4840fc1e58cbeb (patch) | |
tree | 998adbdf35c91930cd94ab748c6c511c802dde7d /sw | |
parent | 43816e78744afdddd5116d8d598fcdd2f3e8767c (diff) |
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 <justin_luth@sil.org>
(cherry picked from commit 7d01ce4021bafde8184355f46d1cbe2c370767e1)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx | bin | 0 -> 11515 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 8 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx b/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx Binary files differnew file mode 100644 index 000000000000..d12b85b2da9c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf57589_hashColor.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index ec6153369569..f9c6524cafe8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -42,6 +42,14 @@ protected: } }; +DECLARE_OOXMLEXPORT_TEST(testTdf57589_hashColor, "tdf57589_hashColor.docx") +{ + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTMAGENTA, getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(getParagraph(2), "FillStyle")); + CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(getParagraph(2), "ParaBackColor")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") { CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle")); |