sw/qa/extras/ooxmlexport/ooxmlexport6.cxx    |    3 ---
 sw/source/filter/ww8/docxattributeoutput.cxx |    5 ++++-
 sw/source/filter/ww8/docxtableexport.cxx     |   20 ++++++++++++++------
 3 files changed, 18 insertions(+), 10 deletions(-)

New commits:
commit f4ff6e8d27b44ac59c54eb130179b3da0e01a9e9
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Dec 9 19:03:51 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Dec 10 09:40:47 2025 +0100

    officeotron: "0-00-00T00:00:00Z" is not a valid date
    
    similar to commit 8c5683ee74230931c9375a22981239ca1a2c1a2e
    
    Change-Id: I3de3e44ea4955a159d8e23932108d623fbb27c60
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195331
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 9a560bf3c19f..1aa0c02104ff 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -505,9 +505,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf127814)
 {
     createSwDoc("tdf127814.docx");
 
-    // FIXME: validation error in OOXML export: Errors: 136
-    skipValidation();
-
     save(TestFilter::DOCX);
     // Paragraph top margin was 0 in a table started on a new page
     xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8d3e9369592b..f0986e3353de 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4359,7 +4359,10 @@ void DocxAttributeOutput::StartRedline(const 
SwRedlineData* pRedlineData, bool b
 
     const DateTime& aDateTime = pRedlineData->GetTimeStamp();
     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 );
     bool isInMoveBookmark = false;
     for (const auto& openedBookmark : m_rOpenedBookmarksIds)
     {
diff --git a/sw/source/filter/ww8/docxtableexport.cxx 
b/sw/source/filter/ww8/docxtableexport.cxx
index fa640b4700ae..6be12ab131ef 100644
--- a/sw/source/filter/ww8/docxtableexport.cxx
+++ b/sw/source/filter/ww8/docxtableexport.cxx
@@ -661,9 +661,13 @@ void DocxAttributeOutput::TableRowRedline(
             RTL_TEXTENCODING_UTF8));
 
         const DateTime aDateTime = aRedlineData.GetTimeStamp();
-        bool bNoDate = bRemovePersonalInfo
-                       || (aDateTime.GetYear() == 1970 && aDateTime.GetMonth() 
== 1
-                           && aDateTime.GetDay() == 1);
+        bool bNoDate
+            = bRemovePersonalInfo
+              || (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);
 
         if (bNoDate)
             m_pSerializer->singleElementNS(
@@ -732,9 +736,13 @@ void DocxAttributeOutput::TableCellRedline(
             RTL_TEXTENCODING_UTF8));
 
         const DateTime aDateTime = aRedlineData.GetTimeStamp();
-        bool bNoDate = bRemovePersonalInfo
-                       || (aDateTime.GetYear() == 1970 && aDateTime.GetMonth() 
== 1
-                           && aDateTime.GetDay() == 1);
+        bool bNoDate
+            = bRemovePersonalInfo
+              || (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);
 
         if (bNoDate)
             m_pSerializer->singleElementNS(

Reply via email to