diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-05-05 20:18:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-07-01 15:16:21 +0200 |
commit | 9f7587debb684688ddb29a90a172e9a3067d2ba1 (patch) | |
tree | eca0f7fcdbb6abaa3e9cfed9c4267e732be2a025 /oox/source | |
parent | ff0eb613d8379e68eaf1754273b314afd28e0b00 (diff) |
tdf#148929 sd theme: limit PPTX import for shape fill effects to lum mod/off
Regression from 30735bdb5a0a81619000fdd24b2d0fbf45687f01 (sd theme: add PPTX
import for shape fill color effects, 2022-04-27), the bugdoc's A2 cell
lost its tinting (its background color is no longer lighter than A1)
after saving back to PPTX + import again.
The code assumed that in case a fill color has effects, it can only be
luminance offset or modulation, since that's what the PowerPoint UI
generates when setting a fill color explicitly. This did not take the
table style case into account, which uses tinting to make a color
lighter.
Fix the problem by not importing the theme index / effects if tinting is
used -- the current doc model is limited to theme index + lum mod/off
with effects.
This limitation can be removed while text color / fill color effects are
not limited to lum mod/off, but also support tinting/shading.
(cherry picked from commit f932b00f3a72dd802a6e50af84c3dc55072a22a0)
Change-Id: I382cc0067518cc262e261a462999170cb7db261b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136731
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/drawingml/color.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 982b77ff4831..f810deecf2bf 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -479,7 +479,7 @@ void Color::clearTransparence() mnAlpha = MAX_PERCENT; } -sal_Int16 Color::getTintOrShade() +sal_Int16 Color::getTintOrShade() const { for(auto const& aTransform : maTransforms) { diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 87b0e62a6fa4..9a39a475ca6c 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -403,7 +403,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, { rPropMap.setProperty(PROP_FillColorTheme, nPhClrTheme); } - else + else if (maFillColor.getTintOrShade() == 0) { rPropMap.setProperty(PROP_FillColorTheme, maFillColor.getSchemeColorIndex()); rPropMap.setProperty(PROP_FillColorLumMod, maFillColor.getLumMod()); |