Files
Mike Kaganski f9b5f49113 tdf#170386: Delay broadcasting object changes, not drop it
Creating a SvxShapeText (and inserting it into the model) will call
SetEditSource with a newly created SvxTextEditSource; and that one
will register its impl as a listener to underlying SdrObject.

Saving the document, the SvxTextEditSource will be queried for the
properties of the text, when generating autostyles. Therefore, it
is important that the properties known to SvxTextEditSource match
the properties applied to the SdrObject.

The problem was, that the notifications to the listeners were not
sent, when the model was locked; and when it was unlocked, there
was no mechanism to re-send notifications at this time. This meant
that SvxTextEditSource was unaware of e.g. weight changes applied
to SdrObject inside lockControllers ... unlockControllers pair.

This change introduces a list where objects can register for a
postponed change notification.

The unit test is implemented as UITest; trying to do that in a
CppunitTest failed (the test succeeded even without the fix, maybe
because the CppunitTest has no UI, and so the mechanics of using
SvxTextEditSource differ).

There already was a case that relied on dropping the notifications,
specifically ScDrawLayer::SetPageSize, which can move / resize
objects as a result of underlying page size change (like hiding
columns), but doesn't want the objects to update their anchoring
information. That was addressed by adding a flag to ignore adding
deferred notifications.

Change-Id: I3aac61bf91a2461b024b26ad7e7c199cc7def37b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198187
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 3f87466d6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198365
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2026-02-02 15:22:05 +01:00
..
2025-08-18 20:19:39 +02:00