[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 10 14:24:27 UTC 2020
sw/source/core/undo/undobj.cxx | 8 ++++++--
sw/source/core/undo/untblk.cxx | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
New commits:
commit 4c42ede07bcc33e81c24b9f35b7ee29a5b1ebfd4
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jun 9 16:12:04 2020 +0200
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jun 10 16:23:56 2020 +0200
tdf#132597 sw: fix inconsistent handling of ExcludeFlyAtStartEnd
IsDestroyFrameAnchoredAtChar() checks the position but the only caller,
SwUndoInserts::UndoImpl(), really wants to exclude the entire nodes,
see IsCreateUndoForNewFly().
(regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5)
Change-Id: I763ad3b7d82af03f6910dcf34315f793d090c62e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95952
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit f9fb86408e6e06c262332be26674305ae5c05bb7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95982
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index a73ceeb9f048..e6a6d5a509d7 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1560,10 +1560,15 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
return (rStart < rAnchorPos) && (rAnchorPos < rEnd);
}
+ if (nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
+ { // exclude selection start and end node
+ return (rAnchorPos.nNode < rEnd.nNode)
+ && (rStart.nNode < rAnchorPos.nNode);
+ }
+
// in general, exclude the start and end position
return ((rStart < rAnchorPos)
|| (rStart == rAnchorPos
- && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
// special case: fully deleted node
&& ((rStart.nNode != rEnd.nNode && rStart.nContent == 0
// but not if the selection is backspace/delete!
@@ -1571,7 +1576,6 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
|| (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection(rEnd)))))
&& ((rAnchorPos < rEnd)
|| (rAnchorPos == rEnd
- && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
// special case: fully deleted node
&& ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len()
&& IsNotBackspaceHeuristic(rStart, rEnd))
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index db586c615e4b..134db4698ee2 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -170,7 +170,7 @@ bool SwUndoInserts::IsCreateUndoForNewFly(SwFormatAnchor const& rAnchor,
assert(nStartNode <= nEndNode);
// check all at-char flys at the start/end nodes:
- // ExcludeAtCharFlyAtStartEnd will exclude them!
+ // ExcludeFlyAtStartEnd will exclude them!
SwPosition const*const pAnchorPos = rAnchor.GetContentAnchor();
return pAnchorPos != nullptr
&& ( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA
More information about the Libreoffice-commits
mailing list