sw/source/filter/ww8/docxattributeoutput.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit dc13249ddd6f92e367de16adca5f65adf36cedba
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Oct 29 14:49:15 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon Nov 3 15:57:29 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]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193277

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9cd47cba413b..7fbf8205777b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8557,7 +8557,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();

Reply via email to