[Libreoffice-commits] core.git: filter/source

Oliver-Rainer Wittmann orw at apache.org
Sat Apr 13 01:29:16 PDT 2013


 filter/source/msfilter/msdffimp.cxx |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

New commits:
commit d7367b709dc4e97714fb2084b872a96389e768fb
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Mon Sep 24 13:37:39 2012 +0000

    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

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index a4bb266..969d300 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


More information about the Libreoffice-commits mailing list