sw/qa/extras/ooxmlexport/data/tdf165059_broken.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 1 + sw/source/filter/ww8/docxattributeoutput.cxx | 15 ++++++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-)
New commits: commit 15ad5a1754d531948fe5fde2552f018463c41bce Author: Jaume Pujantell <jaume.pujant...@collabora.com> AuthorDate: Fri Mar 14 12:17:09 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Mar 20 10:23:28 2025 +0100 tdf#165059 sw use delText inside all del tags Continuation of commit 624de66a2aeee92c0d2cadc8de3740167ec09062 "sw fix not valid moveFrom/moveTo tag". Make sure to us w:delText instead of w:t inside the w:del tags now used because of that change. Change-Id: Ic5bac1865e5c12a71bd15306249c2624eb1149f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182922 Reviewed-by: Jaume Pujantell <jaume.pujant...@collabora.com> Tested-by: Jenkins (cherry picked from commit 05f2cb64f690093172b5d0465936a78b46b3380e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182966 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf165059_broken.docx b/sw/qa/extras/ooxmlexport/data/tdf165059_broken.docx index 548d4d9c7414..6a81afd69e15 100644 Binary files a/sw/qa/extras/ooxmlexport/data/tdf165059_broken.docx and b/sw/qa/extras/ooxmlexport/data/tdf165059_broken.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index 003eed84a7c0..9f786caec376 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -1229,6 +1229,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf165059_moveFromTo) assertXPath(p_XmlDoc, "//w:ins"_ostr, 1); assertXPath(p_XmlDoc, "//w:moveFrom"_ostr, 0); assertXPath(p_XmlDoc, "//w:del"_ostr, 1); + assertXPath(p_XmlDoc, "//w:delText"_ostr, 1); } } // end of anonymous namespace diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d2adca6b6549..0070a93a05e8 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3856,9 +3856,18 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh // the text run is usually XML_t, with the exception of the deleted (and not moved) text sal_Int32 nTextToken = XML_t; - bool bMoved = m_pRedlineData && m_pRedlineData->IsMoved() && - // tdf#150166 save tracked moving around TOC as w:ins, w:del - SwDoc::GetCurTOX(*m_rExport.m_pCurPam->GetPoint()) == nullptr; + bool isInMoveBookmark = false; + for (const auto& openedBookmark : m_rOpenedBookmarksIds) + { + if (openedBookmark.first.startsWith(u"__RefMove")) + { + isInMoveBookmark = true; + break; + } + } + bool bMoved = isInMoveBookmark && m_pRedlineData && m_pRedlineData->IsMoved() && + // tdf#150166 save tracked moving around TOC as w:ins, w:del + SwDoc::GetCurTOX(*m_rExport.m_pCurPam->GetPoint()) == nullptr; if ( m_pRedlineData && m_pRedlineData->GetType() == RedlineType::Delete && !bMoved ) {