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 9bc26ff41fbc189cc3b867a73d12d6b82496ffe7
Author:     Jaume Pujantell <jaume.pujant...@collabora.com>
AuthorDate: Fri Mar 14 12:17:09 2025 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Mar 15 11:09:11 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/+/182924
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

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 811674bbb740..6d4532b24c79 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -1255,6 +1255,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 05ef7fd4886d..a47df51234cf 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3860,9 +3860,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 )
     {

Reply via email to