sw/source/filter/ww8/docxattributeoutput.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 8c5683ee74230931c9375a22981239ca1a2c1a2e Author: Noel Grandin <[email protected]> AuthorDate: Wed Oct 29 14:49:15 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Oct 31 10:56:26 2025 +0100 mso-test: fix w:date value format under w:comment When loading and then saving the document from forum-mso-de-128915.docx, we end up with a zero time value that officeotron does not like. Change-Id: Ib663d7982e583f9938fc13725161b75a16de4930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193150 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit 2842db97cf8058b54e15edcaa606585426b9d035) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193234 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 63d6110069c7..9e4ae0b52a5f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8588,7 +8588,10 @@ DocxAttributeOutput::hasProperties DocxAttributeOutput::WritePostitFields() { const DateTime aDateTime = f->GetDateTime(); bool bNoDate = bRemovePersonalInfo || - ( aDateTime.GetYear() == 1970 && aDateTime.GetMonth() == 1 && aDateTime.GetDay() == 1 ); + ( aDateTime.GetYear() == 1970 && aDateTime.GetMonth() == 1 && aDateTime.GetDay() == 1 ) || + // The officeotron validator does not think year 0 is valid, so just dont put anything, + // a zero year is not useful anyway. + ( aDateTime.GetYear() == 0 && aDateTime.GetMonth() == 0 && aDateTime.GetDay() == 0 ); rtl::Reference<sax_fastparser::FastAttributeList> pAttributeList = sax_fastparser::FastSerializerHelper::createAttrList();
