diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-06 08:53:50 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-06 10:10:59 +0100 |
commit | 51c3d8d7f6a2a3b95e97b9a151df0e63ff09cb74 (patch) | |
tree | dea18f57897b38ce35dda03b4e7d26ea81c4c713 /oox/source | |
parent | f72bb33e78ac9eb7d9f21b61bd89b186547993dd (diff) |
PPTX export: handle theme color of shape text with effects
Handle luminance modulation and offset (lighter and darker colors in
PowerPoint); not handling tinting/shading for now, as that seems to be
not used in DrawingML (only in WordprocessingML), and this code is for
shape text only at the moment.
Change-Id: I5e97f890d3072c7ef282ed4fb971362b3ddaaa4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126400
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/export/drawingml.cxx | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 0c8235a3a1da..249c897740a9 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -431,19 +431,31 @@ bool DrawingML::WriteCharColor(const css::uno::Reference<css::beans::XPropertySe const char* pColorName = g_aPredefinedClrNames[nCharColorTheme]; - sal_Int32 nCharColorLumMod{}; - xPropertySet->getPropertyValue("CharColorLumMod") >>= nCharColorLumMod; - sal_Int32 nCharColorLumOff{}; - xPropertySet->getPropertyValue("CharColorLumOff") >>= nCharColorLumOff; sal_Int32 nCharColorTintOrShade{}; xPropertySet->getPropertyValue("CharColorTintOrShade") >>= nCharColorTintOrShade; - if (nCharColorLumMod != 10000 || nCharColorLumOff != 0 || nCharColorTintOrShade != 0) + if (nCharColorTintOrShade != 0) { return false; } mpFS->startElementNS(XML_a, XML_solidFill); - mpFS->singleElementNS(XML_a, XML_schemeClr, XML_val, pColorName); + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, pColorName); + + sal_Int32 nCharColorLumMod{}; + xPropertySet->getPropertyValue("CharColorLumMod") >>= nCharColorLumMod; + if (nCharColorLumMod != 10000) + { + mpFS->singleElementNS(XML_a, XML_lumMod, XML_val, OString::number(nCharColorLumMod * 10)); + } + + sal_Int32 nCharColorLumOff{}; + xPropertySet->getPropertyValue("CharColorLumOff") >>= nCharColorLumOff; + if (nCharColorLumOff != 0) + { + mpFS->singleElementNS(XML_a, XML_lumOff, XML_val, OString::number(nCharColorLumOff * 10)); + } + + mpFS->endElementNS(XML_a, XML_schemeClr); mpFS->endElementNS(XML_a, XML_solidFill); return true; |