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 05f2cb64f690093172b5d0465936a78b46b3380e Author: Jaume Pujantell <jaume.pujant...@collabora.com> AuthorDate: Fri Mar 14 12:17:09 2025 +0100 Commit: Jaume Pujantell <jaume.pujant...@collabora.com> CommitDate: Fri Mar 14 16:48:41 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 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 3ae8bfd729a4..859f69321219 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -1293,6 +1293,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 6f1aa08eca3f..32e5ca3f5485 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 ) {