summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-06-30 12:24:01 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-06-30 23:28:25 +0200
commita994ab97213db1d8a4a793ed6290d577e431bdbc (patch)
tree8ed5ed1d8a3e6d8fc06506fe4de81f267d57ab67
parent7a542a41f48c673478606cba307662780e5137e0 (diff)
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@cib.de> (cherry picked from commit 17aeb522f566cf225baa5ce524e747089f76728d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97499 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/source/core/undo/undobj.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index c46c93bbcec0..c37cffbaf9f8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1630,14 +1630,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,