diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-06-30 12:24:01 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-06-30 15:06:26 +0200 |
commit | 17aeb522f566cf225baa5ce524e747089f76728d (patch) | |
tree | 877182e8c638dcc30b75a922ff40edfd2701a841 /sw | |
parent | 2017bf06ab758270b2a9eeef5717a34e63e63722 (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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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, |