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

Lei De Bin leidb at apache.org
Mon May 27 04:12:01 PDT 2013


 filter/source/msfilter/msdffimp.cxx |    2 -
 sw/source/filter/ww8/wrtw8esh.cxx   |   57 +++++++++++++++++++++++++++++++++++-
 2 files changed, 57 insertions(+), 2 deletions(-)

New commits:
commit ee0ecef811d445e2a3bf54710707713478e61fad
Author: Lei De Bin <leidb at apache.org>
Date:   Mon Aug 20 00:48:42 2012 +0000

    Resolves: #i120158# fix picture shadow lost after saved as doc in some case
    
    Reported by: Yan Ji
    Patch by: Chen Zuo Jun
    Review by: Lei De Bin (cherry picked from commit fe549458ef04384ba777e4a36f34b68efc5b8b6d)
    
    Conflicts:
    	filter/source/msfilter/msdffimp.cxx
    	sw/source/filter/ww8/wrtw8esh.cxx
    
    Change-Id: I863ea7193f3dee563a892a6d857ee2385f58a862

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index cc2dbf6..23c95fe 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -2616,7 +2616,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
                 break;
             }
         }
-        if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) ) // if there is no fillstyle and linestyle
+        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 )
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 5e7add3..be4f594 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -44,6 +44,7 @@
 #include <svx/svdoole2.hxx>
 #include <editeng/editeng.hxx>
 #include <editeng/flditem.hxx>
+#include <editeng/shaditem.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <svx/fmglob.hxx>
 #include <svx/svdouno.hxx>
@@ -92,7 +93,6 @@
 #include <fstream>
 #include <unotools/streamwrap.hxx>
 
-
 using ::editeng::SvxBorderLine;
 using namespace com::sun::star;
 using namespace sw::util;
@@ -1793,6 +1793,61 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
         rPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 );
         rPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
     }
+    const SwAttrSet& rAttrSet = rFmt.GetAttrSet();
+    if (SFX_ITEM_ON == rAttrSet.GetItemState(RES_BOX, false, &pItem))
+    {
+        const SvxBoxItem* pBox = (const SvxBoxItem*)pItem;
+        if( pBox )
+        {
+            const SfxPoolItem* pShadItem;
+            if (SFX_ITEM_ON
+                == rAttrSet.GetItemState(RES_SHADOW, true, &pShadItem))
+            {
+                const SvxShadowItem* pSI = (const SvxShadowItem*)pShadItem;
+
+                const sal_uInt16 nCstScale = 635;        // unit scale between SODC and MS Word
+                const sal_uInt32 nShadowType = 131074;    // shadow type of ms word. need to set the default value.
+
+                sal_uInt32  nColor = (sal_uInt32)(pSI->GetColor().GetColor()) ;
+                sal_uInt32  nOffX = pSI->GetWidth() * nCstScale;
+                sal_uInt32  nOffY = pSI->GetWidth() * nCstScale;
+                sal_uInt32  nShadow = nShadowType;
+
+                SvxShadowLocation eLocation = pSI->GetLocation();
+                if( (eLocation!=SVX_SHADOW_NONE) && (pSI->GetWidth()!=0) )
+                {
+                    switch( eLocation )
+                    {
+                    case SVX_SHADOW_TOPLEFT:
+                        {
+                            nOffX = -nOffX;
+                            nOffY = -nOffY;
+                        }
+                        break;
+                    case SVX_SHADOW_TOPRIGHT:
+                        {
+                            nOffY = -nOffY;
+                        }
+                        break;
+                    case SVX_SHADOW_BOTTOMLEFT:
+                        {
+                            nOffX = -nOffX;
+                        }
+                        break;
+                    case SVX_SHADOW_BOTTOMRIGHT:
+                        break;
+                    default:
+                        break;
+                    }
+
+                    rPropOpt.AddOpt( DFF_Prop_shadowColor,    wwUtility::RGBToBGR((nColor)));
+                    rPropOpt.AddOpt( DFF_Prop_shadowOffsetX,    nOffX );
+                    rPropOpt.AddOpt( DFF_Prop_shadowOffsetY,    nOffY );
+                    rPropOpt.AddOpt( DFF_Prop_fshadowObscured,  nShadow );
+                }
+            }
+        }
+    }
 
     // SwWW8ImplReader::Read_GrafLayer() imports these as opaque
     // unconditionally, so if both are true, don't export the property.


More information about the Libreoffice-commits mailing list