summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2019-10-01 21:05:10 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2019-10-02 11:30:58 +0200
commitcb5eaa791739865d54b381c16c60224c432171dc (patch)
tree12be2dcfd9bbf0d45e05b9c5c1c2af2014bbc1db /oox
parentf470e5b7812cc4a1afdef5033a25b682cb1d2b94 (diff)
tdf#127901: pptx export image greyscale, watermark, black/white
Similar to 0db96caf0fcce09b87621c11b584a6d81cc7df86 Change-Id: I5c3ec17c7a3472629ba8a63ab500175add36ee8e Reviewed-on: https://gerrit.libreoffice.org/79994 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 0e49cfca4291..19b23be5cd2a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/ColorMode.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
@@ -1266,6 +1267,23 @@ void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference<beans::X
if (nTransparence == 0 && GetProperty(rXPropSet, "Transparency"))
nTransparence = static_cast<sal_Int32>(mAny.get<sal_Int16>());
+ if (GetProperty(rXPropSet, "GraphicColorMode"))
+ {
+ drawing::ColorMode aColorMode;
+ mAny >>= aColorMode;
+ if (aColorMode == drawing::ColorMode_GREYS)
+ mpFS->singleElementNS(XML_a, XML_grayscl);
+ else if (aColorMode == drawing::ColorMode_MONO)
+ //black/white has a 0,5 threshold in LibreOffice
+ mpFS->singleElementNS(XML_a, XML_biLevel, XML_thresh, OString::number(50000));
+ else if (aColorMode == drawing::ColorMode_WATERMARK)
+ {
+ //map watermark with mso washout
+ nBright = 70;
+ nContrast = -70;
+ }
+ }
+
if (nBright || nContrast)
{