summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2022-04-06 11:44:34 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-04-13 09:57:33 +0200
commit55c7691fadfb9b3a4869cc14432ec57c858f693f (patch)
tree21c4e506bf57d9aba7b87cb351d6bf42b22cd177 /sw/qa/extras/ww8export
parentada2d449175afd9a6aa1db9281739e5ad6ac6fef (diff)
tdf#148380 doc: Import AUTHOR/CREATEDATE as FIXEDFLD
Writerfilter already did this earlier in the patch set. So now change DOC format to do all the same things. Change-Id: I8db2b4e3fc227b73c4d075ee624117e1b1f1d92e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132663 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/ww8export')
-rw-r--r--sw/qa/extras/ww8export/data/tdf148380_createField.docbin0 -> 10240 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx13
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf148380_createField.doc b/sw/qa/extras/ww8export/data/tdf148380_createField.doc
new file mode 100644
index 000000000000..79c5e59c5ecd
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf148380_createField.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index de913f30c451..5f0bf54078cd 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -119,6 +119,19 @@ DECLARE_WW8EXPORT_TEST(testTdf147861_customField, "tdf147861_customField.doc")
CPPUNIT_ASSERT_EQUAL(OUString("DocInformation:Title (fixed)"), xField->getPresentation(true));
}
+DECLARE_WW8EXPORT_TEST(testTdf148380_createField, "tdf148380_createField.doc")
+{
+ // Verify that these are fields, and not just plain text
+ 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);
+ // This should NOT be "Lorenzo Chavez", or a real date since the user hand-modified the result.
+ CPPUNIT_ASSERT_EQUAL(OUString("Myself - that's who"), xField->getPresentation(false));
+ xField.set(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("yesterday at noon"), xField->getPresentation(false));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf138345_paraCharHighlight, "tdf138345_paraCharHighlight.doc")
{
uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(9), 1, "A side benefit is that "), uno::UNO_QUERY_THROW);