sd theme: consider accent1 color when inserting shape with solid fill

Desktop / LibreOffice - Miklos Vajna [collabora.com] - 20 June 2022 09:58 UTC

Once a theme is defined for the master page of the current slide, PowerPoint inserts a shapes with their fill color & line color set based on that theme (so this color is master-page-specific), while Impress sets the fill & line color based on the default shape style.

The Impress behavior has the benefit of doing the usual style-based formatting, but now a document-level style overwrites a (master-)slide-specific theme, which is inconsistent.

Fix the problem by extending sd::FuConstruct::SetStyleSheet(): if we construct a shape with fill, then not only apply the style sheet, but also set the fill & line color based on the theme (if there is any).

Note that this works both in case the shape is instantly created on click (LOK case) or when the user first draws a top-left -> bottom-right point pair to define the position / size of the shape. At the same time line colors don't support themes yet, so that color is just a plain value for now.

Change-Id: Ic6ae8f91bd719bd80f2b56f12b001d29b0961e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136138

486810603fb3 sd theme: consider accent1 color when inserting shape with solid fill
include/svx/ColorSets.hxx | 19 +++++++++++++++++++
sd/qa/unit/uiimpress.cxx | 40 ++++++++++++++++++++++++++++++++++++++++
sd/source/ui/func/fuconstr.cxx | 39 +++++++++++++++++++++++++++++++++++++++
sd/source/ui/view/drviewse.cxx | 5 +++++
svx/sdi/svx.sdi | 2 +-
svx/source/styles/ColorSets.cxx | 10 ++++++++++
6 files changed, 114 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share