include/oox/drawingml/color.hxx                  |    1 +
 oox/source/drawingml/color.cxx                   |   16 ++++++++++++++++
 oox/source/drawingml/textcharacterproperties.cxx |    1 +
 3 files changed, 18 insertions(+)

New commits:
commit 3ed69deb04cca67e377c15956679f7bb9794e4ff
Author:     Sarper Akdemir <sarper.akde...@collabora.com>
AuthorDate: Wed Aug 25 02:24:42 2021 +0300
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Nov 18 08:08:14 2021 +0100

    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 <vmik...@collabora.com>

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())
         {

Reply via email to