sw: add ThemeColorChanger that sweeps the model and changes colors

Desktop / LibreOffice - Tomaž Vajngerl [collabora.co.uk] - 14 January 2023 07:52 UTC

The ThemeColorChanger responisiblity is to recalculate and change all the theme colors in the model. This includes styles and direct formatting changes. It uses ModelTraverser for direct formatting changes as it already implements traversing through nodes.

The ThemeColorChanger replaces the code to change the colors in ThemePanel.

Also modify undo/redo for changing of attributes to not move the cursor and selection when undoing and redoing (new flag NO_CURSOR_CHANGE), as in this case it is very distrcting.

Change-Id: Ida1912bd0697307daad9244d474862830ab2686f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145263

1af58b5acec4 sw: add ThemeColorChanger that sweeps the model and changes colors
sw/Library_sw.mk | 1 +
sw/inc/swtypes.hxx | 6 +-
sw/source/core/inc/ThemeColorChanger.hxx | 33 ++++
sw/source/core/inc/UndoAttribute.hxx | 2 +-
sw/source/core/model/ThemeColorChanger.cxx | 271 +++++++++++++++++++++++++++++
sw/source/core/undo/unattr.cxx | 21 ++-
sw/source/uibase/sidebar/ThemePanel.cxx | 44 +----
7 files changed, 331 insertions(+), 47 deletions(-)

Upstream: cgit.freedesktop.org


  • Share