summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx7
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
3 files changed, 12 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index fa0199ede9dd..ebc1cbfd02ab 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -737,6 +737,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf83309, "tdf83309.docx")
// behave same way)
OUString sNodeType = parseDump("/root/page[1]/body/txt[1]/Text[1]", "nType");
CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Text"), sNodeType);
+
+ // tdf148380: creation-date field in header.xml was unsupported on export
+ 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);
+ CPPUNIT_ASSERT_EQUAL(OUString("8/31/14 10:26 AM"), xField->getPresentation(false));
}
CPPUNIT_TEST_FIXTURE(Test, testTdf121661)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 0c357607be22..3df56e2489ce 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -75,8 +75,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148380_createField, "tdf148380_createField.docx"
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
auto xFieldsAccess(xTextFieldsSupplier->getTextFields());
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
- if (mbExported)
- return;
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));
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d038bac90953..44063c816d9e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2935,8 +2935,12 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
case DI_CREATE:
if (DI_SUB_AUTHOR == (nSubType & DI_SUB_MASK))
eField = ww::eAUTHOR;
- else if (GetExport().GetNumberFormat(*pField, sStr))
+ else if (GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty())
eField = ww::eCREATEDATE;
+
+ // Create author/time are always imported as fixed. Safe to ignore on export
+ if (GetExport().GetExportFormat() != MSWordExportBase::DOC)
+ bWriteExpand = false;
break;
case DI_CHANGE: