diff options
author | Justin Luth <jluth@mail.com> | 2022-07-14 10:02:35 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-07-15 13:41:34 +0200 |
commit | 386a9fadffa446caf40fd4f40b865c8c9432fa27 (patch) | |
tree | b54318ee3837568220b68534950158be3d91313a /sw | |
parent | 7b312771d7eb33f7410167e36efdaeca6f540b1c (diff) |
tdf#139759 writerfilter: avoid exception importing w:shd in comments
The unit test depends on the two previous fixes in this bug report.
-initial load tests highlight import
-export tests saving the character background
-reload tests this shade import
Change-Id: Iceb405841efc6814654061659e5551ac89f3c7b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137091
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf139759_commentHighlightBackground.docx | bin | 0 -> 10319 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf139759_commentHighlightBackground.docx b/sw/qa/extras/ooxmlexport/data/tdf139759_commentHighlightBackground.docx Binary files differnew file mode 100644 index 000000000000..487439a5cff8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf139759_commentHighlightBackground.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 93ad3abf2da6..038dca7cc92b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -191,6 +191,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf114734_commentFormating, "tdf114734_commentForma getProperty<sal_Int16>(xParagraph, "ParaAdjust")); } +DECLARE_OOXMLEXPORT_TEST(testTdf139759_commentHighlightBackground, "tdf139759_commentHighlightBackground.docx") +{ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + auto xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + uno::Reference<text::XTextField> xField(xFields->nextElement(), uno::UNO_QUERY); + + uno::Reference<text::XText> xText = getProperty<uno::Reference<text::XText>>(xField, "TextRange"); + uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, getProperty<Color>(getRun(xParagraph, 2), "CharBackColor")); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf135906) { loadAndReload("tdf135906.docx"); |