diff options
author | Armin Le Grand <alg@apache.org> | 2014-03-26 12:08:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-28 12:38:33 +0000 |
commit | 62175dfc7e5cd38f42e2efe77ee4102b9165dc4a (patch) | |
tree | 66614e4293ac924c1c45caf7c20868da24d6f187 /filter/source/msfilter/msdffimp.cxx | |
parent | 7af3170c6bf1480610f3db46d2354769d42c43a4 (diff) |
Resolves: i124477 set object shadow always at PPT import...
it may be applied to object text
(cherry picked from commit 5fb2c24bd0cfc0b911aa2d0389960c5ee3d14c4a)
Conflicts:
filter/source/msfilter/msdffimp.cxx
Change-Id: I8b93ff85333078d3e79cc9aa1002f232214a5be1
Diffstat (limited to 'filter/source/msfilter/msdffimp.cxx')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 2ffcdccacbed..9063bd0b7023 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -2592,37 +2592,47 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj } if ( bHasShadow ) { - // #160376# sj: activating shadow only if fill and or linestyle is used - // this is required because of the latest drawing layer core changes. - // Issue i104085 is related to this. - sal_uInt32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash )); - if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType )) - nLineFlags &= ~0x08; - sal_uInt32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest )); - if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType )) - nFillFlags &= ~0x10; - if ( nFillFlags & 0x10 ) - { - MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ); - switch( eMSO_FillType ) + static bool bCheckShadow(false); + + // #i124477# Found no reason not to set shadow, esp. since it is applied to evtl. existing text + // and will lead to an error of in PPT someone used text and added the object shadow to the + // object carryintg that text. I found no cases where this leads to problems (the old bugtracker + // task #160376# from sj is unfortunately no longer available). Keeping the code for now + // to allow easy fallback when this shows problems in the future + if(bCheckShadow) + { + // #160376# sj: activating shadow only if fill and or linestyle is used + // this is required because of the latest drawing layer core changes. + // #i104085# is related to this. + sal_uInt32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash )); + if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType )) + nLineFlags &= ~0x08; + sal_uInt32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest )); + if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType )) + nFillFlags &= ~0x10; + if ( nFillFlags & 0x10 ) { - case mso_fillSolid : - case mso_fillPattern : - case mso_fillTexture : - case mso_fillPicture : - case mso_fillShade : - case mso_fillShadeCenter : - case mso_fillShadeShape : - case mso_fillShadeScale : - case mso_fillShadeTitle : - break; - default: - nFillFlags &=~0x10; // no fillstyle used - break; + MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid ); + switch( eMSO_FillType ) + { + case mso_fillSolid : + case mso_fillPattern : + case mso_fillTexture : + case mso_fillPicture : + case mso_fillShade : + case mso_fillShadeCenter : + case mso_fillShadeShape : + case mso_fillShadeScale : + case mso_fillShadeTitle : + break; + default: + nFillFlags &=~0x10; // no fillstyle used + break; + } } + if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) && ( rObjData.eShapeType != mso_sptPictureFrame )) // if there is no fillstyle and linestyle + bHasShadow = sal_False; // we are turning shadow off. } - if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) && ( rObjData.eShapeType != mso_sptPictureFrame )) // if there is no fillstyle and linestyle - bHasShadow = sal_False; // we are turning shadow off. if ( bHasShadow ) rSet.Put( SdrShadowItem( bHasShadow ) ); |