From 55c7691fadfb9b3a4869cc14432ec57c858f693f Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Wed, 6 Apr 2022 11:44:34 +0200 Subject: 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 Reviewed-by: Miklos Vajna --- sw/qa/extras/ww8export/data/tdf148380_createField.doc | Bin 0 -> 10240 bytes sw/qa/extras/ww8export/ww8export3.cxx | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 sw/qa/extras/ww8export/data/tdf148380_createField.doc (limited to 'sw/qa/extras/ww8export') 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 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf148380_createField.doc 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 xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + auto xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference xFields(xFieldsAccess->createEnumeration()); + uno::Reference 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 xRun(getRun(getParagraph(9), 1, "A side benefit is that "), uno::UNO_QUERY_THROW); -- cgit v1.2.3