summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/fillpropertiesgroupcontext.cxx
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2013-07-17 13:13:30 +0530
committerMuthu Subramanian <sumuthu@suse.com>2013-07-17 13:13:30 +0530
commitad4604428dc98686d00637b06fe09078873c9acf (patch)
treea0a7ff54f6c18fb13fd556644266e413925e06a1 /oox/source/drawingml/fillpropertiesgroupcontext.cxx
parentb8bcfade5731297dc64c02afd64ba0ea3b4f5132 (diff)
n#820077: Import images with duotone filter.suse-4.0-8
Also, contains implementation for a simple duotone filter. (Port from commit: 8b716072410bcfd252739fb953d5ac198e27a895)
Diffstat (limited to 'oox/source/drawingml/fillpropertiesgroupcontext.cxx')
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
index ad928cd5980f..b73fb2fc91b8 100644
--- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx
+++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
@@ -187,6 +187,9 @@ Reference< XFastContextHandler > BlipContext::createFastChildContext(
case A_TOKEN( clrChange ):
return new ColorChangeContext( *this, rxAttribs, mrBlipProps );
+ case A_TOKEN( duotone ):
+ return new DuotoneContext( *this, rxAttribs, mrBlipProps );
+
case A_TOKEN( lum ):
mrBlipProps.moBrightness = aAttribs.getInteger( XML_bright );
mrBlipProps.moContrast = aAttribs.getInteger( XML_contrast );
@@ -197,6 +200,29 @@ Reference< XFastContextHandler > BlipContext::createFastChildContext(
// ============================================================================
+DuotoneContext::DuotoneContext( ContextHandler& rParent,
+ const Reference< XFastAttributeList >& rxAttribs, BlipFillProperties& rBlipProps ) :
+ ContextHandler( rParent ),
+ mrBlipProps( rBlipProps ),
+ mnColorIndex( 0 )
+{
+ AttributeList aAttribs( rxAttribs );
+ mrBlipProps.maDuotoneColors[0].setUnused();
+ mrBlipProps.maDuotoneColors[1].setUnused();
+}
+
+DuotoneContext::~DuotoneContext()
+{
+}
+
+Reference< XFastContextHandler > DuotoneContext::createFastChildContext(
+ sal_Int32 /*nElement*/, const Reference< XFastAttributeList >& ) throw (SAXException, RuntimeException)
+{
+ if( mnColorIndex < 2 )
+ return new ColorValueContext( *this, mrBlipProps.maDuotoneColors[mnColorIndex++] );
+ return 0;
+}
+
BlipFillContext::BlipFillContext( ContextHandler& rParent,
const Reference< XFastAttributeList >& rxAttribs, BlipFillProperties& rBlipProps ) :
ContextHandler( rParent ),