diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-11-13 08:49:43 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-11-13 10:24:26 +0100 |
commit | 6c761fa3b40d296444681d8d2f991e5a6b7e5b71 (patch) | |
tree | 180b5d4201a9460d68873748e0938180a7e46dfe /include | |
parent | a598de5b6ed6f161844e01f7be7164a65927caee (diff) |
sw floattable, insert UI: fix missing undo/redo
There were 3 problems here:
1) SwDoc::MakeFlyAndMove() declared that inserting fly frames is broken
anyway, so just deleted the whole undo stack. Remove the
DelAllUndoObj() call, so the underlying problem is visible.
2) MoveNodeRange() had a flag to create undo objects, but this flag
wasn't used.
3) The empty text node after the table in the just created fly was
removed using a call to SwNodes::Delete(), which is not undo-aware,
so the table was inserted after the anchor (and not before the anchor)
on undo. Fix this by going via sw::DocumentContentOperationsManager that
knows how to delete while working with the undo.
Do this unconditionally, because the 2 callers of this function is just
SwFEShell::NewFlyFrame() (UI) and SwXFrame::attachToRange() (UNO API,
mostly the DOCX import), probably both want proper undo support.
Change-Id: I50011bf969ff5636c76a8a0b280193ac6d2b90dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159354
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions