diff options
Diffstat (limited to 'oox/source/vml')
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 7 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 28 |
2 files changed, 35 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 4ce5ffb30a34..52390b5e8166 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/drawing/ColorMode.hpp> #include <sal/log.hxx> #include <oox/drawingml/shapepropertymap.hxx> #include <oox/helper/graphichelper.hxx> @@ -977,6 +978,12 @@ Reference< XShape > SimpleShape::createPictureObject(const Reference< XShapes >& aPropSet.setProperty(PROP_GraphicCrop, aGraphicCrop); } + + if (maTypeModel.mnGain == -70 && maTypeModel.mnBlacklevel == 70) + { + // Map MSO 'washout' to our watermark colormode. + aPropSet.setProperty(PROP_GraphicColorMode, uno::makeAny(drawing::ColorMode_WATERMARK)); + } } return xShape; } diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index e8f1b0b1910e..b511a968396c 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -385,6 +385,34 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A mrTypeModel.moCropLeft = rAttribs.getString(XML_cropleft); mrTypeModel.moCropRight = rAttribs.getString(XML_cropright); mrTypeModel.moCropTop = rAttribs.getString(XML_croptop); + + // Gain / contrast. + OptValue<OUString> oGain = rAttribs.getString(XML_gain); + sal_Int32 nGain = 0x10000; + if (oGain.has() && oGain.get().endsWith("f")) + { + nGain = oGain.get().toInt32(); + } + if (nGain < 0x10000) + { + nGain *= 101; // 100 + 1 to round + nGain /= 0x10000; + nGain -= 100; + } + mrTypeModel.mnGain = nGain; + + // Blacklevel / brightness. + OptValue<OUString> oBlacklevel = rAttribs.getString(XML_blacklevel); + sal_Int16 nBlacklevel = 0; + if (oBlacklevel.has() && oBlacklevel.get().endsWith("f")) + { + nBlacklevel = oBlacklevel.get().toInt32(); + } + if (nBlacklevel != 0) + { + nBlacklevel /= 327; + } + mrTypeModel.mnBlacklevel = nBlacklevel; } break; case NMSP_vmlWord | XML_wrap: |