sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 9 +++++---- sw/source/filter/ww8/docxattributeoutput.cxx | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-)
New commits: commit c9702a9b792211f086f07291351fa49caef3ce8a Author: Noel Grandin <[email protected]> AuthorDate: Thu Jan 15 15:06:13 2026 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Mon Jan 19 12:55:02 2026 +0100 officeotron: moveFromRangeStart must have a w:date attribute so just give it our null date Change-Id: I22bdd9ffd53dbe7d4608a759dfc9dd93c658f44a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197426 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins (cherry picked from commit 232b4ff3d530080efe28b8212c44952a625f8bc9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197559 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index 2423e22e93a7..c0b5be54d4e4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -1244,10 +1244,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf145720) // mandatory authors and dates assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFromRangeStart", "author", u"Tekijä"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveToRangeStart", "author", u"Tekijä"); - // no date (anonymized change) - // This failed, date was exported as w:date="0-00-00T00:00:00Z", and later "1970-01-01T00:00:00Z" - assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFromRangeStart", "date"); - assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveToRangeStart", "date"); + // anonymized date + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:moveFromRangeStart", "date", + u"1970-01-01T00:00:00Z"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:moveToRangeStart", "date", + u"1970-01-01T00:00:00Z"); } CPPUNIT_TEST_FIXTURE(Test, testTdf150166) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 1e4168c9a330..c0861329eb96 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2267,6 +2267,9 @@ void DocxAttributeOutput::DoWriteMoveRangeTagStart(std::u16string_view bookmarkN : OUStringToOString(rAuthor, RTL_TEXTENCODING_UTF8)); if (!bNoDate) pAttributeList->add(FSNS(XML_w, XML_date ), DateTimeToOString( aDateTime )); + else + // w:data is a required attribute, so just use a placeholder date + pAttributeList->add(FSNS(XML_w, XML_date ), "1970-01-01T00:00:00Z"); pAttributeList->add(FSNS(XML_w, XML_name), bookmarkName); m_pSerializer->singleElementNS( XML_w, bFrom ? XML_moveFromRangeStart : XML_moveToRangeStart, pAttributeList );
