diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2021-08-25 02:24:42 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-18 08:08:14 +0100 |
commit | 3ed69deb04cca67e377c15956679f7bb9794e4ff (patch) | |
tree | a11f232522755c1f4bc394bb2b90e075525a5f93 | |
parent | 5e6e45eb4247bf8bd57d157b44f49577dde38716 (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>
-rw-r--r-- | include/oox/drawingml/color.hxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/color.cxx | 16 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 00473cfe6f27..bd67982c6e92 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -99,6 +99,7 @@ public: /** Returns the scheme name from the a:schemeClr element for interoperability purposes */ const OUString& getSchemeColorName() const { return msSchemeName; } sal_Int16 getSchemeColorIndex() const; + sal_Int16 getTintOrShade(); /** Returns the unaltered list of transformations for interoperability purposes */ const css::uno::Sequence< css::beans::PropertyValue >& getTransformations() const { return maInteropTransformations;} 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()) { |