diff options
author | Radek Doulik <rodo@novell.com> | 2012-12-11 15:35:43 +0100 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2012-12-11 18:05:09 +0100 |
commit | a69c247f5a9d617d65c932acaf270233183b35cc (patch) | |
tree | 3917549b191d41e9e6a6e0c8afb3395bcee6fdb9 /oox | |
parent | 8846afb15b468bf3397ab5c2acbcca8c835cf9c6 (diff) |
use effect references
Change-Id: Ie0d295cd7db695f777071edcd9b792056ac783ef
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/oox/drawingml/theme.hxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 16 | ||||
-rw-r--r-- | oox/source/drawingml/theme.cxx | 5 | ||||
-rw-r--r-- | oox/source/drawingml/themeelementscontext.cxx | 12 |
4 files changed, 26 insertions, 10 deletions
diff --git a/oox/inc/oox/drawingml/theme.hxx b/oox/inc/oox/drawingml/theme.hxx index c83c7ed02a22..e60a1f04b340 100644 --- a/oox/inc/oox/drawingml/theme.hxx +++ b/oox/inc/oox/drawingml/theme.hxx @@ -46,7 +46,7 @@ const sal_Int32 THEMED_STYLE_INTENSE = 3; typedef RefVector< FillProperties > FillStyleList; typedef RefVector< LineProperties > LineStyleList; -typedef RefVector< PropertyMap > EffectStyleList; +typedef RefVector< EffectProperties > EffectStyleList; typedef RefMap< sal_Int32, TextCharacterProperties > FontScheme; // ============================================================================ @@ -77,6 +77,7 @@ public: inline EffectStyleList& getEffectStyleList() { return maEffectStyleList; } inline const EffectStyleList& getEffectStyleList() const { return maEffectStyleList; } + const EffectProperties* getEffectStyle( sal_Int32 nIndex ) const; inline FontScheme& getFontScheme() { return maFontScheme; } inline const FontScheme& getFontScheme() const { return maFontScheme; } diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index c422926b40b4..2a9eb5042804 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -500,6 +500,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 ) { @@ -515,12 +517,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() ); @@ -545,6 +548,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 46f3dbc19fb3..a3ccb8357cb4 100644 --- a/oox/source/drawingml/theme.cxx +++ b/oox/source/drawingml/theme.cxx @@ -66,6 +66,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 9d6573b8e20e..58b31f17c032 100644 --- a/oox/source/drawingml/themeelementscontext.cxx +++ b/oox/source/drawingml/themeelementscontext.cxx @@ -30,6 +30,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" @@ -131,9 +133,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; } |