Miklos Vajna 3c039cb312 tdf#166319 sw interdependent redlines: handle reject of insert under format
The bugdoc has <insert>AA<format>BB</format>CC</insert> in it, clicking
reject in the middle of AA results in a leftover BB in the document.

This is because the outer redline type of BB is format, so the other
type is not rejected together with the insert reject. But this is not
correct: if the insert is to be rejected, then it's just a small detail
that there was a format on top of it: all this is meant to be rejected,
like Word does.

Fix the problem similar to how commit
d5ca8b09d5ecdc28e28486e5dbd1ecb655d817ab (tdf#166319 sw interdependent
redlines: handle accept of insert under format, 2025-05-05) handled
accept: if there is a format, then see if it has an underlying insert,
and if so, still combine the to-be-rejected changes.

Note that in contrast to insert-then-delete, it's not enough to accept
the change to delete it (for the higher level reject purpose), so
explicitly call DeleteRange() on the range of the format after the
format redline is gone.

Change-Id: Iaf1122d8e37e210790972e0312564245fa6f813f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185089
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-05-09 12:14:54 +02:00
..
2025-04-29 12:51:44 +02:00