sw/source/filter/ww8/docxattributeoutput.cxx |    5 ++++-
 sw/source/filter/ww8/docxtableexport.cxx     |   20 ++++++++++++++------
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit f19d30a41a7ab5094087107d0b1627d7e6bd48c4
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Dec 9 19:03:51 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Dec 12 16:21:44 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
    (cherry picked from commit f4ff6e8d27b44ac59c54eb130179b3da0e01a9e9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195362
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195536

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f5a8c45c732e..95d5c0b7e490 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4381,7 +4381,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 d267960b64ae..4d18255dfdac 100644
--- a/sw/source/filter/ww8/docxtableexport.cxx
+++ b/sw/source/filter/ww8/docxtableexport.cxx
@@ -663,9 +663,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(
@@ -734,9 +738,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