summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2012-09-24 13:37:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-04-13 09:28:31 +0100
commitd7367b709dc4e97714fb2084b872a96389e768fb (patch)
tree8eaee5d2d692c417b35a17975eac89d42797b66f /filter
parent3c85fde4f96ae3ce550a4adb822f4a3c946c0178 (diff)
Resolves: #i119634# mso shape import better shadow defaults
apply default shadow color, if none is given; apply default shadow distance, if shadow type is not supported. Patch by: Jianyuan Li Review by: Oliver (cherry picked from commit 19116761e7c6ebb2c2f9b76ab4c07fed2f9e8c77) Conflicts: filter/source/msfilter/msdffimp.cxx Change-Id: I99932ae3589cf2502db8d5901c5641d475becdcf
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index a4bb2661962b..969d300f77f3 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2586,17 +2586,13 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
rSet.Put( SvxCrossedOutItem( nFontAttributes & 0x01 ? STRIKEOUT_SINGLE : STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
if ( IsProperty( DFF_Prop_fillColor ) )
rSet.Put( XFillColorItem( OUString(), rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor ) ) );
- if ( IsProperty( DFF_Prop_shadowType ) )
- {
- MSO_ShadowType eShadowType = static_cast< MSO_ShadowType >( GetPropertyValue( DFF_Prop_shadowType ) );
- if( eShadowType != mso_shadowOffset )
- {
- rSet.Put( SdrShadowXDistItem( 35 ) ); // 0,35 mm shadow distance
- rSet.Put( SdrShadowYDistItem( 35 ) );
- }
- }
if ( IsProperty( DFF_Prop_shadowColor ) )
rSet.Put( SdrShadowColorItem( rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_shadowColor ), DFF_Prop_shadowColor ) ) );
+ else
+ {
+ //The default value for this property is 0x00808080
+ rSet.Put( SdrShadowColorItem( rManager.MSO_CLR_ToColor( 0x00808080, DFF_Prop_shadowColor ) ) );
+ }
if ( IsProperty( DFF_Prop_shadowOpacity ) )
rSet.Put( SdrShadowTransparenceItem( (sal_uInt16)( ( 0x10000 - GetPropertyValue( DFF_Prop_shadowOpacity ) ) / 655 ) ) );
if ( IsProperty( DFF_Prop_shadowOffsetX ) )
@@ -2622,6 +2618,17 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
rSet.Put( SdrShadowYDistItem( 35 ) );
}
}
+ if ( IsProperty( DFF_Prop_shadowType ) )
+ {
+ MSO_ShadowType eShadowType = static_cast< MSO_ShadowType >( GetPropertyValue( DFF_Prop_shadowType ) );
+ if( eShadowType != mso_shadowOffset )
+ {
+ //0.12" == 173 twip == 302 100mm
+ sal_uInt32 nDist = rManager.pSdrModel->GetScaleUnit() == MAP_TWIP ? 173: 302;
+ rSet.Put( SdrShadowXDistItem( nDist ) );
+ rSet.Put( SdrShadowYDistItem( nDist ) );
+ }
+ }
if ( bHasShadow )
{
// #160376# sj: activating shadow only if fill and or linestyle is used