summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-11-24 08:22:47 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-11-24 09:33:30 +0100
commita557a1c4ac0b73668452f80169870bdfb204aeb6 (patch)
tree5e7b2b4aa3a9d531b6bbbdff17643878f37f6707 /oox/source
parentecfce0ff23d9f1ed5a51b29b14a7043dce87b300 (diff)
PPTX import: implement native handling of a color's luminance offset
This was already handled in oox/ at import-time: this adds it to the doc model, including UNO API and PPTX import. This is a dependency PPTX export and UI, and also the last transform which is easy to generate from the PowerPoint UI and we didn't import to the doc model. Change-Id: Ica4e738d8dc8e0409160ceab941a82f2475ddc68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125749 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/color.cxx16
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx1
-rw-r--r--oox/source/token/properties.txt1
3 files changed, 18 insertions, 0 deletions
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 35f19c42ed30..ee854a761fa2 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -512,6 +512,22 @@ sal_Int16 Color::getLumMod()
return 10000;
}
+sal_Int16 Color::getLumOff()
+{
+ for (const auto& rTransform : maTransforms)
+ {
+ if (rTransform.mnToken != XML_lumOff)
+ {
+ continue;
+ }
+
+ // From 1000th percent to 100th percent.
+ return rTransform.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 e25c07a2bd70..7ffeaeba8da2 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -132,6 +132,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap.setProperty(PROP_CharColorTheme, aColor.getSchemeColorIndex());
rPropMap.setProperty(PROP_CharColorTintOrShade, aColor.getTintOrShade());
rPropMap.setProperty(PROP_CharColorLumMod, aColor.getLumMod());
+ rPropMap.setProperty(PROP_CharColorLumOff, aColor.getLumOff());
if (aColor.hasTransparency())
{
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index e85d2bae19e6..5d261469ca42 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -57,6 +57,7 @@ CharContoured
CharColorTheme
CharColorTintOrShade
CharColorLumMod
+CharColorLumOff
CharEscapement
CharEscapementHeight
CharFontCharSet