[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 30 13:07:09 UTC 2020


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

New commits:
commit 17aeb522f566cf225baa5ce524e747089f76728d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jun 30 12:24:01 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Tue Jun 30 15:06:26 2020 +0200

    tdf#134404 sw: another subtlety with start/end of section (at-para flys)
    
    fix this problem by comparing the start/end of the selection instead of
    the anchor position, which always has an index of 0:
    
    1. new document with image anchored to paragraph
    2. insert one letter
    3. press Enter
    4. Backspace -> Image gone
    
    (regression from cc4b5091e739116a7ec83513fa1cd856f0130330)
    
    Change-Id: I1219a9f58ce19ea88d697c90c862fe9005318177
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97511
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index b2609a228813..f0ed41377a35 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1650,14 +1650,14 @@ bool IsSelectFrameAnchoredAtPara(SwPosition const & rAnchorPos,
                 && ((rStart.nNode != rEnd.nNode && rStart.nContent == 0
                         // but not if the selection is backspace/delete!
                         && IsNotBackspaceHeuristic(rStart, rEnd))
-                    || (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection2(rEnd)))))
+                    || (IsAtStartOfSection2(rStart) && IsAtEndOfSection2(rEnd)))))
         && ((rAnchorPos.nNode < rEnd.nNode)
             || (rAnchorPos.nNode == rEnd.nNode
                 && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
                 // special case: fully deleted node
                 && ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len()
                         && IsNotBackspaceHeuristic(rStart, rEnd))
-                    || (IsAtEndOfSection(rAnchorPos) && IsAtStartOfSection2(rStart)))));
+                    || (IsAtEndOfSection2(rEnd) && IsAtStartOfSection2(rStart)))));
 }
 
 bool IsFlySelectedByCursor(SwDoc const & rDoc,


More information about the Libreoffice-commits mailing list