summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-08-25 02:24:42 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-11-18 08:08:14 +0100
commit3ed69deb04cca67e377c15956679f7bb9794e4ff (patch)
treea11f232522755c1f4bc394bb2b90e075525a5f93 /oox/source
parent5e6e45eb4247bf8bd57d157b44f49577dde38716 (diff)
implement color tint or shade import for pptx
[ Miklos: althought the PowerPoint UI doesn't seem to have a way to generate this markup. ] (cherry picked from commit de40c940c3a94588d44a3d1f6d8cd4191cca4f73) Change-Id: Ibf98ba335b10859e4d6d702263f09e6ba2033bff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125426 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/color.cxx16
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx1
2 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 2ced5345904e..426197102160 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -479,6 +479,22 @@ void Color::clearTransparence()
mnAlpha = MAX_PERCENT;
}
+sal_Int16 Color::getTintOrShade()
+{
+ for(auto const& aTransform : maTransforms)
+ {
+ switch(aTransform.mnToken)
+ {
+ case XML_tint:
+ // from 1000th percent to 100th percent...
+ return aTransform.mnValue/10;
+ case XML_shade:
+ // from 1000th percent to 100th percent...
+ return -aTransform.mnValue/10;
+ }
+ }
+ return 0;
+}
::Color Color::getColor( const GraphicHelper& rGraphicHelper, ::Color nPhClr ) const
{
const sal_Int32 nTempC1 = mnC1;
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 90b0e38c1d3a..bd4d051a490b 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -113,6 +113,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap.setProperty(PROP_CharColor, aColor.getColor(rFilter.getGraphicHelper()));
// set color theme index
rPropMap.setProperty(PROP_CharColorTheme, aColor.getSchemeColorIndex());
+ rPropMap.setProperty(PROP_CharColorTintOrShade, aColor.getTintOrShade());
if (aColor.hasTransparency())
{