summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-06-20 09:46:44 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-07-04 08:09:48 +0200
commitfc4ab8cf4ad74fb8b84ca94800802c47d7efc2ff (patch)
tree84f1128dd2dacdaee8110c5ee56e874fdc2a13d2 /svx
parentcdb9706daccf3135e4789ecd93b57c9e32047315 (diff)
sd theme: consider accent1 color when inserting shape with solid fill
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. (cherry picked from commit 486810603fb3f84847bb549004ed0394a2e22d0b) Conflicts: sd/qa/unit/uiimpress.cxx Change-Id: Ic6ae8f91bd719bd80f2b56f12b001d29b0961e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136749 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/source/styles/ColorSets.cxx10
2 files changed, 11 insertions, 1 deletions
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f415e2522bd0..9ab00de7e881 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -10458,7 +10458,7 @@ SfxVoidItem SbaBrwInsert SID_SBA_BRW_INSERT
SfxStringItem BasicShapes SID_DRAWTBX_CS_BASIC
-(SfxStringItem BasicShapes SID_DRAWTBX_CS_BASIC)
+(SfxStringItem BasicShapes SID_DRAWTBX_CS_BASIC, SfxBoolItem CreateDirectly FN_PARAM_1)
[
AutoUpdate = TRUE,
FastCall = FALSE,
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 895ae91c8e47..88284249fc67 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -362,6 +362,16 @@ std::vector<Color> Theme::GetColors() const
return aColors;
}
+Color Theme::GetColor(ThemeColorType eType) const
+{
+ if (!mpColorSet)
+ {
+ return {};
+ }
+
+ return mpColorSet->getColor(static_cast<size_t>(eType));
+}
+
} // end of namespace svx
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */