[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - 2 commits - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 19 23:23:05 UTC 2020


 sw/source/core/doc/DocumentContentOperationsManager.cxx |   14 +++++++++++++-
 sw/source/core/docnode/nodes.cxx                        |    6 +++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 088324bbd391c858dd17832708b465eb5b6046e6
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Jun 19 15:05:42 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sat Jun 20 01:22:39 2020 +0200

    tdf#132326 sw_redlinehide: no frames allowed in Undo SwNodesArray
    
    This crashes in SwAccessibleParagraph::GetRealHeadingLevel(); the a11y
    should have been disposed earlier because the node it's connected to is
    in the Undo SwNodesArray.
    
    When SwUndoDelete::SwUndoDelete() calls SwNodes::MoveNodes(), all
    existing frames must be destroyed; the MoveNodes() would reset its flag
    temporarily inside a section, to delay creating the frames inside the
    section when moving to the live SwNodesArray, but this also prevents
    the deletion when moving in the other direction.
    
    (crash is regression from 723728cd358693b8f4bc9d913541aa4479f2bd48)
    
    Change-Id: I13719bf98ea96b8d68db3ee78cf7f4b61a99e7e5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96734
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit a60dd9ef1361c5925803acaa5292e99277d1faf3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96701
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 2feef62276df..10f4ba61be03 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -661,7 +661,11 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
                     {
                         pSctNd->NodesArrChgd();
                         ++nSectNdCnt;
-                        bNewFrames = false;
+                        // tdf#132326 do not let frames survive in undo nodes
+                        if (!GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNodes))
+                        {
+                            bNewFrames = false;
+                        }
                     }
                 }
             }
commit fbb87a3d51efb6fdc502c0f5501c5cb5b3158681
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Jun 19 16:32:19 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sat Jun 20 01:22:28 2020 +0200

    tdf#127635 sw_redlinehide: put point at the end of deletion
    
    SwWrtShell::Insert() is called with a selection, so it first calls
    DeleteAndJoin() to get rid of the selection.
    
    With redlining enabled, this leaves the cursor as it was before, so if
    the point was at the start it still is at the start, so the following
    Insert will insert at the start of the selection.
    
    But then AutoCorrect wants to do things and it uses TextFrameIndex and
    ViewToModelPos and gets a result at the end of the delete redline,
    while the cursor remains at the start of the delete redline.
    
    Avoid this by swapping the selection after DeleteAndJoin() (and also
    DeleteRange() for consistency) so that insertion happens at end of
    redline (swap "above" DoWithBreaks because it creates temporary PaMs).
    
    (regression from sw_redlinehide)
    
    Change-Id: Ib5b0475f610c2ce426e9202e9d325dd0cc451d5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96743
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 398ba26077f9029bdf6f7378bfc9ce8376b6f02d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96705
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 456b1ba60f93..08d7eb6f09fa 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2007,6 +2007,11 @@ void DocumentContentOperationsManager::DeleteRange( SwPaM & rPam )
 {
     lcl_DoWithBreaks( *this, rPam, &DocumentContentOperationsManager::DeleteRangeImpl );
 
+    if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
+    {
+        rPam.Normalize(false); // tdf#127635 put point at the end of deletion
+    }
+
     if (!m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline()
         && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty())
     {
@@ -2178,10 +2183,17 @@ bool DocumentContentOperationsManager::DeleteAndJoin( SwPaM & rPam,
     if ( lcl_StrLenOverflow( rPam ) )
         return false;
 
-    return lcl_DoWithBreaks( *this, rPam, (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
+    bool const ret = lcl_DoWithBreaks( *this, rPam, (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
                 ? &DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl
                 : &DocumentContentOperationsManager::DeleteAndJoinImpl,
                 bForceJoinNext );
+
+    if (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn())
+    {
+        rPam.Normalize(false); // tdf#127635 put point at the end of deletion
+    }
+
+    return ret;
 }
 
 // It seems that this is mostly used by SwDoc internals; the only


More information about the Libreoffice-commits mailing list