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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 6 14:43:53 UTC 2019


 sw/source/core/undo/undobj.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 1644fb345e41851fe9fa9d34544e7a1556e1afd6
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Dec 6 12:37:43 2019 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Dec 6 15:42:24 2019 +0100

    tdf#121300 sw: adapt at-char selection to latest at-para design
    
    Also use heuristic from commit 91b2325808a75174f284c48c8b8afc118fad74e4
    to not delete on backspace/delete selections for at-char flys.
    
    Change-Id: I8f561eb0176e0655b715366d1ffe3c71fbee9e30
    Reviewed-on: https://gerrit.libreoffice.org/84622
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Tested-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 98d1622b3721fe899c4e1faa0b4cc35695253014)
    Reviewed-on: https://gerrit.libreoffice.org/84629
    Tested-by: Jenkins

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 3257b862f0cc..b3f08f29022a 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1545,6 +1545,8 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
         SwPosition const & rStart, SwPosition const & rEnd,
         DelContentType const nDelContentType)
 {
+    assert(rStart <= rEnd);
+
     // CheckNoCntnt means DelFullPara which is obvious to handle
     if (DelContentType::CheckNoCntnt & nDelContentType)
     {   // exclude selection end node because it won't be deleted
@@ -1562,13 +1564,16 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
             || (rStart == rAnchorPos
                 && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
                 // special case: fully deleted node
-                && ((rStart.nNode != rEnd.nNode && rStart.nContent == 0)
+                && ((rStart.nNode != rEnd.nNode && rStart.nContent == 0
+                        // but not if the selection is backspace/delete!
+                        && IsNotBackspaceHeuristic(rStart, rEnd))
                     || IsAtStartOfSection(rAnchorPos))))
         && ((rAnchorPos < rEnd)
             || (rAnchorPos == rEnd
                 && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
                 // special case: fully deleted node
-                && ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len())
+                && ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len()
+                        && IsNotBackspaceHeuristic(rStart, rEnd))
                     || IsAtEndOfSection(rAnchorPos))));
 }
 


More information about the Libreoffice-commits mailing list