You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2014/03/19 17:17:04 UTC

svn commit: r1579280 [7/8] - in /openoffice/trunk: ./ main/boost/ main/chart2/source/controller/main/ main/comphelper/inc/comphelper/ main/comphelper/source/property/ main/cui/source/factory/ main/cui/source/inc/ main/cui/source/tabpages/ main/drawingl...

Modified: openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx?rev=1579280&r1=1579279&r2=1579280&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx (original)
+++ openoffice/trunk/main/sw/source/core/unocore/unoframe.cxx Wed Mar 19 16:17:02 2014
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
- 
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
@@ -119,6 +117,24 @@
 #include <toolkit/helper/vclunohelper.hxx>
 #include <switerator.hxx>
 
+//UUUU
+#include <unobrushitemhelper.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/xgrscit.hxx>
+#include <svx/xflbmtit.hxx>
+#include <svx/xflbmpit.hxx>
+#include <svx/xflbmsxy.hxx>
+#include <svx/xflbmsxy.hxx>
+#include <svx/xflftrit.hxx>
+#include <svx/xsflclit.hxx>
+#include <svx/xflbmsli.hxx>
+#include <svx/xflbtoxy.hxx>
+#include <svx/xflbstit.hxx>
+#include <svx/xflboxy.hxx>
+#include <svx/xflbckit.hxx>
+#include <svx/unoshape.hxx>
+
 // from fefly1.cxx
 extern sal_Bool lcl_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet );
 
@@ -132,6 +148,9 @@ using ::com::sun::star::style::XStyleFam
 const sal_Char __FAR_DATA sPackageProtocol[] = "vnd.sun.star.Package:";
 const sal_Char __FAR_DATA sGraphicObjectProtocol[] = "vnd.sun.star.GraphicObject:";
 
+//UUUU
+#define OWN_ATTR_FILLBMP_MODE	(OWN_ATTR_VALUE_START+45)
+
 /****************************************************************************
 	Rahmenbeschreibung
 ****************************************************************************/
@@ -156,7 +175,6 @@ public:
 	//End Bug 119922
 
     virtual sal_Bool                AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0;
-
 };
 
 BaseFrameProperties_Impl::~BaseFrameProperties_Impl()
@@ -192,53 +210,386 @@ sal_Bool BaseFrameProperties_Impl::FillB
         if(GetProperty(RES_ANCHOR, MID_ANCHOR_ANCHORTYPE, pAnchorType))
 			bRet &= ((SfxPoolItem&)aAnchor).PutValue(*pAnchorType, MID_ANCHOR_ANCHORTYPE);
 	}
-	rToSet.Put(aAnchor);
-	{
-        const ::uno::Any* pCol = 0;
-        GetProperty(RES_BACKGROUND, MID_BACK_COLOR, pCol );
-        const ::uno::Any* pRGBCol = 0;
-        GetProperty(RES_BACKGROUND, MID_BACK_COLOR_R_G_B, pRGBCol );
-        const ::uno::Any* pColTrans = 0;
-        GetProperty(RES_BACKGROUND, MID_BACK_COLOR_TRANSPARENCY, pColTrans);
-        const ::uno::Any* pTrans = 0;
-        GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pTrans );
-        const ::uno::Any* pGrLoc = 0;
-        GetProperty(RES_BACKGROUND, MID_GRAPHIC_POSITION, pGrLoc );
-        const ::uno::Any* pGrURL = 0;
-        GetProperty(RES_BACKGROUND, MID_GRAPHIC_URL, pGrURL     );
-        const ::uno::Any* pGrFilter = 0;
-        GetProperty(RES_BACKGROUND, MID_GRAPHIC_FILTER, pGrFilter     );
-        const ::uno::Any* pGrTranparency = 0;
-        GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency     );
-
-        if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc ||
-                            pGrTranparency || pColTrans || pRGBCol)
-		{
-            SvxBrushItem aBrush ( static_cast < const :: SvxBrushItem & > ( rFromSet.Get ( RES_BACKGROUND ) ) );
-			if(pCol )
-				bRet &= ((SfxPoolItem&)aBrush).PutValue(*pCol,MID_BACK_COLOR	);
-            if(pColTrans)
-                bRet &= ((SfxPoolItem&)aBrush).PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
-            if(pRGBCol)
-                bRet &= ((SfxPoolItem&)aBrush).PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B);
-            if(pTrans)
-            {
-                // don't overwrite transparency with a non-transparence flag
-                if(!pColTrans || Any2Bool( *pTrans ))
-                    bRet &= ((SfxPoolItem&)aBrush).PutValue(*pTrans, MID_GRAPHIC_TRANSPARENT);
-            }
-            if(pGrURL)
-				bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrURL, MID_GRAPHIC_URL);
-			if(pGrFilter)
-				bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrFilter, MID_GRAPHIC_FILTER);
-			if(pGrLoc)
-				bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrLoc, MID_GRAPHIC_POSITION);
-            if(pGrTranparency)
-                bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrTranparency, MID_GRAPHIC_TRANSPARENCY);
 
-            rToSet.Put(aBrush);
-		}
-	}
+    rToSet.Put(aAnchor);
+
+    //UUUU check for SvxBrushItem (RES_BACKGROUND) properties
+    const ::uno::Any* pCol = 0; GetProperty(RES_BACKGROUND, MID_BACK_COLOR, pCol );
+    const ::uno::Any* pRGBCol = 0; GetProperty(RES_BACKGROUND, MID_BACK_COLOR_R_G_B, pRGBCol );
+    const ::uno::Any* pColTrans = 0; GetProperty(RES_BACKGROUND, MID_BACK_COLOR_TRANSPARENCY, pColTrans);
+    const ::uno::Any* pTrans = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pTrans );
+    const ::uno::Any* pGrLoc = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_POSITION, pGrLoc );
+    const ::uno::Any* pGrURL = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_URL, pGrURL     );
+    const ::uno::Any* pGrFilter = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_FILTER, pGrFilter     );
+    const ::uno::Any* pGrTranparency = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency     );
+    const bool bSvxBrushItemPropertiesUsed(
+        pCol || 
+        pTrans || 
+        pGrURL || 
+        pGrFilter || 
+        pGrLoc || 
+        pGrTranparency || 
+        pColTrans || 
+        pRGBCol);
+
+    //UUUU check for FillStyle properties in the range XATTR_FILL_FIRST, XATTR_FILL_LAST
+    const uno::Any* pXFillStyleItem = 0; GetProperty(XATTR_FILLSTYLE, 0, pXFillStyleItem);
+    const uno::Any* pXFillColorItem = 0; GetProperty(XATTR_FILLCOLOR, 0, pXFillColorItem);
+
+    // XFillGradientItem: two possible slots supported in UNO API
+    const uno::Any* pXFillGradientItem = 0; GetProperty(XATTR_FILLGRADIENT, MID_FILLGRADIENT, pXFillGradientItem);
+    const uno::Any* pXFillGradientNameItem = 0; GetProperty(XATTR_FILLGRADIENT, MID_NAME, pXFillGradientNameItem);
+
+    // XFillHatchItem: two possible slots supported in UNO API
+    const uno::Any* pXFillHatchItem = 0; GetProperty(XATTR_FILLHATCH, MID_FILLHATCH, pXFillHatchItem);
+    const uno::Any* pXFillHatchNameItem = 0; GetProperty(XATTR_FILLHATCH, MID_NAME, pXFillHatchNameItem);
+
+    // XFillBitmapItem: three possible slots supported in UNO API
+    const uno::Any* pXFillBitmapItem = 0; GetProperty(XATTR_FILLBITMAP, MID_BITMAP, pXFillBitmapItem);
+    const uno::Any* pXFillBitmapNameItem = 0; GetProperty(XATTR_FILLBITMAP, MID_NAME, pXFillBitmapNameItem);
+    const uno::Any* pXFillBitmapURLItem = 0; GetProperty(XATTR_FILLBITMAP, MID_GRAFURL, pXFillBitmapURLItem);
+
+    const uno::Any* pXFillTransparenceItem = 0; GetProperty(XATTR_FILLTRANSPARENCE, 0, pXFillTransparenceItem);
+    const uno::Any* pXGradientStepCountItem = 0; GetProperty(XATTR_GRADIENTSTEPCOUNT, 0, pXGradientStepCountItem);
+    const uno::Any* pXFillBmpPosItem = 0; GetProperty(XATTR_FILLBMP_POS, 0, pXFillBmpPosItem);
+    const uno::Any* pXFillBmpSizeXItem = 0; GetProperty(XATTR_FILLBMP_SIZEX, 0, pXFillBmpSizeXItem);
+    const uno::Any* pXFillBmpSizeYItem = 0; GetProperty(XATTR_FILLBMP_SIZEY, 0, pXFillBmpSizeYItem);
+
+    // XFillFloatTransparenceItem: two possible slots supported in UNO API
+    const uno::Any* pXFillFloatTransparenceItem = 0; GetProperty(XATTR_FILLFLOATTRANSPARENCE, MID_FILLGRADIENT, pXFillFloatTransparenceItem);
+    const uno::Any* pXFillFloatTransparenceNameItem = 0; GetProperty(XATTR_FILLFLOATTRANSPARENCE, MID_NAME, pXFillFloatTransparenceNameItem);
+
+    const uno::Any* pXSecondaryFillColorItem = 0; GetProperty(XATTR_SECONDARYFILLCOLOR, 0, pXSecondaryFillColorItem);
+    const uno::Any* pXFillBmpSizeLogItem = 0; GetProperty(XATTR_FILLBMP_SIZELOG, 0, pXFillBmpSizeLogItem);
+    const uno::Any* pXFillBmpTileOffsetXItem = 0; GetProperty(XATTR_FILLBMP_TILEOFFSETX, 0, pXFillBmpTileOffsetXItem);
+    const uno::Any* pXFillBmpTileOffsetYItem = 0; GetProperty(XATTR_FILLBMP_TILEOFFSETY, 0, pXFillBmpTileOffsetYItem);
+    const uno::Any* pXFillBmpPosOffsetXItem = 0; GetProperty(XATTR_FILLBMP_POSOFFSETX, 0, pXFillBmpPosOffsetXItem);
+    const uno::Any* pXFillBmpPosOffsetYItem = 0; GetProperty(XATTR_FILLBMP_POSOFFSETY, 0, pXFillBmpPosOffsetYItem);
+    const uno::Any* pXFillBackgroundItem = 0; GetProperty(XATTR_FILLBACKGROUND, 0, pXFillBackgroundItem);
+    const uno::Any* pOwnAttrFillBmpItem = 0; GetProperty(OWN_ATTR_FILLBMP_MODE, 0, pOwnAttrFillBmpItem);
+
+    const bool bXFillStyleItemUsed(
+        pXFillStyleItem || 
+        pXFillColorItem || 
+        pXFillGradientItem || pXFillGradientNameItem || 
+        pXFillHatchItem || pXFillHatchNameItem ||
+        pXFillBitmapItem || pXFillBitmapNameItem || pXFillBitmapURLItem ||
+        pXFillTransparenceItem || 
+        pXGradientStepCountItem || 
+        pXFillBmpPosItem || 
+        pXFillBmpSizeXItem || 
+        pXFillBmpSizeYItem || 
+        pXFillFloatTransparenceItem || pXFillFloatTransparenceNameItem ||
+        pXSecondaryFillColorItem || 
+        pXFillBmpSizeLogItem || 
+        pXFillBmpTileOffsetXItem || 
+        pXFillBmpTileOffsetYItem || 
+        pXFillBmpPosOffsetXItem || 
+        pXFillBmpPosOffsetYItem || 
+        pXFillBackgroundItem ||
+        pOwnAttrFillBmpItem);
+
+    // use brush items, but *only* if no FillStyle properties are used; if both are used and when applying both
+    // in the obvious order some attributes may be wrong since they are set by the 1st set, but not
+    // redefined as needed by the 2nd set when they are default (and thus no tset) in the 2nd set. If
+    // it is necessary for any reason to set both (it should not) a in-between step will be needed
+    // that resets the items for FillAttributes in rToSet to default
+    if(bSvxBrushItemPropertiesUsed && !bXFillStyleItemUsed)
+    {
+        //UUUU create a temporary SvxBrushItem, fill the attributes to it and use it to set
+        // the corresponding FillAttributes
+        SvxBrushItem aBrush(RES_BACKGROUND);
+
+        if(pCol)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pCol,MID_BACK_COLOR	);
+        }
+
+        if(pColTrans)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
+        }
+
+        if(pRGBCol)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B);
+        }
+
+        if(pTrans)
+        {
+            // don't overwrite transparency with a non-transparence flag
+            if(!pColTrans || Any2Bool( *pTrans ))
+                bRet &= ((SfxPoolItem&)aBrush).PutValue(*pTrans, MID_GRAPHIC_TRANSPARENT);
+        }
+
+        if(pGrURL)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrURL, MID_GRAPHIC_URL);
+        }
+
+        if(pGrFilter)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrFilter, MID_GRAPHIC_FILTER);
+        }
+
+        if(pGrLoc)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrLoc, MID_GRAPHIC_POSITION);
+        }
+
+        if(pGrTranparency)
+        {
+            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGrTranparency, MID_GRAPHIC_TRANSPARENCY);
+        }
+
+        setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+    }
+
+    if(bXFillStyleItemUsed)
+    {
+        if(pXFillStyleItem) 
+        { 
+            XFillStyleItem aXFillStyleItem; 
+
+            aXFillStyleItem.PutValue(*pXFillStyleItem); 
+            rToSet.Put(aXFillStyleItem); 
+        }
+
+        if(pXFillColorItem) 
+        { 
+            const XubString aNullStr;
+            const Color aNullCol(COL_DEFAULT_SHAPE_FILLING);
+            XFillColorItem aXFillColorItem(aNullStr, aNullCol); 
+
+            aXFillColorItem.PutValue(*pXFillColorItem); 
+            rToSet.Put(aXFillColorItem); 
+        }
+
+        if(pXFillGradientItem || pXFillGradientNameItem) 
+        { 
+            if(pXFillGradientItem)
+            {
+                const XGradient aNullGrad(RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
+                XFillGradientItem aXFillGradientItem(rToSet.GetPool(), aNullGrad); 
+
+                aXFillGradientItem.PutValue(*pXFillGradientItem, MID_FILLGRADIENT); 
+                rToSet.Put(aXFillGradientItem); 
+            }
+
+            if(pXFillGradientNameItem)
+            {
+                OUString aTempName;
+
+                if(!(*pXFillGradientNameItem >>= aTempName ))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                bRet &= SvxShape::SetFillAttribute(XATTR_FILLGRADIENT, aTempName, rToSet);
+            }
+        }
+
+        if(pXFillHatchItem || pXFillHatchNameItem) 
+        { 
+            if(pXFillHatchItem)
+            {
+                const Color aNullCol(COL_DEFAULT_SHAPE_STROKE);
+                const XHatch aNullHatch(aNullCol);
+                XFillHatchItem aXFillHatchItem(rToSet.GetPool(), aNullHatch); 
+
+                aXFillHatchItem.PutValue(*pXFillHatchItem, MID_FILLHATCH); 
+                rToSet.Put(aXFillHatchItem); 
+            }
+
+            if(pXFillHatchNameItem)
+            {
+                OUString aTempName;
+
+                if(!(*pXFillHatchNameItem >>= aTempName ))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                bRet &= SvxShape::SetFillAttribute(XATTR_FILLHATCH, aTempName, rToSet);
+            }
+        }
+
+        if(pXFillBitmapItem || pXFillBitmapNameItem || pXFillBitmapURLItem) 
+        { 
+            if(pXFillBitmapItem)
+            {
+                const Graphic aNullGraphic;
+                XFillBitmapItem aXFillBitmapItem(rToSet.GetPool(), aNullGraphic); 
+
+                aXFillBitmapItem.PutValue(*pXFillBitmapItem, MID_BITMAP); 
+                rToSet.Put(aXFillBitmapItem); 
+            }
+
+            if(pXFillBitmapNameItem)
+            {
+                OUString aTempName;
+
+                if(!(*pXFillBitmapNameItem >>= aTempName ))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                bRet &= SvxShape::SetFillAttribute(XATTR_FILLBITMAP, aTempName, rToSet);
+            }
+
+            if(pXFillBitmapURLItem)
+            {
+                const Graphic aNullGraphic;
+                XFillBitmapItem aXFillBitmapItem(rToSet.GetPool(), aNullGraphic); 
+
+                aXFillBitmapItem.PutValue(*pXFillBitmapURLItem, MID_GRAFURL); 
+                rToSet.Put(aXFillBitmapItem); 
+            }
+        }
+
+        if(pXFillTransparenceItem) 
+        { 
+            const XGradient aNullGrad(RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
+            XFillTransparenceItem aXFillTransparenceItem; 
+
+            aXFillTransparenceItem.PutValue(*pXFillTransparenceItem); 
+            rToSet.Put(aXFillTransparenceItem); 
+        }
+
+        if(pXGradientStepCountItem) 
+        { 
+            XGradientStepCountItem aXGradientStepCountItem; 
+
+            aXGradientStepCountItem.PutValue(*pXGradientStepCountItem); 
+            rToSet.Put(aXGradientStepCountItem); 
+        }
+
+        if(pXFillBmpPosItem) 
+        { 
+            XFillBmpPosItem aXFillBmpPosItem; 
+
+            aXFillBmpPosItem.PutValue(*pXFillBmpPosItem); 
+            rToSet.Put(aXFillBmpPosItem); 
+        }
+
+        if(pXFillBmpSizeXItem) 
+        { 
+            XFillBmpSizeXItem aXFillBmpSizeXItem; 
+
+            aXFillBmpSizeXItem.PutValue(*pXFillBmpSizeXItem); 
+            rToSet.Put(aXFillBmpSizeXItem); 
+        }
+
+        if(pXFillBmpSizeYItem) 
+        { 
+            XFillBmpSizeYItem aXFillBmpSizeYItem; 
+
+            aXFillBmpSizeYItem.PutValue(*pXFillBmpSizeYItem); 
+            rToSet.Put(aXFillBmpSizeYItem); 
+        }
+
+        if(pXFillFloatTransparenceItem || pXFillFloatTransparenceNameItem) 
+        { 
+            if(pXFillFloatTransparenceItem)
+            {
+                const XGradient aNullGrad(RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
+                XFillFloatTransparenceItem aXFillFloatTransparenceItem(rToSet.GetPool(), aNullGrad, false); 
+
+                aXFillFloatTransparenceItem.PutValue(*pXFillFloatTransparenceItem, MID_FILLGRADIENT); 
+                rToSet.Put(aXFillFloatTransparenceItem); 
+            }
+
+            if(pXFillFloatTransparenceNameItem)
+            {
+                OUString aTempName;
+
+                if(!(*pXFillFloatTransparenceNameItem >>= aTempName ))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                bRet &= SvxShape::SetFillAttribute(XATTR_FILLFLOATTRANSPARENCE, aTempName, rToSet);
+            }
+        }
+
+        if(pXSecondaryFillColorItem) 
+        { 
+            const XubString aNullStr;
+            const Color aNullCol(COL_DEFAULT_SHAPE_FILLING);
+            XSecondaryFillColorItem aXSecondaryFillColorItem(aNullStr, aNullCol); 
+
+            aXSecondaryFillColorItem.PutValue(*pXSecondaryFillColorItem); 
+            rToSet.Put(aXSecondaryFillColorItem); 
+        }
+
+        if(pXFillBmpSizeLogItem) 
+        { 
+            XFillBmpSizeLogItem aXFillBmpSizeLogItem; 
+
+            aXFillBmpSizeLogItem.PutValue(*pXFillBmpSizeLogItem); 
+            rToSet.Put(aXFillBmpSizeLogItem); 
+        }
+
+        if(pXFillBmpTileOffsetXItem) 
+        { 
+            XFillBmpTileOffsetXItem aXFillBmpTileOffsetXItem; 
+
+            aXFillBmpTileOffsetXItem.PutValue(*pXFillBmpTileOffsetXItem); 
+            rToSet.Put(aXFillBmpTileOffsetXItem); 
+        }
+
+        if(pXFillBmpTileOffsetYItem) 
+        { 
+            XFillBmpTileOffsetYItem aXFillBmpTileOffsetYItem; 
+
+            aXFillBmpTileOffsetYItem.PutValue(*pXFillBmpTileOffsetYItem); 
+            rToSet.Put(aXFillBmpTileOffsetYItem); 
+        }
+
+        if(pXFillBmpPosOffsetXItem) 
+        { 
+            XFillBmpPosOffsetXItem aXFillBmpPosOffsetXItem; 
+
+            aXFillBmpPosOffsetXItem.PutValue(*pXFillBmpPosOffsetXItem); 
+            rToSet.Put(aXFillBmpPosOffsetXItem); 
+        }
+
+        if(pXFillBmpPosOffsetYItem) 
+        { 
+            XFillBmpPosOffsetYItem aXFillBmpPosOffsetYItem; 
+
+            aXFillBmpPosOffsetYItem.PutValue(*pXFillBmpPosOffsetYItem); 
+            rToSet.Put(aXFillBmpPosOffsetYItem); 
+        }
+
+        if(pXFillBackgroundItem) 
+        { 
+            XFillBackgroundItem aXFillBackgroundItem; 
+
+            aXFillBackgroundItem.PutValue(*pXFillBackgroundItem); 
+            rToSet.Put(aXFillBackgroundItem); 
+        }
+
+        if(pOwnAttrFillBmpItem)
+        {
+            drawing::BitmapMode eMode;
+
+            if(!(*pOwnAttrFillBmpItem >>= eMode))
+            {
+                sal_Int32 nMode = 0;
+
+                if(!(*pOwnAttrFillBmpItem >>= nMode))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                eMode = (drawing::BitmapMode)nMode;
+            }
+
+            rToSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode));
+            rToSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode));
+        }
+    }
 	{
         const ::uno::Any* pCont = 0;
         GetProperty(RES_PROTECT, MID_PROTECT_CONTENT, pCont );
@@ -966,7 +1317,7 @@ SwFrmFmt *lcl_GetFrmFmt( const :: uno::A
 	return pRet;
 }
 
-void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::Any& aValue)
+void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::Any& _rValue)
 	throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException )
 {
 	vos::OGuard aGuard(Application::GetSolarMutex());
@@ -976,6 +1327,40 @@ void SwXFrame::setPropertyValue(const ::
     if (!pEntry)
         throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
 
+    //UUUU
+    const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM));
+    uno::Any aValue(_rValue);
+
+    //UUUU check for needed metric translation
+    if(pEntry->nMemberId & SFX_METRIC_ITEM)
+    {
+        bool bDoIt(true);
+
+        if(XATTR_FILLBMP_SIZEX == pEntry->nWID || XATTR_FILLBMP_SIZEY == pEntry->nWID)
+        {
+            // exception: If these ItemTypes are used, do not convert when these are negative
+            // since this means they are intended as percent values
+            sal_Int32 nValue = 0;
+
+            if(aValue >>= nValue)
+            {
+                bDoIt = nValue > 0;
+            }
+        }
+
+        if(bDoIt)
+        {
+            const SwDoc* pDoc = (IsDescriptor() ? m_pDoc : GetFrmFmt()->GetDoc());
+            const SfxItemPool& rPool = pDoc->GetAttrPool();
+            const SfxMapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
+
+            if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+            {
+                SvxUnoConvertFromMM(eMapUnit, aValue);
+            }
+        }
+    }
+
     if(pFmt)
 	{
 		sal_Bool bNextFrame = sal_False;
@@ -1292,7 +1677,7 @@ void SwXFrame::setPropertyValue(const ::
 							SetObjectOrdNum(pObject->GetOrdNum(), nZOrder);
 			}
 		}
-        else if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == pEntry->nMemberId)
+        else if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == nMemberId)
         {
             sal_Bool bDone = sal_False;
             uno::Reference<text::XTextFrame> xFrame;
@@ -1322,15 +1707,66 @@ void SwXFrame::setPropertyValue(const ::
                 throw lang::IllegalArgumentException();
         }
 		else
-		{
+		{   //UUUU
+            // standard UNO API write attributes
+            // adapt former attr from SvxBrushItem::PutValue to new items XATTR_FILL_FIRST, XATTR_FILL_LAST
 			SfxItemSet aSet( pDoc->GetAttrPool(),
 				RES_FRMATR_BEGIN, RES_FRMATR_END - 1,
 				RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER,
+
+                //UUUU FillAttribute support
+                XATTR_FILL_FIRST, XATTR_FILL_LAST,
+
 				0L);
+            bool bDone(false);
 
 			aSet.SetParent(&pFmt->GetAttrSet());
-            m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
-            if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId)
+
+            if(RES_BACKGROUND == pEntry->nWID)
+            {
+                const SwAttrSet& rSet = pFmt->GetAttrSet();
+                const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet));
+                SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
+
+                aChangedBrushItem.PutValue(aValue, nMemberId);
+
+                if(!(aChangedBrushItem == aOriginalBrushItem))
+                {
+                    setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, aSet);
+                    pFmt->GetDoc()->SetFlyFrmAttr( *pFmt, aSet );
+                }
+
+                bDone = true;
+            }
+            else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+            {
+                //UUUU
+                drawing::BitmapMode eMode;
+
+                if(!(aValue >>= eMode))
+                {
+                    sal_Int32 nMode = 0;
+
+                    if(!(aValue >>= nMode))
+                    {
+                        throw lang::IllegalArgumentException();
+                    }
+
+                    eMode = (drawing::BitmapMode)nMode;
+                }
+
+                aSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode));
+                aSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode));
+                pFmt->GetDoc()->SetFlyFrmAttr( *pFmt, aSet );
+                bDone = true;
+            }
+
+            if(!bDone)
+            {
+                m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
+            }
+
+            if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == nMemberId)
             {
                 SwFmtAnchor aAnchor = (const :: SwFmtAnchor&)aSet.Get(pEntry->nWID);
                 if(aAnchor.GetAnchorId() == FLY_AT_FLY)
@@ -1397,7 +1833,7 @@ void SwXFrame::setPropertyValue(const ::
 	}
 	else if(IsDescriptor())
 	{
-        pProps->SetProperty(pEntry->nWID, pEntry->nMemberId, aValue);
+        pProps->SetProperty(pEntry->nWID, nMemberId, aValue);
         if( FN_UNO_FRAME_STYLE_NAME == pEntry->nWID )
         {
             OUString sStyleName;
@@ -1432,6 +1868,9 @@ uno::Any SwXFrame::getPropertyValue(cons
     if (!pEntry)
         throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
 
+    //UUUU
+    const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM));
+
     if(FN_UNO_ANCHOR_TYPES == pEntry->nWID)
 	{
 		uno::Sequence<text::TextContentAnchorType> aTypes(5);
@@ -1707,9 +2146,50 @@ uno::Any SwXFrame::getPropertyValue(cons
             }
 		}
 		else
-		{
+		{   //UUUU
+            // standard UNO API read attributes
+            // adapt former attr from SvxBrushItem::PutValue to new items XATTR_FILL_FIRST, XATTR_FILL_LAST
             const SwAttrSet& rSet = pFmt->GetAttrSet();
-            m_pPropSet->getPropertyValue(*pEntry, rSet, aAny);
+            bool bDone(false);
+
+            if(RES_BACKGROUND == pEntry->nWID)
+            {
+                //UUUU
+                const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet));
+
+                if(!aOriginalBrushItem.QueryValue(aAny, nMemberId))
+                {
+                    OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
+                }
+
+                bDone = true;
+            }
+            else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+            {
+                //UUUU
+                const XFillBmpStretchItem* pStretchItem = dynamic_cast< const XFillBmpStretchItem* >(&rSet.Get(XATTR_FILLBMP_STRETCH));
+                const XFillBmpTileItem* pTileItem = dynamic_cast< const XFillBmpTileItem* >(&rSet.Get(XATTR_FILLBMP_TILE));
+
+                if( pTileItem && pTileItem->GetValue() )
+                {
+                    aAny <<= drawing::BitmapMode_REPEAT;
+                }
+                else if( pStretchItem && pStretchItem->GetValue() )
+                {
+                    aAny <<= drawing::BitmapMode_STRETCH;
+                }
+                else
+                {
+                    aAny <<= drawing::BitmapMode_NO_REPEAT;
+                }
+
+                bDone = true;
+            }
+
+            if(!bDone)
+            {
+                m_pPropSet->getPropertyValue(*pEntry, rSet, aAny);
+            }
 		}
 	}
 	else if(IsDescriptor())
@@ -1719,7 +2199,7 @@ uno::Any SwXFrame::getPropertyValue(cons
         if(WID_LAYOUT_SIZE != pEntry->nWID)  // there is no LayoutSize in a descriptor
 		{
             const uno::Any* pAny = 0;
-            if( !pProps->GetProperty( pEntry->nWID, pEntry->nMemberId, pAny ) )
+            if( !pProps->GetProperty( pEntry->nWID, nMemberId, pAny ) )
                 aAny = mxStyleData->getPropertyValue( rPropertyName );
 			else if ( pAny )
 				aAny = *pAny;
@@ -1727,7 +2207,47 @@ uno::Any SwXFrame::getPropertyValue(cons
 	}
 	else
 		throw uno::RuntimeException();
-	return aAny;
+
+    //UUUU
+    if(pEntry && pEntry->pType && *(pEntry->pType) == ::getCppuType((const sal_Int16*)0) && *(pEntry->pType) != aAny.getValueType())
+    {
+        // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
+        sal_Int32 nValue = 0;
+        aAny >>= nValue;
+        aAny <<= (sal_Int16)nValue;
+    }
+
+    //UUUU check for needed metric translation
+    if(pEntry->nMemberId & SFX_METRIC_ITEM)
+    {
+        bool bDoIt(true);
+
+        if(XATTR_FILLBMP_SIZEX == pEntry->nWID || XATTR_FILLBMP_SIZEY == pEntry->nWID)
+        {
+            // exception: If these ItemTypes are used, do not convert when these are negative
+            // since this means they are intended as percent values
+            sal_Int32 nValue = 0;
+
+            if(aAny >>= nValue)
+            {
+                bDoIt = nValue > 0;
+            }
+        }
+
+        if(bDoIt)
+        {
+            const SwDoc* pDoc = (IsDescriptor() ? m_pDoc : GetFrmFmt()->GetDoc());
+            const SfxItemPool& rPool = pDoc->GetAttrPool();
+            const SfxMapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
+
+            if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+            {
+                SvxUnoConvertToMM(eMapUnit, aAny);
+            }
+        }
+    }
+
+    return aAny;
 }
 
 void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
@@ -1769,6 +2289,42 @@ beans::PropertyState SwXFrame::getProper
 	return aStates.getConstArray()[0];
 }
 
+//UUUU
+bool SwXFrame::needToMapFillItemsToSvxBrushItemTypes() const
+{
+    SwFrmFmt* pFmt = GetFrmFmt();
+
+    if(!pFmt)
+    {
+        return false;
+    }
+
+    const SwAttrSet& rFmtSet = pFmt->GetAttrSet();
+    const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem*  >(rFmtSet.GetItem(XATTR_FILLSTYLE, false)));
+
+    if(!pXFillStyleItem)
+    {
+        return false;
+    }
+
+    //UUUU here different FillStyles can be excluded for export; it will depend on the
+    // quality these fallbacks can reach. That again is done in getSvxBrushItemFromSourceSet,
+    // take a look there how the superset of DrawObject FillStyles is mapped to SvxBrushItem.
+    // For now, take them all - except XFILL_NONE
+
+    if(XFILL_NONE != pXFillStyleItem->GetValue())
+    {
+        return true;
+    }
+
+    //if(XFILL_SOLID == pXFillStyleItem->GetValue() || XFILL_BITMAP == pXFillStyleItem->GetValue())
+    //{
+    //    return true;
+    //}
+
+    return false;
+}
+
 uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
     const uno::Sequence< OUString >& aPropertyNames )
 		throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -1797,6 +2353,27 @@ uno::Sequence< beans::PropertyState > Sw
             {
 				pStates[i] = beans::PropertyState_DIRECT_VALUE;
             }
+            else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+            {
+                //UUUU
+                if(SFX_ITEM_SET == rFmtSet.GetItemState(XATTR_FILLBMP_STRETCH, false)
+                    || SFX_ITEM_SET == rFmtSet.GetItemState(XATTR_FILLBMP_TILE, false))
+                {
+                    pStates[i] = beans::PropertyState_DIRECT_VALUE;
+                }
+                else
+                {
+                    pStates[i] = beans::PropertyState_AMBIGUOUS_VALUE;
+                }
+            }
+            //UUUU for FlyFrames we need to mark all properties from type RES_BACKGROUND
+            // as beans::PropertyState_DIRECT_VALUE to let users of this property call
+            // getPropertyValue where the member properties will be mapped from the
+            // fill attributes to the according SvxBrushItem entries
+            else if(RES_BACKGROUND == pEntry->nWID && needToMapFillItemsToSvxBrushItemTypes())
+            {
+                pStates[i] = beans::PropertyState_DIRECT_VALUE;
+            }
             else
             {
                 if ((eType == FLYCNTTYPE_GRF) &&
@@ -1847,7 +2424,20 @@ void SwXFrame::setPropertyToDefault( con
             throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
 
 		sal_Bool bNextFrame;
-        if( pEntry->nWID &&
+
+        if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
+        {
+            //UUUU
+            SwDoc* pDoc = pFmt->GetDoc();
+            SfxItemSet aSet(pDoc->GetAttrPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+            aSet.SetParent(&pFmt->GetAttrSet());
+
+            aSet.ClearItem(XATTR_FILLBMP_STRETCH);
+            aSet.ClearItem(XATTR_FILLBMP_TILE);
+
+            pFmt->SetFmtAttr(aSet);
+        }
+        else if( pEntry->nWID &&
             pEntry->nWID != FN_UNO_ANCHOR_TYPES &&
             pEntry->nWID != FN_PARAM_LINK_DISPLAY_NAME)
         {
@@ -1945,7 +2535,10 @@ uno::Any SwXFrame::getPropertyDefault( c
 			{
                 const SfxPoolItem& rDefItem =
                     pFmt->GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID);
-                rDefItem.QueryValue(aRet, pEntry->nMemberId);
+                //UUUU
+                const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM));
+
+                rDefItem.QueryValue(aRet, nMemberId);
 			}
 		}
 		else
@@ -2071,8 +2664,12 @@ void SwXFrame::attachToRange(const uno::
 		static sal_uInt16 __READONLY_DATA aFrmAttrRange[] =
 		{
 			RES_FRMATR_BEGIN, 		RES_FRMATR_END-1,
-			SID_ATTR_BORDER_INNER,	SID_ATTR_BORDER_INNER,
             RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER,
+
+            //UUUU FillAttribute support
+            XATTR_FILL_FIRST, XATTR_FILL_LAST,
+
+            SID_ATTR_BORDER_INNER,	SID_ATTR_BORDER_INNER,
 			0
 		};
 		static sal_uInt16 __READONLY_DATA aGrAttrRange[] =

Modified: openoffice/trunk/main/sw/source/core/unocore/unomap.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unomap.cxx?rev=1579280&r1=1579279&r2=1579280&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/unocore/unomap.cxx (original)
+++ openoffice/trunk/main/sw/source/core/unocore/unomap.cxx Wed Mar 19 16:17:02 2014
@@ -40,6 +40,7 @@
 #include <cmdid.h>
 #include <unofldmid.h>
 #include <editeng/memberids.hrc>
+#include <editeng/unoipset.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
@@ -507,6 +508,43 @@ SwUnoPropertyMapProvider::~SwUnoProperty
 					{ SW_PROP_NMID(UNO_NAME_TABSTOPS), RES_PARATR_TABSTOP,   CPPU_E2T(CPPUTYPE_SEQTABSTOP),   PropertyAttribute::MAYBEVOID, CONVERT_TWIPS},	\
 
 
+//UUUU
+#define FILL_PROPERTIES_SW_BMP \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_LOGICAL_SIZE),           XATTR_FILLBMP_SIZELOG,      CPPU_E2T(CPPUTYPE_BOOLEAN) ,        0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_OFFSET_X),               XATTR_FILLBMP_TILEOFFSETX,  CPPU_E2T(CPPUTYPE_INT32) ,          0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_OFFSET_Y),               XATTR_FILLBMP_TILEOFFSETY,  CPPU_E2T(CPPUTYPE_INT32) ,          0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_POSITION_OFFSET_X),      XATTR_FILLBMP_POSOFFSETX,   CPPU_E2T(CPPUTYPE_INT32) ,          0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_POSITION_OFFSET_Y),      XATTR_FILLBMP_POSOFFSETY,   CPPU_E2T(CPPUTYPE_INT32) ,          0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_RECTANGLE_POINT),        XATTR_FILLBMP_POS,          CPPU_E2T(CPPUTYPE_RECTANGLEPOINT) , 0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_SIZE_X),                 XATTR_FILLBMP_SIZEX,        CPPU_E2T(CPPUTYPE_INT32) ,          0,  SFX_METRIC_ITEM}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_SIZE_Y),                 XATTR_FILLBMP_SIZEY,        CPPU_E2T(CPPUTYPE_INT32) ,          0,  SFX_METRIC_ITEM},    \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_STRETCH),                XATTR_FILLBMP_STRETCH,      CPPU_E2T(CPPUTYPE_BOOLEAN) ,        0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_TILE),                   XATTR_FILLBMP_TILE,         CPPU_E2T(CPPUTYPE_BOOLEAN) ,        0,  0},\
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBMP_MODE),                   OWN_ATTR_FILLBMP_MODE,      CPPU_E2T(CPPUTYPE_BITMAPMODE),      0,  0}, \
+
+//UUUU
+#define FILL_PROPERTIES_SW_DEFAULTS \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLCOLOR),                      XATTR_FILLCOLOR,            CPPU_E2T(CPPUTYPE_INT32),           0,  0}, \
+
+//UUUU
+#define FILL_PROPERTIES_SW \
+    FILL_PROPERTIES_SW_BMP \
+    FILL_PROPERTIES_SW_DEFAULTS \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBACKGROUND),                 XATTR_FILLBACKGROUND,           CPPU_E2T(CPPUTYPE_BOOLEAN),     0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBITMAP),                     XATTR_FILLBITMAP,               CPPU_E2T(CPPUTYPE_REFBITMAP),   0,  MID_BITMAP}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBITMAPNAME),                 XATTR_FILLBITMAP,               CPPU_E2T(CPPUTYPE_OUSTRING),    0,  MID_NAME }, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLBITMAPURL),                  XATTR_FILLBITMAP,               CPPU_E2T(CPPUTYPE_OUSTRING),    0,  MID_GRAFURL }, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLGRADIENTSTEPCOUNT),          XATTR_GRADIENTSTEPCOUNT,        CPPU_E2T(CPPUTYPE_INT16),       0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLGRADIENT),                   XATTR_FILLGRADIENT,             CPPU_E2T(CPPUTYPE_GRADIENT),    0,  MID_FILLGRADIENT}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLGRADIENTNAME),               XATTR_FILLGRADIENT,             CPPU_E2T(CPPUTYPE_OUSTRING),    0,  MID_NAME }, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLHATCH),                      XATTR_FILLHATCH,                CPPU_E2T(CPPUTYPE_HATCH),       0,  MID_FILLHATCH}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLHATCHNAME),                  XATTR_FILLHATCH,                CPPU_E2T(CPPUTYPE_OUSTRING),    0,  MID_NAME }, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLSTYLE),                      XATTR_FILLSTYLE,                CPPU_E2T(CPPUTYPE_FILLSTYLE),   0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILL_TRANSPARENCE),              XATTR_FILLTRANSPARENCE,         CPPU_E2T(CPPUTYPE_INT16),       0,  0}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLTRANSPARENCEGRADIENT),       XATTR_FILLFLOATTRANSPARENCE,    CPPU_E2T(CPPUTYPE_GRADIENT),    0,  MID_FILLGRADIENT}, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLTRANSPARENCEGRADIENTNAME),   XATTR_FILLFLOATTRANSPARENCE,    CPPU_E2T(CPPUTYPE_OUSTRING),    0,  MID_NAME }, \
+    { SW_PROP_NMID(UNO_NAME_SW_FILLCOLOR_2),                    XATTR_SECONDARYFILLCOLOR,       CPPU_E2T(CPPUTYPE_INT32),       0,  0}, \
+
 const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(sal_uInt16 nPropertyId)
 {
 	DBG_ASSERT(nPropertyId < PROPERTY_MAP_END, "Id ?" );
@@ -778,6 +816,12 @@ const SfxItemPropertyMapEntry* SwUnoProp
                     // OD 2004-05-05 #i28701#
                     { SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE},
                     { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
+
+                    //UUUU adf FillProperties for SW, same as FILL_PROPERTIES in svx
+                    // but need own defines in Writer due to later association of strings
+                    // and uno types (see loop at end of this metjhod and definition of SW_PROP_NMID)
+                    FILL_PROPERTIES_SW
+
                     {0,0,0,0,0,0}
                 };
                 aMapEntriesArr[nPropertyId] = aFrameStyleMap;
@@ -1107,7 +1151,10 @@ const SfxItemPropertyMapEntry* SwUnoProp
 			case PROPERTY_MAP_TEXT_FRAME:
 			{
                 static SfxItemPropertyMapEntry aFramePropertyMap_Impl[] =
-				{
+				{   //UUUU
+                    // evtl. completely remove SvxBrushItem stuff ()
+                    // add support for XATTR_FILL_FIRST, XATTR_FILL_LAST
+                    // COMMON_FRAME_PROPERTIES currently hosts the RES_BACKGROUND entries from SvxBrushItem
 					COMMON_FRAME_PROPERTIES
                     _REDLINE_NODE_PROPERTIES
                     { SW_PROP_NMID(UNO_NAME_CHAIN_NEXT_NAME), RES_CHAIN,                CPPU_E2T(CPPUTYPE_OUSTRING),            PropertyAttribute::MAYBEVOID ,MID_CHAIN_NEXTNAME},
@@ -1125,6 +1172,12 @@ const SfxItemPropertyMapEntry* SwUnoProp
 					{ SW_PROP_NMID(UNO_NAME_SIZE_TYPE), RES_FRM_SIZE,   		CPPU_E2T(CPPUTYPE_INT16)  ,  		PROPERTY_NONE,   MID_FRMSIZE_SIZE_TYPE	},
 					{ SW_PROP_NMID(UNO_NAME_WIDTH_TYPE), RES_FRM_SIZE,   		CPPU_E2T(CPPUTYPE_INT16)  ,  		PROPERTY_NONE,   MID_FRMSIZE_WIDTH_TYPE },
                     { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },
+
+                    //UUUU adf FillProperties for SW, same as FILL_PROPERTIES in svx
+                    // but need own defines in Writer due to later association of strings
+                    // and uno types (see loop at end of this metjhod and definition of SW_PROP_NMID)
+                    FILL_PROPERTIES_SW
+
                     {0,0,0,0,0,0}
 				};
                 aMapEntriesArr[nPropertyId] = aFramePropertyMap_Impl;
@@ -2536,6 +2589,7 @@ const SfxItemPropertyMapEntry* SwUnoProp
         for( ; p->pName; ++p, ++i )
         {
             // set the name
+            OSL_ENSURE((long)p->pName < SW_PROPNAME_END, "Error in SW SfxItemPropertyMapEntry defines: ID for string out of range (!)");
             const SwPropNameLen& rPropNm = GetPropName( (sal_uInt16)(long)p->pName );
             p->pName = rPropNm.pName;
             p->nNameLen = rPropNm.nNameLen;

Modified: openoffice/trunk/main/sw/source/core/unocore/unoprnms.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unoprnms.cxx?rev=1579280&r1=1579279&r2=1579280&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/unocore/unoprnms.cxx (original)
+++ openoffice/trunk/main/sw/source/core/unocore/unoprnms.cxx Wed Mar 19 16:17:02 2014
@@ -26,7 +26,7 @@
 #include <tools/debug.hxx>
 #include <svl/itemprop.hxx>
 #include <unoprnms.hxx>
-
+#include <editeng/unoprnms.hxx>
 
 //#define MAP_CHAR_LEN(cchar) cchar, sizeof(cchar) - 1
 
@@ -778,7 +778,35 @@ const SwPropNameTab aPropNameTab = {
 /* 0740 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")},
 /* 0741 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")},
 /* 0742 UNO_NAME_DEFAULT_PAGE_MODE */	 {MAP_CHAR_LEN("DefaultPageMode")},
-/* 0743 UNO_NAME_INITIALS */            {MAP_CHAR_LEN("Initials")}
+/* 0743 UNO_NAME_INITIALS */            {MAP_CHAR_LEN("Initials")},
+
+//UUUU names for FillAttributes from SVX; use already existing string defines from editengine
+/* 0744 UNO_NAME_FILLBMP_LOGICAL_SIZE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_LOGICAL_SIZE)},
+/* 0745 UNO_NAME_FILLBMP_OFFSET_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_X)},
+/* 0746 UNO_NAME_FILLBMP_OFFSET_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_OFFSET_Y)},
+/* 0747 UNO_NAME_FILLBMP_POSITION_OFFSET_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_X)},
+/* 0748 UNO_NAME_FILLBMP_POSITION_OFFSET_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_POSITION_OFFSET_Y)},
+/* 0749 UNO_NAME_FILLBMP_RECTANGLE_POINT */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_RECTANGLE_POINT)},
+/* 0750 UNO_NAME_FILLBMP_SIZE_X */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_X)},
+/* 0751 UNO_NAME_FILLBMP_SIZE_Y */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_SIZE_Y)},
+/* 0752 UNO_NAME_FILLBMP_STRETCH */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_STRETCH)},
+/* 0753 UNO_NAME_FILLBMP_TILE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_TILE)},
+/* 0754 UNO_NAME_FILLBMP_MODE */ {MAP_CHAR_LEN(UNO_NAME_FILLBMP_MODE)},
+/* 0755 UNO_NAME_FILLCOLOR */ {MAP_CHAR_LEN(UNO_NAME_FILLCOLOR)},
+/* 0756 UNO_NAME_FILLBACKGROUND */ {MAP_CHAR_LEN(UNO_NAME_FILLBACKGROUND)},
+/* 0757 UNO_NAME_FILLBITMAP */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAP)},
+/* 0758 UNO_NAME_FILLBITMAPNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAPNAME)},
+/* 0759 UNO_NAME_FILLBITMAPURL */ {MAP_CHAR_LEN(UNO_NAME_FILLBITMAPURL)},
+/* 0760 UNO_NAME_FILLGRADIENTSTEPCOUNT */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTSTEPCOUNT)},
+/* 0761 UNO_NAME_FILLGRADIENT */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENT)},
+/* 0762 UNO_NAME_FILLGRADIENTNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTNAME)},
+/* 0763 UNO_NAME_FILLHATCH */ {MAP_CHAR_LEN(UNO_NAME_FILLHATCH)},
+/* 0764 UNO_NAME_FILLHATCHNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLHATCHNAME)},
+/* 0765 UNO_NAME_FILLSTYLE */ {MAP_CHAR_LEN(UNO_NAME_FILLSTYLE)},
+/* 0766 UNO_NAME_FILL_TRANSPARENCE */ {MAP_CHAR_LEN(UNO_NAME_FILL_TRANSPARENCE)},
+/* 0767 UNO_NAME_FILLTRANSPARENCEGRADIENT */ {MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENT)},
+/* 0768 UNO_NAME_FILLTRANSPARENCEGRADIENTNAME */ {MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENTNAME)},
+/* 0769 UNO_NAME_FILLCOLOR_2 */ {MAP_CHAR_LEN(UNO_NAME_FILLCOLOR_2)}
 };
 
 const SwPropNameLen& SwGetPropName( sal_uInt16 nId )

Modified: openoffice/trunk/main/sw/source/core/unocore/unostyle.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/unocore/unostyle.cxx?rev=1579280&r1=1579279&r2=1579280&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/unocore/unostyle.cxx (original)
+++ openoffice/trunk/main/sw/source/core/unocore/unostyle.cxx Wed Mar 19 16:17:02 2014
@@ -74,6 +74,14 @@
 #include <fmtfsize.hxx>
 #include <numrule.hxx>
 
+//UUUU
+#include <unobrushitemhelper.hxx>
+#include <editeng/unoipset.hxx>
+#include <editeng/memberids.hrc>
+#include <svx/unoshape.hxx>
+#include <svx/xflbstit.hxx>
+#include <svx/xflbmtit.hxx>
+
 #include <boost/shared_ptr.hpp>
 
 #include "ccoll.hxx"
@@ -1823,46 +1831,153 @@ void lcl_SetStyleProperty(const SfxItemP
                                 lang::WrappedTargetException, uno::RuntimeException)
 
 {
+    //UUUU adapted switch logic to a more readable state; removed goto's and made
+    // execution of standard setting of proerty in ItemSet dependent of this variable
+    bool bDone(false);
+
+    //UUUU
+    const sal_uInt8 nMemberId(rEntry.nMemberId & (~SFX_METRIC_ITEM));
+    uno::Any aValue(rValue);
+
+    //UUUU check for needed metric translation
+    if(rEntry.nMemberId & SFX_METRIC_ITEM)
+    {
+        bool bDoIt(true);
+
+        if(XATTR_FILLBMP_SIZEX == rEntry.nWID || XATTR_FILLBMP_SIZEY == rEntry.nWID)
+        {
+            // exception: If these ItemTypes are used, do not convert when these are negative
+            // since this means they are intended as percent values
+            sal_Int32 nValue = 0;
+
+            if(aValue >>= nValue)
+            {
+                bDoIt = nValue > 0;
+            }
+        }
+
+        if(bDoIt && pDoc)
+        {
+            const SfxItemPool& rPool = pDoc->GetAttrPool();
+            const SfxMapUnit eMapUnit(rPool.GetMetric(rEntry.nWID));
+
+            if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+            {
+                SvxUnoConvertFromMM(eMapUnit, aValue);
+            }
+        }
+    }
+
     switch(rEntry.nWID)
     {
-		case RES_PAPER_BIN:
-		{
+        case XATTR_FILLBITMAP:
+        case XATTR_FILLGRADIENT:
+        case XATTR_FILLHATCH:
+        case XATTR_FILLFLOATTRANSPARENCE:
+        // not yet needed; activate when LineStyle support may be added
+        // case XATTR_LINESTART:
+        // case XATTR_LINEEND:
+        // case XATTR_LINEDASH:
+        {
+            //UUUU add set commands for FillName items
+            if(MID_NAME == nMemberId)
+            {
+                OUString aTempName;
+                SfxItemSet& rStyleSet = rBase.GetItemSet();
+
+                if(!(aValue >>= aTempName))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                SvxShape::SetFillAttribute(rEntry.nWID, aTempName, rStyleSet);
+                bDone = true;
+            }
+
+            break;
+        }
+        case RES_BACKGROUND:
+        {
+            //UUUU
+            SfxItemSet& rStyleSet = rBase.GetItemSet();
+            const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rStyleSet));
+            SvxBrushItem aChangedBrushItem(aOriginalBrushItem);
+
+            aChangedBrushItem.PutValue(aValue, nMemberId);
+
+            if(!(aChangedBrushItem == aOriginalBrushItem))
+            {
+                setSvxBrushItemAsFillAttributesToTargetSet(aChangedBrushItem, rStyleSet);
+            }
+
+            bDone = true;
+            break;
+        }
+        case OWN_ATTR_FILLBMP_MODE:
+        {
+            //UUUU
+            drawing::BitmapMode eMode;
+
+            if(!(aValue >>= eMode))
+            {
+                sal_Int32 nMode = 0;
+
+                if(!(aValue >>= nMode))
+                {
+                    throw lang::IllegalArgumentException();
+                }
+
+                eMode = (drawing::BitmapMode)nMode;
+            }
+
+            SfxItemSet& rStyleSet = rBase.GetItemSet();
+
+            rStyleSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode));
+            rStyleSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode));
+
+            bDone = true;
+            break;
+        }
+        case RES_PAPER_BIN:
+        {
             SfxPrinter *pPrinter = pDoc->getPrinter( true );
-			OUString sTmp;
-			sal_uInt16 nBin = USHRT_MAX;
-			if ( !( rValue >>= sTmp ) )
-				throw lang::IllegalArgumentException();
-			if ( sTmp.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "[From printer settings]" ) ) )
-				nBin = USHRT_MAX-1;
-			else if ( pPrinter )
-			{
-				for (sal_uInt16 i=0, nEnd = pPrinter->GetPaperBinCount(); i < nEnd; i++ )
-				{
-					if (sTmp == OUString ( pPrinter->GetPaperBinName ( i ) ) )
-					{
-						nBin = i;
-						break;
-					}
-				}
-			}
-			if ( nBin == USHRT_MAX )
-				throw lang::IllegalArgumentException();
-			else
-			{
-				SfxItemSet& rStyleSet = rBase.GetItemSet();
+            OUString sTmp;
+            sal_uInt16 nBin = USHRT_MAX;
+            if ( !( aValue >>= sTmp ) )
+                throw lang::IllegalArgumentException();
+            if ( sTmp.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "[From printer settings]" ) ) )
+                nBin = USHRT_MAX-1;
+            else if ( pPrinter )
+            {
+                for (sal_uInt16 i=0, nEnd = pPrinter->GetPaperBinCount(); i < nEnd; i++ )
+                {
+                    if (sTmp == OUString ( pPrinter->GetPaperBinName ( i ) ) )
+                    {
+                        nBin = i;
+                        break;
+                    }
+                }
+            }
+            if ( nBin == USHRT_MAX )
+                throw lang::IllegalArgumentException();
+            else
+            {
+                SfxItemSet& rStyleSet = rBase.GetItemSet();
                 SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
-				aSet.SetParent(&rStyleSet);
+                aSet.SetParent(&rStyleSet);
                 rPropSet.setPropertyValue(rEntry, uno::makeAny ( static_cast < sal_Int8 > ( nBin == USHRT_MAX-1 ? -1 : nBin ) ), aSet);
-				rStyleSet.Put(aSet);
-			}
-		}
-		break;
-		case  FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
-		{
-            if(rValue.getValueType() == ::getCppuType((uno::Reference< container::XIndexReplace>*)0) )
+                rStyleSet.Put(aSet);
+            }
+
+            bDone = true;
+            break;
+        }
+        case  FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
+        {
+            if(aValue.getValueType() == ::getCppuType((uno::Reference< container::XIndexReplace>*)0) )
             {
                 uno::Reference< container::XIndexReplace > * pxRulesRef =
-                        (uno::Reference< container::XIndexReplace > *)rValue.getValue();
+                        (uno::Reference< container::XIndexReplace > *)aValue.getValue();
 
                 uno::Reference<lang::XUnoTunnel> xNumberTunnel( *pxRulesRef, uno::UNO_QUERY);
 
@@ -1943,113 +2058,127 @@ void lcl_SetStyleProperty(const SfxItemP
             }
             else
                 throw lang::IllegalArgumentException();
+
+            bDone = true;
+            break;
         }
-        break;
         // case FN_UNO_DEFAULT_OUTLINE_LEVEL:		//#outline level,removed by zahojianwei
         //{
         //    sal_Int8 nLevel = 0;
-        //    if( rValue >>= nLevel )
+        //    if( aValue >>= nLevel )
         //        rBase.mxNewBase->GetCollection()->SetOutlineLevel( nLevel );
         //    else
         //        rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );
+        //
+        //    bDone = true;
+        //    break;
         //}
-        //break;
-        case RES_PARATR_OUTLINELEVEL:				//add by zahojianwei
+        case RES_PARATR_OUTLINELEVEL:   //add by zahojianwei
         {
             sal_Int16 nLevel = 0;
-   			rValue >>= nLevel;		
+            aValue >>= nLevel;		
             if( 0 <= nLevel && nLevel <= MAXLEVEL)
-				rBase.mxNewBase->GetCollection()->SetAttrOutlineLevel( nLevel );
-        }											
-        break;										//<-end,zhaojianwei
+                rBase.mxNewBase->GetCollection()->SetAttrOutlineLevel( nLevel );
+
+            bDone = true;
+            break;  //<-end,zhaojianwei
+        }
         case FN_UNO_FOLLOW_STYLE:
         {
             OUString sTmp;
-            rValue >>= sTmp;
-			String aString;
-			SwStyleNameMapper::FillUIName(sTmp, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True ) ;
+            aValue >>= sTmp;
+            String aString;
+            SwStyleNameMapper::FillUIName(sTmp, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True ) ;
             rBase.mxNewBase->SetFollow( aString );
+
+            bDone = true;
+            break;
         }
-        break;
         case RES_PAGEDESC :
-        if( MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId)
-            goto put_itemset;
         {
-            // Sonderbehandlung RES_PAGEDESC
-            if(rValue.getValueType() != ::getCppuType((const OUString*)0))
-                throw lang::IllegalArgumentException();
-            SfxItemSet& rStyleSet = rBase.GetItemSet();
+            if( MID_PAGEDESC_PAGEDESCNAME == nMemberId)
+            {
+                // Sonderbehandlung RES_PAGEDESC
+                if(aValue.getValueType() != ::getCppuType((const OUString*)0))
+                    throw lang::IllegalArgumentException();
+                SfxItemSet& rStyleSet = rBase.GetItemSet();
 
-            SwFmtPageDesc* pNewDesc = 0;
-            const SfxPoolItem* pItem;
-            if(SFX_ITEM_SET == rStyleSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
-            {
-                pNewDesc = new SwFmtPageDesc(*((SwFmtPageDesc*)pItem));
-            }
-            if(!pNewDesc)
-                pNewDesc = new SwFmtPageDesc();
-            OUString uDescName;
-            rValue >>= uDescName;
-            String sDescName;
-			SwStyleNameMapper::FillUIName(uDescName, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
-            if(!pNewDesc->GetPageDesc() || pNewDesc->GetPageDesc()->GetName() != sDescName)
-            {
-                //sal_uInt16 nCount = pDoc->GetPageDescCnt();
-                sal_Bool bPut = sal_False;
-                if(sDescName.Len())
+                SwFmtPageDesc* pNewDesc = 0;
+                const SfxPoolItem* pItem;
+                if(SFX_ITEM_SET == rStyleSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
                 {
-                    SwPageDesc* pPageDesc = ::GetPageDescByName_Impl(*pDoc, sDescName);
-                    if(pPageDesc)
+                    pNewDesc = new SwFmtPageDesc(*((SwFmtPageDesc*)pItem));
+                }
+                if(!pNewDesc)
+                    pNewDesc = new SwFmtPageDesc();
+                OUString uDescName;
+                aValue >>= uDescName;
+                String sDescName;
+                SwStyleNameMapper::FillUIName(uDescName, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
+                if(!pNewDesc->GetPageDesc() || pNewDesc->GetPageDesc()->GetName() != sDescName)
+                {
+                    //sal_uInt16 nCount = pDoc->GetPageDescCnt();
+                    sal_Bool bPut = sal_False;
+                    if(sDescName.Len())
                     {
-                        pNewDesc->RegisterToPageDesc( *pPageDesc );
-                        bPut = sal_True;
+                        SwPageDesc* pPageDesc = ::GetPageDescByName_Impl(*pDoc, sDescName);
+                        if(pPageDesc)
+                        {
+                            pNewDesc->RegisterToPageDesc( *pPageDesc );
+                            bPut = sal_True;
+                        }
+                        else
+                        {
+                            throw lang::IllegalArgumentException();
+                        }
                     }
-                    else
+                    if(!bPut)
                     {
-                        throw lang::IllegalArgumentException();
+                        rStyleSet.ClearItem(RES_BREAK);
+                        rStyleSet.Put(SwFmtPageDesc());
                     }
+                    else
+                        rStyleSet.Put(*pNewDesc);
                 }
-                if(!bPut)
-                {
-                    rStyleSet.ClearItem(RES_BREAK);
-                    rStyleSet.Put(SwFmtPageDesc());
-                }
-                else
-                    rStyleSet.Put(*pNewDesc);
+
+                delete pNewDesc;
+                bDone = true;
             }
-            delete pNewDesc;
+
+            break;
         }
-        break;
         case FN_UNO_IS_AUTO_UPDATE:
         {
-            sal_Bool bAuto = *(sal_Bool*)rValue.getValue();
+            sal_Bool bAuto = *(sal_Bool*)aValue.getValue();
             if(SFX_STYLE_FAMILY_PARA == eFamily)
                 rBase.mxNewBase->GetCollection()->SetAutoUpdateFmt(bAuto);
             else if(SFX_STYLE_FAMILY_FRAME == eFamily)
                 rBase.mxNewBase->GetFrmFmt()->SetAutoUpdateFmt(bAuto);
+
+            bDone = true;
+            break;
         }
-        break;
         case FN_UNO_PARA_STYLE_CONDITIONS:
         {
-			uno::Sequence< beans::NamedValue > aSeq;
-			if (!(rValue >>= aSeq))
-				throw lang::IllegalArgumentException();
+            uno::Sequence< beans::NamedValue > aSeq;
+            if (!(aValue >>= aSeq))
+                throw lang::IllegalArgumentException();
 
             DBG_ASSERT(COND_COMMAND_COUNT == 28,
                     "invalid size of comman count?");
-			const beans::NamedValue *pSeq = aSeq.getConstArray();
+            const beans::NamedValue *pSeq = aSeq.getConstArray();
             sal_Int32 nLen = aSeq.getLength();
 
             sal_Bool bFailed = sal_False;
-			SwCondCollItem aCondItem;
-			for(sal_uInt16 i = 0; i < nLen; i++)
-			{
-				OUString aTmp;
-				if ((pSeq[i].Value >>= aTmp))
-				{
-					// get UI style name from programmatic style name
+            SwCondCollItem aCondItem;
+            for(sal_uInt16 i = 0; i < nLen; i++)
+            {
+                OUString aTmp;
+                if ((pSeq[i].Value >>= aTmp))
+                {
+                    // get UI style name from programmatic style name
                     String aStyleName;
-                   	SwStyleNameMapper::FillUIName( aTmp, aStyleName, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True );
+                    SwStyleNameMapper::FillUIName( aTmp, aStyleName, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True );
 
                     //
                     // check for correct context and style name
@@ -2073,21 +2202,22 @@ void lcl_SetStyleProperty(const SfxItemP
                     }
 
                     aCondItem.SetStyle( &aStyleName, nIdx);
-				}
-				else
-					bFailed = sal_True;
-			}
-			if (bFailed)
-				throw lang::IllegalArgumentException();
-			rBase.GetItemSet().Put( aCondItem );
-		}
-        break;
+                }
+                else
+                    bFailed = sal_True;
+            }
+            if (bFailed)
+                throw lang::IllegalArgumentException();
+            rBase.GetItemSet().Put( aCondItem );
+            bDone = true;
+            break;
+        }
         case FN_UNO_CATEGORY:
         {
             if(!rBase.mxNewBase->IsUserDefined())
                 throw lang::IllegalArgumentException();
             short nSet = 0;
-            rValue >>= nSet;
+            aValue >>= nSet;
 
             sal_uInt16 nId;
             switch( nSet )
@@ -2112,27 +2242,31 @@ void lcl_SetStyleProperty(const SfxItemP
                     break;
                 default: throw lang::IllegalArgumentException();
             }
+
             rBase.mxNewBase->SetMask( nId|SFXSTYLEBIT_USERDEF );
+            bDone = true;
+            break;
         }
-        break;
         case SID_SWREGISTER_COLLECTION:
         {
             OUString sName;
-            rValue >>= sName;
+            aValue >>= sName;
             SwRegisterItem aReg( sName.getLength() != 0);
             aReg.SetWhich(SID_SWREGISTER_MODE);
             rBase.GetItemSet().Put(aReg);
-			String aString;
+            String aString;
             SwStyleNameMapper::FillUIName(sName, aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True);
 
             rBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, aString ) );
+            bDone = true;
+            break;
         }
-        break;
         case RES_TXTATR_CJK_RUBY:
-            if(MID_RUBY_CHARSTYLE == rEntry.nMemberId )
+        {
+            if(MID_RUBY_CHARSTYLE == nMemberId )
             {
                 OUString sTmp;
-                if(rValue >>= sTmp)
+                if(aValue >>= sTmp)
                 {
                     SfxItemSet& rStyleSet = rBase.GetItemSet();
                     SwFmtRuby* pRuby = 0;
@@ -2142,7 +2276,7 @@ void lcl_SetStyleProperty(const SfxItemP
                     if(!pRuby)
                         pRuby = new SwFmtRuby(aEmptyStr);
                     String sStyle;
-					SwStyleNameMapper::FillUIName(sTmp, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
+                    SwStyleNameMapper::FillUIName(sTmp, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
                     pRuby->SetCharFmtName( sTmp );
                     pRuby->SetCharFmtId( 0 );
                     if(sTmp.getLength())
@@ -2156,13 +2290,13 @@ void lcl_SetStyleProperty(const SfxItemP
                 else
                     throw lang::IllegalArgumentException();
             }
-        goto put_itemset;
-        //break;
+            break;
+        }
         case RES_PARATR_DROP:
         {
-            if( MID_DROPCAP_CHAR_STYLE_NAME == rEntry.nMemberId)
+            if( MID_DROPCAP_CHAR_STYLE_NAME == nMemberId)
             {
-                if(rValue.getValueType() == ::getCppuType((const OUString*)0))
+                if(aValue.getValueType() == ::getCppuType((const OUString*)0))
                 {
                     SfxItemSet& rStyleSet = rBase.GetItemSet();
 
@@ -2173,9 +2307,9 @@ void lcl_SetStyleProperty(const SfxItemP
                     if(!pDrop)
                         pDrop = new SwFmtDrop();
                     OUString uStyle;
-                    rValue >>= uStyle;
+                    aValue >>= uStyle;
                     String sStyle;
-					SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
+                    SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
                     SwDocStyleSheet* pStyle =
                         (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR);
                     if(pStyle)
@@ -2187,36 +2321,42 @@ void lcl_SetStyleProperty(const SfxItemP
                 }
                 else
                     throw lang::IllegalArgumentException();
-                break;
+
+                bDone = true;
             }
+            break;
         }
-        //no break!
         default:
-put_itemset:
         {
-            SfxItemSet& rStyleSet = rBase.GetItemSet();
-            SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
-            aSet.SetParent(&rStyleSet);
-            rPropSet.setPropertyValue(rEntry, rValue, aSet);
-            rStyleSet.Put(aSet);
-            // --> OD 2006-10-18 #i70223#
-            if ( SFX_STYLE_FAMILY_PARA == eFamily &&
-                 rEntry.nWID == RES_PARATR_NUMRULE &&
-                 rBase.mxNewBase.is() && rBase.mxNewBase->GetCollection() &&
-                 //rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */)	//#outline level,removed by zhaojianwei
-                 rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() )		////<-end,add by zhaojianwei
-				 
-            {
-                OUString sNewNumberingRuleName;
-                rValue >>= sNewNumberingRuleName;
-                String sTmp( sNewNumberingRuleName );
-                if ( sNewNumberingRuleName.getLength() == 0 ||
-                     sTmp != pDoc->GetOutlineNumRule()->GetName() )
-                {
-                    // delete assignment to list level of outline style.
-                    //rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );			//#outline level,removed by zhaojianwei
-                    rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();	//<-end,adde by zhaojianwei
-                }
+            // nothing to do
+            break;
+        }
+    }
+
+    if(!bDone)
+    {
+        // default ItemSet handling
+        SfxItemSet& rStyleSet = rBase.GetItemSet();
+        SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
+        aSet.SetParent(&rStyleSet);
+        rPropSet.setPropertyValue(rEntry, aValue, aSet);
+        rStyleSet.Put(aSet);
+
+        // --> OD 2006-10-18 #i70223#
+        if ( SFX_STYLE_FAMILY_PARA == eFamily &&
+                rEntry.nWID == RES_PARATR_NUMRULE &&
+                rBase.mxNewBase.is() && rBase.mxNewBase->GetCollection() &&
+                //rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */)	//#outline level,removed by zhaojianwei
+                rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() )		////<-end,add by zhaojianwei
+        {
+            OUString sNewNumberingRuleName;
+            aValue >>= sNewNumberingRuleName;
+            String sTmp( sNewNumberingRuleName );
+            if ( sNewNumberingRuleName.getLength() == 0 || sTmp != pDoc->GetOutlineNumRule()->GetName() )
+            {
+                // delete assignment to list level of outline style.
+                //rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );			//#outline level,removed by zhaojianwei
+                rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();	//<-end,adde by zhaojianwei
             }
         }
     }
@@ -2320,9 +2460,10 @@ uno::Any lcl_GetStyleProperty(const SfxI
                         SwStyleBase_Impl& rBase,
                         SfxStyleSheetBase* pBase,
                         SfxStyleFamily eFamily,
-						SwDoc *pDoc) throw(uno::RuntimeException)
+                        SwDoc *pDoc) throw(uno::RuntimeException)
 {
     uno::Any aRet;
+
     if(FN_UNO_IS_PHYSICAL == rEntry.nWID)
     {
         sal_Bool bPhys = pBase != 0;
@@ -2340,33 +2481,48 @@ uno::Any lcl_GetStyleProperty(const SfxI
     else if(pBase)
     {
         if(!rBase.mxNewBase.is())
+        {
             rBase.mxNewBase = new SwDocStyleSheet( *(SwDocStyleSheet*)pBase );
+        }
+
+        //UUUU
+        const sal_uInt8 nMemberId(rEntry.nMemberId & (~SFX_METRIC_ITEM));
+
+        //UUUU adapted switch logic to a more readable state; removed goto's and made
+        // execution of standard setting of proerty in ItemSet dependent of this variable
+        bool bDone(false);
+
         switch(rEntry.nWID)
         {
-			case RES_PAPER_BIN:
-			{
+            case RES_PAPER_BIN:
+            {
                 SfxItemSet& rSet = rBase.GetItemSet();
                 rPropSet.getPropertyValue(rEntry, rSet, aRet);
-				sal_Int8 nBin = 0;
-				aRet >>= nBin;
-				if ( nBin == -1 )
-					aRet <<= OUString ( RTL_CONSTASCII_USTRINGPARAM ( "[From printer settings]" ) );
-				else
-				{
+                sal_Int8 nBin = 0;
+                aRet >>= nBin;
+                if ( nBin == -1 )
+                    aRet <<= OUString ( RTL_CONSTASCII_USTRINGPARAM ( "[From printer settings]" ) );
+                else
+                {
                     SfxPrinter *pPrinter = pDoc->getPrinter( false );
-					OUString sTmp;
-					if (pPrinter )
-						sTmp = pPrinter->GetPaperBinName ( nBin );
-					aRet <<= sTmp;
-				}
-			}
-			break;
+                    OUString sTmp;
+                    if (pPrinter )
+                        sTmp = pPrinter->GetPaperBinName ( nBin );
+                    aRet <<= sTmp;
+                }
+
+                bDone = true;
+                break;
+            }
             case  FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
             {
                 const SwNumRule* pRule = rBase.mxNewBase->GetNumRule();
                 DBG_ASSERT(pRule, "Wo ist die NumRule?");
                 uno::Reference< container::XIndexReplace >  xRules = new SwXNumberingRules(*pRule);
+
                 aRet.setValue(&xRules, ::getCppuType((uno::Reference<container::XIndexReplace>*)0));
+                bDone = true;
+                break;
             }
             break;
             //case FN_UNO_DEFAULT_OUTLINE_LEVEL:		//#outline level,removed by zahojianwei
@@ -2375,40 +2531,49 @@ uno::Any lcl_GetStyleProperty(const SfxI
             //    sal_uInt8 nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
             //    if( nLevel != NO_NUMBERING )
             //        aRet <<= static_cast<sal_Int8>( nLevel );
+            //    bDone = true;
+            //    break;
             //}
-            //break;
-			case RES_PARATR_OUTLINELEVEL:				//add by zahojianwei
+            case RES_PARATR_OUTLINELEVEL:				//add by zahojianwei
             {
                 DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
-				int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
-                    aRet <<= static_cast<sal_Int16>( nLevel );
-            }
-            break;										//<-end,zhaojianwei
+                int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
+
+                aRet <<= static_cast<sal_Int16>( nLevel );
+                bDone = true;
+                break;
+            } //<-end,zhaojianwei
             case FN_UNO_FOLLOW_STYLE:
-			{
-				String aString;
-				SwStyleNameMapper::FillProgName(rBase.mxNewBase->GetFollow(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True);
+            {
+                String aString;
+
+                SwStyleNameMapper::FillProgName(rBase.mxNewBase->GetFollow(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True);
                 aRet <<= OUString( aString );
-			}
-            break;
+                bDone = true;
+                break;
+            }
             case RES_PAGEDESC :
-            if( MID_PAGEDESC_PAGEDESCNAME != rEntry.nMemberId)
-                goto query_itemset;
             {
-                // Sonderbehandlung RES_PAGEDESC
-                const SfxPoolItem* pItem;
-                if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
+                if( MID_PAGEDESC_PAGEDESCNAME == nMemberId)
                 {
-                    const SwPageDesc* pDesc = ((const SwFmtPageDesc*)pItem)->GetPageDesc();
-                    if(pDesc)
-					{
-						String aString;
-						SwStyleNameMapper::FillProgName(pDesc->GetName(), aString,  nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
-                        aRet <<= OUString( aString );
-					}
+                    // Sonderbehandlung RES_PAGEDESC
+                    const SfxPoolItem* pItem;
+                    if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
+                    {
+                        const SwPageDesc* pDesc = ((const SwFmtPageDesc*)pItem)->GetPageDesc();
+                        if(pDesc)
+                        {
+                            String aString;
+                            SwStyleNameMapper::FillProgName(pDesc->GetName(), aString,  nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
+                            aRet <<= OUString( aString );
+                        }
+                    }
+
+                    bDone = true;
                 }
+
+                break;
             }
-            break;
             case FN_UNO_IS_AUTO_UPDATE:
             {
                 sal_Bool bAuto = sal_False;
@@ -2417,25 +2582,29 @@ uno::Any lcl_GetStyleProperty(const SfxI
                 else if(SFX_STYLE_FAMILY_FRAME == eFamily)
                     bAuto = rBase.mxNewBase->GetFrmFmt()->IsAutoUpdateFmt();
                 aRet.setValue(&bAuto, ::getBooleanCppuType());
+
+                bDone = true;
+                break;
             }
-            break;
             case FN_UNO_DISPLAY_NAME:
             {
                 OUString sName(rBase.mxNewBase->GetDisplayName());
                 aRet <<= sName;
+
+                bDone = true;
+                break;
             }
-            break;
-			case FN_UNO_PARA_STYLE_CONDITIONS:
-			{
-				DBG_ASSERT(COND_COMMAND_COUNT == 28,
-						"invalid size of comman count?");
-				//SfxItemSet& rStyleSet = rBase.GetItemSet();
-				uno::Sequence< beans::NamedValue > aSeq(COND_COMMAND_COUNT);
-				beans::NamedValue *pSeq = aSeq.getArray();
+            case FN_UNO_PARA_STYLE_CONDITIONS:
+            {
+                DBG_ASSERT(COND_COMMAND_COUNT == 28,
+                        "invalid size of comman count?");
+                //SfxItemSet& rStyleSet = rBase.GetItemSet();
+                uno::Sequence< beans::NamedValue > aSeq(COND_COMMAND_COUNT);
+                beans::NamedValue *pSeq = aSeq.getArray();
 
-				SwFmt *pFmt = ((SwDocStyleSheet*)pBase)->GetCollection();
+                SwFmt *pFmt = ((SwDocStyleSheet*)pBase)->GetCollection();
                 const CommandStruct *pCmds = SwCondCollItem::GetCmds();
-				for (sal_uInt16 n = 0;  n < COND_COMMAND_COUNT;  ++n)
+                for (sal_uInt16 n = 0;  n < COND_COMMAND_COUNT;  ++n)
                 {
                     String aStyleName;
 
@@ -2454,12 +2623,15 @@ uno::Any lcl_GetStyleProperty(const SfxI
                     pSeq[n].Value <<= rtl::OUString( aStyleName );
                 }
                 aRet <<= aSeq;
-			}
-			break;
+
+                bDone = true;
+                break;
+            }
             case FN_UNO_CATEGORY:
             {
                 sal_uInt16 nPoolId = rBase.mxNewBase->GetCollection()->GetPoolFmtId();
                 short nRet = -1;
+
                 switch ( COLL_GET_RANGE_BITS & nPoolId )
                 {
                     case COLL_TEXT_BITS:
@@ -2481,32 +2653,119 @@ uno::Any lcl_GetStyleProperty(const SfxI
                         nRet = style::ParagraphStyleCategory::HTML;
                         break;
                 }
+
                 aRet <<= nRet;
+                bDone = true;
+                break;
             }
-            break;
             case SID_SWREGISTER_COLLECTION:
             {
                 const SwPageDesc *pPageDesc = rBase.mxNewBase->GetPageDesc();
                 const SwTxtFmtColl* pCol = 0;
-				String aString;
+                String aString;
                 if( pPageDesc )
                     pCol = pPageDesc->GetRegisterFmtColl();
                 if( pCol )
                     SwStyleNameMapper::FillProgName(
                                 pCol->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True );
+
                 aRet <<= OUString ( aString );
+                bDone = true;
+                break;
+            }
+            case RES_BACKGROUND:
+            {
+                //UUUU
+                const SfxItemSet& rSet = rBase.GetItemSet();
+                const SvxBrushItem aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet));
+
+                if(!aOriginalBrushItem.QueryValue(aRet, nMemberId))
+                {
+                    OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
+                }
+
+                bDone = true;
+                break;
+            }
+            case OWN_ATTR_FILLBMP_MODE:
+            {
+                //UUUU
+                const SfxItemSet& rSet = rBase.GetItemSet();
+                const XFillBmpStretchItem* pStretchItem = dynamic_cast< const XFillBmpStretchItem* >(&rSet.Get(XATTR_FILLBMP_STRETCH));
+                const XFillBmpTileItem* pTileItem = dynamic_cast< const XFillBmpTileItem* >(&rSet.Get(XATTR_FILLBMP_TILE));
+
+                if( pTileItem && pTileItem->GetValue() )
+                {
+                    aRet <<= drawing::BitmapMode_REPEAT;
+                }
+                else if( pStretchItem && pStretchItem->GetValue() )
+                {
+                    aRet <<= drawing::BitmapMode_STRETCH;
+                }
+                else
+                {
+                    aRet <<= drawing::BitmapMode_NO_REPEAT;
+                }
+
+                bDone = true;
+                break;
             }
-            break;
             default:
-query_itemset:
             {
-                SfxItemSet& rSet = rBase.GetItemSet();
-                rPropSet.getPropertyValue(rEntry, rSet, aRet);
+                // nothing to do as default
+                break;
+            }
+        }
+
+        if(!bDone)
+        {
+            SfxItemSet& rSet = rBase.GetItemSet();
+            rPropSet.getPropertyValue(rEntry, rSet, aRet);
+
+            //UUUU
+            if(rEntry.pType && *(rEntry.pType) == ::getCppuType((const sal_Int16*)0) && *(rEntry.pType) != aRet.getValueType())
+            {
+                // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
+                sal_Int32 nValue = 0;
+                aRet >>= nValue;
+                aRet <<= (sal_Int16)nValue;
+            }
+
+            //UUUU check for needed metric translation
+            if(rEntry.nMemberId & SFX_METRIC_ITEM)
+            {
+                bool bDoIt(true);
+
+                if(XATTR_FILLBMP_SIZEX == rEntry.nWID || XATTR_FILLBMP_SIZEY == rEntry.nWID)
+                {
+                    // exception: If these ItemTypes are used, do not convert when these are negative
+                    // since this means they are intended as percent values
+                    sal_Int32 nValue = 0;
+
+                    if(aRet >>= nValue)
+                    {
+                        bDoIt = nValue > 0;
+                    }
+                }
+
+                if(bDoIt && pDoc)
+                {
+                    const SfxItemPool& rPool = pDoc->GetAttrPool();
+                    const SfxMapUnit eMapUnit(rPool.GetMetric(rEntry.nWID));
+
+                    if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+                    {
+                        SvxUnoConvertToMM(eMapUnit, aRet);
+                    }
+                }
             }
         }
     }
     else
+    {
         throw uno::RuntimeException();
+    }
+
     return aRet;
 }
 /* -----------------------------19.04.01 09:26--------------------------------

Modified: openoffice/trunk/main/sw/source/ui/app/docst.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/ui/app/docst.cxx?rev=1579280&r1=1579279&r2=1579280&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/ui/app/docst.cxx (original)
+++ openoffice/trunk/main/sw/source/ui/app/docst.cxx Wed Mar 19 16:17:02 2014
@@ -508,6 +508,9 @@ void SwDocShell::ExecStyleSheet( SfxRequ
 	Beschreibung:	Edit
  --------------------------------------------------------------------*/
 
+//UUUU
+//#include <svx/svdmodel.hxx>
+//#include <svx/drawitem.hxx>
 
 sal_uInt16 SwDocShell::Edit(
     const String &rName,
@@ -664,10 +667,24 @@ sal_uInt16 SwDocShell::Edit(
 			rSet.Put( aTmpBrush );
 		}
 	}
-	if (!bBasic)
-	{
-		// vor dem Dialog wird der HtmlMode an der DocShell versenkt
-		sal_uInt16 nHtmlMode = ::GetHtmlMode(this);
+    if (!bBasic)
+    {
+        //UUUU
+        //if(SFX_STYLE_FAMILY_FRAME == nFamily)
+        //{
+        //    //UUUU create needed items for XPropertyList entries from the DrawModel so that
+        //    // the Area TabPage can access them
+        //    SfxItemSet& rSet = xTmp->GetItemSet();
+        //    const SdrModel* pDrawModel = GetDoc()->GetDrawModel();
+        //
+        //    rSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
+        //    rSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
+        //    rSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
+        //    rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
+        //}
+
+        // vor dem Dialog wird der HtmlMode an der DocShell versenkt
+        sal_uInt16 nHtmlMode = ::GetHtmlMode(this);
 
         // In HTML mode, we do not always have a printer. In order to show
         // the correct page size in the Format - Page dialog, we have to
@@ -733,6 +750,14 @@ sal_uInt16 SwDocShell::Edit(
 					}
 					aTmpSet.ClearItem( RES_BACKGROUND );
 				}
+
+                //UUUU
+                if(bNew && SFX_STYLE_FAMILY_FRAME == nFamily)
+                {
+                    // clear FillStyle so that it works as a derived attribute
+                    aTmpSet.ClearItem(XATTR_FILLSTYLE);
+                }
+
 				xTmp->SetItemSet( aTmpSet );
 
                 if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() )

Modified: openoffice/trunk/main/sw/source/ui/app/docstyle.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/ui/app/docstyle.cxx?rev=1579280&r1=1579279&r2=1579280&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/ui/app/docstyle.cxx (original)
+++ openoffice/trunk/main/sw/source/ui/app/docstyle.cxx Wed Mar 19 16:17:02 2014
@@ -397,40 +397,49 @@ void SwPoolFmtList::Erase()
  --------------------------------------------------------------------*/
 
 SwDocStyleSheet::SwDocStyleSheet(	SwDoc&			rDocument,
-									const String& 			rName,
+                                    const String& 			rName,
                                     SwDocStyleSheetPool&    _rPool,
-									SfxStyleFamily 			eFam,
+                                    SfxStyleFamily 			eFam,
                                     sal_uInt16                  _nMask) :
 
     SfxStyleSheetBase( rName, _rPool, eFam, _nMask ),
-	pCharFmt(0),
-	pColl(0),
+    pCharFmt(0),
+    pColl(0),
     pFrmFmt(0),
-	pDesc(0),
-	pNumRule(0),
+    pDesc(0),
+    pNumRule(0),
 
     rDoc(rDocument),
-	aCoreSet(GetPool().GetPool(),
-			RES_CHRATR_BEGIN,		RES_CHRATR_END - 1,
-            RES_PARATR_BEGIN,       RES_PARATR_END - 1,
+    aCoreSet(GetPool().GetPool(),   //UUUU sorted by indices, one double removed
+            RES_CHRATR_BEGIN,		RES_CHRATR_END - 1,             // [1
+            RES_PARATR_BEGIN,       RES_PARATR_END - 1,             // [60
             // --> OD 2008-02-25 #refactorlists#
-            RES_PARATR_LIST_BEGIN,  RES_PARATR_LIST_END - 1,
+            RES_PARATR_LIST_BEGIN,  RES_PARATR_LIST_END - 1,        // [77
             // <--
-			RES_FRMATR_BEGIN, 		RES_FRMATR_END - 1,
-			RES_UNKNOWNATR_BEGIN, 	RES_UNKNOWNATR_END-1,
-			SID_ATTR_PAGE, 			SID_ATTR_PAGE_EXT1,
-			SID_ATTR_PAGE_HEADERSET,SID_ATTR_PAGE_FOOTERSET,
-			SID_ATTR_BORDER_INNER, 	SID_ATTR_BORDER_INNER,
-			FN_PARAM_FTN_INFO, 		FN_PARAM_FTN_INFO,
-			SID_ATTR_PARA_MODEL,	SID_ATTR_PARA_MODEL,
-			SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,
-            SID_SWREGISTER_MODE,    SID_SWREGISTER_MODE,
-            SID_SWREGISTER_COLLECTION, SID_SWREGISTER_COLLECTION,
-			FN_COND_COLL,			FN_COND_COLL,
-			SID_ATTR_AUTO_STYLE_UPDATE,	SID_ATTR_AUTO_STYLE_UPDATE,
-			SID_ATTR_NUMBERING_RULE,	SID_ATTR_NUMBERING_RULE,
-			SID_PARA_BACKGRND_DESTINATION,	SID_ATTR_BRUSH_CHAR,
-			SID_ATTR_NUMBERING_RULE, 	SID_ATTR_NUMBERING_RULE,
+            RES_FRMATR_BEGIN, 		RES_FRMATR_END - 1,             // [82
+            RES_UNKNOWNATR_BEGIN, 	RES_UNKNOWNATR_END-1,           // [143
+
+            //UUUU FillAttribute support
+            XATTR_FILL_FIRST, XATTR_FILL_LAST,                      // [1014
+
+            SID_ATTR_BORDER_INNER, 	SID_ATTR_BORDER_INNER,          // [10023
+            SID_ATTR_PAGE, 			SID_ATTR_PAGE_EXT1,             // [10050
+            SID_ATTR_PAGE_HEADERSET,SID_ATTR_PAGE_FOOTERSET,        // [10058
+            SID_ATTR_PARA_MODEL,	SID_ATTR_PARA_MODEL,            // [10065
+
+            //UUUU items to hand over XPropertyList things like
+            // XColorList, XHatchList, XGradientList and XBitmapList
+            // to the Area TabPage
+            SID_COLOR_TABLE,        SID_BITMAP_LIST,                // [10179
+
+            SID_SWREGISTER_COLLECTION, SID_SWREGISTER_COLLECTION,   // [10451
+            SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,           // [10457
+            SID_SWREGISTER_MODE,    SID_SWREGISTER_MODE,            // [10467
+            SID_PARA_BACKGRND_DESTINATION,	SID_ATTR_BRUSH_CHAR,    // [10590
+            SID_ATTR_NUMBERING_RULE,	SID_ATTR_NUMBERING_RULE,    // [10855
+            SID_ATTR_AUTO_STYLE_UPDATE,	SID_ATTR_AUTO_STYLE_UPDATE, // [12065
+            FN_PARAM_FTN_INFO, 		FN_PARAM_FTN_INFO,              // [21123
+            FN_COND_COLL,			FN_COND_COLL,                   // [22401
             0),
     bPhysical(sal_False)
 {
@@ -1015,6 +1024,10 @@ sal_Bool   SwDocStyleSheet::SetFollow( c
 	Beschreibung:	ueber Name und Family, Mask den ItemSet rausholen
  --------------------------------------------------------------------*/
 
+//UUUU
+#include <svx/svdmodel.hxx>
+#include <svx/drawitem.hxx>
+
 SfxItemSet&   SwDocStyleSheet::GetItemSet()
 {
 	if(!bPhysical)
@@ -1057,7 +1070,16 @@ SfxItemSet&   SwDocStyleSheet::GetItemSe
 					aCoreSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, pFrmFmt->IsAutoUpdateFmt()));
 					if(pFrmFmt->DerivedFrom())
 						aCoreSet.SetParent(&pFrmFmt->DerivedFrom()->GetAttrSet());
-				}
+
+                    //UUUU create needed items for XPropertyList entries from the DrawModel so that
+                    // the Area TabPage can access them
+                    const SdrModel* pDrawModel = rDoc.GetDrawModel();
+
+                    aCoreSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
+                    aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
+                    aCoreSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
+                    aCoreSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));
+                }
 			}
 			break;
 
@@ -1379,6 +1401,14 @@ void SwDocStyleSheet::SetItemSet( const 
 		SfxItemSet aSet(rSet);
 		aSet.ClearInvalidItems();
 
+        if(SFX_STYLE_FAMILY_FRAME == nFamily)
+        {
+            //UUUU Need to check for unique item for DrawingLayer items of type NameOrIndex
+            // and evtl. correct that item to ensure unique names for that type. This call may
+            // modify/correct entries inside of the given SfxItemSet
+            rDoc.CheckForUniqueItemForLineFillNameOrIndex(aSet);
+        }
+
 		aCoreSet.ClearItem();
 
 		if( pNewDsc )