summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-02-24 09:44:36 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-02-24 15:49:47 +0100
commit3082985399bc549cd5bcb675c4af2c91d8149413 (patch)
treee3c26997785e021e74925eafbcf229049da25683 /sw/qa/extras
parent1c62465ff27a5721fac7f60798e8d674fefdd2aa (diff)
tdf#130812 DOC import: fix unexpected transparency of text
DOC can have black with transparency set to 0xff, and that is meant to be just black. Allow COL_AUTO, though; the rendering will not consider that as transparent anyway. Other than that, DOC does not support text with transparency, it's a DOCX-only feature. Change-Id: I33f61b54b8ebd7958845063ae61900182d6f5e80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89321 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 634a9ba15d65b6fdc506326e6b49b4b957c5cfcb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89341 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ww8import/data/transparent-text.docbin0 -> 33792 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/transparent-text.doc b/sw/qa/extras/ww8import/data/transparent-text.doc
new file mode 100644
index 000000000000..b458db29cc09
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/transparent-text.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index e3763e60ba17..d58490f1b0da 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -94,6 +94,18 @@ DECLARE_WW8IMPORT_TEST(testTdf106291, "tdf106291.doc")
CPPUNIT_ASSERT(cellHeight.toInt32() > 200); // height might depend on font size
}
+DECLARE_WW8IMPORT_TEST(testTransparentText, "transparent-text.doc")
+{
+ uno::Reference<text::XText> xHeaderText = getProperty<uno::Reference<text::XText>>(
+ getStyles("PageStyles")->getByName("Standard"), "HeaderText");
+ uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(3, xHeaderText);
+ // Without the accompanying fix in place, this test would have failed: transparency was set to
+ // 100%, so the text was not readable.
+ sal_Int32 nExpected(COL_BLACK);
+ sal_Int32 nActual(getProperty<sal_Int16>(xParagraph, "CharTransparence"));
+ CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+}
+
DECLARE_WW8IMPORT_TEST( testTdf105570, "tdf105570.doc" )
{
/*****