[Libreoffice-commits] core.git: sw/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 6 13:39:15 UTC 2019
sw/source/core/undo/undobj.cxx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 98d1622b3721fe899c4e1faa0b4cc35695253014
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 14:37:43 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>
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 7ddeb7a15e3e..21db9be5c8e3 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1548,6 +1548,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
@@ -1565,13 +1567,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