summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2012-12-11 15:35:43 +0100
committerRadek Doulik <rodo@novell.com>2012-12-11 16:20:13 +0100
commit9f19422c546c4d8d556699df394622386afca5f3 (patch)
tree83d886f75ff6bb7f72f3c8048be9d8195d8133db /oox/source/drawingml
parent20b720ba3790d657ea3112fde0678c262908a1b6 (diff)
use effect references
Change-Id: Ie0d295cd7db695f777071edcd9b792056ac783ef
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/shape.cxx16
-rw-r--r--oox/source/drawingml/theme.cxx5
-rw-r--r--oox/source/drawingml/themeelementscontext.cxx12
3 files changed, 24 insertions, 9 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index dba41afe372f..3318ab8fccb7 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -490,6 +490,8 @@ Reference< XShape > Shape::createAndInsert(
aFillProperties.moFillType = XML_noFill;
sal_Int32 nFillPhClr = -1;
EffectProperties aEffectProperties;
+ // TODO: use ph color when applying effect properties
+ //sal_Int32 nEffectPhClr = -1;
if( pTheme )
{
@@ -505,12 +507,13 @@ Reference< XShape > Shape::createAndInsert(
aFillProperties.assignUsed( *pFillProps );
nFillPhClr = pFillRef->maPhClr.getColor( rGraphicHelper );
}
-// if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_fillRef ) )
-// {
-// if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
-// aEffectProperties.assignUsed( *pEffectProps );
-// nEffectPhClr = pEffectRef->maPhClr.getColor( rGraphicHelper );
-// }
+ if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_effectRef ) )
+ {
+ if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) )
+ aEffectProperties.assignUsed( *pEffectProps );
+ // TODO: use ph color when applying effect properties
+ // nEffectPhClr = pEffectRef->maPhClr.getColor( rGraphicHelper );
+ }
}
aLineProperties.assignUsed( getLineProperties() );
@@ -535,6 +538,7 @@ Reference< XShape > Shape::createAndInsert(
mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle );
aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr );
aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr );
+ // TODO: use ph color when applying effect properties
aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper );
// applying autogrowheight property before setting shape size, because
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index 32c0997546c6..c60b764e0ea6 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -55,6 +55,11 @@ const LineProperties* Theme::getLineStyle( sal_Int32 nIndex ) const
return lclGetStyleElement( maLineStyleList, nIndex );
}
+const EffectProperties* Theme::getEffectStyle( sal_Int32 nIndex ) const
+{
+ return lclGetStyleElement( maEffectStyleList, nIndex );
+}
+
const TextCharacterProperties* Theme::getFontStyle( sal_Int32 nSchemeType ) const
{
return maFontScheme.get( nSchemeType ).get();
diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx
index c68369e37c64..a171545e7df8 100644
--- a/oox/source/drawingml/themeelementscontext.cxx
+++ b/oox/source/drawingml/themeelementscontext.cxx
@@ -21,6 +21,8 @@
#include "oox/drawingml/clrschemecontext.hxx"
#include "oox/drawingml/lineproperties.hxx"
#include "oox/drawingml/linepropertiescontext.hxx"
+#include "oox/drawingml/effectproperties.hxx"
+#include "oox/drawingml/effectpropertiescontext.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/drawingml/theme.hxx"
@@ -121,9 +123,13 @@ Reference< XFastContextHandler > EffectStyleListContext::createFastChildContext(
switch( nElement )
{
case A_TOKEN( effectStyle ):
- mrEffectStyleList.push_back( EffectStyleList::value_type( new PropertyMap ) );
- // TODO: import effect styles
- return 0;
+ mrEffectStyleList.push_back( EffectPropertiesPtr( new EffectProperties ) );
+ return this;
+
+ case A_TOKEN( effectLst ): // CT_EffectList
+ if( mrEffectStyleList.back() )
+ return new EffectPropertiesContext( *this, *mrEffectStyleList.back() );
+ break;
}
return 0;
}