diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2013-07-17 12:59:40 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2013-07-17 13:02:07 +0530 |
commit | 8b716072410bcfd252739fb953d5ac198e27a895 (patch) | |
tree | 64c119dbc0db723bce6a205aaf8f189a128f7415 /oox/source/drawingml/fillpropertiesgroupcontext.cxx | |
parent | 09fb28de3b29c426afa4c37e36268e883aa55923 (diff) |
n#820077: Import images with duotone filter.
Also, contains implementation for a simple duotone filter.
Diffstat (limited to 'oox/source/drawingml/fillpropertiesgroupcontext.cxx')
-rw-r--r-- | oox/source/drawingml/fillpropertiesgroupcontext.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx index 0d84d3a6bb90..8483e81b9b8d 100644 --- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx +++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx @@ -179,6 +179,9 @@ ContextHandlerRef BlipContext::onCreateContext( case A_TOKEN( clrChange ): return new ColorChangeContext( *this, rAttribs, mrBlipProps ); + case A_TOKEN( duotone ): + return new DuotoneContext( *this, rAttribs, mrBlipProps ); + case A_TOKEN( lum ): mrBlipProps.moBrightness = rAttribs.getInteger( XML_bright ); mrBlipProps.moContrast = rAttribs.getInteger( XML_contrast ); @@ -187,6 +190,28 @@ ContextHandlerRef BlipContext::onCreateContext( return 0; } +DuotoneContext::DuotoneContext( ContextHandler2Helper& rParent, + const AttributeList& /*rAttribs*/, BlipFillProperties& rBlipProps ) : + ContextHandler2( rParent ), + mrBlipProps( rBlipProps ), + mnColorIndex( 0 ) +{ + mrBlipProps.maDuotoneColors[0].setUnused(); + mrBlipProps.maDuotoneColors[1].setUnused(); +} + +DuotoneContext::~DuotoneContext() +{ +} + +::oox::core::ContextHandlerRef DuotoneContext::onCreateContext( + sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ ) +{ + if( mnColorIndex < 2 ) + return new ColorValueContext( *this, mrBlipProps.maDuotoneColors[mnColorIndex++] ); + return 0; +} + BlipFillContext::BlipFillContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, BlipFillProperties& rBlipProps ) : ContextHandler2( rParent ), |