Merge back branch alg_writerframes to trunk

Notes:

merged as: 6e61ecd09679a66060f932835622821d39e92f01
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 14e70dc..fe820af 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -316,8 +316,7 @@ void ShapeController::executeDispatch_FormatArea()
            if ( pFact )
            {
                ::boost::scoped_ptr< AbstractSvxAreaTabDialog > pDlg(
                    pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
                        pDrawViewWrapper ) );
                    pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(), true ) );
                if ( pDlg.get() )
                {
                    SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
diff --git a/comphelper/inc/comphelper/TypeGeneration.hxx b/comphelper/inc/comphelper/TypeGeneration.hxx
index 981ef75..78a4868 100644
--- a/comphelper/inc/comphelper/TypeGeneration.hxx
+++ b/comphelper/inc/comphelper/TypeGeneration.hxx
@@ -113,6 +113,13 @@ namespace comphelper
        CPPUTYPE_TABLEBORDERDISTANCES, //getCppuType( (table::TableBorderDistances*)0 )
        CPPUTPYE_REFEMBEDDEDOBJECT, // XEmbeddedObject::static_type

        //UUUU add types needed for fill style definitions in SW
        CPPUTYPE_RECTANGLEPOINT,    //getCppuType((drawing::RectanglePoint*)0)
        CPPUTYPE_BITMAPMODE,        // getCppuType((drawing::BitmapMode*)0)
        CPPUTYPE_GRADIENT,          // getCppuType((awt::Gradient*)0)
        CPPUTYPE_HATCH,             // getCppuType((drawing::Hatch*)0)
        CPPUTYPE_FILLSTYLE,         // getCppuType((drawing::FillStyle*)0)

        CPPUTYPE_END
    };
    COMPHELPER_DLLPUBLIC void GenerateCppuType (
diff --git a/comphelper/source/property/TypeGeneration.cxx b/comphelper/source/property/TypeGeneration.cxx
index bacf2bd..1b981a6 100644
--- a/comphelper/source/property/TypeGeneration.cxx
+++ b/comphelper/source/property/TypeGeneration.cxx
@@ -131,6 +131,13 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>

//UUUU add types needed for fill style definitions in SW
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/drawing/Hatch.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>

using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::container;
@@ -228,6 +235,14 @@ namespace comphelper
            case CPPUTYPE_REFXGRAPHIC:      pType = &::getCppuType( (Reference< graphic::XGraphic >*)0); break;
            case CPPUTYPE_TABLEBORDERDISTANCES:     pType = &::getCppuType( (table::TableBorderDistances*)0 ); break;
            case CPPUTPYE_REFEMBEDDEDOBJECT:        pType = &embed::XEmbeddedObject::static_type(); break;

            //UUUU add types needed for fill style definitions in SW
            case CPPUTYPE_RECTANGLEPOINT:   pType = &getCppuType((drawing::RectanglePoint*)0); break;
            case CPPUTYPE_BITMAPMODE:       pType = &getCppuType((drawing::BitmapMode*)0); break;
            case CPPUTYPE_GRADIENT:         pType = &getCppuType((awt::Gradient*)0); break;
            case CPPUTYPE_HATCH:            pType = &getCppuType((drawing::Hatch*)0); break;
            case CPPUTYPE_FILLSTYLE:        pType = &getCppuType((drawing::FillStyle*)0); break;

            default:
                OSL_ASSERT( "Unknown CPPU type" );
        }
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f38fadb..2c38a1e 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1607,9 +1607,9 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos
AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( Window* pParent,
                                                            const SfxItemSet* pAttr,
                                                            SdrModel* pModel,
                                                            const SdrView* pSdrView )
                                                            bool bShadow)
{
    SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel,pSdrView );
    SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel, bShadow );
    return new AbstractSvxAreaTabDialog_Impl( pDlg );
}

diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 097b62f..cdb579b 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -741,7 +741,7 @@ public:
    virtual AbstractSvxAreaTabDialog*       CreateSvxAreaTabDialog( Window* pParent,//add for SvxAreaTabDialog
                                                            const SfxItemSet* pAttr,
                                                            SdrModel* pModel,
                                                            const SdrView* pSdrView = NULL ); //add for SvxAreaTabDialog
                                                            bool bShadow ); //add for SvxAreaTabDialog
    virtual SfxAbstractTabDialog*           CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, //add for SvxLineTabDialog
                                                                 SdrModel* pModel,
                                                                 const SdrObject* pObj = NULL,
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index bcc777f..d7a46a0 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -71,9 +71,7 @@ protected:
#endif

public:
    SvxAreaTabDialog( Window* pParent,
                      const SfxItemSet* pAttr, SdrModel* pModel,
                      const SdrView* pSdrView = NULL );
    SvxAreaTabDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow );
    ~SvxAreaTabDialog();

    void SetNewColorTable( XColorListSharedPtr aColTab ) { maNewColorTab = aColTab; }
@@ -107,10 +105,8 @@ class SvxTransparenceTabPage : public SvxTabPage
    const SfxItemSet&   rOutAttrs;
    RECT_POINT          eRP;

    //CHINA001 sal_uInt16*             pPageType;
    //CHINA001 sal_uInt16*             pDlgType;
    sal_uInt16             nPageType; //add CHINA001
    sal_uInt16             nDlgType;  //add CHINA001
    sal_uInt16             nPageType;
    sal_uInt16             nDlgType;

    // main selection
    FixedLine           aFlProp;
@@ -240,19 +236,23 @@ private:
    XHatchListSharedPtr     maHatchingList;
    XBitmapListSharedPtr    maBitmapList;

    // Placeholders for pointer-based entries; these will be inited
    // to point to these so that the page is usable without that
    // SvxAreaTabDialog has to call the setter methods (e.g. SetColorChgd).
    // Without that the pages used in SvxAreaTabDialog are not usable
    ChangeType          maFixed_ChangeType;
    sal_Bool            maFixed_sal_Bool;

    ChangeType*         pnColorTableState;
    ChangeType*         pnBitmapListState;
    ChangeType*         pnGradientListState;
    ChangeType*         pnHatchingListState;

    //CHINA001 sal_uInt16*             pPageType;
    //CHINA001 sal_uInt16*             pDlgType;
    //CHINA001 sal_uInt16*             pPos;
    sal_uInt16 nPageType; //add CHINA001
    sal_uInt16 nDlgType;//add CHINA001
    sal_uInt16 nPos; //add CHINA001
    sal_uInt16          nPageType;
    sal_uInt16          nDlgType;
    sal_uInt16          nPos;

    sal_Bool*               pbAreaTP;
    sal_Bool*           pbAreaTP;

    XOutdevItemPool*    pXPool;
    XFillAttrSetItem    aXFillAttr;
@@ -261,6 +261,14 @@ private:
    SfxMapUnit          ePoolUnit;
    FieldUnit           eFUnit;

    //UUUU
    bool                mbOfferImportButton;
    bool                mbPositionsAdapted;
    bool                mbDirectGraphicSet;
    Graphic             maDirectGraphic;
    String              maDirectName;
    PushButton          maBtnImport;

#ifdef _SVX_TPAREA_CXX
    DECL_LINK( SelectDialogTypeHdl_Impl, ListBox * );
    DECL_LINK( ClickInvisibleHdl_Impl, void * );
@@ -276,12 +284,16 @@ private:
    DECL_LINK( ModifyBitmapHdl_Impl, void * );
//  DECL_LINK( ModifyTransparentHdl_Impl, void * );
    DECL_LINK( ModifyStepCountHdl_Impl, void * );

    //UUUU
    DECL_LINK( ClickImportHdl_Impl, void * );

    DECL_LINK( ModifyTileHdl_Impl, void * );
    DECL_LINK( ClickScaleHdl_Impl, void * );
#endif

public:
    SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
    SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs );

    void    Construct();

diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index 7fc75eb..2ef09a80 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -62,7 +62,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
    Window* pParent,
    const SfxItemSet* pAttr,
    SdrModel* pModel,
    const SdrView* /* pSdrView */
    bool bShadow
) :

    SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_AREA ), pAttr ),
@@ -89,7 +89,16 @@ SvxAreaTabDialog::SvxAreaTabDialog
    FreeResource();

    AddTabPage( RID_SVXPAGE_AREA, SvxAreaTabPage::Create, 0 );
    AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 );

    if(bShadow)
    {
        AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 );
    }
    else
    {
        RemoveTabPage( RID_SVXPAGE_SHADOW );
    }

    AddTabPage( RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create,  0);
    AddTabPage( RID_SVXPAGE_COLOR, SvxColorTabPage::Create, 0 );
    AddTabPage( RID_SVXPAGE_GRADIENT, SvxGradientTabPage::Create, 0 );
diff --git a/cui/source/tabpages/tabarea.hrc b/cui/source/tabpages/tabarea.hrc
index 478d029..7406502 100644
--- a/cui/source/tabpages/tabarea.hrc
+++ b/cui/source/tabpages/tabarea.hrc
@@ -142,6 +142,8 @@
#define RBT_COLUMN 7
#define MTR_FLD_OFFSET 3
#define GRP_OFFSET 8
//UUUU
#define BTN_IMPORTOPTIONAL 1

#define FT_TRANSPARENT 9
#define FT_X_SIZE 10
diff --git a/cui/source/tabpages/tabarea.src b/cui/source/tabpages/tabarea.src
index 0d750d5..0982cb5 100644
--- a/cui/source/tabpages/tabarea.src
+++ b/cui/source/tabpages/tabarea.src
@@ -560,6 +560,15 @@ TabPage RID_SVXPAGE_AREA
        Last = 100 ;
        SpinSize = 5 ;
    };
    //UUUU
    PushButton BTN_IMPORTOPTIONAL
    {
        HelpID = "cui:PushButton:MD_ICONSELECTOR:BTN_IMPORTOPTIONAL";
        Pos = MAP_APPFONT ( 132 + 12, 157 + 6 ) ;
        Size = MAP_APPFONT ( 100 , 14 ) ;
        TabStop = TRUE ;
        Text[ en-US ] = "Import Graphic...";
    };
};
 // RID_SVXPAGE_SHADOW ------------------------------------------------------
TabPage RID_SVXPAGE_SHADOW
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 4f70a92..f175e25 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -54,6 +54,11 @@
#include <svl/intitem.hxx> //add CHINA001
#include <sfx2/request.hxx>//add CHINA001
#include "paragrph.hrc"

//UUUU
#include "sfx2/opengrf.hxx"
#include <vcl/msgbox.hxx>

#define DLGWIN this->GetParent()->GetParent()

// static ----------------------------------------------------------------
@@ -250,6 +255,8 @@ void SvxTransparenceTabPage::SetControlState_Impl(XGradientStyle eXGS)
SvxTransparenceTabPage::SvxTransparenceTabPage(Window* pParent, const SfxItemSet& rInAttrs)
:   SvxTabPage          ( pParent, CUI_RES( RID_SVXPAGE_TRANSPARENCE ), rInAttrs),
    rOutAttrs           ( rInAttrs ),
    eRP                 ( RP_MM ),

    nPageType(0),
    nDlgType(0),

@@ -616,9 +623,8 @@ void SvxTransparenceTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
|*
\************************************************************************/

SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :

    SvxTabPage          ( pParent, CUI_RES( RID_SVXPAGE_AREA ), rInAttrs ),
SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs )
:   SvxTabPage          ( pParent, CUI_RES( RID_SVXPAGE_AREA ), rInAttrs ),

    aFlProp             ( this, CUI_RES( FL_PROP ) ),
    aTypeLB             ( this, CUI_RES( LB_AREA_TYPE ) ),
@@ -659,15 +665,43 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
    aCtlXRectPreview    ( this, CUI_RES( CTL_COLOR_PREVIEW ) ),

    rOutAttrs           ( rInAttrs ),
    eRP                 ( RP_MM ),

    maColorTab(),
    maGradientList(),
    maHatchingList(),
    maBitmapList(),

    // local fixed not o be changed values for local pointers
    maFixed_ChangeType(CT_NONE),
    maFixed_sal_Bool(false),

    // init with pointers to fixed ChangeType
    pnColorTableState(&maFixed_ChangeType),
    pnBitmapListState(&maFixed_ChangeType),
    pnGradientListState(&maFixed_ChangeType),
    pnHatchingListState(&maFixed_ChangeType),

    nPageType(0),
    nDlgType(0),
    nPos(0),

    // init with pointer to fixed bool
    pbAreaTP(&maFixed_sal_Bool),

    pXPool              ( (XOutdevItemPool*) rInAttrs.GetPool() ),
    aXFillAttr          ( pXPool ),
    rXFSet              ( aXFillAttr.GetItemSet() )
    rXFSet              ( aXFillAttr.GetItemSet() ),

    ePoolUnit(SFX_MAPUNIT_100TH_MM),
    eFUnit(FUNIT_NONE),

    //UUUU
    mbOfferImportButton(false),
    mbPositionsAdapted(false),
    mbDirectGraphicSet(false),
    maDirectGraphic(),
    maBtnImport(this, CUI_RES(BTN_IMPORTOPTIONAL))
{
    FreeResource();

@@ -683,6 +717,8 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
    aTsbStepCount.Hide();
    aNumFldStepCount.Hide();

    //UUUU
    maBtnImport.Hide();
    aTsbTile.Hide();
    aTsbStretch.Hide();
    aTsbScale.Hide();
@@ -702,6 +738,7 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
    aFtYOffset.Hide();
    aMtrFldYOffset.Hide();
    aFlPosition.Hide();

    // Controls for Hatch-Background
    aCbxHatchBckgrd.Hide();
    aLbHatchBckgrdColor.Hide();
@@ -754,6 +791,10 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
    aNumFldStepCount.SetModifyHdl(
        LINK( this, SvxAreaTabPage, ModifyStepCountHdl_Impl ) );

    //UUUU
    maBtnImport.SetClickHdl(LINK(this, SvxAreaTabPage, ClickImportHdl_Impl));
    maBtnImport.SetAccessibleRelationMemberOf(&aFlProp);

    Link aLink( LINK( this, SvxAreaTabPage, ModifyTileHdl_Impl ) );
    aTsbTile.SetClickHdl( aLink );
    aTsbStretch.SetClickHdl( aLink );
@@ -1124,33 +1165,44 @@ sal_Bool SvxAreaTabPage::FillItemSet( SfxItemSet& rAttrs )
            break;
            case XFILL_BITMAP:
            {
                nPos = aLbBitmap.GetSelectEntryPos();
                if( nPos != LISTBOX_ENTRY_NOTFOUND &&
                    nPos != aLbBitmap.GetSavedValue() )
                //UUUU
                if(mbDirectGraphicSet && GRAPHIC_NONE != maDirectGraphic.GetType())
                {
                    const XBitmapEntry* pXBitmapEntry = maBitmapList->GetBitmap(nPos);
                    const String aString(aLbBitmap.GetSelectEntry());
                    const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject());
                    pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP );
                    if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) )
                    {
                        rAttrs.Put( aFillBitmapItem );
                        bModified = sal_True;
                    }
                    const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic);
                    rAttrs.Put(XFillStyleItem(XFILL_BITMAP));
                    rAttrs.Put(aXBmpItem);
                    bModified = sal_True;
                }
                // NEU
                if( (eSavedStyle != eStyle) &&
                    ( bModified ||
                      SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), sal_True ) ) )
                else
                {
                    XFillStyleItem aStyleItem( XFILL_BITMAP );
                    pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
                    if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
                    nPos = aLbBitmap.GetSelectEntryPos();
                    if( nPos != LISTBOX_ENTRY_NOTFOUND &&
                        nPos != aLbBitmap.GetSavedValue() )
                    {
                        rAttrs.Put( aStyleItem );
                        bModified = sal_True;
                        const XBitmapEntry* pXBitmapEntry = maBitmapList->GetBitmap(nPos);
                        const String aString(aLbBitmap.GetSelectEntry());
                        const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject());
                        pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP );
                        if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) )
                        {
                            rAttrs.Put( aFillBitmapItem );
                            bModified = sal_True;
                        }
                    }
               }
                    // NEU
                    if( (eSavedStyle != eStyle) &&
                        ( bModified ||
                          SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), sal_True ) ) )
                    {
                        XFillStyleItem aStyleItem( XFILL_BITMAP );
                        pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
                        if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
                        {
                            rAttrs.Put( aStyleItem );
                            bModified = sal_True;
                        }
                   }
                }
           }
           break;
       }
@@ -1778,6 +1830,8 @@ IMPL_LINK( SvxAreaTabPage, SelectDialogTypeHdl_Impl, ListBox *, EMPTYARG )

IMPL_LINK( SvxAreaTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG )
{
    //UUUU
    maBtnImport.Hide();
    aTsbTile.Hide();
    aTsbStretch.Hide();
    aTsbScale.Hide();
@@ -1827,6 +1881,8 @@ IMPL_LINK( SvxAreaTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG )

IMPL_LINK( SvxAreaTabPage, ClickColorHdl_Impl, void *, EMPTYARG )
{
    //UUUU
    maBtnImport.Hide();
    aTsbTile.Hide();
    aTsbStretch.Hide();
    aTsbScale.Hide();
@@ -1915,6 +1971,8 @@ IMPL_LINK( SvxAreaTabPage, ModifyColorHdl_Impl, void *, EMPTYARG )

IMPL_LINK( SvxAreaTabPage, ClickGradientHdl_Impl, void *, EMPTYARG )
{
    //UUUU
    maBtnImport.Hide();
    aTsbTile.Hide();
    aTsbStretch.Hide();
    aTsbScale.Hide();
@@ -2023,6 +2081,8 @@ IMPL_LINK( SvxAreaTabPage, ClickHatchingHdl_Impl, void *, EMPTYARG )
    aTsbStepCount.Hide();
    aNumFldStepCount.Hide();

    //UUUU
    maBtnImport.Hide();
    aTsbTile.Hide();
    aTsbStretch.Hide();
    aTsbScale.Hide();
@@ -2197,6 +2257,50 @@ IMPL_LINK( SvxAreaTabPage, ClickBitmapHdl_Impl, void *, EMPTYARG )
    aCbxHatchBckgrd.Hide();
    aLbHatchBckgrdColor.Hide();

    //UUUU
    if(mbOfferImportButton)
    {
        maBtnImport.Show();
        maBtnImport.Enable();
    }
    else
    {
        maBtnImport.Hide();
        maBtnImport.Disable();
    }

    if(mbOfferImportButton && !mbPositionsAdapted)
    {
        //UUUU adapt positions only once in dialogs lifetime
        mbPositionsAdapted = true;

        // adapt in y from position of FL_SIZE MAP_APPFONT(3) to position of MTR_FLD_OFFSET MAP_APPFONT(157)
        const sal_uInt32 nOrigStartY(aFlSize.GetPosPixel().Y());
        const sal_uInt32 nOrigHeight(aMtrFldOffset.GetPosPixel().Y() - nOrigStartY);
        const sal_uInt32 nBtnImportHeight(maBtnImport.GetSizePixel().Height());
        const sal_uInt32 nNewHeight(nOrigHeight - nBtnImportHeight);

        aFlSize.SetPosPixel(Point(aFlSize.GetPosPixel().X(), nOrigStartY + (((aFlSize.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aTsbOriginal.SetPosPixel(Point(aTsbOriginal.GetPosPixel().X(), nOrigStartY + (((aTsbOriginal.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aTsbScale.SetPosPixel(Point(aTsbScale.GetPosPixel().X(), nOrigStartY + (((aTsbScale.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aFtXSize.SetPosPixel(Point(aFtXSize.GetPosPixel().X(), nOrigStartY + (((aFtXSize.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aMtrFldXSize.SetPosPixel(Point(aMtrFldXSize.GetPosPixel().X(), nOrigStartY + (((aMtrFldXSize.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aFtYSize.SetPosPixel(Point(aFtYSize.GetPosPixel().X(), nOrigStartY + (((aFtYSize.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aMtrFldYSize.SetPosPixel(Point(aMtrFldYSize.GetPosPixel().X(), nOrigStartY + (((aMtrFldYSize.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aFlPosition.SetPosPixel(Point(aFlPosition.GetPosPixel().X(), nOrigStartY + (((aFlPosition.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aCtlPosition.SetPosPixel(Point(aCtlPosition.GetPosPixel().X(), nOrigStartY + (((aCtlPosition.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aFtXOffset.SetPosPixel(Point(aFtXOffset.GetPosPixel().X(), nOrigStartY + (((aFtXOffset.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aMtrFldXOffset.SetPosPixel(Point(aMtrFldXOffset.GetPosPixel().X(), nOrigStartY + (((aMtrFldXOffset.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aFtYOffset.SetPosPixel(Point(aFtYOffset.GetPosPixel().X(), nOrigStartY + (((aFtYOffset.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aMtrFldYOffset.SetPosPixel(Point(aMtrFldYOffset.GetPosPixel().X(), nOrigStartY + (((aMtrFldYOffset.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aTsbTile.SetPosPixel(Point(aTsbTile.GetPosPixel().X(), nOrigStartY + (((aTsbTile.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aTsbStretch.SetPosPixel(Point(aTsbStretch.GetPosPixel().X(), nOrigStartY + (((aTsbStretch.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aFlOffset.SetPosPixel(Point(aFlOffset.GetPosPixel().X(), nOrigStartY + (((aFlOffset.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aRbtRow.SetPosPixel(Point(aRbtRow.GetPosPixel().X(), nOrigStartY + (((aRbtRow.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aRbtColumn.SetPosPixel(Point(aRbtColumn.GetPosPixel().X(), nOrigStartY + (((aRbtColumn.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
        aMtrFldOffset.SetPosPixel(Point(aMtrFldOffset.GetPosPixel().X(), nOrigStartY + (((aMtrFldOffset.GetPosPixel().Y() - nOrigStartY) * nNewHeight) / nOrigHeight)));
    }

    aTsbTile.Show();
    aTsbStretch.Show();
    aTsbScale.Show();
@@ -2244,6 +2348,11 @@ IMPL_LINK( SvxAreaTabPage, ClickBitmapHdl_Impl, void *, EMPTYARG )

IMPL_LINK( SvxAreaTabPage, ModifyBitmapHdl_Impl, void *, EMPTYARG )
{
    //UUUU
    mbDirectGraphicSet = false;
    maDirectGraphic.Clear();
    maDirectName = String();

    const SfxPoolItem* pPoolItem = NULL;
    sal_uInt16 _nPos = aLbBitmap.GetSelectEntryPos();
    if( _nPos != LISTBOX_ENTRY_NOTFOUND )
@@ -2320,25 +2429,77 @@ IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p )

//------------------------------------------------------------------------

IMPL_LINK( SvxAreaTabPage, ClickImportHdl_Impl, void *, EMPTYARG )
{
    ResMgr& rMgr = CUI_MGR();
    SvxOpenGraphicDialog aDlg(UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("Import")));
    aDlg.EnableLink(sal_False);

    if(!aDlg.Execute())
    {
        EnterWait();
        const int nError(aDlg.GetGraphic(maDirectGraphic));
        LeaveWait();

        if(!nError && GRAPHIC_NONE != maDirectGraphic.GetType())
        {
            // extract name from filename
            const INetURLObject aURL(aDlg.GetPath());
            maDirectName = String(aURL.GetName()).GetToken( 0, '.' );

            // use loaded graphic
            const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic);
            rXFSet.Put(XFillStyleItem(XFILL_BITMAP));
            rXFSet.Put(aXBmpItem);

            // trigger state flag for directly loaded graphic
            mbDirectGraphicSet = true;

            // preview
            aCtlBitmapPreview.SetAttributes(aXFillAttr.GetItemSet());
            aCtlBitmapPreview.Invalidate();
        }
        else
        {
            // graphic could not be loaded
            ErrorBox(DLGWIN, WinBits(WB_OK), String(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr))).Execute();
        }
    }

    return 0L;
}

//------------------------------------------------------------------------

IMPL_LINK( SvxAreaTabPage, ModifyTileHdl_Impl, void *, EMPTYARG )
{
    TriState eState = aTsbTile.GetState();
    if( eState == STATE_CHECK )
    {
        // tiled
        // disable stretched for tiled graphic
        aTsbStretch.Disable();

        // allow tile offset
        aRbtRow.Enable();
        aRbtColumn.Enable();
        aMtrFldOffset.Enable();
        aFlOffset.Enable();

        // allow positioning
        aCtlPosition.Enable();
        aCtlPosition.Invalidate();

        // allow offsets
        aFtXOffset.Enable();
        aMtrFldXOffset.Enable();
        aFtYOffset.Enable();
        aMtrFldYOffset.Enable();

        // allow 'Position" title
        aFlPosition.Enable();

        // allow size definitions
        aTsbScale.Enable();
        aTsbOriginal.Enable();
        aFtXSize.Enable();
@@ -2349,22 +2510,33 @@ IMPL_LINK( SvxAreaTabPage, ModifyTileHdl_Impl, void *, EMPTYARG )
    }
    else if( eState == STATE_NOCHECK )
    {
        // non-tiled
        // enable stretch selection
        aTsbStretch.Enable();

        // no need for tile offset
        aRbtRow.Disable();
        aRbtColumn.Disable();
        aMtrFldOffset.Disable();
        aFlOffset.Disable();

        aCtlPosition.Disable();
        aCtlPosition.Invalidate();
        // no need for offsets, only position is supported in non-tiled
        aFtXOffset.Disable();
        aMtrFldXOffset.Disable();
        aFtYOffset.Disable();
        aMtrFldYOffset.Disable();
        aFlPosition.Disable();

        if( aTsbStretch.GetState() != STATE_NOCHECK )
        {
            // non-tiled, stretched
            // no need for positioning
            aCtlPosition.Disable();
            aCtlPosition.Invalidate();

            // no need for 'Position" title, all deactivated
            aFlPosition.Disable();

            // no need for size definitions
            aTsbScale.Disable();
            aTsbOriginal.Disable();
            aFtXSize.Disable();
@@ -2375,6 +2547,15 @@ IMPL_LINK( SvxAreaTabPage, ModifyTileHdl_Impl, void *, EMPTYARG )
        }
        else
        {
            // non-tiled, non-stretched
            // allow positioning
            aCtlPosition.Enable();
            aCtlPosition.Invalidate();

            // allow 'Position" title, positioning is active
            aFlPosition.Enable();

            // allow size definitions
            aTsbScale.Enable();
            aTsbOriginal.Enable();
            aFtXSize.Enable();
@@ -2386,6 +2567,7 @@ IMPL_LINK( SvxAreaTabPage, ModifyTileHdl_Impl, void *, EMPTYARG )
    }
    else
    {
        // disable all when tiling is undefined
        aTsbStretch.Disable();
        aRbtRow.Disable();
        aRbtColumn.Disable();
@@ -2573,6 +2755,8 @@ void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
    SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
    SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
    SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False);
    //UUUU
    SFX_ITEMSET_ARG (&aSet, pOfferImportItem, SfxBoolItem, SID_OFFER_IMPORT, sal_False);

    if (pColorTabItem)
        SetColorTable(pColorTabItem->GetColorTable());
@@ -2588,6 +2772,19 @@ void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) //add CHINA001
        SetDlgType(pDlgTypeItem->GetValue());
    if (pPosItem)
        SetPos(pPosItem->GetValue());

    //UUUU
    if(pOfferImportItem)
    {
        const bool bNew(pOfferImportItem->GetValue());

        if(mbOfferImportButton != bNew)
        {
            mbOfferImportButton = bNew;
        }
    }

    Construct();
}

//eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
index b937dee..3b4e818 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
@@ -58,8 +58,12 @@ namespace drawinglayer
        class DRAWINGLAYER_DLLPUBLIC FillGradientPrimitive2D : public BufferedDecompositionPrimitive2D
        {
        private:
            /// the geometric definition
            basegfx::B2DRange                       maObjectRange;
            /// the geometrically visible area
            basegfx::B2DRange                       maOutputRange;

            /// the area the gradient definition is based on
            /// in the simplest case identical to OutputRange
            basegfx::B2DRange                       maDefinitionRange;

            /// the gradient definition
            attribute::FillGradientAttribute        maFillGradient;
@@ -67,14 +71,14 @@ namespace drawinglayer
            /// local helpers
            void generateMatricesAndColors(
                std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor) const;
                basegfx::BColor& rOuterColor) const;
            Primitive2DSequence createOverlappingFill(
                const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
                const basegfx::BColor& rOutmostColor,
                const basegfx::BColor& rOuterColor,
                const basegfx::B2DPolygon& rUnitPolygon) const;
            Primitive2DSequence createNonOverlappingFill(
                const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
                const basegfx::BColor& rOutmostColor,
                const basegfx::BColor& rOuterColor,
                const basegfx::B2DPolygon& rUnitPolygon) const;

        protected:
@@ -85,13 +89,18 @@ namespace drawinglayer
            virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;

        public:
            /// constructor
            /// constructors. The one without definition range will use output range as definition range
            FillGradientPrimitive2D(
                const basegfx::B2DRange& rObjectRange,
                const basegfx::B2DRange& rOutputRange,
                const attribute::FillGradientAttribute& rFillGradient);
            FillGradientPrimitive2D(
                const basegfx::B2DRange& rOutputRange,
                const basegfx::B2DRange& rDefinitionRange,
                const attribute::FillGradientAttribute& rFillGradient);

            /// data read access
            const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
            const basegfx::B2DRange& getOutputRange() const { return maOutputRange; }
            const basegfx::B2DRange& getDefinitionRange() const { return maDefinitionRange; }
            const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }

            /// compare operator
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 9fbc68b..d360f03 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -53,8 +53,12 @@ namespace drawinglayer
        class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D : public DiscreteMetricDependentPrimitive2D
        {
        private:
            /// the geometric definition
            basegfx::B2DRange                       maObjectRange;
            /// the geometrically visible area
            basegfx::B2DRange                       maOutputRange;

            /// the area the gradient definition is based on
            /// in the simplest case identical to OutputRange
            basegfx::B2DRange                       maDefinitionRange;

            /// the hatch definition
            attribute::FillHatchAttribute           maFillHatch;
@@ -67,14 +71,20 @@ namespace drawinglayer
            virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;

        public:
            /// constructor
            /// constructors. The one without definition range will use output range as definition range
            FillHatchPrimitive2D(
                const basegfx::B2DRange& rObjectRange,
                const basegfx::B2DRange& rOutputRange,
                const basegfx::BColor& rBColor,
                const attribute::FillHatchAttribute& rFillHatch);
            FillHatchPrimitive2D(
                const basegfx::B2DRange& rOutputRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rBColor,
                const attribute::FillHatchAttribute& rFillHatch);

            /// data read access
            const basegfx::B2DRange& getObjectRange() const { return maObjectRange; }
            const basegfx::B2DRange& getOutputRange() const { return maOutputRange; }
            const basegfx::B2DRange& getDefinitionRange() const { return maDefinitionRange; }
            const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }
            const basegfx::BColor& getBColor() const { return maBColor; }

diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index b07cbab..d604f23 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -47,7 +47,7 @@ namespace drawinglayer

            This primitive defines a multi-PolygonHairlinePrimitive2D and is
            just for convenience. The definition is not different from the single
            defined PolygonHairlinePrimitive2Ds.
                defined PolygonHairlinePrimitive2Ds.
         */
        class DRAWINGLAYER_DLLPUBLIC PolyPolygonHairlinePrimitive2D : public BufferedDecompositionPrimitive2D
        {
@@ -315,6 +315,9 @@ namespace drawinglayer
            /// the PolyPolygon geometry
            basegfx::B2DPolyPolygon                     maPolyPolygon;

            /// the definition range
            basegfx::B2DRange                           maDefinitionRange;

            /// the gradient definition
            attribute::FillGradientAttribute            maFillGradient;

@@ -323,13 +326,18 @@ namespace drawinglayer
            virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;

        public:
            /// constructor
            /// constructors. The one without definition range will use output range as definition range
            PolyPolygonGradientPrimitive2D(
                const basegfx::B2DPolyPolygon& rPolyPolygon,
                const attribute::FillGradientAttribute& rFillGradient);
            PolyPolygonGradientPrimitive2D(
                const basegfx::B2DPolyPolygon& rPolyPolygon,
                const basegfx::B2DRange& rDefinitionRange,
                const attribute::FillGradientAttribute& rFillGradient);

            /// data read access
            const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
            const basegfx::B2DRange& getDefinitionRange() const { return maDefinitionRange; }
            const attribute::FillGradientAttribute& getFillGradient() const { return maFillGradient; }

            /// compare operator
@@ -360,6 +368,9 @@ namespace drawinglayer
            /// the PolyPolygon geometry
            basegfx::B2DPolyPolygon                     maPolyPolygon;

            /// the definition range
            basegfx::B2DRange                           maDefinitionRange;

            /// the hatch background color (if used)
            basegfx::BColor                             maBackgroundColor;

@@ -371,14 +382,20 @@ namespace drawinglayer
            virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;

        public:
            /// constructor
            /// constructors. The one without definition range will use output range as definition range
            PolyPolygonHatchPrimitive2D(
                const basegfx::B2DPolyPolygon& rPolyPolygon,
                const basegfx::BColor& rBackgroundColor,
                const attribute::FillHatchAttribute& rFillHatch);
            PolyPolygonHatchPrimitive2D(
                const basegfx::B2DPolyPolygon& rPolyPolygon,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rBackgroundColor,
                const attribute::FillHatchAttribute& rFillHatch);

            /// data read access
            const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
            const basegfx::B2DRange& getDefinitionRange() const { return maDefinitionRange; }
            const basegfx::BColor& getBackgroundColor() const { return maBackgroundColor; }
            const attribute::FillHatchAttribute& getFillHatch() const { return maFillHatch; }

@@ -410,6 +427,9 @@ namespace drawinglayer
            /// the PolyPolygon geometry
            basegfx::B2DPolyPolygon                     maPolyPolygon;

            /// the definition range
            basegfx::B2DRange                           maDefinitionRange;

            /// the bitmap fill definition (may include tiling)
            attribute::FillGraphicAttribute             maFillGraphic;

@@ -418,13 +438,18 @@ namespace drawinglayer
            virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;

        public:
            /// constructor
            /// constructors. The one without definition range will use output range as definition range
            PolyPolygonGraphicPrimitive2D(
                const basegfx::B2DPolyPolygon& rPolyPolygon,
                const attribute::FillGraphicAttribute& rFillGraphic);
            PolyPolygonGraphicPrimitive2D(
                const basegfx::B2DPolyPolygon& rPolyPolygon,
                const basegfx::B2DRange& rDefinitionRange,
                const attribute::FillGraphicAttribute& rFillGraphic);

            /// data read access
            const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
            const basegfx::B2DRange& getDefinitionRange() const { return maDefinitionRange; }
            const attribute::FillGraphicAttribute& getFillGraphic() const { return maFillGraphic; }

            /// compare operator
diff --git a/drawinglayer/inc/drawinglayer/texture/texture.hxx b/drawinglayer/inc/drawinglayer/texture/texture.hxx
index aa62d1e..ce1e97d 100644
--- a/drawinglayer/inc/drawinglayer/texture/texture.hxx
+++ b/drawinglayer/inc/drawinglayer/texture/texture.hxx
@@ -79,14 +79,14 @@ namespace drawinglayer
        {
        protected:
            basegfx::ODFGradientInfo            maGradientInfo;
            basegfx::B2DRange                   maTargetRange;
            basegfx::B2DRange                   maDefinitionRange;
            basegfx::BColor                     maStart;
            basegfx::BColor                     maEnd;
            double                              mfBorder;

        public:
            GeoTexSvxGradient(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -99,7 +99,7 @@ namespace drawinglayer
            // virtual base methods
            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor) = 0;
                basegfx::BColor& rOuterColor) = 0;

            // data access
            const basegfx::BColor& getStart() const { return maStart; }
@@ -116,9 +116,15 @@ namespace drawinglayer
    {
        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientLinear : public GeoTexSvxGradient
        {
        protected:
            double                  mfUnitMinX;
            double                  mfUnitWidth;
            double                  mfUnitMaxY;

        public:
            GeoTexSvxGradientLinear(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::B2DRange& rOutputRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -128,7 +134,7 @@ namespace drawinglayer

            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor);
                basegfx::BColor& rOuterColor);
            virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
        };
    } // end of namespace texture
@@ -142,9 +148,14 @@ namespace drawinglayer
    {
        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientAxial : public GeoTexSvxGradient
        {
        protected:
            double                  mfUnitMinX;
            double                  mfUnitWidth;

        public:
            GeoTexSvxGradientAxial(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::B2DRange& rOutputRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -154,7 +165,7 @@ namespace drawinglayer

            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor);
                basegfx::BColor& rOuterColor);
            virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
        };
    } // end of namespace texture
@@ -170,7 +181,7 @@ namespace drawinglayer
        {
        public:
            GeoTexSvxGradientRadial(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -181,7 +192,7 @@ namespace drawinglayer

            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor);
                basegfx::BColor& rOuterColor);
            virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
        };
    } // end of namespace texture
@@ -197,7 +208,7 @@ namespace drawinglayer
        {
        public:
            GeoTexSvxGradientElliptical(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -209,7 +220,7 @@ namespace drawinglayer

            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor);
                basegfx::BColor& rOuterColor);
            virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
        };
    } // end of namespace texture
@@ -225,7 +236,7 @@ namespace drawinglayer
        {
        public:
            GeoTexSvxGradientSquare(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -237,7 +248,7 @@ namespace drawinglayer

            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor);
                basegfx::BColor& rOuterColor);
            virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
        };
    } // end of namespace texture
@@ -253,7 +264,7 @@ namespace drawinglayer
        {
        public:
            GeoTexSvxGradientRect(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::BColor& rStart,
                const basegfx::BColor& rEnd,
                sal_uInt32 nSteps,
@@ -265,7 +276,7 @@ namespace drawinglayer

            virtual void appendTransformationsAndColors(
                std::vector< B2DHomMatrixAndBColor >& rEntries,
                basegfx::BColor& rOutmostColor);
                basegfx::BColor& rOuterColor);
            virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const;
        };
    } // end of namespace texture
@@ -280,15 +291,20 @@ namespace drawinglayer
        class DRAWINGLAYER_DLLPUBLIC GeoTexSvxHatch : public GeoTexSvx
        {
        protected:
            basegfx::B2DRange                   maOutputRange;
            basegfx::B2DHomMatrix               maTextureTransform;
            basegfx::B2DHomMatrix               maBackTextureTransform;
            double                              mfDistance;
            double                              mfAngle;
            sal_uInt32                          mnSteps;

            /// bitfield
            bool                                mbDefinitionRangeEqualsOutputRange : 1;

        public:
            GeoTexSvxHatch(
                const basegfx::B2DRange& rTargetRange,
                const basegfx::B2DRange& rDefinitionRange,
                const basegfx::B2DRange& rOutputRange,
                double fDistance,
                double fAngle);
            virtual ~GeoTexSvxHatch();
@@ -296,7 +312,7 @@ namespace drawinglayer
            // compare operator
            virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;

            virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
            void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
            double getDistanceToHatch(const basegfx::B2DPoint& rUV) const;
            const basegfx::B2DHomMatrix& getBackTextureTransform() const;
        };
@@ -335,7 +351,7 @@ namespace drawinglayer
            // compare operator
            virtual bool operator==(const GeoTexSvx& rGeoTexSvx) const;

            virtual void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
            void appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices);
        };
    } // end of namespace texture
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
index aeba381..174b948 100755
--- a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
@@ -263,11 +263,11 @@ namespace drawinglayer
            // get logical size of bitmap (before expanding eventually)
            Graphic aGraphic(getFillGraphic());

            // init values with defaults
            // init values with defaults for stretched
            basegfx::B2DPoint aBitmapSize(1.0, 1.0);
            basegfx::B2DVector aBitmapTopLeft(0.0, 0.0);

            // are changes needed?
            //UUUU are changes needed? When streched we are already done, all other values will have no influence
            if(getTiling() || !getStretch())
            {
                // init values with range sizes
@@ -312,34 +312,33 @@ namespace drawinglayer
                    aBitmapSize.setY(getGraphicLogicSize().getY());
                }

                // get values, force to centered if necessary
                const basegfx::B2DVector aRectPoint(getTiling() ? getRectPoint() : basegfx::B2DVector(0.0, 0.0));

                // position changes X
                if(0.0 == aRectPoint.getX())
                if(0.0 == getRectPoint().getX())
                {
                    aBitmapTopLeft.setX((fRangeWidth - aBitmapSize.getX()) * 0.5);
                }
                else if(1.0 == aRectPoint.getX())
                else if(1.0 == getRectPoint().getX())
                {
                    aBitmapTopLeft.setX(fRangeWidth - aBitmapSize.getX());
                }

                // offset positions are only meaningful when tiled
                if(getTiling() && 0.0 != getOffsetPosition().getX())
                {
                    aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (getOffsetPosition().getX() * 0.01)));
                }

                // position changes Y
                if(0.0 == aRectPoint.getY())
                if(0.0 == getRectPoint().getY())
                {
                    aBitmapTopLeft.setY((fRangeHeight - aBitmapSize.getY()) * 0.5);
                }
                else if(1.0 == aRectPoint.getY())
                else if(1.0 == getRectPoint().getY())
                {
                    aBitmapTopLeft.setY(fRangeHeight - aBitmapSize.getY());
                }

                // offset positions are only meaningful when tiled
                if(getTiling() && 0.0 != getOffsetPosition().getY())
                {
                    aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (getOffsetPosition().getY() * 0.01)));
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index d5132de..9d7251a 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -44,7 +44,7 @@ namespace drawinglayer
    {
        void FillGradientPrimitive2D::generateMatricesAndColors(
            std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor) const
            basegfx::BColor& rOuterColor) const
        {
            rEntries.clear();

@@ -73,38 +73,83 @@ namespace drawinglayer
            {
                case attribute::GRADIENTSTYLE_LINEAR:
                {
                    texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
                    texture::GeoTexSvxGradientLinear aGradient(
                        getDefinitionRange(),
                        getOutputRange(),
                        aStart,
                        aEnd,
                        nSteps,
                        getFillGradient().getBorder(),
                        getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                    break;
                }
                case attribute::GRADIENTSTYLE_AXIAL:
                {
                    texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
                    texture::GeoTexSvxGradientAxial aGradient(
                        getDefinitionRange(),
                        getOutputRange(),
                        aStart,
                        aEnd,
                        nSteps,
                        getFillGradient().getBorder(),
                        getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                    break;
                }
                case attribute::GRADIENTSTYLE_RADIAL:
                {
                    texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY());
                    aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
                    texture::GeoTexSvxGradientRadial aGradient(
                        getDefinitionRange(),
                        aStart,
                        aEnd,
                        nSteps,
                        getFillGradient().getBorder(),
                        getFillGradient().getOffsetX(),
                        getFillGradient().getOffsetY());
                    aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                    break;
                }
                case attribute::GRADIENTSTYLE_ELLIPTICAL:
                {
                    texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
                    texture::GeoTexSvxGradientElliptical aGradient(
                        getDefinitionRange(),
                        aStart,
                        aEnd,
                        nSteps,
                        getFillGradient().getBorder(),
                        getFillGradient().getOffsetX(),
                        getFillGradient().getOffsetY(),
                        getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                    break;
                }
                case attribute::GRADIENTSTYLE_SQUARE:
                {
                    texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
                    texture::GeoTexSvxGradientSquare aGradient(
                        getDefinitionRange(),
                        aStart,
                        aEnd,
                        nSteps,
                        getFillGradient().getBorder(),
                        getFillGradient().getOffsetX(),
                        getFillGradient().getOffsetY(),
                        getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                    break;
                }
                case attribute::GRADIENTSTYLE_RECT:
                {
                    texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
                    texture::GeoTexSvxGradientRect aGradient(
                        getDefinitionRange(),
                        aStart,
                        aEnd,
                        nSteps,
                        getFillGradient().getBorder(),
                        getFillGradient().getOffsetX(),
                        getFillGradient().getOffsetY(),
                        getFillGradient().getAngle());
                    aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                    break;
                }
            }
@@ -112,7 +157,7 @@ namespace drawinglayer

        Primitive2DSequence FillGradientPrimitive2D::createOverlappingFill(
            const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
            const basegfx::BColor& rOutmostColor,
            const basegfx::BColor& rOuterColor,
            const basegfx::B2DPolygon& rUnitPolygon) const
        {
            // prepare return value
@@ -121,8 +166,9 @@ namespace drawinglayer
            // create solid fill with outmost color
            aRetval[0] = Primitive2DReference(
                new PolyPolygonColorPrimitive2D(
                    basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())),
                    rOutmostColor));
                    basegfx::B2DPolyPolygon(
                        basegfx::tools::createPolygonFromRect(getOutputRange())),
                    rOuterColor));

            // create solid fill steps
            for(sal_uInt32 a(0); a < rEntries.size(); a++)
@@ -144,14 +190,14 @@ namespace drawinglayer

        Primitive2DSequence FillGradientPrimitive2D::createNonOverlappingFill(
            const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
            const basegfx::BColor& rOutmostColor,
            const basegfx::BColor& rOuterColor,
            const basegfx::B2DPolygon& rUnitPolygon) const
        {
            // prepare return value
            Primitive2DSequence aRetval(rEntries.size() + 1);

            // get outmost range from object
            basegfx::B2DRange aOutmostRange(getObjectRange());
            // get outmost viusible range from object
            basegfx::B2DRange aOutmostRange(getOutputRange());
            basegfx::B2DPolyPolygon aCombinedPolyPoly;

            if(rEntries.size())
@@ -169,7 +215,7 @@ namespace drawinglayer
            aRetval[0] = Primitive2DReference(
                new PolyPolygonColorPrimitive2D(
                    aCombinedPolyPoly,
                    rOutmostColor));
                    rOuterColor));

            if(rEntries.size())
            {
@@ -227,17 +273,17 @@ namespace drawinglayer
            // get the transform matrices and colors (where colors
            // will have one more entry that matrices)
            std::vector< drawinglayer::texture::B2DHomMatrixAndBColor > aEntries;
            basegfx::BColor aOutmostColor;
            basegfx::BColor aOuterColor;

            generateMatricesAndColors(aEntries, aOutmostColor);
            generateMatricesAndColors(aEntries, aOuterColor);

            if(bOverlapping)
            {
                return createOverlappingFill(aEntries, aOutmostColor, aUnitPolygon);
                return createOverlappingFill(aEntries, aOuterColor, aUnitPolygon);
            }
            else
            {
                return createNonOverlappingFill(aEntries, aOutmostColor, aUnitPolygon);
                return createNonOverlappingFill(aEntries, aOuterColor, aUnitPolygon);
            }
        }

@@ -263,10 +309,22 @@ namespace drawinglayer
        }

        FillGradientPrimitive2D::FillGradientPrimitive2D(
            const basegfx::B2DRange& rObjectRange,
            const basegfx::B2DRange& rOutputRange,
            const attribute::FillGradientAttribute& rFillGradient)
        :   BufferedDecompositionPrimitive2D(),
            maObjectRange(rObjectRange),
            maOutputRange(rOutputRange),
            maDefinitionRange(rOutputRange),
            maFillGradient(rFillGradient)
        {
        }

        FillGradientPrimitive2D::FillGradientPrimitive2D(
            const basegfx::B2DRange& rOutputRange,
            const basegfx::B2DRange& rDefinitionRange,
            const attribute::FillGradientAttribute& rFillGradient)
        :   BufferedDecompositionPrimitive2D(),
            maOutputRange(rOutputRange),
            maDefinitionRange(rDefinitionRange),
            maFillGradient(rFillGradient)
        {
        }
@@ -277,7 +335,8 @@ namespace drawinglayer
            {
                const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;

                return (getObjectRange() == rCompare.getObjectRange()
                return (getOutputRange() == rCompare.getOutputRange()
                    && getDefinitionRange() == rCompare.getDefinitionRange()
                    && getFillGradient() == rCompare.getFillGradient());
            }

@@ -286,8 +345,8 @@ namespace drawinglayer

        basegfx::B2DRange FillGradientPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
        {
            // return ObjectRange
            return getObjectRange();
            // return the geometrically visible area
            return getOutputRange();
        }

        // provide unique ID
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index beb5707..41fc4ff 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -74,7 +74,12 @@ namespace drawinglayer
                    case attribute::HATCHSTYLE_TRIPLE:
                    {
                        // rotated 45 degrees
                        texture::GeoTexSvxHatch aHatch(getObjectRange(), fDistance, fAngle - F_PI4);
                        texture::GeoTexSvxHatch aHatch(
                            getDefinitionRange(),
                            getOutputRange(),
                            fDistance,
                            fAngle - F_PI4);

                        aHatch.appendTransformations(aMatrices);

                        // fall-through by purpose
@@ -82,7 +87,12 @@ namespace drawinglayer
                    case attribute::HATCHSTYLE_DOUBLE:
                    {
                        // rotated 90 degrees
                        texture::GeoTexSvxHatch aHatch(getObjectRange(), fDistance, fAngle - F_PI2);
                        texture::GeoTexSvxHatch aHatch(
                            getDefinitionRange(),
                            getOutputRange(),
                            fDistance,
                            fAngle - F_PI2);

                        aHatch.appendTransformations(aMatrices);

                        // fall-through by purpose
@@ -90,7 +100,12 @@ namespace drawinglayer
                    case attribute::HATCHSTYLE_SINGLE:
                    {
                        // angle as given
                        texture::GeoTexSvxHatch aHatch(getObjectRange(), fDistance, fAngle);
                        texture::GeoTexSvxHatch aHatch(
                            getDefinitionRange(),
                            getOutputRange(),
                            fDistance,
                            fAngle);

                        aHatch.appendTransformations(aMatrices);
                    }
                }
@@ -106,7 +121,7 @@ namespace drawinglayer
                    const Primitive2DReference xRef(
                        new PolyPolygonColorPrimitive2D(
                            basegfx::B2DPolyPolygon(
                                basegfx::tools::createPolygonFromRect(getObjectRange())), getBColor()));
                                basegfx::tools::createPolygonFromRect(getOutputRange())), getBColor()));
                    aRetval[0] = xRef;
                }

@@ -132,11 +147,25 @@ namespace drawinglayer
        }

        FillHatchPrimitive2D::FillHatchPrimitive2D(
            const basegfx::B2DRange& rObjectRange,
            const basegfx::B2DRange& rOutputRange,
            const basegfx::BColor& rBColor,
            const attribute::FillHatchAttribute& rFillHatch)
        :   DiscreteMetricDependentPrimitive2D(),
            maObjectRange(rObjectRange),
            maOutputRange(rOutputRange),
            maDefinitionRange(rOutputRange),
            maFillHatch(rFillHatch),
            maBColor(rBColor)
        {
        }

        FillHatchPrimitive2D::FillHatchPrimitive2D(
            const basegfx::B2DRange& rOutputRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rBColor,
            const attribute::FillHatchAttribute& rFillHatch)
        :   DiscreteMetricDependentPrimitive2D(),
            maOutputRange(rOutputRange),
            maDefinitionRange(rDefinitionRange),
            maFillHatch(rFillHatch),
            maBColor(rBColor)
        {
@@ -148,7 +177,8 @@ namespace drawinglayer
            {
                const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;

                return (getObjectRange() == rCompare.getObjectRange()
                return (getOutputRange() == rCompare.getOutputRange()
                    && getDefinitionRange() == rCompare.getDefinitionRange()
                    && getFillHatch() == rCompare.getFillHatch()
                    && getBColor() == rCompare.getBColor());
            }
@@ -158,8 +188,8 @@ namespace drawinglayer

        basegfx::B2DRange FillHatchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
        {
            // return ObjectRange
            return getObjectRange();
            // return the geometrically visible area
            return getOutputRange();
        }

        Primitive2DSequence FillHatchPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
index 142002e..e648122 100644
--- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -208,7 +208,7 @@ namespace drawinglayer

        PolyPolygonStrokePrimitive2D::PolyPolygonStrokePrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
              const attribute::LineAttribute& rLineAttribute,
            const attribute::LineAttribute& rLineAttribute,
            const attribute::StrokeAttribute& rStrokeAttribute)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
@@ -219,7 +219,7 @@ namespace drawinglayer

        PolyPolygonStrokePrimitive2D::PolyPolygonStrokePrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
              const attribute::LineAttribute& rLineAttribute)
            const attribute::LineAttribute& rLineAttribute)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maLineAttribute(rLineAttribute),
@@ -304,7 +304,7 @@ namespace drawinglayer

        PolyPolygonStrokeArrowPrimitive2D::PolyPolygonStrokeArrowPrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
               const attribute::LineAttribute& rLineAttribute,
            const attribute::LineAttribute& rLineAttribute,
            const attribute::StrokeAttribute& rStrokeAttribute,
            const attribute::LineStartEndAttribute& rStart,
            const attribute::LineStartEndAttribute& rEnd)
@@ -316,7 +316,7 @@ namespace drawinglayer

        PolyPolygonStrokeArrowPrimitive2D::PolyPolygonStrokeArrowPrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
               const attribute::LineAttribute& rLineAttribute,
            const attribute::LineAttribute& rLineAttribute,
            const attribute::LineStartEndAttribute& rStart,
            const attribute::LineStartEndAttribute& rEnd)
        :   PolyPolygonStrokePrimitive2D(rPolyPolygon, rLineAttribute),
@@ -412,7 +412,10 @@ namespace drawinglayer
            {
                // create SubSequence with FillGradientPrimitive2D
                const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
                FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, getFillGradient());
                FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(
                    aPolyPolygonRange,
                    getDefinitionRange(),
                    getFillGradient());
                const Primitive2DReference xSubRef(pNewGradient);
                const Primitive2DSequence aSubSequence(&xSubRef, 1L);

@@ -433,6 +436,18 @@ namespace drawinglayer
            const attribute::FillGradientAttribute& rFillGradient)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maDefinitionRange(rPolyPolygon.getB2DRange()),
            maFillGradient(rFillGradient)
        {
        }

        PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const basegfx::B2DRange& rDefinitionRange,
            const attribute::FillGradientAttribute& rFillGradient)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maDefinitionRange(rDefinitionRange),
            maFillGradient(rFillGradient)
        {
        }
@@ -443,7 +458,9 @@ namespace drawinglayer
            {
                const PolyPolygonGradientPrimitive2D& rCompare = (PolyPolygonGradientPrimitive2D&)rPrimitive;

                return (getFillGradient() == rCompare.getFillGradient());
                return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
                    && getDefinitionRange() == rCompare.getDefinitionRange()
                    && getFillGradient() == rCompare.getFillGradient());
            }

            return false;
@@ -467,7 +484,11 @@ namespace drawinglayer
            {
                // create SubSequence with FillHatchPrimitive2D
                const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
                FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch());
                FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(
                    aPolyPolygonRange,
                    getDefinitionRange(),
                    getBackgroundColor(),
                    getFillHatch());
                const Primitive2DReference xSubRef(pNewHatch);
                const Primitive2DSequence aSubSequence(&xSubRef, 1L);

@@ -489,6 +510,20 @@ namespace drawinglayer
            const attribute::FillHatchAttribute& rFillHatch)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maDefinitionRange(rPolyPolygon.getB2DRange()),
            maBackgroundColor(rBackgroundColor),
            maFillHatch(rFillHatch)
        {
        }

        PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rBackgroundColor,
            const attribute::FillHatchAttribute& rFillHatch)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maDefinitionRange(rDefinitionRange),
            maBackgroundColor(rBackgroundColor),
            maFillHatch(rFillHatch)
        {
@@ -500,7 +535,9 @@ namespace drawinglayer
            {
                const PolyPolygonHatchPrimitive2D& rCompare = (PolyPolygonHatchPrimitive2D&)rPrimitive;

                return (getBackgroundColor() == rCompare.getBackgroundColor()
                return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
                    && getDefinitionRange() == rCompare.getDefinitionRange()
                    && getBackgroundColor() == rCompare.getBackgroundColor()
                    && getFillHatch() == rCompare.getFillHatch());
            }

@@ -535,15 +572,56 @@ namespace drawinglayer
                    if(aPrefSize.Width() && aPrefSize.Height())
                    {
                        // create SubSequence with FillGraphicPrimitive2D based on polygon range
                        const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
                        const basegfx::B2DRange aOutRange(getB2DPolyPolygon().getB2DRange());
                        const basegfx::B2DHomMatrix aNewObjectTransform(
                            basegfx::tools::createScaleTranslateB2DHomMatrix(
                                aPolyPolygonRange.getRange(),
                                aPolyPolygonRange.getMinimum()));
                        const Primitive2DReference xSubRef(
                            new FillGraphicPrimitive2D(
                                aOutRange.getRange(),
                                aOutRange.getMinimum()));
                        Primitive2DReference xSubRef;

                        if(aOutRange != getDefinitionRange())
                        {
                            // we want to paint (tiled) content which is defined relative to DefinitionRange
                            // with the same tiling and offset(s) in the traget range of the geometry (the
                            // polygon). The range given in the local FillGraphicAttribute defines the position
                            // of the graphic in unit coordinates relative to the DefinitionRange. Transform
                            // this using DefinitionRange to get to the global definition and then with the
                            // inverse transformation from the target range to go to unit coordinates relative
                            // to that traget coordinate system.
                            basegfx::B2DRange aAdaptedRange(getFillGraphic().getGraphicRange());

                            const basegfx::B2DHomMatrix aFromDefinitionRangeToGlobal(
                                basegfx::tools::createScaleTranslateB2DHomMatrix(
                                    getDefinitionRange().getRange(),
                                    getDefinitionRange().getMinimum()));

                            aAdaptedRange.transform(aFromDefinitionRangeToGlobal);

                            basegfx::B2DHomMatrix aFromGlobalToOutRange(
                                basegfx::tools::createScaleTranslateB2DHomMatrix(
                                    aOutRange.getRange(),
                                    aOutRange.getMinimum()));
                            aFromGlobalToOutRange.invert();

                            aAdaptedRange.transform(aFromGlobalToOutRange);

                            const drawinglayer::attribute::FillGraphicAttribute aAdaptedFillGraphicAttribute(
                                getFillGraphic().getGraphic(),
                                aAdaptedRange,
                                getFillGraphic().getTiling(),
                                getFillGraphic().getOffsetX(),
                                getFillGraphic().getOffsetY());

                            xSubRef = new FillGraphicPrimitive2D(
                                aNewObjectTransform,
                                getFillGraphic()));
                                aAdaptedFillGraphicAttribute);
                        }
                        else
                        {
                            xSubRef = new FillGraphicPrimitive2D(
                                aNewObjectTransform,
                                getFillGraphic());
                        }

                        // embed to mask primitive
                        const Primitive2DReference xRef(
@@ -564,6 +642,18 @@ namespace drawinglayer
            const attribute::FillGraphicAttribute& rFillGraphic)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maDefinitionRange(rPolyPolygon.getB2DRange()),
            maFillGraphic(rFillGraphic)
        {
        }

        PolyPolygonGraphicPrimitive2D::PolyPolygonGraphicPrimitive2D(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const basegfx::B2DRange& rDefinitionRange,
            const attribute::FillGraphicAttribute& rFillGraphic)
        :   BufferedDecompositionPrimitive2D(),
            maPolyPolygon(rPolyPolygon),
            maDefinitionRange(rDefinitionRange),
            maFillGraphic(rFillGraphic)
        {
        }
@@ -574,7 +664,9 @@ namespace drawinglayer
            {
                const PolyPolygonGraphicPrimitive2D& rCompare = (PolyPolygonGraphicPrimitive2D&)rPrimitive;

                return (getFillGraphic() == rCompare.getFillGraphic());
                return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
                    && getDefinitionRange() == rCompare.getDefinitionRange()
                    && getFillGraphic() == rCompare.getFillGraphic());
            }

            return false;
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 7b13bfe..22d9f84 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -152,19 +152,34 @@ namespace drawinglayer
                                                case attribute::HATCHSTYLE_TRIPLE:
                                                {
                                                    // rotated 45 degrees
                                                    texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI4);
                                                    texture::GeoTexSvxHatch aHatch(
                                                        aOutlineRange,
                                                        aOutlineRange,
                                                        getHatch().getDistance(),
                                                        fAngle - F_PI4);

                                                    aHatch.appendTransformations(aMatrices);
                                                }
                                                case attribute::HATCHSTYLE_DOUBLE:
                                                {
                                                    // rotated 90 degrees
                                                    texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI2);
                                                    texture::GeoTexSvxHatch aHatch(
                                                        aOutlineRange,
                                                        aOutlineRange,
                                                        getHatch().getDistance(),
                                                        fAngle - F_PI2);

                                                    aHatch.appendTransformations(aMatrices);
                                                }
                                                case attribute::HATCHSTYLE_SINGLE:
                                                {
                                                    // angle as given
                                                    texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle);
                                                    texture::GeoTexSvxHatch aHatch(
                                                        aOutlineRange,
                                                        aOutlineRange,
                                                        getHatch().getDistance(),
                                                        fAngle);

                                                    aHatch.appendTransformations(aMatrices);
                                                }
                                            }
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d6a93ba..6618102 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1454,6 +1454,15 @@ namespace drawinglayer
                    const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
                    basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());

                    if(aLocalPolyPolygon.getB2DRange() != rHatchCandidate.getDefinitionRange())
                    {
                        // the range which defines the hatch is different from the range of the
                        // geometry (used for writer frames). This cannot be done calling vcl, thus use
                        // decomposition here
                        process(rCandidate.get2DDecomposition(getViewInformation2D()));
                        break;
                    }

                    // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                    // per polygon. Split polygon until there are less than that
                    while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
@@ -1576,78 +1585,86 @@ namespace drawinglayer
                        // BTW: One more example how useful the principles of primitives are; the decomposition
                        // is by definition a simpler, maybe more expensive representation of the same content.
                        process(rCandidate.get2DDecomposition(getViewInformation2D()));
                        break;
                    }
                    else

                    const primitive2d::PolyPolygonGradientPrimitive2D& rGradientCandidate = static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate);
                    basegfx::B2DPolyPolygon aLocalPolyPolygon(rGradientCandidate.getB2DPolyPolygon());

                    if(aLocalPolyPolygon.getB2DRange() != rGradientCandidate.getDefinitionRange())
                    {
                        const primitive2d::PolyPolygonGradientPrimitive2D& rGradientCandidate = static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate);
                        basegfx::B2DPolyPolygon aLocalPolyPolygon(rGradientCandidate.getB2DPolyPolygon());
                        // the range which defines the gradient is different from the range of the
                        // geometry (used for writer frames). This cannot be done calling vcl, thus use
                        // decomposition here
                        process(rCandidate.get2DDecomposition(getViewInformation2D()));
                        break;
                    }

                        // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                        // per polygon. Split polygon until there are less than that
                        while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
                            ;
                    // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                    // per polygon. Split polygon until there are less than that
                    while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
                        ;

                        // for support of MetaCommentActions of the form XGRAD_SEQ_BEGIN, XGRAD_SEQ_END
                        // it is safest to use the VCL OutputDevice::DrawGradient method which creates those.
                        // re-create a VCL-gradient from FillGradientPrimitive2D and the needed tools PolyPolygon
                        Gradient aVCLGradient;
                        impConvertFillGradientAttributeToVCLGradient(aVCLGradient, rGradientCandidate.getFillGradient(), false);
                        aLocalPolyPolygon.transform(maCurrentTransformation);
                    // for support of MetaCommentActions of the form XGRAD_SEQ_BEGIN, XGRAD_SEQ_END
                    // it is safest to use the VCL OutputDevice::DrawGradient method which creates those.
                    // re-create a VCL-gradient from FillGradientPrimitive2D and the needed tools PolyPolygon
                    Gradient aVCLGradient;
                    impConvertFillGradientAttributeToVCLGradient(aVCLGradient, rGradientCandidate.getFillGradient(), false);
                    aLocalPolyPolygon.transform(maCurrentTransformation);

                        // #i82145# ATM VCL printing of gradients using curved shapes does not work,
                        // i submitted the bug with the given ID to THB. When that task is fixed it is
                        // necessary to again remove this subdivision since it decreases possible
                        // printing quality (not even resolution-dependent for now). THB will tell
                        // me when that task is fixed in the master
                        const PolyPolygon aToolsPolyPolygon(basegfx::tools::adaptiveSubdivideByAngle(aLocalPolyPolygon));
                    // #i82145# ATM VCL printing of gradients using curved shapes does not work,
                    // i submitted the bug with the given ID to THB. When that task is fixed it is
                    // necessary to again remove this subdivision since it decreases possible
                    // printing quality (not even resolution-dependent for now). THB will tell
                    // me when that task is fixed in the master
                    const PolyPolygon aToolsPolyPolygon(basegfx::tools::adaptiveSubdivideByAngle(aLocalPolyPolygon));

                        // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
                        SvtGraphicFill* pSvtGraphicFill = 0;
                    // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
                    SvtGraphicFill* pSvtGraphicFill = 0;

                        if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
                    if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
                    {
                        // setup gradient stuff like in like in impgrfll
                        SvtGraphicFill::GradientType eGrad(SvtGraphicFill::gradientLinear);

                        switch(aVCLGradient.GetStyle())
                        {
                            // setup gradient stuff like in like in impgrfll
                            SvtGraphicFill::GradientType eGrad(SvtGraphicFill::gradientLinear);

                            switch(aVCLGradient.GetStyle())
                            {
                                default : // GRADIENT_LINEAR:
                                case GRADIENT_AXIAL:
                                    eGrad = SvtGraphicFill::gradientLinear;
                                    break;
                                case GRADIENT_RADIAL:
                                case GRADIENT_ELLIPTICAL:
                                    eGrad = SvtGraphicFill::gradientRadial;
                                    break;
                                case GRADIENT_SQUARE:
                                case GRADIENT_RECT:
                                    eGrad = SvtGraphicFill::gradientRectangular;
                                    break;
                            }

                            pSvtGraphicFill = new SvtGraphicFill(
                                aToolsPolyPolygon,
                                Color(),
                                0.0,
                                SvtGraphicFill::fillEvenOdd,
                                SvtGraphicFill::fillGradient,
                                SvtGraphicFill::Transform(),
                                false,
                                SvtGraphicFill::hatchSingle,
                                Color(),
                                eGrad,
                                aVCLGradient.GetStartColor(),
                                aVCLGradient.GetEndColor(),
                                aVCLGradient.GetSteps(),
                                Graphic());
                            default : // GRADIENT_LINEAR:
                            case GRADIENT_AXIAL:
                                eGrad = SvtGraphicFill::gradientLinear;
                                break;
                            case GRADIENT_RADIAL:
                            case GRADIENT_ELLIPTICAL:
                                eGrad = SvtGraphicFill::gradientRadial;
                                break;
                            case GRADIENT_SQUARE:
                            case GRADIENT_RECT:
                                eGrad = SvtGraphicFill::gradientRectangular;
                                break;
                        }

                        // call VCL directly; encapsulate with SvtGraphicFill
                        impStartSvtGraphicFill(pSvtGraphicFill);
                        mpOutputDevice->DrawGradient(aToolsPolyPolygon, aVCLGradient);
                        impEndSvtGraphicFill(pSvtGraphicFill);
                        pSvtGraphicFill = new SvtGraphicFill(
                            aToolsPolyPolygon,
                            Color(),
                            0.0,
                            SvtGraphicFill::fillEvenOdd,
                            SvtGraphicFill::fillGradient,
                            SvtGraphicFill::Transform(),
                            false,
                            SvtGraphicFill::hatchSingle,
                            Color(),
                            eGrad,
                            aVCLGradient.GetStartColor(),
                            aVCLGradient.GetEndColor(),
                            aVCLGradient.GetSteps(),
                            Graphic());
                    }

                    // call VCL directly; encapsulate with SvtGraphicFill
                    impStartSvtGraphicFill(pSvtGraphicFill);
                    mpOutputDevice->DrawGradient(aToolsPolyPolygon, aVCLGradient);
                    impEndSvtGraphicFill(pSvtGraphicFill);

                    break;
                }
                case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 0dd8466..9f62849 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -707,7 +707,7 @@ namespace drawinglayer
                        const attribute::FillHatchAttribute& rFillHatchAttributes = rFillHatchPrimitive.getFillHatch();

                        // create hatch polygon in range size and discrete coordinates
                        basegfx::B2DRange aHatchRange(rFillHatchPrimitive.getObjectRange());
                        basegfx::B2DRange aHatchRange(rFillHatchPrimitive.getOutputRange());
                        aHatchRange.transform(maCurrentTransformation);
                        const basegfx::B2DPolygon aHatchPolygon(basegfx::tools::createPolygonFromRect(aHatchRange));

diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 0745920..9c7404c 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -98,32 +98,83 @@ namespace drawinglayer
                    {
                        case attribute::GRADIENTSTYLE_LINEAR:
                        {
                            pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
                            pNewTex.reset(
                                new texture::GeoTexSvxGradientLinear(
                                    aOutlineRange,
                                    aOutlineRange,
                                    aStart,
                                    aEnd,
                                    nSteps,
                                    rFillGradient.getBorder(),
                                    rFillGradient.getAngle()));
                            break;
                        }
                        case attribute::GRADIENTSTYLE_AXIAL:
                        {
                            pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
                            pNewTex.reset(
                                new texture::GeoTexSvxGradientAxial(
                                    aOutlineRange,
                                    aOutlineRange,
                                    aStart,
                                    aEnd,
                                    nSteps,
                                    rFillGradient.getBorder(),
                                    rFillGradient.getAngle()));
                            break;
                        }
                        case attribute::GRADIENTSTYLE_RADIAL:
                        {
                            pNewTex.reset(new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY()));
                            pNewTex.reset(
                                new texture::GeoTexSvxGradientRadial(
                                    aOutlineRange,
                                    aStart,
                                    aEnd,
                                    nSteps,
                                    rFillGradient.getBorder(),
                                    rFillGradient.getOffsetX(),
                                    rFillGradient.getOffsetY()));
                            break;
                        }
                        case attribute::GRADIENTSTYLE_ELLIPTICAL:
                        {
                            pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
                            pNewTex.reset(
                                new texture::GeoTexSvxGradientElliptical(
                                    aOutlineRange,
                                    aStart,
                                    aEnd,
                                    nSteps,
                                    rFillGradient.getBorder(),
                                    rFillGradient.getOffsetX(),
                                    rFillGradient.getOffsetY(),
                                    rFillGradient.getAngle()));
                            break;
                        }
                        case attribute::GRADIENTSTYLE_SQUARE:
                        {
                            pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
                            pNewTex.reset(
                                new texture::GeoTexSvxGradientSquare(
                                    aOutlineRange,
                                    aStart,
                                    aEnd,
                                    nSteps,
                                    rFillGradient.getBorder(),
                                    rFillGradient.getOffsetX(),
                                    rFillGradient.getOffsetY(),
                                    rFillGradient.getAngle()));
                            break;
                        }
                        case attribute::GRADIENTSTYLE_RECT:
                        {
                            pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
                            pNewTex.reset(
                                new texture::GeoTexSvxGradientRect(
                                    aOutlineRange,
                                    aStart,
                                    aEnd,
                                    nSteps,
                                    rFillGradient.getBorder(),
                                    rFillGradient.getOffsetX(),
                                    rFillGradient.getOffsetY(),
                                    rFillGradient.getAngle()));
                            break;
                        }
                    }
diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx
index 937018c..909869b 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -74,14 +74,14 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradient::GeoTexSvxGradient(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 /* nSteps */,
            double fBorder)
        :   GeoTexSvx(),
            maGradientInfo(),
            maTargetRange(rTargetRange),
            maDefinitionRange(rDefinitionRange),
            maStart(rStart),
            maEnd(rEnd),
            mfBorder(fBorder)
@@ -98,7 +98,7 @@ namespace drawinglayer

            return (pCompare
                && maGradientInfo == pCompare->maGradientInfo
                && maTargetRange == pCompare->maTargetRange
                && maDefinitionRange == pCompare->maDefinitionRange
                && mfBorder == pCompare->mfBorder);
        }
    } // end of namespace texture
@@ -111,19 +111,33 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradientLinear::GeoTexSvxGradientLinear(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::B2DRange& rOutputRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 nSteps,
            double fBorder,
            double fAngle)
        :   GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
        :   GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder),
            mfUnitMinX(0.0),
            mfUnitWidth(1.0),
            mfUnitMaxY(1.0)
        {
            maGradientInfo = basegfx::tools::createLinearODFGradientInfo(
                rTargetRange,
                rDefinitionRange,
                nSteps,
                fBorder,
                fAngle);

            if(rDefinitionRange != rOutputRange)
            {
                basegfx::B2DRange aInvOutputRange(rOutputRange);

                aInvOutputRange.transform(maGradientInfo.getBackTextureTransform());
                mfUnitMinX = aInvOutputRange.getMinX();
                mfUnitWidth = aInvOutputRange.getWidth();
                mfUnitMaxY = aInvOutputRange.getMaxY();
            }
        }

        GeoTexSvxGradientLinear::~GeoTexSvxGradientLinear()
@@ -132,29 +146,46 @@ namespace drawinglayer

        void GeoTexSvxGradientLinear::appendTransformationsAndColors(
            std::vector< B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor)
            basegfx::BColor& rOuterColor)
        {
            rOutmostColor = maStart;
            rOuterColor = maStart;

            if(maGradientInfo.getSteps())
            {
                const double fStripeWidth(1.0 / maGradientInfo.getSteps());
                B2DHomMatrixAndBColor aB2DHomMatrixAndBColor;
                basegfx::B2DHomMatrix aPattern;

                // bring from unit circle [-1, -1, 1, 1] to unit range [0, 0, 1, 1]
                aPattern.scale(0.5, 0.5);
                aPattern.translate(0.5, 0.5);

                // scale and translate in X
                aPattern.scale(mfUnitWidth, 1.0);
                aPattern.translate(mfUnitMinX, 0.0);

                for(sal_uInt32 a(1); a < maGradientInfo.getSteps(); a++)
                {
                    const double fPos(fStripeWidth * a);
                    // optimized below...
                    //
                    // basegfx::B2DHomMatrix aNew;
                    // aNew.scale(0.5, 0.5);
                    // aNew.translate(0.5, 0.5);
                    // aNew.scale(1.0, (1.0 - fPos));
                    // aNew.translate(0.0, fPos);
                    // aNew = maGradientInfo.getTextureTransform() * aNew;
                    aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() *
                        basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5 * (1.0 - fPos), 0.5, 0.5 * (1.0 + fPos));
                    basegfx::B2DHomMatrix aNew(aPattern);

                    // scale and translate in Y
                    double fHeight(1.0 - fPos);

                    if(a + 1 == maGradientInfo.getSteps() && mfUnitMaxY > 1.0)
                    {
                        fHeight += mfUnitMaxY - 1.0;
                    }

                    aNew.scale(1.0, fHeight);
                    aNew.translate(0.0, fPos);

                    // set at target
                    aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() * aNew;

                    // interpolate and set color
                    aB2DHomMatrixAndBColor.maBColor = interpolate(maStart, maEnd, double(a) / double(maGradientInfo.getSteps() - 1));

                    rEntries.push_back(aB2DHomMatrixAndBColor);
                }
            }
@@ -176,19 +207,31 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradientAxial::GeoTexSvxGradientAxial(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::B2DRange& rOutputRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 nSteps,
            double fBorder,
            double fAngle)
        :   GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
        :   GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder),
            mfUnitMinX(0.0),
            mfUnitWidth(1.0)
        {
            maGradientInfo = basegfx::tools::createAxialODFGradientInfo(
                rTargetRange,
                rDefinitionRange,
                nSteps,
                fBorder,
                fAngle);

            if(rDefinitionRange != rOutputRange)
            {
                basegfx::B2DRange aInvOutputRange(rOutputRange);

                aInvOutputRange.transform(maGradientInfo.getBackTextureTransform());
                mfUnitMinX = aInvOutputRange.getMinX();
                mfUnitWidth = aInvOutputRange.getWidth();
            }
        }

        GeoTexSvxGradientAxial::~GeoTexSvxGradientAxial()
@@ -197,9 +240,9 @@ namespace drawinglayer

        void GeoTexSvxGradientAxial::appendTransformationsAndColors(
            std::vector< B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor)
            basegfx::BColor& rOuterColor)
        {
            rOutmostColor = maEnd;
            rOuterColor = maEnd;

            if(maGradientInfo.getSteps())
            {
@@ -208,16 +251,26 @@ namespace drawinglayer

                for(sal_uInt32 a(1); a < maGradientInfo.getSteps(); a++)
                {
                    // const double fPos(fStripeWidth * a);
                    // optimized below...
                    //
                    // basegfx::B2DHomMatrix aNew;
                    // aNew.scale(0.50, (1.0 - fPos));
                    // aNew.translate(0.5, 0.0);
                    // aNew = maGradientInfo.getTextureTransform() * aNew;
                    aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() *
                        basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 1.0 - (fStripeWidth * a), 0.5, 0.0);
                    const double fPos(fStripeWidth * a);
                    basegfx::B2DHomMatrix aNew;

                    // bring in X from unit circle [-1, -1, 1, 1] to unit range [0, 0, 1, 1]
                    aNew.scale(0.5, 1.0);
                    aNew.translate(0.5, 0.0);

                    // scale/translate in X
                    aNew.scale(mfUnitWidth, 1.0);
                    aNew.translate(mfUnitMinX, 0.0);

                    // already centerd in Y on X-Axis, just scale in Y
                    aNew.scale(1.0, 1.0 - fPos);

                    // set at target
                    aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() * aNew;

                    // interpolate and set color
                    aB2DHomMatrixAndBColor.maBColor = interpolate(maEnd, maStart, double(a) / double(maGradientInfo.getSteps() - 1));

                    rEntries.push_back(aB2DHomMatrixAndBColor);
                }
            }
@@ -239,17 +292,17 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradientRadial::GeoTexSvxGradientRadial(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 nSteps,
            double fBorder,
            double fOffsetX,
            double fOffsetY)
        :   GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
        :   GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder)
        {
            maGradientInfo = basegfx::tools::createRadialODFGradientInfo(
                rTargetRange,
                rDefinitionRange,
                basegfx::B2DVector(fOffsetX,fOffsetY),
                nSteps,
                fBorder);
@@ -261,9 +314,9 @@ namespace drawinglayer

        void GeoTexSvxGradientRadial::appendTransformationsAndColors(
            std::vector< B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor)
            basegfx::BColor& rOuterColor)
        {
            rOutmostColor = maStart;
            rOuterColor = maStart;

            if(maGradientInfo.getSteps())
            {
@@ -296,7 +349,7 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradientElliptical::GeoTexSvxGradientElliptical(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 nSteps,
@@ -304,10 +357,10 @@ namespace drawinglayer
            double fOffsetX,
            double fOffsetY,
            double fAngle)
        :   GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
        :   GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder)
        {
            maGradientInfo = basegfx::tools::createEllipticalODFGradientInfo(
                rTargetRange,
                rDefinitionRange,
                basegfx::B2DVector(fOffsetX,fOffsetY),
                nSteps,
                fBorder,
@@ -320,9 +373,9 @@ namespace drawinglayer

        void GeoTexSvxGradientElliptical::appendTransformationsAndColors(
            std::vector< B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor)
            basegfx::BColor& rOuterColor)
        {
            rOutmostColor = maStart;
            rOuterColor = maStart;

            if(maGradientInfo.getSteps())
            {
@@ -373,7 +426,7 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradientSquare::GeoTexSvxGradientSquare(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 nSteps,
@@ -381,10 +434,10 @@ namespace drawinglayer
            double fOffsetX,
            double fOffsetY,
            double fAngle)
        :   GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
        :   GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder)
        {
            maGradientInfo = basegfx::tools::createSquareODFGradientInfo(
                rTargetRange,
                rDefinitionRange,
                basegfx::B2DVector(fOffsetX,fOffsetY),
                nSteps,
                fBorder,
@@ -397,9 +450,9 @@ namespace drawinglayer

        void GeoTexSvxGradientSquare::appendTransformationsAndColors(
            std::vector< B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor)
            basegfx::BColor& rOuterColor)
        {
            rOutmostColor = maStart;
            rOuterColor = maStart;

            if(maGradientInfo.getSteps())
            {
@@ -432,7 +485,7 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxGradientRect::GeoTexSvxGradientRect(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::BColor& rStart,
            const basegfx::BColor& rEnd,
            sal_uInt32 nSteps,
@@ -440,10 +493,10 @@ namespace drawinglayer
            double fOffsetX,
            double fOffsetY,
            double fAngle)
        :   GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
        :   GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder)
        {
            maGradientInfo = basegfx::tools::createRectangularODFGradientInfo(
                rTargetRange,
                rDefinitionRange,
                basegfx::B2DVector(fOffsetX,fOffsetY),
                nSteps,
                fBorder,
@@ -456,9 +509,9 @@ namespace drawinglayer

        void GeoTexSvxGradientRect::appendTransformationsAndColors(
            std::vector< B2DHomMatrixAndBColor >& rEntries,
            basegfx::BColor& rOutmostColor)
            basegfx::BColor& rOuterColor)
        {
            rOutmostColor = maStart;
            rOuterColor = maStart;

            if(maGradientInfo.getSteps())
            {
@@ -509,17 +562,22 @@ namespace drawinglayer
    namespace texture
    {
        GeoTexSvxHatch::GeoTexSvxHatch(
            const basegfx::B2DRange& rTargetRange,
            const basegfx::B2DRange& rDefinitionRange,
            const basegfx::B2DRange& rOutputRange,
            double fDistance,
            double fAngle)
        :   mfDistance(0.1),
        :   maOutputRange(rOutputRange),
            maTextureTransform(),
            maBackTextureTransform(),
            mfDistance(0.1),
            mfAngle(fAngle),
            mnSteps(10L)
            mnSteps(10),
            mbDefinitionRangeEqualsOutputRange(rDefinitionRange == rOutputRange)
        {
            double fTargetSizeX(rTargetRange.getWidth());
            double fTargetSizeY(rTargetRange.getHeight());
            double fTargetOffsetX(rTargetRange.getMinX());
            double fTargetOffsetY(rTargetRange.getMinY());
            double fTargetSizeX(rDefinitionRange.getWidth());
            double fTargetSizeY(rDefinitionRange.getHeight());
            double fTargetOffsetX(rDefinitionRange.getMinX());
            double fTargetOffsetY(rDefinitionRange.getMinY());

            fAngle = -fAngle;

@@ -566,6 +624,7 @@ namespace drawinglayer
        {
            const GeoTexSvxHatch* pCompare = dynamic_cast< const GeoTexSvxHatch* >(&rGeoTexSvx);
            return (pCompare
                && maOutputRange == pCompare->maOutputRange
                && maTextureTransform == pCompare->maTextureTransform
                && mfDistance == pCompare->mfDistance
                && mfAngle == pCompare->mfAngle
@@ -574,13 +633,54 @@ namespace drawinglayer

        void GeoTexSvxHatch::appendTransformations(::std::vector< basegfx::B2DHomMatrix >& rMatrices)
        {
            for(sal_uInt32 a(1L); a < mnSteps; a++)
            if(mbDefinitionRangeEqualsOutputRange)
            {
                // create matrix
                const double fOffset(mfDistance * (double)a);
                basegfx::B2DHomMatrix aNew;
                aNew.set(1, 2, fOffset);
                rMatrices.push_back(maTextureTransform * aNew);
                // simple hatch where the definition area equals the output area
                for(sal_uInt32 a(1); a < mnSteps; a++)
                {
                    // create matrix
                    const double fOffset(mfDistance * (double)a);
                    basegfx::B2DHomMatrix aNew;
                    aNew.set(1, 2, fOffset);
                    rMatrices.push_back(maTextureTransform * aNew);
                }
            }
            else
            {
                // output area is different from definition area, back-transform to get
                // the output area in unit coordinates and fill this with hatch lines
                // using the settings derived from the definition area
                basegfx::B2DRange aBackUnitRange(maOutputRange);

                aBackUnitRange.transform(getBackTextureTransform());

                // calculate vertical start value and a security maximum integer value to avoid death loops
                double fStart(basegfx::snapToNearestMultiple(aBackUnitRange.getMinY(), mfDistance));
                const sal_uInt32 nNeededIntegerSteps(basegfx::fround((aBackUnitRange.getHeight() / mfDistance) + 0.5));
                sal_uInt32 nMaxIntegerSteps(::std::min(nNeededIntegerSteps, sal_uInt32(10000)));

                while(fStart < aBackUnitRange.getMaxY() && nMaxIntegerSteps)
                {
                    // create new transform for
                    basegfx::B2DHomMatrix aNew;

                    // adapt x scale and position
                    //aNew.scale(aBackUnitRange.getWidth(), 1.0);
                    //aNew.translate(aBackUnitRange.getMinX(), 0.0);
                    aNew.set(0, 0, aBackUnitRange.getWidth());
                    aNew.set(0, 2, aBackUnitRange.getMinX());

                    // adapt y position to current step
                    aNew.set(1, 2, fStart);
                    //aNew.translate(0.0, fStart);

                    // add new transformation
                    rMatrices.push_back(maTextureTransform * aNew);

                    // next step
                    fStart += mfDistance;
                    nMaxIntegerSteps--;
                }
            }
        }

diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index db7ce8a..0c6ae78 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -341,16 +341,28 @@ namespace drawinglayer
            const double fAngleA(rHatch.getAngle());
            maColor = rHatch.getColor();
            mbFillBackground = rHatch.isFillBackground();
            mp0 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA);
            mp0 = new GeoTexSvxHatch(
                aOutlineRange,
                aOutlineRange,
                rHatch.getDistance(),
                fAngleA);

            if(attribute::HATCHSTYLE_DOUBLE == rHatch.getStyle() || attribute::HATCHSTYLE_TRIPLE == rHatch.getStyle())
            {
                mp1 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA + F_PI2);
                mp1 = new GeoTexSvxHatch(
                    aOutlineRange,
                    aOutlineRange,
                    rHatch.getDistance(),
                    fAngleA + F_PI2);
            }

            if(attribute::HATCHSTYLE_TRIPLE == rHatch.getStyle())
            {
                mp2 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA + F_PI4);
                mp2 = new GeoTexSvxHatch(
                    aOutlineRange,
                    aOutlineRange,
                    rHatch.getDistance(),
                    fAngleA + F_PI4);
            }
        }

diff --git a/editeng/inc/editeng/brshitem.hxx b/editeng/inc/editeng/brshitem.hxx
index f5225fb..0097048 100644
--- a/editeng/inc/editeng/brshitem.hxx
+++ b/editeng/inc/editeng/brshitem.hxx
@@ -119,6 +119,10 @@ public:
    const String*           GetGraphicLink() const      { return pStrLink; }
    const String*           GetGraphicFilter() const    { return pStrFilter; }

    //UUUU get graphic transparency in percent
    sal_Int8 getGraphicTransparency() const;
    void setGraphicTransparency(sal_Int8 nNew);

    void                SetGraphicPos( SvxGraphicPosition eNew );
    void                SetGraphic( const Graphic& rNew );
    void                SetGraphicObject( const GraphicObject& rNewObj );
diff --git a/editeng/inc/editeng/unoprnms.hxx b/editeng/inc/editeng/unoprnms.hxx
index f612182..4829117 100644
--- a/editeng/inc/editeng/unoprnms.hxx
+++ b/editeng/inc/editeng/unoprnms.hxx
@@ -37,8 +37,13 @@
#define UNO_NAME_FILLSTYLE                      "FillStyle"
#define UNO_NAME_FILLCOLOR                      "FillColor"
#define UNO_NAME_FILLGRADIENT                   "FillGradient"
#define UNO_NAME_FILLGRADIENTNAME               "FillGradientName"
#define UNO_NAME_FILLHATCH                      "FillHatch"
#define UNO_NAME_FILLHATCHNAME                  "FillHatchName"
#define UNO_NAME_FILLBITMAP                     "FillBitmap"
#define UNO_NAME_FILLBITMAPNAME                 "FillBitmapName"
#define UNO_NAME_FILLBITMAPURL                  "FillBitmapURL"
#define UNO_NAME_FILLGRADIENTSTEPCOUNT          "FillGradientStepCount"
#define UNO_NAME_FILLBACKGROUND                 "FillBackground"
#define UNO_NAME_FILLCOLOR_2                    "FillColor2"

@@ -62,6 +67,8 @@
#define UNO_NAME_FILLBMP_SIZE_X                 "FillBitmapSizeX"
#define UNO_NAME_FILLBMP_SIZE_Y                 "FillBitmapSizeY"
#define UNO_NAME_FILL_TRANSPARENCE              "FillTransparence"
#define UNO_NAME_FILLTRANSPARENCEGRADIENT       "FillTransparenceGradient"
#define UNO_NAME_FILLTRANSPARENCEGRADIENTNAME   "FillTransparenceGradientName"
#define UNO_NAME_FILLBMP_MODE                   "FillBitmapMode"

#define UNO_NAME_FILL_GRADIENT_STYLE            "FillGradientStyle"
diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx
index f52e53d..6e82c2b 100644
--- a/editeng/inc/editeng/unotext.hxx
+++ b/editeng/inc/editeng/unotext.hxx
@@ -255,7 +255,7 @@ class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public ::com::sun::star::text::XTe

{
    friend class SvxUnoTextRangeEnumeration;
    friend class accessibility::AccessibleEditableTextPara;
    friend class ::accessibility::AccessibleEditableTextPara;

protected:
    SvxEditSource*          mpEditSource;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 7d6326f..5402b93 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -4127,6 +4127,24 @@ const GraphicObject* SvxBrushItem::GetGraphicObject() const
}

// -----------------------------------------------------------------------
//UUUU
sal_Int8 SvxBrushItem::getGraphicTransparency() const
{
    return pImpl->nGraphicTransparency;
}

// -----------------------------------------------------------------------
//UUUU
void SvxBrushItem::setGraphicTransparency(sal_Int8 nNew)
{
    if(nNew != pImpl->nGraphicTransparency)
    {
        pImpl->nGraphicTransparency = nNew;
        ApplyGraphicTransparency_Impl();
    }
}

// -----------------------------------------------------------------------

const Graphic* SvxBrushItem::GetGraphic() const
{
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 4fb60d5..abb4f9c 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -351,6 +351,7 @@
            DrawImpress,    TextObject, hidden  ;
            DrawImpress,    OLE,        hidden  ;
            WriterVariants, Draw,       visible ;
            Writer,         Frame,      visible ;
          </value>
        </prop>
        <prop oor:name="ImplementationURL" oor:type="xs:string">
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 6567676..0f0190e 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -770,7 +770,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R

        {   // want the dialog to be destroyed before our set
            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
            ::std::auto_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get() ));
            ::std::auto_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get(), true));
            bSuccess = ( RET_OK == pDialog->Execute() );
            if ( bSuccess )
            {
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index e0ccdb5..76634d0 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -459,7 +459,7 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
    AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( pViewData->GetDialogParent(),
                                                                    &aNewAttr,
                                                            pViewData->GetDocument()->GetDrawLayer(),
                                                            pView);
                                                            true);
    DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001

    // #i74099# by default, the dialog deletes the current color table if a different one is loaded
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index 96cf766..132a4ba 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -78,7 +78,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
        AbstractSvxAreaTabDialog * pDlg = pFact ? pFact->CreateSvxAreaTabDialog( NULL,
                                                                        &aNewAttr,
                                                                        mpDoc,
                                                                        mpView) : 0;
                                                                        true) : 0;
        if( pDlg && (pDlg->Execute() == RET_OK) )
        {
            mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index f6c1512..78a0fd5 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1394,7 +1394,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
*/

{
    sal_uInt16 const nId = pTabCtrl->GetCurPageId();
    sal_uInt16 nId = pTabCtrl->GetCurPageId();

    DBG_ASSERT( pImpl->pData->Count(), "keine Pages angemeldet" );
    SFX_APP();
@@ -1402,6 +1402,16 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
    // Tab Page schon da?
    SfxTabPage* pTabPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId ));
    Data_Impl* pDataObject = Find( *pImpl->pData, nId );

    //UUUU fallback to 1st page when requested one does not exist
    if(!pDataObject && pTabCtrl->GetPageCount())
    {
        pTabCtrl->SetCurPageId(pTabCtrl->GetPageId(0));
        nId = pTabCtrl->GetCurPageId();
        pTabPage = dynamic_cast< SfxTabPage* >(pTabCtrl->GetTabPage(nId));
        Data_Impl* pDataObject = Find(*pImpl->pData, nId);
    }

    DBG_ASSERT( pDataObject, "Id nicht bekannt" );

    // ggf. TabPage erzeugen:
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 6faeb95..63d449b 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -636,7 +636,15 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT
        {
            i_guard.markForDeletion( m_pData->pActUndoArray->aUndoActions[0].pAction );
            m_pData->pActUndoArray->aUndoActions.Remove(0);
            --m_pData->pActUndoArray->nCurUndoAction;

            if(m_pData->pActUndoArray->nCurUndoAction)
            {
                --m_pData->pActUndoArray->nCurUndoAction;
            }
            else
            {
                OSL_ENSURE(false, "CurrentUndoAction going negative (!)");
            }
        }
    }

diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
index ab2ddd9..007124e 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
@@ -70,7 +70,7 @@ namespace drawinglayer
        attribute::SdrShadowAttribute createNewSdrShadowAttribute(
            const SfxItemSet& rSet);

        attribute::SdrFillAttribute createNewSdrFillAttribute(
        attribute::SdrFillAttribute SVX_DLLPUBLIC createNewSdrFillAttribute(
            const SfxItemSet& rSet);

        // #i101508# Support handing over given text-to-border distances
@@ -82,7 +82,7 @@ namespace drawinglayer
            const sal_Int32* pRight = 0,
            const sal_Int32* pLower = 0);

        attribute::FillGradientAttribute createNewTransparenceGradientAttribute(
        attribute::FillGradientAttribute SVX_DLLPUBLIC createNewTransparenceGradientAttribute(
            const SfxItemSet& rSet);

        attribute::SdrFillGraphicAttribute createNewSdrFillGraphicAttribute(
diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
index 6802d32..e6f2dad 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
@@ -26,6 +26,8 @@

#include <drawinglayer/primitive2d/baseprimitive2d.hxx>

#include <svx/svxdllapi.h>

//////////////////////////////////////////////////////////////////////////////
// predefines
namespace basegfx {
@@ -49,19 +51,23 @@ namespace drawinglayer
{
    namespace primitive2d
    {
        Primitive2DReference createPolyPolygonFillPrimitive(
            const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
            const basegfx::B2DHomMatrix& rObjectTransform,
        Primitive2DReference SVX_DLLPUBLIC createPolyPolygonFillPrimitive(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const attribute::SdrFillAttribute& rFill,
            const attribute::FillGradientAttribute& rFillGradient);

        Primitive2DReference createPolygonLinePrimitive(
            const basegfx::B2DPolygon& rUnitPolygon,
            const basegfx::B2DHomMatrix& rObjectTransform,
        Primitive2DReference SVX_DLLPUBLIC createPolyPolygonFillPrimitive(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const basegfx::B2DRange& rDefinitionRange,
            const attribute::SdrFillAttribute& rFill,
            const attribute::FillGradientAttribute& rFillGradient);

        Primitive2DReference SVX_DLLPUBLIC createPolygonLinePrimitive(
            const basegfx::B2DPolygon& rPolygon,
            const attribute::SdrLineAttribute& rLine,
            const attribute::SdrLineStartEndAttribute& rStroke);

        Primitive2DReference createTextPrimitive(
        Primitive2DReference SVX_DLLPUBLIC createTextPrimitive(
            const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
            const basegfx::B2DHomMatrix& rObjectTransform,
            const attribute::SdrTextAttribute& rText,
@@ -70,7 +76,7 @@ namespace drawinglayer
            bool bWordWrap,
            bool bClipOnBounds);

        Primitive2DSequence createEmbeddedShadowPrimitive(
        Primitive2DSequence SVX_DLLPUBLIC createEmbeddedShadowPrimitive(
            const Primitive2DSequence& rContent,
            const attribute::SdrShadowAttribute& rShadow);

diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx
index 6bcad99..bea905e 100644
--- a/svx/inc/svx/svxdlg.hxx
+++ b/svx/inc/svx/svxdlg.hxx
@@ -446,7 +446,7 @@ public:
    virtual AbstractSvxAreaTabDialog*       CreateSvxAreaTabDialog( Window* pParent,//add for SvxAreaTabDialog
                                                            const SfxItemSet* pAttr,
                                                            SdrModel* pModel,
                                                            const SdrView* pSdrView = NULL ) = 0 ;
                                                            bool bShadow) = 0 ;
    virtual SfxAbstractTabDialog*           CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog
                                                                 SdrModel* pModel,
                                                                 const SdrObject* pObj = NULL,
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index 70e8cf0..67b145f 100755
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -413,13 +413,19 @@

#define SID_ATTR_ZOOM                                   ( SID_SVX_START + 0 )

// CAUTION! Range <1 .. 22> used by EditEngine (!)

#define SID_ATTR_BORDER_INNER                           ( SID_SVX_START + 23 )

// CAUTION! Range <24 .. 43> used by EditEngine (!)

#define SID_ATTR_POSTIT_AUTHOR                          ( SID_SVX_START + 44 )
#define SID_ATTR_POSTIT_DATE                            ( SID_SVX_START + 45 )
#define SID_ATTR_POSTIT_TEXT                            ( SID_SVX_START + 46 )
#define SID_ATTR_SEARCH                                 ( SID_SVX_START + 47 )

// CAUTION! Range <48 .. 49> used by EditEngine (!)

#define SID_ATTR_PAGE                                   ( SID_SVX_START + 50 )
#define SID_ATTR_PAGE_SIZE                              ( SID_SVX_START + 51 )
#define SID_ATTR_PAGE_MAXSIZE                           ( SID_SVX_START + 52 )
@@ -433,6 +439,9 @@
#define SID_ATTR_PAGE_DYNAMIC                           ( SID_SVX_START + 61 )
#define SID_ATTR_PAGE_SHARED                            ( SID_SVX_START + 62 )
#define SID_ATTR_PAGE_BSP                               ( SID_SVX_START + 63 )

// CAUTION! Range <64 .. 67> used by EditEngine (!)

#define SID_ATTR_DBSESS_SERVERTYPE                      ( SID_SVX_START + 70 )
#define SID_ATTR_DBSESS_SERVEROPTS                      ( SID_SVX_START + 71 )
#define SID_ATTR_DBSESS_USERNAME                        ( SID_SVX_START + 72 )
@@ -608,6 +617,9 @@
#define SID_SPELL_DIALOG                                 ( SID_SVX_START + 243 )
#define SID_INSERT_DRAW                                 ( SID_SVX_START + 244 )
#define SID_THESAURUS                                   ( SID_SVX_START + 245 )

// CAUTION! Range <250 .. 250> used by EditEngine (!)

#define SID_AUTOCOMPLETEWORD                            ( SID_SVX_START + 251 )
#define SID_DRAW_TEXT                                   ( SID_SVX_START + 253 )
#define SID_DRAW_CAPTION                                ( SID_SVX_START + 254 )
@@ -655,6 +667,9 @@
#define SID_PARA_DLG                                    ( SID_SVX_START + 297 )
#define SID_ATTR_GRID_OPTIONS                           ( SID_SVX_START + 298 )
#define SID_ATTR_FILL_SHADOW                            ( SID_SVX_START + 299 )

// CAUTION! Range <300 .. 300> used by EditEngine (!)

#define SID_ATTR_LINEEND_STYLE                          ( SID_SVX_START + 301 )
#define SID_ATTR_TRANSFORM_SLANT                        ( SID_SVX_START + 302 ) // !!!
#define SID_ATTR_TRANSFORM_SHEAR                        ( SID_SVX_START + 304 )
@@ -704,6 +719,9 @@
//#define SID_HYPERLINK_INSERT                            ( SID_SVX_START + 360 )   -> sfxsids.hrc
//#define SID_HYPERLINK_GETLINK                           ( SID_SVX_START + 361 )   -> sfxsids.hrc
//#define SID_HYPERLINK_SETLINK                           ( SID_SVX_START + 362 )   -> sfxsids.hrc

// CAUTION! Range <363 .. 363> used by EditEngine (!)

#define SID_NO_GRAPHICS                                 ( SID_SVX_START + 364 )
#define SID_IMPORT_GRAPH_LASTURL                        ( SID_SVX_START + 365 )
//#define SID_NAVIGATOR                                   ( SID_SVX_START + 366 )   -> sfxsids.hrc
@@ -753,7 +771,7 @@
#define SID_ATTR_3D_AMBIENTCOLOR                        ( SID_SVX_START + 411 )
#define SID_IMPORT_GRAPH_LINK                           ( SID_SVX_START + 412 )

//#define SID_ATTR_PARA_REGISTER                          ( SID_SVX_START + 413 ) -> editids.hrc
// CAUTION! Range <413 .. 413> used by EditEngine (!)

//! moved to sfx2, still in use:
//#define SID_HTML_MODE                                   ( SID_SVX_START + 414 )
@@ -803,6 +821,9 @@
#define SID_GROUP                                       ( SID_SVX_START + 454 )
#define SID_UNGROUP                                     ( SID_SVX_START + 455 )
#define SID_SET_DEFAULT                                 ( SID_SVX_START + 456 )

// CAUTION! Range <457 .. 457> used by EditEngine (!)

#define SID_BEZIER                                      ( SID_SVX_START + 458 )
#define SID_ATTR_3D_DOUBLE_SIDED                        ( SID_SVX_START + 459 )
#define SID_ATTR_ALIGN_INDENT                           ( SID_SVX_START + 460 )
@@ -857,10 +878,15 @@
#define SID_TAB_REMOVE_ALL                              ( SID_SVX_START + 583 )
#define SID_TAB_REMOVE_BY_INDEX                         ( SID_SVX_START + 584 )
#define SID_OFA_VW_CREATE                               ( SID_SVX_START + 585 )

// CAUTION! Range <587 .. 587> used by EditEngine (!)

#define SID_OFA_REL_DESIGNVIEW                          ( SID_SVX_START + 588 )
#define SID_OFA_MANUAL_SQL                              ( SID_SVX_START + 589 )
#define SID_PARA_BACKGRND_DESTINATION                   ( SID_SVX_START + 590 )

// CAUTION! Range <591 .. 591> used by EditEngine (!)

#define SID_FMSLOTS_START                               ( SID_SVX_START + 592 )
#define SID_FM_CONFIG                                   ( SID_SVX_START + 593 )
#define SID_FM_PUSHBUTTON                               ( SID_SVX_START + 594 )
@@ -1051,6 +1077,9 @@
#define SID_HLINKBAR_BOOKMARK                           ( SID_SVX_START + 852 )
#define SID_HLINKBAR_SEARCH                             ( SID_SVX_START + 853 )
#define SID_HLINKBAR_TARGET                             ( SID_SVX_START + 854 )

// CAUTION! Range <855 .. 855> used by EditEngine (!)

#define SID_PARAM_NUM_PRESET                            ( SID_SVX_START + 856 )
#define SID_PARAM_CUR_NUMBER                            ( SID_SVX_START + 857 )
#define SID_PARAM_CHILD_LEVELS                          ( SID_SVX_START + 858 )
@@ -1069,17 +1098,29 @@
#define SID_ATTR_GRAF_RESERVE3                          ( SID_SVX_START + 873 )
#define SID_ATTR_GRAF_RESERVE4                          ( SID_SVX_START + 874 )
#define SID_ATTR_GRAF_RESERVE5                          ( SID_SVX_START + 875 )

// CAUTION! Range <877 .. 877> used by EditEngine (!)

//#define SID_COMP_BIBLIOGRAPHY                           ( SID_SVX_START + 880 )   -> sfxsids.hrc
#define SID_ATTR_GRAF_KEEP_ZOOM                         ( SID_SVX_START + 882 )
#define SID_ATTR_GRAF_CROP                              ( SID_SVX_START + 883 )
#define SID_ATTR_GRAF_FRMSIZE                           ( SID_SVX_START + 884 )
#define SID_ATTR_GRAF_FRMSIZE_PERCENT                   ( SID_SVX_START + 885 )
#define SID_ATTR_GRAF_GRAPHIC                           ( SID_SVX_START + 886 )

// CAUTION! Range <887 .. 903> used by EditEngine (!)

#define SID_ASIAN_DLG                                   ( SID_SVX_START + 904 )
#define SID_DRAW_TEXT_VERTICAL                          SID_ATTR_CHAR_VERTICAL

// CAUTION! Range <905 .. 905> used by EditEngine (!)

#define SID_DRAW_CAPTION_VERTICAL                       ( SID_SVX_START + 906 )
#define SID_TEXTDIRECTION_LEFT_TO_RIGHT                 ( SID_SVX_START + 907 )
#define SID_TEXTDIRECTION_TOP_TO_BOTTOM                 ( SID_SVX_START + 908 )

// CAUTION! Range <910 .. 911> used by EditEngine (!)

#define SID_TRANSLITERATE_UPPER                         ( SID_SVX_START + 912 )
#define SID_TRANSLITERATE_LOWER                         ( SID_SVX_START + 913 )
#define SID_TRANSLITERATE_HALFWIDTH                     ( SID_SVX_START + 914 )
@@ -1087,10 +1128,15 @@
#define SID_TRANSLITERATE_HIRAGANA                      ( SID_SVX_START + 916 )
#define SID_TRANSLITERATE_KATAGANA                      ( SID_SVX_START + 917 )
#define SID_MN_SUB_TRANSLITERATE                        ( SID_SVX_START + 918 )

// CAUTION! Range <919 .. 920> used by EditEngine (!)

#define SID_LANGUAGE_OPTIONS                            ( SID_SVX_START + 921 )
#define SID_GETUNDOSTRINGS                              ( SID_SVX_START + 923 )
#define SID_GETREDOSTRINGS                              ( SID_SVX_START + 924 )

// CAUTION! Range <925 .. 925> used by EditEngine (!)

#define SID_INSERT_IMAGECONTROL                         ( SID_SVX_START + 926 )
#define SID_INSERT_PROGRESSBAR                          ( SID_SVX_START + 927 )
#define SID_INSERT_HFIXEDLINE                           ( SID_SVX_START + 928 )
@@ -1109,9 +1155,18 @@
#define SID_INSERT_PATTERNFIELD                         ( SID_SVX_START + 941 )
#define SID_INSERT_FILECONTROL                          ( SID_SVX_START + 942 )
#define SID_SHOW_PROPERTYBROWSER                        ( SID_SVX_START + 943 )

// CAUTION! Range <944 .. 945> used by EditEngine (!)

#define SID_ATTR_TABSTOP_VERTICAL                       ( SID_SVX_START + 946 )

// CAUTION! Range <947 .. 947> used by EditEngine (!)

#define SID_RULER_BORDERS_VERTICAL                      ( SID_SVX_START + 948 )
#define SID_ATTR_ALIGN_ASIANVERTICAL                    ( SID_SVX_START + 949 )

// CAUTION! Range <950 .. 951> used by EditEngine (!)

#define SID_RULER_TEXT_RIGHT_TO_LEFT                    ( SID_SVX_START + 952 )
#define SID_ATTR_HDFT_DYNAMIC_SPACING                   ( SID_SVX_START + 953 )
#define SID_ATTR_NUMBERFORMAT_ADD_AUTO                  ( SID_SVX_START + 954 )
@@ -1149,10 +1204,16 @@
#define SID_FONTWORK_KERN_CHARACTER_PAIRS               ( SID_SVX_START + 986 )
#define SID_DRAW_FONTWORK                               ( SID_SVX_START + 987 )
#define SID_DRAW_FONTWORK_VERTICAL                      ( SID_SVX_START + 988 )

// CAUTION! Range <989 .. 989> used by EditEngine (!)

#define SID_ATTR_BORDER_CONNECT                         ( SID_SVX_START + 990 )
#define SID_SW_FOLLOW_TEXT_FLOW                         ( SID_SVX_START + 991 ) /* #i18732# - slot-id for new option IsFollowingTextFlow' */
#define SID_RULER_ROWS                                  ( SID_SVX_START + 992 )
#define SID_RULER_ROWS_VERTICAL                         ( SID_SVX_START + 993 )

// CAUTION! Range <994 .. 998> used by EditEngine (!)

#define SID_ATTR_TRANSFORM_HORI_POSITION                ( SID_SVX_START + 999 )
#define SID_ATTR_TRANSFORM_VERT_POSITION                ( SID_SVX_START + 1000 )
#define SID_SHOW_ITEMBROWSER                            ( SID_SVX_START + 1001 )
@@ -1284,8 +1345,11 @@
#define FN_SVX_SET_NUMBER               (SID_SVX_START + 1117)
#define FN_SVX_SET_BULLET               (SID_SVX_START + 1118)

//UUUU
#define SID_OFFER_IMPORT                                ( SID_SVX_START + 1119)

// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
#define SID_SVX_FIRSTFREE                               (FN_SVX_SET_BULLET + 1)
#define SID_SVX_FIRSTFREE                               (SID_OFFER_IMPORT + 1)

// --------------------------------------------------------------------------
// Overflow check for slot IDs
diff --git a/svx/inc/svx/unoshprp.hxx b/svx/inc/svx/unoshprp.hxx
index 839e6e2..5ee9d52 100644
--- a/svx/inc/svx/unoshprp.hxx
+++ b/svx/inc/svx/unoshprp.hxx
@@ -254,17 +254,17 @@
    FILL_PROPERTIES_DEFAULTS \
    { MAP_CHAR_LEN(UNO_NAME_FILLBACKGROUND),    XATTR_FILLBACKGROUND    , &::getBooleanCppuType(),              0,   0}, \
    { MAP_CHAR_LEN(UNO_NAME_FILLBITMAP),        XATTR_FILLBITMAP        , &::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >*)0)  ,       0,     MID_BITMAP}, \
    { MAP_CHAR_LEN("FillBitmapName"),           XATTR_FILLBITMAP        , &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN("FillBitmapURL"),            XATTR_FILLBITMAP        , &::getCppuType((const ::rtl::OUString*)0), 0, MID_GRAFURL }, \
    { MAP_CHAR_LEN("FillGradientStepCount"),    XATTR_GRADIENTSTEPCOUNT , &::getCppuType((const sal_Int16*)0), 0, 0}, \
    { MAP_CHAR_LEN(UNO_NAME_FILLBITMAPNAME),            XATTR_FILLBITMAP        , &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLBITMAPURL),         XATTR_FILLBITMAP        , &::getCppuType((const ::rtl::OUString*)0), 0, MID_GRAFURL }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT , &::getCppuType((const sal_Int16*)0), 0, 0}, \
    { MAP_CHAR_LEN(UNO_NAME_FILLGRADIENT),      XATTR_FILLGRADIENT      , &::getCppuType((const ::com::sun::star::awt::Gradient*)0),        0,     MID_FILLGRADIENT}, \
    { MAP_CHAR_LEN("FillGradientName"),         XATTR_FILLGRADIENT      , &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLGRADIENTNAME),          XATTR_FILLGRADIENT      , &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLHATCH),         XATTR_FILLHATCH         , &::getCppuType((const ::com::sun::star::drawing::Hatch*)0),           0,     MID_FILLHATCH}, \
    { MAP_CHAR_LEN("FillHatchName"),            XATTR_FILLHATCH         , &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLHATCHNAME),         XATTR_FILLHATCH         , &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLSTYLE),         XATTR_FILLSTYLE         , &::getCppuType((const ::com::sun::star::drawing::FillStyle*)0) ,      0,     0}, \
    { MAP_CHAR_LEN(UNO_NAME_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, &::getCppuType((const sal_Int16*)0) ,           0,     0}, \
    { MAP_CHAR_LEN("FillTransparenceGradient"), XATTR_FILLFLOATTRANSPARENCE, &::getCppuType((const ::com::sun::star::awt::Gradient*)0),         0,     MID_FILLGRADIENT}, \
    { MAP_CHAR_LEN("FillTransparenceGradientName"), XATTR_FILLFLOATTRANSPARENCE, &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENT),  XATTR_FILLFLOATTRANSPARENCE, &::getCppuType((const ::com::sun::star::awt::Gradient*)0),         0,     MID_FILLGRADIENT}, \
    { MAP_CHAR_LEN(UNO_NAME_FILLTRANSPARENCEGRADIENTNAME),  XATTR_FILLFLOATTRANSPARENCE, &::getCppuType((const ::rtl::OUString*)0), 0, MID_NAME }, \
    { MAP_CHAR_LEN(UNO_NAME_FILLCOLOR_2),       XATTR_SECONDARYFILLCOLOR, &::getCppuType((const sal_Int32*)0),          0,     0},

#define EDGERADIUS_PROPERTIES \
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index f5502e7..f4e1f42 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -75,11 +75,9 @@ namespace sdr
                    rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(),
                    rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
                const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
                const basegfx::B2DHomMatrix aEmptyTransform;
                const drawinglayer::primitive2d::Primitive2DReference xReference(
                    drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aInnerPolgon),
                        aEmptyTransform,
                        aFill,
                        drawinglayer::attribute::FillGradientAttribute()));

diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 9b88e18..d83247e 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -175,7 +175,6 @@ namespace sdr
                            // if there is shadow, create the specialized shadow primitive
                            xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
                                aClippedShadow,
                                basegfx::B2DHomMatrix(),
                                aFill,
                                drawinglayer::attribute::FillGradientAttribute());
                        }
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index 923d9a6..caf1559 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -251,11 +251,9 @@ namespace sdr
                            rPage.GetLftBorder(), rPage.GetUppBorder(),
                            rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
                        const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
                        const basegfx::B2DHomMatrix aEmptyTransform;
                        const drawinglayer::primitive2d::Primitive2DReference xReference(
                            drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
                                basegfx::B2DPolyPolygon(aInnerPolgon),
                                aEmptyTransform,
                                aFill,
                                drawinglayer::attribute::FillGradientAttribute()));

diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index 421229b..a81b7a8 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -61,10 +61,12 @@ namespace drawinglayer
            }
            else
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aUnitOutline),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -87,17 +89,20 @@ namespace drawinglayer
            }
            else
            {
                basegfx::B2DPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolygonLinePrimitive(
                        aUnitOutline,
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getLine(),
                        attribute::SdrLineStartEndAttribute()));

                aTransformed = getTail();
                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolygonLinePrimitive(
                        getTail(),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getLine(),
                        getSdrLFSTAttribute().getLineStartEnd()));
            }
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index d7ceaa9..e97b457 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -58,7 +58,6 @@ namespace drawinglayer
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolygonLinePrimitive(
                        getUnitPolygon(),
                        basegfx::B2DHomMatrix(),
                        getSdrLSTAttribute().getLine(),
                        getSdrLSTAttribute().getLineStartEnd()));
            }
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 0ba9d8e..a44b677 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -61,32 +61,62 @@ namespace drawinglayer
    namespace primitive2d
    {
        Primitive2DReference createPolyPolygonFillPrimitive(
            const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
            const basegfx::B2DHomMatrix& rObjectTransform,
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const attribute::SdrFillAttribute& rFill,
            const attribute::FillGradientAttribute& rFillGradient)
        {
            // when we have no given definition range, use the range of the given geometry
            // also for definition (simplest case)
            const basegfx::B2DRange aRange(basegfx::tools::getRange(rPolyPolygon));

            return createPolyPolygonFillPrimitive(
                rPolyPolygon,
                aRange,
                rFill,
                rFillGradient);
        }

        Primitive2DReference createPolyPolygonFillPrimitive(
            const basegfx::B2DPolyPolygon& rPolyPolygon,
            const basegfx::B2DRange& rDefinitionRange,
            const attribute::SdrFillAttribute& rFill,
            const attribute::FillGradientAttribute& rFillGradient)
        {
            if(basegfx::fTools::moreOrEqual(rFill.getTransparence(), 1.0))
            {
                return Primitive2DReference();
            }

            // prepare fully scaled polygon
            basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
            aScaledPolyPolygon.transform(rObjectTransform);
            BasePrimitive2D* pNewFillPrimitive = 0;

            if(!rFill.getGradient().isDefault())
            {
                pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getGradient());
                pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(
                    rPolyPolygon,
                    rDefinitionRange,
                    rFill.getGradient());
            }
            else if(!rFill.getHatch().isDefault())
            {
                pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getHatch());
                pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(
                    rPolyPolygon,
                    rDefinitionRange,
                    rFill.getColor(),
                    rFill.getHatch());
            }
            else if(!rFill.getFillGraphic().isDefault())
            {
                const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
                pNewFillPrimitive = new PolyPolygonGraphicPrimitive2D(aScaledPolyPolygon, rFill.getFillGraphic().createFillGraphicAttribute(aRange));
                pNewFillPrimitive = new PolyPolygonGraphicPrimitive2D(
                    rPolyPolygon,
                    rDefinitionRange,
                    rFill.getFillGraphic().createFillGraphicAttribute(rDefinitionRange));
            }
            else
            {
                pNewFillPrimitive = new PolyPolygonColorPrimitive2D(aScaledPolyPolygon, rFill.getColor());
                pNewFillPrimitive = new PolyPolygonColorPrimitive2D(
                    rPolyPolygon,
                    rFill.getColor());
            }

            if(0.0 != rFill.getTransparence())
@@ -104,7 +134,7 @@ namespace drawinglayer

                // create FillGradientPrimitive2D for transparence and add to new sequence
                // fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
                const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
                const basegfx::B2DRange aRange(basegfx::tools::getRange(rPolyPolygon));
                const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, rFillGradient));
                const Primitive2DSequence aAlpha(&xRefB, 1L);

@@ -119,32 +149,27 @@ namespace drawinglayer
        }

        Primitive2DReference createPolygonLinePrimitive(
            const basegfx::B2DPolygon& rUnitPolygon,
            const basegfx::B2DHomMatrix& rObjectTransform,
            const basegfx::B2DPolygon& rPolygon,
            const attribute::SdrLineAttribute& rLine,
            const attribute::SdrLineStartEndAttribute& rStroke)
        {
            // prepare fully scaled polygon
            basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
            aScaledPolygon.transform(rObjectTransform);

            // create line and stroke attribute
            const attribute::LineAttribute aLineAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getCap());
            const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
            BasePrimitive2D* pNewLinePrimitive = 0L;

            if(!rUnitPolygon.isClosed() && !rStroke.isDefault())
            if(!rPolygon.isClosed() && !rStroke.isDefault())
            {
                attribute::LineStartEndAttribute aStart(rStroke.getStartWidth(), rStroke.getStartPolyPolygon(), rStroke.isStartCentered());
                attribute::LineStartEndAttribute aEnd(rStroke.getEndWidth(), rStroke.getEndPolyPolygon(), rStroke.isEndCentered());

                // create data
                pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd);
                pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(rPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd);
            }
            else
            {
                // create data
                pNewLinePrimitive = new PolygonStrokePrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute);
                pNewLinePrimitive = new PolygonStrokePrimitive2D(rPolygon, aLineAttribute, aStrokeAttribute);
            }

            if(0.0 != rLine.getTransparence())
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index a3e560d..10d1def 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -62,10 +62,12 @@ namespace drawinglayer
            // add fill
            if(!getSdrLFSTAttribute().getFill().isDefault())
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aUnitOutline),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -82,10 +84,12 @@ namespace drawinglayer
            }
            else
            {
                basegfx::B2DPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolygonLinePrimitive(
                        aUnitOutline,
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getLine(),
                        attribute::SdrLineStartEndAttribute()));
            }
@@ -178,10 +182,12 @@ namespace drawinglayer
            // add fill
            if(!getSdrLFSTAttribute().getFill().isDefault() && aUnitOutline.isClosed())
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aUnitOutline),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -198,10 +204,12 @@ namespace drawinglayer
            }
            else
            {
                basegfx::B2DPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolygonLinePrimitive(
                        aUnitOutline,
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getLine(),
                        getSdrLFSTAttribute().getLineStartEnd()));
            }
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 671160f..b346105 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -47,10 +47,12 @@ namespace drawinglayer
            // add fill, but only when graphic ist transparent
            if(!getSdrLFSTAttribute().getFill().isDefault() && isTransparent())
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aUnitOutline),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -87,18 +89,21 @@ namespace drawinglayer
                    const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
                    basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));

                    aExpandedUnitOutline.transform(getTransform());
                    appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                        createPolygonLinePrimitive(
                            aExpandedUnitOutline,
                            getTransform(),
                            getSdrLFSTAttribute().getLine(),
                            attribute::SdrLineStartEndAttribute()));
                }
                else
                {
                    basegfx::B2DPolygon aTransformed(aUnitOutline);

                    aTransformed.transform(getTransform());
                    appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                        createPolygonLinePrimitive(
                            aUnitOutline, getTransform(),
                            aTransformed,
                            getSdrLFSTAttribute().getLine(),
                            attribute::SdrLineStartEndAttribute()));
                }
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 2145159..1e19e92 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -57,12 +57,12 @@ namespace drawinglayer

            aPolygon.append(rStart);
            aPolygon.append(rEnd);
            aPolygon.transform(rObjectMatrix);

            if(rLineStartEnd.isDefault() || (!bLeftActive && !bRightActive))
            {
                return createPolygonLinePrimitive(
                    aPolygon,
                    rObjectMatrix,
                    rLineAttribute,
                    attribute::SdrLineStartEndAttribute());
            }
@@ -71,7 +71,6 @@ namespace drawinglayer
            {
                return createPolygonLinePrimitive(
                    aPolygon,
                    rObjectMatrix,
                    rLineAttribute,
                    rLineStartEnd);
            }
@@ -83,7 +82,10 @@ namespace drawinglayer
                bLeftActive ? rLineStartEnd.isStartActive() : false, bRightActive ? rLineStartEnd.isEndActive() : false,
                bLeftActive ? rLineStartEnd.isStartCentered() : false, bRightActive? rLineStartEnd.isEndCentered() : false);

            return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, aLineStartEnd);
            return createPolygonLinePrimitive(
                aPolygon,
                rLineAttribute,
                aLineStartEnd);
        }

        Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index 4f364f5..f666af9 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -89,10 +89,12 @@ namespace drawinglayer
            if(!bBehaveCompatibleToPaintVersion
                && !getSdrLFSTAttribute().getFill().isDefault())
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aUnitOutline),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -119,19 +121,21 @@ namespace drawinglayer
                    const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
                    basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));

                    aExpandedUnitOutline.transform(getTransform());
                    appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                        createPolygonLinePrimitive(
                            aExpandedUnitOutline,
                            getTransform(),
                            getSdrLFSTAttribute().getLine(),
                            attribute::SdrLineStartEndAttribute()));
                }
                else
                {
                    basegfx::B2DPolygon aTransformed(aUnitOutline);

                    aTransformed.transform(getTransform());
                    appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                        createPolygonLinePrimitive(
                            aUnitOutline,
                            getTransform(),
                            aTransformed,
                            getSdrLFSTAttribute().getLine(),
                            attribute::SdrLineStartEndAttribute()));
                }
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index 2786360..23261b8 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -49,10 +49,12 @@ namespace drawinglayer
            {
                // #i108255# no need to use correctOrientations here; target is
                // straight visualisation
                basegfx::B2DPolyPolygon aTransformed(getUnitPolyPolygon());

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        getUnitPolyPolygon(),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -73,9 +75,11 @@ namespace drawinglayer

                for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++)
                {
                    basegfx::B2DPolygon aTransformed(getUnitPolyPolygon().getB2DPolygon(a));

                    aTransformed.transform(getTransform());
                    aTemp[a] = createPolygonLinePrimitive(
                        getUnitPolyPolygon().getB2DPolygon(a),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getLine(),
                        getSdrLFSTAttribute().getLineStartEnd());
                }
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 96ee351..491ec09 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -53,10 +53,12 @@ namespace drawinglayer
            // add fill
            if(!getSdrLFSTAttribute().getFill().isDefault())
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        basegfx::B2DPolyPolygon(aUnitOutline),
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getFill(),
                        getSdrLFSTAttribute().getFillFloatTransGradient()));
            }
@@ -74,10 +76,12 @@ namespace drawinglayer
            // add line
            if(!getSdrLFSTAttribute().getLine().isDefault())
            {
                basegfx::B2DPolygon aTransformed(aUnitOutline);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolygonLinePrimitive(
                        aUnitOutline,
                        getTransform(),
                        aTransformed,
                        getSdrLFSTAttribute().getLine(),
                        attribute::SdrLineStartEndAttribute()));
            }
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 2e25489..78c3d63 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -958,7 +958,6 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla
                            drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(
                                aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive(
                                    aEdgePolygon,
                                    basegfx::B2DHomMatrix(),
                                    aLine,
                                    aLineStartEnd));
                        }
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index a3c6111..a6dff3f 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -98,10 +98,12 @@ namespace drawinglayer
            // add fill
            if(!getSdrFTAttribute().getFill().isDefault())
            {
                basegfx::B2DPolyPolygon aTransformed(aUnitPolyPolygon);

                aTransformed.transform(getTransform());
                appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
                    createPolyPolygonFillPrimitive(
                        aUnitPolyPolygon,
                        getTransform(),
                        aTransformed,
                        getSdrFTAttribute().getFill(),
                        getSdrFTAttribute().getFillFloatTransGradient()));
            }
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index ebda1cb..06394eb 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -281,6 +281,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
    sw/source/core/layout/anchoreddrawobject \
    sw/source/core/layout/anchoredobject \
    sw/source/core/layout/atrfrm \
    sw/source/core/layout/fillattributes \
    sw/source/core/layout/calcmove \
    sw/source/core/layout/colfrm \
    sw/source/core/layout/dbg_lay \
@@ -449,6 +450,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
    sw/source/core/unocore/unoport \
    sw/source/core/unocore/unoportenum \
    sw/source/core/unocore/unoprnms \
    sw/source/core/unocore/unobrushitemhelper \
    sw/source/core/unocore/unoredline \
    sw/source/core/unocore/unoredlines \
    sw/source/core/unocore/unorefmk \
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index c8e3b29..9aa4c4d 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1120,6 +1120,13 @@ public:
        const sal_Bool bDelRedlines = sal_True,
        const sal_Bool bCopyFlyAtFly = sal_False ) const;

    //UUUU Helper that checks for unique items for DrawingLayer items of type NameOrIndex
    // and evtl. corrects that items to ensure unique names for that type. This call may
    // modify/correct entries inside of the given SfxItemSet, and it will apply a name to
    // the items in question (what is essential to make the named slots associated with
    // these items work for the UNO API and thus e.g. for ODF im/export)
    void CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet);

    sal_Bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet );

    sal_Bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt,
diff --git a/sw/inc/fillattributes.hxx b/sw/inc/fillattributes.hxx
new file mode 100755
index 0000000..33ec929
--- /dev/null
+++ b/sw/inc/fillattributes.hxx
@@ -0,0 +1,72 @@
/**************************************************************
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 *************************************************************/

#ifndef FILLATTRIBUTES_HXX
#define FILLATTRIBUTES_HXX

#include <drawinglayer/attribute/fillgradientattribute.hxx>
#include <drawinglayer/attribute/sdrfillattribute.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <boost/shared_ptr.hpp>

//////////////////////////////////////////////////////////////////////////////

class FillAttributes
{
private:
    basegfx::B2DRange                                                   maLastPaintRange;
    basegfx::B2DRange                                                   maLastDefineRange;
    boost::shared_ptr< drawinglayer::attribute::SdrFillAttribute >      maFillAttribute;
    boost::shared_ptr< drawinglayer::attribute::FillGradientAttribute > maFillGradientAttribute;
    drawinglayer::primitive2d::Primitive2DSequence                      maPrimitives;

    void createPrimitive2DSequence(
        const basegfx::B2DRange& rPaintRange,
        const basegfx::B2DRange& rDefineRange);

protected:
public:
    FillAttributes();
    FillAttributes(const Color& rColor);
    FillAttributes(const SfxItemSet& rSet);
    ~FillAttributes();

    bool isUsed() const;
    bool hasSdrFillAttribute() const { return maFillAttribute.get(); }
    bool hasFillGradientAttribute() const { return maFillGradientAttribute.get(); }
    bool isTransparent() const;

    const drawinglayer::attribute::SdrFillAttribute& getFillAttribute() const;
    const drawinglayer::attribute::FillGradientAttribute& getFillGradientAttribute() const;
    const drawinglayer::primitive2d::Primitive2DSequence& getPrimitive2DSequence(
        const basegfx::B2DRange& rPaintRange,
        const basegfx::B2DRange& rDefineRange) const;
};

//////////////////////////////////////////////////////////////////////////////

typedef boost::shared_ptr< FillAttributes > FillAttributesPtr;

//////////////////////////////////////////////////////////////////////////////

#endif // FILLATTRIBUTES_HXX

// eof
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index eeb4ee0..c5542f1 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -29,6 +29,8 @@
#include <swatrset.hxx>     // fuer SfxItemPool/-Set, Attr forward decl.
#include <calbck.hxx>       // fuer SwModify
#include <hintids.hxx>
//UUUU
#include <fillattributes.hxx>

class IDocumentSettingAccess;
class IDocumentDrawModelAccess;
@@ -89,10 +91,11 @@ public:

    // Ist bInParents sal_False,
    // wird nur in diesem Format nach dem Attribut gesucht.
    inline const SfxPoolItem& GetFmtAttr( sal_uInt16 nWhich,
                                          sal_Bool bInParents = sal_True ) const;
    inline SfxItemState GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True,
                                    const SfxPoolItem **ppItem = 0 ) const;
    //UUUUinline
    const SfxPoolItem& GetFmtAttr( sal_uInt16 nWhich, sal_Bool bInParents = sal_True ) const;
    //UUUUinline
    SfxItemState GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True, const SfxPoolItem **ppItem = 0 ) const;

    // --> OD 2008-03-03 #refactorlists#
    // methods renamed and made virtual
    virtual sal_Bool SetFmtAttr( const SfxPoolItem& rAttr );
@@ -239,7 +242,10 @@ public:
    inline const SwFmtVertOrient      &GetVertOrient( sal_Bool = sal_True ) const;
    inline const SvxBoxItem               &GetBox( sal_Bool = sal_True ) const;
    inline const SvxFmtKeepItem         &GetKeep( sal_Bool = sal_True ) const;
    inline const SvxBrushItem           &GetBackground( sal_Bool = sal_True ) const;

    //UUUU
    const SvxBrushItem& GetBackground( sal_Bool = sal_True ) const;

    inline const SvxShadowItem            &GetShadow( sal_Bool = sal_True ) const;
    inline const SwFmtPageDesc            &GetPageDesc( sal_Bool = sal_True ) const;
    inline const SvxFmtBreakItem      &GetBreak( sal_Bool = sal_True ) const;
@@ -323,15 +329,18 @@ public:
        @return false, default implementation
    */
    virtual sal_Bool IsShadowTransparent() const;

    //UUUU
    virtual FillAttributesPtr getFillAttributes() const;
};

// --------------- inline Implementierungen ------------------------

inline const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich,
                                             sal_Bool bInParents ) const
{
    return aSet.Get( nWhich, bInParents );
}
//UUUUinline const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich,
//UUUU                                             sal_Bool bInParents ) const
//UUUU{
//UUUU  return aSet.Get( nWhich, bInParents );
//UUUU}

inline void SwFmt::SetName( const sal_Char* pNewName,
                             sal_Bool bBroadcast )
@@ -340,11 +349,11 @@ inline void SwFmt::SetName( const sal_Char* pNewName,
    SetName( aTmp, bBroadcast );
}

inline SfxItemState SwFmt::GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent,
                                        const SfxPoolItem **ppItem ) const
{
    return aSet.GetItemState( nWhich, bSrchInParent, ppItem );
}
//UUUUinline SfxItemState SwFmt::GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent,
//UUUU                                      const SfxPoolItem **ppItem ) const
//UUUU{
//UUUU  return aSet.GetItemState( nWhich, bSrchInParent, ppItem );
//UUUU}

#undef inline

diff --git a/sw/inc/frmatr.hxx b/sw/inc/frmatr.hxx
index 6843e81..f9facc7 100644
--- a/sw/inc/frmatr.hxx
+++ b/sw/inc/frmatr.hxx
@@ -81,8 +81,8 @@ inline const SvxBoxItem &SwFmt::GetBox(sal_Bool bInP) const
    { return aSet.GetBox(bInP); }
inline const SvxFmtKeepItem &SwFmt::GetKeep(sal_Bool bInP) const
    { return aSet.GetKeep(bInP); }
inline const SvxBrushItem &SwFmt::GetBackground(sal_Bool bInP) const
    { return aSet.GetBackground(bInP); }
//UUUUinline const SvxBrushItem &SwFmt::GetBackground(sal_Bool bInP) const
//UUUU  { return aSet.GetBackground(bInP); }
inline const SvxShadowItem &SwFmt::GetShadow(sal_Bool bInP) const
    { return aSet.GetShadow(bInP); }
inline const SvxFmtBreakItem &SwFmt::GetBreak(sal_Bool bInP) const
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 4230c97..b12c95e 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -47,23 +47,25 @@ class SW_DLLPUBLIC SwFrmFmt: public SwFmt
    ::com::sun::star::uno::WeakReference<
        ::com::sun::star::uno::XInterface> m_wXObject;

    //UUUU
    FillAttributesPtr           maFillAttributes;

protected:
    SwFrmFmt* pCaptionFmt;
    SwFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
                SwFrmFmt *pDrvdFrm, sal_uInt16 nFmtWhich = RES_FRMFMT,
                const sal_uInt16* pWhichRange = 0 )
          : SwFmt( rPool, pFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange),
                pDrvdFrm, nFmtWhich )
                ,pCaptionFmt( NULL )
    {}

    SwFrmFmt( SwAttrPool& rPool, const String &rFmtNm,
                SwFrmFmt *pDrvdFrm, sal_uInt16 nFmtWhich = RES_FRMFMT,
                const sal_uInt16* pWhichRange = 0 )
          : SwFmt( rPool, rFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange),
                pDrvdFrm, nFmtWhich )
                ,pCaptionFmt( NULL )
    {}
    SwFrmFmt(
        SwAttrPool& rPool,
        const sal_Char* pFmtNm,
        SwFrmFmt *pDrvdFrm,
        sal_uInt16 nFmtWhich = RES_FRMFMT,
        const sal_uInt16* pWhichRange = 0);

    SwFrmFmt(
        SwAttrPool& rPool,
        const String &rFmtNm,
        SwFrmFmt *pDrvdFrm,
        sal_uInt16 nFmtWhich = RES_FRMFMT,
        const sal_uInt16* pWhichRange = 0);

   virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );

@@ -144,6 +146,9 @@ public:

    DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt)
    void RegisterToFormat( SwFmt& rFmt );

    //UUUU
    virtual FillAttributesPtr getFillAttributes() const;
};

//Das FlyFrame-Format ------------------------------
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index f5fe084..dcecdc0d 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -281,13 +281,13 @@ RES_UNKNOWNATR_END
enum RES_FMT
{
RES_FMT_BEGIN = RES_UNKNOWNATR_END,
    RES_CHRFMT = RES_FMT_BEGIN,
    RES_FRMFMT,
    RES_FLYFRMFMT,
    RES_TXTFMTCOLL,
    RES_GRFFMTCOLL,
    RES_DRAWFRMFMT,
    RES_CONDTXTFMTCOLL,
    RES_CHRFMT = RES_FMT_BEGIN,                     // 144
    RES_FRMFMT,                                     // 145
    RES_FLYFRMFMT,                                  // 146
    RES_TXTFMTCOLL,                                 // 147
    RES_GRFFMTCOLL,                                 // 148
    RES_DRAWFRMFMT,                                 // 149
    RES_CONDTXTFMTCOLL,                             // 150
RES_FMT_END
};

@@ -295,7 +295,7 @@ RES_FMT_END
enum RES_MSG
{
RES_MSG_BEGIN = RES_FMT_END,
    RES_OBJECTDYING = RES_MSG_BEGIN,
    RES_OBJECTDYING = RES_MSG_BEGIN,                // 151
    RES_FMT_CHG,
    RES_ATTRSET_CHG,
    RES_FRM_SIZECHG,
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 9c07f5d..6147325 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -140,6 +140,12 @@ class SwTblBoxValue;

class SwAttrPool : public SfxItemPool
{
private:
    ///UUUU helpers to add/rmove DrawingLayer ItemPool, used in constructor
    /// and destructor; still isolated to evtl. allow other use later
    void createAndAddSecondaryPools();
    void removeAndDeleteSecondaryPools();

    friend void _InitCore();            // fuers anlegen/zerstoeren der
    friend void _FinitCore();           // Versionsmaps
    static sal_uInt16* pVersionMap1;
diff --git a/sw/inc/unobrushitemhelper.hxx b/sw/inc/unobrushitemhelper.hxx
new file mode 100644
index 0000000..03edfff
--- /dev/null
+++ b/sw/inc/unobrushitemhelper.hxx
@@ -0,0 +1,33 @@
/**************************************************************
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 *************************************************************/

#ifndef _UNOBRUSHITEMHELPER_HXX
#define _UNOBRUSHITEMHELPER_HXX

#include <editeng/brshitem.hxx>

//UUUU helper function definintions for UNO API fallbacks to replace SvxBrushItem
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxItemSet& rToSet);
SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents = sal_True);

#endif // _UNOBRUSHITEMHELPER_HXX

//eof
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index b9894c1..461b386 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -76,6 +76,11 @@ class SwXFrame : public cppu::WeakImplHelper6

    SwPaM*                          m_pCopySource;

    ///UUUU helper to check if fill style is set to color or bitmap
    /// and thus formally used SvxBrushItem parts need to be mapped
    /// for backwards compatibility
    bool needToMapFillItemsToSvxBrushItemTypes() const;

protected:
    com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData;
    com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >  mxStyleFamily;
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index a5f44f9..a7d6722 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -314,6 +314,14 @@
#define WID_TXTCOL_IS_AUTOMATIC         5
#define WID_TXTCOL_AUTO_DISTANCE        6

//UUUU This define would need the include of <svx/unoshprp.hxx>, but this ends
// in a mess; there *are* double used symbols which are used in a #define in
// editengine and as an enum in sw; these will then collide and lead to severe
// problems which will be hard to detect at all (e.g. look for UNO_NAME_CHAR_COLOR).
// More of these are likely, so better use a local define here, but at least the same
// as in svx/inc/unoshprp.hxx
#define OWN_ATTR_FILLBMP_MODE   (OWN_ATTR_VALUE_START+45)

/* -----------------04.07.98 11:41-------------------
 *
 * --------------------------------------------------*/
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index d92c7b5..ec38cf2 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -786,7 +786,35 @@ enum SwPropNameIds

/* 0743 */  UNO_NAME_INITIALS,

/* 0744 */  SW_PROPNAME_END
//UUUU names for FillAttributes from SVX
/* 0744 */ UNO_NAME_SW_FILLBMP_LOGICAL_SIZE,
/* 0745 */ UNO_NAME_SW_FILLBMP_OFFSET_X,
/* 0746 */ UNO_NAME_SW_FILLBMP_OFFSET_Y,
/* 0747 */ UNO_NAME_SW_FILLBMP_POSITION_OFFSET_X,
/* 0748 */ UNO_NAME_SW_FILLBMP_POSITION_OFFSET_Y,
/* 0749 */ UNO_NAME_SW_FILLBMP_RECTANGLE_POINT,
/* 0750 */ UNO_NAME_SW_FILLBMP_SIZE_X,
/* 0751 */ UNO_NAME_SW_FILLBMP_SIZE_Y,
/* 0752 */ UNO_NAME_SW_FILLBMP_STRETCH,
/* 0753 */ UNO_NAME_SW_FILLBMP_TILE,
/* 0754 */ UNO_NAME_SW_FILLBMP_MODE,
/* 0755 */ UNO_NAME_SW_FILLCOLOR,
/* 0756 */ UNO_NAME_SW_FILLBACKGROUND,
/* 0757 */ UNO_NAME_SW_FILLBITMAP,
/* 0758 */ UNO_NAME_SW_FILLBITMAPNAME,
/* 0759 */ UNO_NAME_SW_FILLBITMAPURL,
/* 0760 */ UNO_NAME_SW_FILLGRADIENTSTEPCOUNT,
/* 0761 */ UNO_NAME_SW_FILLGRADIENT,
/* 0762 */ UNO_NAME_SW_FILLGRADIENTNAME,
/* 0763 */ UNO_NAME_SW_FILLHATCH,
/* 0764 */ UNO_NAME_SW_FILLHATCHNAME,
/* 0765 */ UNO_NAME_SW_FILLSTYLE,
/* 0766 */ UNO_NAME_SW_FILL_TRANSPARENCE,
/* 0767 */ UNO_NAME_SW_FILLTRANSPARENCEGRADIENT,
/* 0768 */ UNO_NAME_SW_FILLTRANSPARENCEGRADIENTNAME,
/* 0769 */ UNO_NAME_SW_FILLCOLOR_2,

/* 0770 */  SW_PROPNAME_END
};


diff --git a/sw/sdi/_frmsh.sdi b/sw/sdi/_frmsh.sdi
index 8fea153e..3715e65 100644
--- a/sw/sdi/_frmsh.sdi
+++ b/sw/sdi/_frmsh.sdi
@@ -26,6 +26,89 @@ interface BaseTextFrame
    Automation = FALSE;
]
{
    SID_ATTR_FILL_STYLE
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_ATTR_FILL_COLOR
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_ATTR_FILL_GRADIENT
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_ATTR_FILL_HATCH
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_ATTR_FILL_BITMAP
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_ATTR_FILL_TRANSPARENCE
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_ATTR_FILL_FLOATTRANSPARENCE
    [
        Export = FALSE;
        ExecMethod = ExecDrawAttrArgsTextFrame;
        StateMethod = GetDrawAttrStateTextFrame;
        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
    ]

    SID_COLOR_TABLE
    [
        StateMethod = GetDrawAttrStateTextFrame;
    ]

    SID_GRADIENT_LIST
    [
        StateMethod = GetDrawAttrStateTextFrame;
    ]

    SID_HATCH_LIST
    [
        StateMethod = GetDrawAttrStateTextFrame;
    ]

    SID_BITMAP_LIST
    [
        StateMethod = GetDrawAttrStateTextFrame;
    ]

    SID_ATTRIBUTES_AREA
    [
        ExecMethod = ExecDrawDlgTextFrame;
        StateMethod = DisableStateTextFrame;
    ]


    FN_FRAME_TO_ANCHOR  // status()
    [
        /*OS: Datentypen unvertraeglich ?? */
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 54c27d6..382e1f8 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1207,8 +1207,12 @@ bool lcl_GetBackgroundColor( Color & rColor,
    const SvxBrushItem* pBackgrdBrush = 0;
    const Color* pSectionTOXColor = 0;
    SwRect aDummyRect;

    //UUUU
    FillAttributesPtr aFillAttributes;

    if ( pFrm &&
         pFrm->GetBackgroundBrush( pBackgrdBrush, pSectionTOXColor, aDummyRect, false ) )
         pFrm->GetBackgroundBrush( aFillAttributes, pBackgrdBrush, pSectionTOXColor, aDummyRect, false ) )
    {
        if ( pSectionTOXColor )
        {
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 5bbd0d1..ee822e7 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -19,12 +19,9 @@
 *
 *************************************************************/



// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"


#include <hintids.hxx>          // fuer RES_..
#include <frame.hxx>            // fuer AttrCache
#include <format.hxx>
@@ -33,6 +30,8 @@
#include <paratr.hxx>           // fuer SwParaFmt - SwHyphenBug
#include <swcache.hxx>
#include <fmtcolfunc.hxx>
//UUUU
#include <unobrushitemhelper.hxx>

TYPEINIT1( SwFmt, SwClient );   //rtti fuer SwFmt

@@ -431,6 +430,59 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom)
}


const SfxPoolItem& SwFmt::GetFmtAttr( sal_uInt16 nWhich, sal_Bool bInParents ) const
{
    if(RES_BACKGROUND == nWhich && RES_FLYFRMFMT == Which())
    {
        //UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
        OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
        static SvxBrushItem aSvxBrushItem(RES_BACKGROUND);

        // fill the local static SvxBrushItem from the current ItemSet so that
        // the fill attributes [XATTR_FILL_FIRST .. XATTR_FILL_LAST] are used
        // as good as possible to create a fallback representation and return that
        aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, bInParents);

        return aSvxBrushItem;
    }

    return aSet.Get( nWhich, bInParents );
}


SfxItemState SwFmt::GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent, const SfxPoolItem **ppItem ) const
{
    if(RES_BACKGROUND == nWhich && RES_FLYFRMFMT == Which())
    {
        //UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
        OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
        const FillAttributesPtr aFill = getFillAttributes();

        // check if the new fill attributes are used
        if(aFill.get() && aFill->isUsed())
        {
            // if yes, fill the local SvxBrushItem using the new fill attributes
            // as good as possible to have an instance for the pointer to point
            // to and return as state that it is set
            static SvxBrushItem aSvxBrushItem(RES_BACKGROUND);

            aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, bSrchInParent);
            *ppItem = &aSvxBrushItem;

            return SFX_ITEM_SET;
        }

        // if not, reset pointer and return SFX_ITEM_DEFAULT to signal that
        // the item is not set
        *ppItem = 0;

        return SFX_ITEM_DEFAULT;
    }

    return aSet.GetItemState( nWhich, bSrchInParent, ppItem );
}


sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
{
    if ( IsInCache() || IsInSwFntCache() )
@@ -439,9 +491,50 @@ sal_Bool SwFmt::SetFmtAttr(const SfxPoolItem& rAttr )
        CheckCaching( nWhich );
    }

    sal_Bool bRet = sal_False;

    //UUUU
    if(RES_BACKGROUND == rAttr.Which() && RES_FLYFRMFMT == Which())
    {
        //UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
        OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
        SfxItemSet aTempSet(*aSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0);
        const SvxBrushItem& rSource = static_cast< const SvxBrushItem& >(rAttr);

        // fill a local ItemSet with the attributes corresponding as good as possible
        // to the new fill properties [XATTR_FILL_FIRST .. XATTR_FILL_LAST] and set these
        // as ItemSet
        setSvxBrushItemAsFillAttributesToTargetSet(rSource, aTempSet);

        if(IsModifyLocked())
        {
            if( 0 != ( bRet = (0 != aSet.Put( aTempSet ))) )
            {
                aSet.SetModifyAtAttr( this );
            }
        }
        else
        {
            SwAttrSet aOld(*aSet.GetPool(), aSet.GetRanges()), aNew(*aSet.GetPool(), aSet.GetRanges());

            bRet = 0 != aSet.Put_BC(aTempSet, &aOld, &aNew);

            if(bRet)
            {
                aSet.SetModifyAtAttr(this);

                SwAttrSetChg aChgOld(aSet, aOld);
                SwAttrSetChg aChgNew(aSet, aNew);

                ModifyNotification(&aChgOld, &aChgNew);
            }
        }

        return bRet;
    }

    // wenn Modify gelockt ist, werden keine Modifies verschickt;
    // fuer FrmFmt's immer das Modify verschicken!
    sal_Bool bRet = sal_False;
    const sal_uInt16 nFmtWhich = Which();
    if( IsModifyLocked() || (!GetDepends() &&
        (RES_GRFFMTCOLL == nFmtWhich  ||
@@ -489,9 +582,55 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet )
    }
    SetInSwFntCache( sal_False );

    sal_Bool bRet = sal_False;

    //UUUU
    if(RES_FLYFRMFMT == Which())
    {
        const SfxPoolItem* pSource = 0;

        if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND, sal_False, &pSource))
        {
            //UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
            OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
            SfxItemSet aTempSet(rSet);

            // copy all items to be set anyways to a local ItemSet with is also prepared for the new
            // fill attribute ranges [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Add the attributes
            // corresponding as good as possible to the new fill properties and set the whole ItemSet
            const SvxBrushItem& rSource(static_cast< const SvxBrushItem& >(*pSource));
            setSvxBrushItemAsFillAttributesToTargetSet(rSource, aTempSet);

            if(IsModifyLocked())
            {
                if( 0 != ( bRet = (0 != aSet.Put( aTempSet ))) )
                {
                    aSet.SetModifyAtAttr( this );
                }
            }
            else
            {
                SwAttrSet aOld(*aSet.GetPool(), aSet.GetRanges()), aNew(*aSet.GetPool(), aSet.GetRanges());

                bRet = 0 != aSet.Put_BC(aTempSet, &aOld, &aNew);

                if(bRet)
                {
                    aSet.SetModifyAtAttr(this);

                    SwAttrSetChg aChgOld(aSet, aOld);
                    SwAttrSetChg aChgNew(aSet, aNew);

                    ModifyNotification(&aChgOld, &aChgNew);
                }
            }

            return bRet;
        }
    }

    // wenn Modify gelockt ist, werden keine Modifies verschickt;
    // fuer FrmFmt's immer das Modify verschicken!
    sal_Bool bRet = sal_False;
    const sal_uInt16 nFmtWhich = Which();
    if ( IsModifyLocked() ||
         ( !GetDepends() &&
@@ -686,3 +825,33 @@ IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); }
IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); }
IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return GetDoc(); }

//UUUU
const SvxBrushItem& SwFmt::GetBackground(sal_Bool bInP) const
{
    if(RES_FLYFRMFMT == Which())
    {
        //UUUU FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
        OSL_ENSURE(false, "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)");
        static SvxBrushItem aSvxBrushItem(RES_BACKGROUND);

        // fill the local static SvxBrushItem from the current ItemSet so that
        // the fill attributes [XATTR_FILL_FIRST .. XATTR_FILL_LAST] are used
        // as good as possible to create a fallback representation and return that
        aSvxBrushItem = getSvxBrushItemFromSourceSet(aSet, bInP);

        return aSvxBrushItem;
    }

    return aSet.GetBackground(bInP);
}

//UUUU
FillAttributesPtr SwFmt::getFillAttributes() const
{
    // FALLBACKBREAKHERE return empty pointer
    OSL_ENSURE(false, "getFillAttributes() call only valid for RES_FLYFRMFMT currently (!)");

    return FillAttributesPtr();
}

// eof
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 8b12206..2dd4a38 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -19,12 +19,9 @@
 *
 *************************************************************/



// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"


#include <hintids.hxx>
#include <svl/whiter.hxx>
#include <editeng/colritem.hxx>
@@ -44,10 +41,10 @@
#endif
#include <istyleaccess.hxx>
#include <numrule.hxx>
// --> OD 2008-03-19 #refactorlists#
#include <list.hxx>
// <--

#include <svx/svdpool.hxx>
#include <svx/sxenditm.hxx>
#include <svx/sdsxyitm.hxx>

SwAttrPool::SwAttrPool( SwDoc* pD )
    : SfxItemPool( String::CreateFromAscii(
@@ -63,10 +60,92 @@ SwAttrPool::SwAttrPool( SwDoc* pD )
    // OD 2004-01-21 #i18732# - apply new version map
    SetVersionMap( 5, 1,130, pVersionMap5 );
    SetVersionMap( 6, 1,136, pVersionMap6 );

    //UUUU create secondary pools immediately
    createAndAddSecondaryPools();
}

SwAttrPool::~SwAttrPool()
{
    //UUUU cleanup secondary pools first
    removeAndDeleteSecondaryPools();
}

//UUUU
void SwAttrPool::createAndAddSecondaryPools()
{
    const SfxItemPool* pCheckAlreadySet = GetSecondaryPool();

    if(pCheckAlreadySet)
    {
        OSL_ENSURE(false, "SwAttrPool already has a secondary pool (!)");
        return;
    }

    // create SfxItemPool and EditEngine pool and add these in a chain. These
    // belomg us and will be removed/destroyed in removeAndDeleteSecondaryPools() used from
    // the destructor
    SfxItemPool *pSdrPool = new SdrItemPool(this);

    // #75371# change DefaultItems for the SdrEdgeObj distance items
    // to TWIPS.
    if(pSdrPool)
    {
        // 1/100th mm in twips
        const long nDefEdgeDist = ((500 * 72) / 127);

        pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));

        // #i33700# // Set shadow distance defaults as PoolDefaultItems
        pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
        pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
    }

    SfxItemPool *pEEgPool = EditEngine::CreatePool(sal_False);

    pSdrPool->SetSecondaryPool(pEEgPool);

    if(!GetFrozenIdRanges())
    {
        FreezeIdRanges();
    }
    else
    {
        pSdrPool->FreezeIdRanges();
    }
}

//UUUU
void SwAttrPool::removeAndDeleteSecondaryPools()
{
    SfxItemPool *pSdrPool = GetSecondaryPool();

    if(!pSdrPool)
    {
        OSL_ENSURE(false, "SwAttrPool has no secondary pool, it's missing (!)");
        return;
    }

    SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();

    if(!pEEgPool)
    {
        OSL_ENSURE(false, "i don't accept additional pools");
        return;
    }

    // first delete the items, then break the linking
    pSdrPool->Delete();

    SetSecondaryPool(0);
    pSdrPool->SetSecondaryPool(0);

    // final cleanup of secondary pool(s)
    SfxItemPool::Free(pSdrPool);
    SfxItemPool::Free(pEEgPool);
}

SwAttrSet::SwAttrSet( SwAttrPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2 )
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 41ed3b1..066d0e8 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -157,6 +157,10 @@ sal_uInt16 __FAR_DATA aTxtFmtCollSetRange[] = {
    RES_CHRATR_BEGIN, RES_CHRATR_END-1,
    RES_PARATR_BEGIN, RES_PARATR_END-1,
    RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,

    //UUUU FillAttribute support
    XATTR_FILL_FIRST, XATTR_FILL_LAST,

    0
};

@@ -230,6 +234,10 @@ sal_uInt16 __FAR_DATA aTableBoxSetRange[] = {
sal_uInt16 __FAR_DATA aFrmFmtSetRange[] = {
    RES_FRMATR_BEGIN, RES_FRMATR_END-1,
    RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,

    //UUUU FillAttribute support
    XATTR_FILL_FIRST, XATTR_FILL_LAST,

    0
};

diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 99fd96e..bdd8ebb 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -599,33 +599,34 @@ void SwDoc::InitDrawModel()
    if ( pDrawModel )
        ReleaseDrawModel();

    //DrawPool und EditEnginePool anlegen, diese gehoeren uns und werden
    //dem Drawing nur mitgegeben. Im ReleaseDrawModel werden die Pools wieder
    //zerstoert.
    // 17.2.99: for Bug 73110 - for loading the drawing items. This must
    //                          be loaded without RefCounts!
    SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
    // #75371# change DefaultItems for the SdrEdgeObj distance items
    // to TWIPS.
    if(pSdrPool)
    {
        const long nDefEdgeDist = ((500 * 72) / 127); // 1/100th mm in twips
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
        pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));

        // #i33700#
        // Set shadow distance defaults as PoolDefaultItems. Details see bug.
        pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
        pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
    }
    SfxItemPool *pEEgPool = EditEngine::CreatePool( sal_False );
    pSdrPool->SetSecondaryPool( pEEgPool );
     if ( !GetAttrPool().GetFrozenIdRanges () )
        GetAttrPool().FreezeIdRanges();
    else
        pSdrPool->FreezeIdRanges();
//UUUU
//  //DrawPool und EditEnginePool anlegen, diese gehoeren uns und werden
//  //dem Drawing nur mitgegeben. Im ReleaseDrawModel werden die Pools wieder
//  //zerstoert.
//  // 17.2.99: for Bug 73110 - for loading the drawing items. This must
//  //                          be loaded without RefCounts!
//  SfxItemPool *pSdrPool = new SdrItemPool( &GetAttrPool() );
//  // #75371# change DefaultItems for the SdrEdgeObj distance items
//  // to TWIPS.
//  if(pSdrPool)
//  {
//      const long nDefEdgeDist = ((500 * 72) / 127); // 1/100th mm in twips
//      pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
//      pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
//      pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
//      pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));
//
//      // #i33700#
//      // Set shadow distance defaults as PoolDefaultItems. Details see bug.
//      pSdrPool->SetPoolDefaultItem(SdrShadowXDistItem((300 * 72) / 127));
//      pSdrPool->SetPoolDefaultItem(SdrShadowYDistItem((300 * 72) / 127));
//  }
//  SfxItemPool *pEEgPool = EditEngine::CreatePool( sal_False );
//  pSdrPool->SetSecondaryPool( pEEgPool );
//  if ( !GetAttrPool().GetFrozenIdRanges () )
//      GetAttrPool().FreezeIdRanges();
//  else
//      pSdrPool->FreezeIdRanges();

    // SJ: #95129# set FontHeight pool defaults without changing static SdrEngineDefaults
     GetAttrPool().SetPoolDefaultItem(SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ));
@@ -848,17 +849,18 @@ void SwDoc::ReleaseDrawModel()
        //!!Den code im sw3io fuer Einfuegen Dokument mitpflegen!!

        delete pDrawModel; pDrawModel = 0;
        SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();

        ASSERT( pSdrPool, "missing Pool" );
        SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
        ASSERT( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
        pSdrPool->Delete();                 //Erst die Items vernichten lassen,
                                            //dann erst die Verkettung loesen
        GetAttrPool().SetSecondaryPool( 0 );    //Der ist ein muss!
        pSdrPool->SetSecondaryPool( 0 );    //Der ist sicherer
        SfxItemPool::Free(pSdrPool);
        SfxItemPool::Free(pEEgPool);
//UUUU
//      SfxItemPool *pSdrPool = GetAttrPool().GetSecondaryPool();
//
//      ASSERT( pSdrPool, "missing Pool" );
//      SfxItemPool *pEEgPool = pSdrPool->GetSecondaryPool();
//      ASSERT( !pEEgPool->GetSecondaryPool(), "i don't accept additional pools");
//      pSdrPool->Delete();                 //Erst die Items vernichten lassen,
//                                          //dann erst die Verkettung loesen
//      GetAttrPool().SetSecondaryPool( 0 );    //Der ist ein muss!
//      pSdrPool->SetSecondaryPool( 0 );    //Der ist sicherer
//      SfxItemPool::Free(pSdrPool);
//      SfxItemPool::Free(pEEgPool);
    }
}

diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 895c114..301b2ea 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -64,6 +64,10 @@
#include <undoflystrattr.hxx>
#include <switerator.hxx>

//UUUU
#include <svx/xbtmpit.hxx>
#include <svx/xflftrit.hxx>

extern sal_uInt16 GetHtmlMode( const SwDocShell* );


@@ -428,6 +432,62 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc,
    return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
}

void SwDoc::CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet)
{
    SdrModel* pDrawModel = GetOrCreateDrawModel();
    SfxItemIter aIter(rSet);

    for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem; pItem = aIter.NextItem())
    {
        const SfxPoolItem* pResult = pItem;

        switch(pItem->Which())
        {
            case XATTR_FILLBITMAP:
            {
                pResult = static_cast< const XFillBitmapItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
            case XATTR_LINEDASH:
            {
                pResult = static_cast< const XLineDashItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
            case XATTR_LINESTART:
            {
                pResult = static_cast< const XLineStartItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
            case XATTR_LINEEND:
            {
                pResult = static_cast< const XLineEndItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
            case XATTR_FILLGRADIENT:
            {
                pResult = static_cast< const XFillGradientItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
            case XATTR_FILLFLOATTRANSPARENCE:
            {
                pResult = static_cast< const XFillFloatTransparenceItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
            case XATTR_FILLHATCH:
            {
                pResult = static_cast< const XFillHatchItem* >(pItem)->checkForUniqueItem(pDrawModel);
                break;
            }
        }

        if(pResult != pItem)
        {
            rSet.Put(*pResult);
            delete pResult;
        }
    }
}

sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
{
    if( !rSet.Count() )
@@ -441,6 +501,11 @@ sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
        pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
    }

    //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
    CheckForUniqueItemForLineFillNameOrIndex(rSet);

    bool const bRet =
        lcl_SetFlyFrmAttr(*this, &SwDoc::SetFlyFrmAnchor, rFlyFmt, rSet);

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 15f2fc7..232326d 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -234,9 +234,22 @@ void lcl_ClearArea( const SwFrm &rFrm,
    if ( aRegion.Count() )
    {
        const SvxBrushItem *pItem; const Color *pCol; SwRect aOrigRect;
        if ( rFrm.GetBackgroundBrush( pItem, pCol, aOrigRect, sal_False ) )
            for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
                ::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );

        //UUUU
        FillAttributesPtr aFillAttributes;

        if ( rFrm.GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigRect, sal_False ) )
        {
            const bool bDone(::DrawFillAttributes(aFillAttributes, aOrigRect, rPtArea, rOut));

            if(!bDone)
            {
                for( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
                {
                    ::DrawGraphic( pItem, &rOut, aOrigRect, aRegion[i] );
                }
            }
        }
        else
        {
            // OD 2004-04-23 #116347#
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 797ddcf..9a99bfd 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1311,6 +1311,9 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId )
                aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
                aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
            }

            //UUUU for styles of FlyFrames do not set the FillStyle to make it a derived attribute
            aSet.ClearItem(XATTR_FILLSTYLE);
        }
        break;
    case RES_POOLFRM_GRAPHIC:
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 887378a..477d8bf 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -58,6 +58,8 @@ class SwFmt;
class SwPrintData;
class SwSortedObjs;
class SwAnchoredObject;
//UUUU
class FillAttributes;

//Jeder FrmTyp findet sich hier in einem Bit wieder.
//Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
@@ -570,10 +572,12 @@ public:
    //Retouche, nicht im Bereich des uebergebenen Rect!
    void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;

    sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
                             const Color*& rpColor,
                             SwRect &rOrigRect,
                             sal_Bool bLowerMode ) const;
    sal_Bool GetBackgroundBrush(
        boost::shared_ptr< FillAttributes >& rFillAttributes,
        const SvxBrushItem*& rpBrush,
        const Color*& rpColor,
        SwRect &rOrigRect,
        sal_Bool bLowerMode ) const;

    inline void SetCompletePaint() const;
    inline void ResetCompletePaint() const;
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 1ad75c41..bbea276 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -63,9 +63,18 @@ struct SwFindRowSpanCacheObj;
//Painten des Hintergrunds. Mit Brush oder Graphic.
// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
//     consider background transparency, saved in the color of the brush item
void MA_FASTCALL DrawGraphic( const SvxBrushItem *, OutputDevice *,
      const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum = GRFNUM_NO,
      const sal_Bool bConsiderBackgroundTransparency = sal_False );
void MA_FASTCALL DrawGraphic(
    const SvxBrushItem *,
    OutputDevice *,
    const SwRect &rOrg,
    const SwRect &rOut,
    const sal_uInt8 nGrfNum = GRFNUM_NO,
    const sal_Bool bConsiderBackgroundTransparency = sal_False );
bool MA_FASTCALL DrawFillAttributes(
    const boost::shared_ptr< FillAttributes >& rFillAttributes,
    const SwRect& rOriginalLayoutRect,
    const SwRect& rPaintRect,
    OutputDevice& rOut);

// OD 24.01.2003 #106593# - method to align rectangle
// Created declaration here to avoid <extern> declarations
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 73cbe16..4ae107d 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -107,6 +107,10 @@
#include <switerator.hxx>
#include <pagedeschint.hxx>

//UUUU
#include <fillattributes.hxx>
#include <svx/xfillit0.hxx>

using namespace ::com::sun::star;
using ::rtl::OUString;

@@ -2470,13 +2474,73 @@ SfxPoolItem* SwHeaderAndFooterEatSpacingItem::Clone( SfxItemPool* ) const
    return new SwHeaderAndFooterEatSpacingItem( Which(), GetValue() );
}


//////////////////////////////////////////////////////////////////////////////
//  class SwFrmFmt
//  Implementierung teilweise inline im hxx

TYPEINIT1( SwFrmFmt, SwFmt );
IMPL_FIXEDMEMPOOL_NEWDEL_DLL( SwFrmFmt, 20, 20 )

SwFrmFmt::SwFrmFmt(
    SwAttrPool& rPool,
    const sal_Char* pFmtNm,
    SwFrmFmt *pDrvdFrm,
    sal_uInt16 nFmtWhich,
    const sal_uInt16* pWhichRange)
:   SwFmt(rPool, pFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange), pDrvdFrm, nFmtWhich),
    m_wXObject(),
    maFillAttributes(),
    pCaptionFmt(0)
{
    //UUUU
    if(RES_FLYFRMFMT == nFmtWhich)
    {
        // when its a SwFlyFrmFmt do not do this, this setting
        // will be derived from the parent style. In the future this
        // may be needed for more formats; all which use the
        // XATTR_FILL_FIRST, XATTR_FILL_LAST range as fill attributes
#ifdef DBG_UTIL
        bool bBla = true; // allow setting a breakpoint here in debug mode
#endif
    }
    else
    {
        // set FillStyle to none; this is necessary since the pool default is
        // to fill objects by color (blue8)
        SetFmtAttr(XFillStyleItem(XFILL_NONE));
    }
}

SwFrmFmt::SwFrmFmt(
    SwAttrPool& rPool,
    const String &rFmtNm,
    SwFrmFmt *pDrvdFrm,
    sal_uInt16 nFmtWhich,
    const sal_uInt16* pWhichRange)
:   SwFmt(rPool, rFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange), pDrvdFrm, nFmtWhich),
    m_wXObject(),
    maFillAttributes(),
    pCaptionFmt(0)
{
    //UUUU
    if(RES_FLYFRMFMT == nFmtWhich)
    {
        // when its a SwFlyFrmFmt do not do this, this setting
        // will be derived from the parent style. In the future this
        // may be needed for more formats; all which use the
        // XATTR_FILL_FIRST, XATTR_FILL_LAST range as fill attributes
#ifdef DBG_UTIL
        bool bBla = true; // allow setting a breakpoint here in debug mode
#endif
    }
    else
    {
        // set FillStyle to none; this is necessary since the pool default is
        // to fill objects by color (blue8)
        SetFmtAttr(XFillStyleItem(XFILL_NONE));
    }
}

void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
    SwFmtHeader *pH = 0;
@@ -2490,6 +2554,31 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
            RES_HEADER, sal_False, (const SfxPoolItem**)&pH );
        ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
            RES_FOOTER, sal_False, (const SfxPoolItem**)&pF );

        //UUUU reset fill information
        if(RES_FLYFRMFMT == Which() && maFillAttributes.get())
        {
            SfxItemIter aIter(*((SwAttrSetChg*)pNew)->GetChgSet());
            bool bReset(false);

            for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem && !bReset; pItem = aIter.NextItem())
            {
                bReset = !IsInvalidItem(pItem) && pItem->Which() >= XATTR_FILL_FIRST && pItem->Which() <= XATTR_FILL_LAST;
            }

            if(bReset)
            {
                maFillAttributes.reset();
            }
        }
    }
    else if(RES_FMT_CHG == nWhich) //UUUU
    {
        //UUUU reset fill information on format change (e.g. style changed)
        if(RES_FLYFRMFMT == Which() && maFillAttributes.get())
        {
            maFillAttributes.reset();
        }
    }
    else if( RES_HEADER == nWhich )
        pH = (SwFmtHeader*)pNew;
@@ -3029,7 +3118,11 @@ const String SwFlyFrmFmt::GetObjDescription() const
*/
sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
{
    sal_Bool bReturn = sal_False;
    //UUUU
    if(RES_FLYFRMFMT == Which() && getFillAttributes())
    {
        return getFillAttributes()->isTransparent();
    }

    /// NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT)
    ///     and there is no background graphic, it "inherites" the background
@@ -3038,7 +3131,7 @@ sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
         (GetBackground().GetColor() != COL_TRANSPARENT)
       )
    {
        bReturn = sal_True;
        return sal_True;
    }
    else
    {
@@ -3048,11 +3141,11 @@ sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
             (pTmpGrf->GetAttr().GetTransparency() != 0)
           )
        {
            bReturn = sal_True;
            return sal_True;
        }
    }

    return bReturn;
    return sal_False;
}

/** SwFlyFrmFmt::IsBackgroundBrushInherited - for #103898#
@@ -3069,15 +3162,18 @@ sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
*/
sal_Bool SwFlyFrmFmt::IsBackgroundBrushInherited() const
{
    sal_Bool bReturn = sal_False;

    if ( (GetBackground().GetColor() == COL_TRANSPARENT) &&
    //UUUU
    if(RES_FLYFRMFMT == Which() && getFillAttributes())
    {
        return !getFillAttributes()->isUsed();
    }
    else if ( (GetBackground().GetColor() == COL_TRANSPARENT) &&
         !(GetBackground().GetGraphicObject()) )
    {
        bReturn = sal_True;
        return sal_True;
    }

    return bReturn;
    return sal_False;
}

// --> OD 2006-02-28 #125892#
@@ -3310,3 +3406,25 @@ SwFrmFmt* SwFrmFmt::GetCaptionFmt() const
{
    return pCaptionFmt;
}

//UUUU
FillAttributesPtr SwFrmFmt::getFillAttributes() const
{
    if(RES_FLYFRMFMT == Which())
    {
        // create FillAttributes on demand
        if(!maFillAttributes.get())
        {
            const_cast< SwFrmFmt* >(this)->maFillAttributes.reset(new FillAttributes(GetAttrSet()));
        }
    }
    else
    {
        // FALLBACKBREAKHERE assert wrong usage
        OSL_ENSURE(false, "getFillAttributes() call only valid for RES_FLYFRMFMT currently (!)");
    }

    return maFillAttributes;
}

// eof
diff --git a/sw/source/core/layout/fillattributes.cxx b/sw/source/core/layout/fillattributes.cxx
new file mode 100755
index 0000000..33a2ba0
--- /dev/null
+++ b/sw/source/core/layout/fillattributes.cxx
@@ -0,0 +1,166 @@
/**************************************************************
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 *************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"

#include <fillattributes.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/attribute/fillhatchattribute.hxx>
#include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
#include <svx/xfillit0.hxx>

//////////////////////////////////////////////////////////////////////////////

void FillAttributes::createPrimitive2DSequence(
    const basegfx::B2DRange& rPaintRange,
    const basegfx::B2DRange& rDefineRange)
{
    // reset and remember new target range for object geometry
    maLastPaintRange = rPaintRange;
    maLastDefineRange = rDefineRange;

    if(isUsed())
    {
        maPrimitives.realloc(1);
        maPrimitives[0] = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
            basegfx::B2DPolyPolygon(
                basegfx::tools::createPolygonFromRect(
                    maLastPaintRange)),
                maLastDefineRange,
            maFillAttribute.get() ? *maFillAttribute.get() : drawinglayer::attribute::SdrFillAttribute(),
            maFillGradientAttribute.get() ? *maFillGradientAttribute.get() : drawinglayer::attribute::FillGradientAttribute());
    }
}

FillAttributes::FillAttributes()
:   maLastPaintRange(),
    maLastDefineRange(),
    maFillAttribute(),
    maFillGradientAttribute(),
    maPrimitives()
{
}

FillAttributes::FillAttributes(const Color& rColor)
:   maLastPaintRange(),
    maLastDefineRange(),
    maFillAttribute(),
    maFillGradientAttribute(),
    maPrimitives()
{
    maFillAttribute.reset(
        new drawinglayer::attribute::SdrFillAttribute(
            0.0,
            Color(rColor.GetRGBColor()).getBColor(),
            drawinglayer::attribute::FillGradientAttribute(),
            drawinglayer::attribute::FillHatchAttribute(),
            drawinglayer::attribute::SdrFillGraphicAttribute()));
}

FillAttributes::FillAttributes(const SfxItemSet& rSet)
:   maLastPaintRange(),
    maLastDefineRange(),
    maFillAttribute(
        new drawinglayer::attribute::SdrFillAttribute(
            drawinglayer::primitive2d::createNewSdrFillAttribute(rSet))),
    maFillGradientAttribute(
        new drawinglayer::attribute::FillGradientAttribute(
            drawinglayer::primitive2d::createNewTransparenceGradientAttribute(rSet))),
    maPrimitives()
{
}

FillAttributes::~FillAttributes()
{
}

bool FillAttributes::isUsed() const
{
    // only depends on fill, FillGradientAttribute alone defines no fill
    return maFillAttribute.get() && !maFillAttribute->isDefault();
}

bool FillAttributes::isTransparent() const
{
    if(hasSdrFillAttribute() && 0.0 != maFillAttribute->getTransparence())
    {
        return true;
    }

    if(hasFillGradientAttribute() && !maFillGradientAttribute->isDefault())
    {
        return true;
    }

    if(hasSdrFillAttribute())
    {
        const Graphic& rGraphic = getFillAttribute().getFillGraphic().getFillGraphic();

        return rGraphic.IsSupportedGraphic() && rGraphic.IsTransparent();
    }

    return false;
}

const drawinglayer::attribute::SdrFillAttribute& FillAttributes::getFillAttribute() const
{
    if(!maFillAttribute.get())
    {
        const_cast< FillAttributes* >(this)->maFillAttribute.reset(new drawinglayer::attribute::SdrFillAttribute());
    }

    return *maFillAttribute.get();
}

const drawinglayer::attribute::FillGradientAttribute& FillAttributes::getFillGradientAttribute() const
{
    if(!maFillGradientAttribute.get())
    {
        const_cast< FillAttributes* >(this)->maFillGradientAttribute.reset(new drawinglayer::attribute::FillGradientAttribute());
    }

    return *maFillGradientAttribute.get();
}

const drawinglayer::primitive2d::Primitive2DSequence& FillAttributes::getPrimitive2DSequence(
    const basegfx::B2DRange& rPaintRange,
    const basegfx::B2DRange& rDefineRange) const
{
    if(maPrimitives.getLength() && (maLastPaintRange != rPaintRange || maLastDefineRange != rDefineRange))
    {
        const_cast< FillAttributes* >(this)->maPrimitives.realloc(0);
    }

    if(!maPrimitives.getLength())
    {
        const_cast< FillAttributes* >(this)->createPrimitive2DSequence(rPaintRange, rDefineRange);
    }

    return maPrimitives;
}

//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3ff19d7..5971837 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -95,6 +95,9 @@
#include <tools/color.hxx>
#include <vcl/svapp.hxx>

//UUUU
#include <drawinglayer/processor2d/processor2dtools.hxx>

#define COL_NOTES_SIDEPANE                  RGB_COLORDATA(230,230,230)
#define COL_NOTES_SIDEPANE_BORDER           RGB_COLORDATA(200,200,200)
#define COL_NOTES_SIDEPANE_SCROLLAREA       RGB_COLORDATA(230,230,220)
@@ -1300,175 +1303,175 @@ void MA_FASTCALL lcl_ExtendLeftAndRight( SwRect&                _rRect,
}


void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
                           const SwRect &rRect, SwRegionRects &rRegion )
{
    const SwSortedObjs& rObjs = *pPage->GetSortedObjs();
    const SwFlyFrm* pSelfFly = pFrm->IsInFly() ? pFrm->FindFlyFrm() : pRetoucheFly2;
    if ( !pRetoucheFly )
        pRetoucheFly = pRetoucheFly2;

    for ( sal_uInt16 j = 0; (j < rObjs.Count()) && rRegion.Count(); ++j )
    {
        const SwAnchoredObject* pAnchoredObj = rObjs[j];
        const SdrObject* pSdrObj = pAnchoredObj->GetDrawObj();

        // OD 2004-01-15 #110582# - do not consider invisible objects
        if ( !pPage->GetFmt()->GetDoc()->IsVisibleLayerId( pSdrObj->GetLayer() ) )
            continue;

        if ( !pAnchoredObj->ISA(SwFlyFrm) )
            continue;

        const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);

        if ( pSelfFly == pFly || pRetoucheFly == pFly || !rRect.IsOver( pFly->Frm() ) )
            continue;

        if ( !pFly->GetFmt()->GetPrint().GetValue() &&
                (OUTDEV_PRINTER == pGlobalShell->GetOut()->GetOutDevType() ||
                pGlobalShell->IsPreView()))
            continue;

        const sal_Bool bLowerOfSelf = pSelfFly && pFly->IsLowerOf( pSelfFly ) ?
                                            sal_True : sal_False;

        //Bei zeichengebundenem Fly nur diejenigen betrachten, in denen er
        //nicht selbst verankert ist.
        //#33429# Warum nur bei zeichengebundenen? Es macht doch nie Sinn
        //Rahmen abzuziehen in denen er selbst verankert ist oder?
        if ( pSelfFly && pSelfFly->IsLowerOf( pFly ) )
            continue;

        //#57194# Und warum gilt das nicht analog fuer den RetoucheFly?
        if ( pRetoucheFly && pRetoucheFly->IsLowerOf( pFly ) )
            continue;


#ifdef DBG_UTIL
        //Flys, die innerhalb des eigenen verankert sind, muessen eine
        //groessere OrdNum haben oder Zeichengebunden sein.
        if ( pSelfFly && bLowerOfSelf )
        {
            ASSERT( pFly->IsFlyInCntFrm() ||
                    pSdrObj->GetOrdNumDirect() > pSelfFly->GetVirtDrawObj()->GetOrdNumDirect(),
                    "Fly with wrong z-Order" );
        }
#endif

        sal_Bool bStopOnHell = sal_True;
        if ( pSelfFly )
        {
            const SdrObject *pTmp = pSelfFly->GetVirtDrawObj();
            if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
            {
                if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
                    //Im gleichen Layer werden nur obenliegende beachtet.
                    continue;
            }
            else
            {
                if ( !bLowerOfSelf && !pFly->GetFmt()->GetOpaque().GetValue() )
                    //Aus anderem Layer interessieren uns nur nicht transparente
                    //oder innenliegende
                    continue;
                bStopOnHell = sal_False;
            }
        }
        if ( pRetoucheFly )
        {
            const SdrObject *pTmp = pRetoucheFly->GetVirtDrawObj();
            if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
            {
                if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
                    //Im gleichen Layer werden nur obenliegende beachtet.
                    continue;
            }
            else
            {
                if ( !pFly->IsLowerOf( pRetoucheFly ) && !pFly->GetFmt()->GetOpaque().GetValue() )
                    //Aus anderem Layer interessieren uns nur nicht transparente
                    //oder innenliegende
                    continue;
                bStopOnHell = sal_False;
            }
        }

        //Wenn der Inhalt des Fly Transparent ist, wird er nicht abgezogen, es sei denn
        //er steht im Hell-Layer (#31941#)
        const IDocumentDrawModelAccess* pIDDMA = pFly->GetFmt()->getIDocumentDrawModelAccess();
        sal_Bool bHell = pSdrObj->GetLayer() == pIDDMA->GetHellId();
        if ( (bStopOnHell && bHell) ||
             /// OD 05.08.2002 - change internal order of condition
             ///    first check "!bHell", then "..->Lower()" and "..->IsNoTxtFrm()"
             ///    have not to be performed, if frame is in "Hell"
             ( !bHell && pFly->Lower() && pFly->Lower()->IsNoTxtFrm() &&
               ( ((SwNoTxtFrm*)pFly->Lower())->IsTransparent() ||
                 ((SwNoTxtFrm*)pFly->Lower())->HasAnimation() ||
                 pFly->GetFmt()->GetSurround().IsContour()
               )
             )
           )
            continue;

        // OD 08.10.2002 #103898#
        // Own if-statements for transparent background/shadow of fly frames
        // (#99657#) in order to handle special conditions.
        if ( pFly->IsBackgroundTransparent() )
        {
            // Background <pFly> is transparent drawn. Thus normally, its region
            // have not to be substracted from given region.
            // But, if method is called for a fly frame and
            // <pFly> is a direct lower of this fly frame and
            // <pFly> inherites its transparent background brush from its parent,
            // then <pFly> frame area have to be subtracted from given region.
            // NOTE: Because in Status Quo transparent backgrounds can only be
            //     assigned to fly frames, the handle of this special case
            //     avoids drawing of transparent areas more than once, if
            //     a fly frame inherites a transparent background from its
            //     parent fly frame.
            if ( pFrm->IsFlyFrm() &&
                 (pFly->GetAnchorFrm()->FindFlyFrm() == pFrm) &&
                 static_cast<const SwFlyFrmFmt*>(pFly->GetFmt())->IsBackgroundBrushInherited()
               )
            {
                SwRect aRect;
                SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly );
                const SwBorderAttrs &rAttrs = *aAccess.Get();
                ::lcl_CalcBorderRect( aRect, pFly, rAttrs, sal_True );
                rRegion -= aRect;
                continue;
            }
            else
            {
                continue;
            }
        }
        if ( pFly->IsShadowTransparent() )
        {
            continue;
        }

        if ( bHell && pFly->GetAnchorFrm()->IsInFly() )
        {
            //Damit die Umrandung nicht vom Hintergrund des anderen Flys
            //zerlegt wird.
            SwRect aRect;
            SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly );
            const SwBorderAttrs &rAttrs = *aAccess.Get();
            ::lcl_CalcBorderRect( aRect, pFly, rAttrs, sal_True );
            rRegion -= aRect;
        }
        else
        {
            SwRect aRect( pFly->Prt() );
            aRect += pFly->Frm().Pos();
            rRegion -= aRect;
        }
    }
    if ( pRetoucheFly == pRetoucheFly2 )
        pRetoucheFly = 0;
}
//void MA_FASTCALL lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
//                         const SwRect &rRect, SwRegionRects &rRegion )
//{
//    const SwSortedObjs& rObjs = *pPage->GetSortedObjs();
//    const SwFlyFrm* pSelfFly = pFrm->IsInFly() ? pFrm->FindFlyFrm() : pRetoucheFly2;
//  if ( !pRetoucheFly )
//      pRetoucheFly = pRetoucheFly2;
//
//  for ( sal_uInt16 j = 0; (j < rObjs.Count()) && rRegion.Count(); ++j )
//  {
//        const SwAnchoredObject* pAnchoredObj = rObjs[j];
//        const SdrObject* pSdrObj = pAnchoredObj->GetDrawObj();
//
//        // OD 2004-01-15 #110582# - do not consider invisible objects
//        if ( !pPage->GetFmt()->GetDoc()->IsVisibleLayerId( pSdrObj->GetLayer() ) )
//            continue;
//
//        if ( !pAnchoredObj->ISA(SwFlyFrm) )
//            continue;
//
//        const SwFlyFrm *pFly = static_cast<const SwFlyFrm*>(pAnchoredObj);
//
//      if ( pSelfFly == pFly || pRetoucheFly == pFly || !rRect.IsOver( pFly->Frm() ) )
//          continue;
//
//      if ( !pFly->GetFmt()->GetPrint().GetValue() &&
//              (OUTDEV_PRINTER == pGlobalShell->GetOut()->GetOutDevType() ||
//              pGlobalShell->IsPreView()))
//          continue;
//
//        const sal_Bool bLowerOfSelf = pSelfFly && pFly->IsLowerOf( pSelfFly ) ?
//                                          sal_True : sal_False;
//
//      //Bei zeichengebundenem Fly nur diejenigen betrachten, in denen er
//      //nicht selbst verankert ist.
//      //#33429# Warum nur bei zeichengebundenen? Es macht doch nie Sinn
//      //Rahmen abzuziehen in denen er selbst verankert ist oder?
//        if ( pSelfFly && pSelfFly->IsLowerOf( pFly ) )
//          continue;
//
//      //#57194# Und warum gilt das nicht analog fuer den RetoucheFly?
//        if ( pRetoucheFly && pRetoucheFly->IsLowerOf( pFly ) )
//          continue;
//
//
//#ifdef DBG_UTIL
//      //Flys, die innerhalb des eigenen verankert sind, muessen eine
//      //groessere OrdNum haben oder Zeichengebunden sein.
//      if ( pSelfFly && bLowerOfSelf )
//      {
//          ASSERT( pFly->IsFlyInCntFrm() ||
//                    pSdrObj->GetOrdNumDirect() > pSelfFly->GetVirtDrawObj()->GetOrdNumDirect(),
//                  "Fly with wrong z-Order" );
//      }
//#endif
//
//      sal_Bool bStopOnHell = sal_True;
//      if ( pSelfFly )
//      {
//          const SdrObject *pTmp = pSelfFly->GetVirtDrawObj();
//            if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
//          {
//                if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
//                  //Im gleichen Layer werden nur obenliegende beachtet.
//                  continue;
//          }
//          else
//          {
//              if ( !bLowerOfSelf && !pFly->GetFmt()->GetOpaque().GetValue() )
//                  //Aus anderem Layer interessieren uns nur nicht transparente
//                  //oder innenliegende
//                  continue;
//              bStopOnHell = sal_False;
//          }
//      }
//      if ( pRetoucheFly )
//      {
//          const SdrObject *pTmp = pRetoucheFly->GetVirtDrawObj();
//            if ( pSdrObj->GetLayer() == pTmp->GetLayer() )
//          {
//                if ( pSdrObj->GetOrdNumDirect() < pTmp->GetOrdNumDirect() )
//                  //Im gleichen Layer werden nur obenliegende beachtet.
//                  continue;
//          }
//          else
//          {
//                if ( !pFly->IsLowerOf( pRetoucheFly ) && !pFly->GetFmt()->GetOpaque().GetValue() )
//                  //Aus anderem Layer interessieren uns nur nicht transparente
//                  //oder innenliegende
//                  continue;
//              bStopOnHell = sal_False;
//          }
//      }
//
//      //Wenn der Inhalt des Fly Transparent ist, wird er nicht abgezogen, es sei denn
//      //er steht im Hell-Layer (#31941#)
//        const IDocumentDrawModelAccess* pIDDMA = pFly->GetFmt()->getIDocumentDrawModelAccess();
//        sal_Bool bHell = pSdrObj->GetLayer() == pIDDMA->GetHellId();
//      if ( (bStopOnHell && bHell) ||
//             /// OD 05.08.2002 - change internal order of condition
//             ///    first check "!bHell", then "..->Lower()" and "..->IsNoTxtFrm()"
//             ///    have not to be performed, if frame is in "Hell"
//             ( !bHell && pFly->Lower() && pFly->Lower()->IsNoTxtFrm() &&
//               ( ((SwNoTxtFrm*)pFly->Lower())->IsTransparent() ||
//                 ((SwNoTxtFrm*)pFly->Lower())->HasAnimation() ||
//                 pFly->GetFmt()->GetSurround().IsContour()
//               )
//             )
//           )
//          continue;
//
//        // OD 08.10.2002 #103898#
//        // Own if-statements for transparent background/shadow of fly frames
//        // (#99657#) in order to handle special conditions.
//        if ( pFly->IsBackgroundTransparent() )
//        {
//            // Background <pFly> is transparent drawn. Thus normally, its region
//            // have not to be substracted from given region.
//            // But, if method is called for a fly frame and
//            // <pFly> is a direct lower of this fly frame and
//            // <pFly> inherites its transparent background brush from its parent,
//            // then <pFly> frame area have to be subtracted from given region.
//            // NOTE: Because in Status Quo transparent backgrounds can only be
//            //     assigned to fly frames, the handle of this special case
//            //     avoids drawing of transparent areas more than once, if
//            //     a fly frame inherites a transparent background from its
//            //     parent fly frame.
//            if ( pFrm->IsFlyFrm() &&
//                 (pFly->GetAnchorFrm()->FindFlyFrm() == pFrm) &&
//                 static_cast<const SwFlyFrmFmt*>(pFly->GetFmt())->IsBackgroundBrushInherited()
//               )
//            {
//                SwRect aRect;
//                SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly );
//                const SwBorderAttrs &rAttrs = *aAccess.Get();
//                ::lcl_CalcBorderRect( aRect, pFly, rAttrs, sal_True );
//                rRegion -= aRect;
//                continue;
//            }
//            else
//            {
//                continue;
//            }
//        }
//        if ( pFly->IsShadowTransparent() )
//        {
//            continue;
//        }
//
//        if ( bHell && pFly->GetAnchorFrm()->IsInFly() )
//      {
//          //Damit die Umrandung nicht vom Hintergrund des anderen Flys
//          //zerlegt wird.
//          SwRect aRect;
//          SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFly );
//          const SwBorderAttrs &rAttrs = *aAccess.Get();
//          ::lcl_CalcBorderRect( aRect, pFly, rAttrs, sal_True );
//          rRegion -= aRect;
//      }
//      else
//      {
//          SwRect aRect( pFly->Prt() );
//          aRect += pFly->Frm().Pos();
//          rRegion -= aRect;
//      }
//  }
//  if ( pRetoucheFly == pRetoucheFly2 )
//      pRetoucheFly = 0;
//}

// --> OD 2008-05-16 #i84659# - no longer needed
//inline sal_Bool IsShortCut( const SwRect &rRect, const SwRect &rFrmRect )
@@ -1633,12 +1636,75 @@ void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
        pOut->Pop();
} // end of method <lcl_DrawGraphic>

void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
                              OutputDevice *pOutDev,
                              const SwRect &rOrg,
                              const SwRect &rOut,
                              const sal_uInt8 nGrfNum,
                              const sal_Bool bConsiderBackgroundTransparency )
bool MA_FASTCALL DrawFillAttributes(
    const FillAttributesPtr& rFillAttributes,
    const SwRect& rOriginalLayoutRect,
    const SwRect& rPaintRect,
    OutputDevice& rOut)
{
    static bool bUseNew(true);
    static bool bReturnWhenNew(true);

    if(bUseNew && rFillAttributes.get() && rFillAttributes->isUsed())
    {
        const basegfx::B2DRange aPaintRange(
            rPaintRect.Left(),
            rPaintRect.Top(),
            rPaintRect.Right(),
            rPaintRect.Bottom());

        if(!aPaintRange.isEmpty() &&
            !basegfx::fTools::equalZero(aPaintRange.getWidth()) &&
            !basegfx::fTools::equalZero(aPaintRange.getHeight()))
        {
            const basegfx::B2DRange aDefineRange(
                rOriginalLayoutRect.Left(),
                rOriginalLayoutRect.Top(),
                rOriginalLayoutRect.Right(),
                rOriginalLayoutRect.Bottom());

            const drawinglayer::primitive2d::Primitive2DSequence& rSequence = rFillAttributes->getPrimitive2DSequence(
                aPaintRange,
                aDefineRange);

            if(rSequence.getLength())
            {
                const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
                    basegfx::B2DHomMatrix(),
                    rOut.GetViewTransformation(),
                    aPaintRange,
                    0,
                    0.0,
                    uno::Sequence< beans::PropertyValue >());
                drawinglayer::processor2d::BaseProcessor2D* pProcessor = drawinglayer::processor2d::createProcessor2DFromOutputDevice(
                    rOut,
                    aViewInformation2D);

                if(pProcessor)
                {
                    pProcessor->process(rSequence);

                    delete pProcessor;

                    if(bReturnWhenNew)
                    {
                        return true;
                    }
                }
            }
        }
    }

    return false;
}

void MA_FASTCALL DrawGraphic(
    const SvxBrushItem *pBrush,
    OutputDevice *pOutDev,
    const SwRect &rOrg,
    const SwRect &rOut,
    const sal_uInt8 nGrfNum,
    const sal_Bool bConsiderBackgroundTransparency )
    /// OD 05.08.2002 #99657# - add 6th parameter to indicate that method should
    ///   consider background transparency, saved in the color of the brush item
{
@@ -3344,7 +3410,11 @@ sal_Bool SwFlyFrm::IsBackgroundTransparent() const
        const SvxBrushItem* pBackgrdBrush = 0;
        const Color* pSectionTOXColor = 0;
        SwRect aDummyRect;
        if ( GetBackgroundBrush( pBackgrdBrush, pSectionTOXColor, aDummyRect, false) )

        //UUUU
        FillAttributesPtr aFillAttributes;

        if ( GetBackgroundBrush( aFillAttributes, pBackgrdBrush, pSectionTOXColor, aDummyRect, false) )
        {
            if ( pSectionTOXColor &&
                 (pSectionTOXColor->GetTransparency() != 0) &&
@@ -3352,6 +3422,10 @@ sal_Bool SwFlyFrm::IsBackgroundTransparent() const
            {
                bBackgroundTransparent = sal_True;
            }
            else if(aFillAttributes.get() && aFillAttributes->isUsed()) //UUUU
            {
                bBackgroundTransparent = aFillAttributes->isTransparent();
            }
            else if ( pBackgrdBrush )
            {
                if ( (pBackgrdBrush->GetColor().GetTransparency() != 0) &&
@@ -3587,13 +3661,28 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
        if ( !bPaintCompleteBack &&
             ( bIsGraphicTransparent|| bContour ) )
        {
            const SvxBrushItem &rBack = GetFmt()->GetBackground();
            // OD 07.08.2002 #99657# #GetTransChg#
            //     to determine, if background has to be painted, by checking, if
            //     background color is not COL_TRANSPARENT ("no fill"/"auto fill")
            //     or a background graphic exists.
            bPaintCompleteBack = !(rBack.GetColor() == COL_TRANSPARENT) ||
                                 rBack.GetGraphicPos() != GPOS_NONE;
            const SwFrmFmt* pSwFrmFmt = dynamic_cast< const SwFrmFmt* >(GetFmt());

            if(pSwFrmFmt && RES_FLYFRMFMT == pSwFrmFmt->Which())
            {
                //UUUU check for transparency
                const FillAttributesPtr aFillAttributes(pSwFrmFmt->getFillAttributes());

                if(aFillAttributes.get())
                {
                    bPaintCompleteBack = aFillAttributes->isTransparent();
                }
            }
            else
            {
                const SvxBrushItem &rBack = GetFmt()->GetBackground();
                // OD 07.08.2002 #99657# #GetTransChg#
                //     to determine, if background has to be painted, by checking, if
                //     background color is not COL_TRANSPARENT ("no fill"/"auto fill")
                //     or a background graphic exists.
                bPaintCompleteBack = !(rBack.GetColor() == COL_TRANSPARENT) ||
                                     rBack.GetGraphicPos() != GPOS_NONE;
            }
        }
        // paint of margin needed.
        const bool bPaintMarginOnly( !bPaintCompleteBack &&
@@ -4052,14 +4141,14 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
        pColor = &SwViewOption::GetFontColor();
    }

    if ( pPage->GetSortedObjs() )
    {
        SwRegionRects aRegion( aOut, 4, 1 );
        ::lcl_SubtractFlys( this, pPage, aOut, aRegion );
        for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
            pLines->AddLineRect( aRegion[i], pColor, pTab, nSubCol );
    }
    else
    //if ( pPage->GetSortedObjs() )
    //{
    //  SwRegionRects aRegion( aOut, 4, 1 );
    //  ::lcl_SubtractFlys( this, pPage, aOut, aRegion );
    //  for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
    //        pLines->AddLineRect( aRegion[i], pColor, pTab, nSubCol );
    //}
    //else
        pLines->AddLineRect( aOut, pColor, pTab, nSubCol );
}

@@ -5306,8 +5395,8 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
            SwRegionRects aPgRegion( aPgRect );
            aPgRegion -= aPgPrtRect;
            const SwPageFrm* pPage = static_cast<const SwPageFrm*>(this);
            if ( pPage->GetSortedObjs() )
                ::lcl_SubtractFlys( this, pPage, aPgRect, aPgRegion );
            //if ( pPage->GetSortedObjs() )
            //    ::lcl_SubtractFlys( this, pPage, aPgRect, aPgRegion );
            if ( aPgRegion.Count() )
            {
                OutputDevice *pOut = _pViewShell->GetOut();
@@ -5737,7 +5826,11 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
    const sal_Bool bPageFrm = IsPageFrm();
    sal_Bool bLowMode = sal_True;

    sal_Bool bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, bLowerMode );
    //UUUU
    FillAttributesPtr aFillAttributes;

    sal_Bool bBack = GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, bLowerMode );

    //- Ausgabe wenn ein eigener Hintergrund mitgebracht wird.
    bool bNoFlyBackground = !bFlyMetafile && !bBack && IsFlyFrm();
    if ( bNoFlyBackground )
@@ -5747,7 +5840,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
        // <GetBackgroundBrush> disabled this option with the parameter <bLowerMode>
        if ( bLowerMode )
        {
            bBack = GetBackgroundBrush( pItem, pCol, aOrigBackRect, false );
            bBack = GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, false );
        }
        // If still no background found for the fly frame, initialize the
        // background brush <pItem> with global retouche color and set <bBack>
@@ -5765,11 +5858,18 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
               )
            {
                pTmpBackBrush = new SvxBrushItem( Color( COL_WHITE ), RES_BACKGROUND );

                //UUU
                aFillAttributes.reset(new FillAttributes(Color( COL_WHITE )));
            }
            else
            {
                pTmpBackBrush = new SvxBrushItem( aGlobalRetoucheColor, RES_BACKGROUND);

                //UUU
                aFillAttributes.reset(new FillAttributes(aGlobalRetoucheColor));
            }

            pItem = pTmpBackBrush;
            bBack = true;
        }
@@ -5810,14 +5910,21 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
            if ( aRect.HasArea() )
            {
                SvxBrushItem* pNewItem = 0;
                SwRegionRects aRegion( aRect );
                //SwRegionRects aRegion( aRect );

                if( pCol )
                {
                    pNewItem = new SvxBrushItem( *pCol, RES_BACKGROUND );
                    pItem = pNewItem;

                    //UUUU
                    aFillAttributes.reset(new FillAttributes(*pCol));
                }
                if ( pPage->GetSortedObjs() )
                    ::lcl_SubtractFlys( this, pPage, aRect, aRegion );

                //if ( pPage->GetSortedObjs() )
                //{
                //    ::lcl_SubtractFlys( this, pPage, aRect, aRegion );
                //}

                {
                    /// OD 06.08.2002 #99657# - determine, if background transparency
@@ -5825,20 +5932,35 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
                    ///     --> Status Quo: background transparency have to be
                    ///        considered for fly frames
                    const sal_Bool bConsiderBackgroundTransparency = IsFlyFrm();
                    for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
                    bool bDone(false);

                    if(pOut && aFillAttributes.get() && aFillAttributes->isUsed())
                    {
                        if ( 1 < aRegion.Count() )
                        {
                            ::SwAlignRect( aRegion[i], pGlobalShell );
                            if( !aRegion[i].HasArea() )
                                continue;
                        }
                        /// OD 06.08.2002 #99657# - add 6th parameter to indicate, if
                        ///     background transparency have to be considered
                        ///     Set missing 5th parameter to the default value GRFNUM_NO
                        ///         - see declaration in /core/inc/frmtool.hxx.
                        ::DrawGraphic( pItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO,
                        bDone = DrawFillAttributes(aFillAttributes, aOrigBackRect, aRect, *pOut);
                    }

                    if(!bDone)
                    {
                        //for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
                        //{
                        //    if ( 1 < aRegion.Count() )
                        //    {
                        //        ::SwAlignRect( aRegion[i], pGlobalShell );
                        //        if( !aRegion[i].HasArea() )
                        //            continue;
                        //    }
                            /// OD 06.08.2002 #99657# - add 6th parameter to indicate, if
                            ///     background transparency have to be considered
                            ///     Set missing 5th parameter to the default value GRFNUM_NO
                            ///         - see declaration in /core/inc/frmtool.hxx.
                        ::DrawGraphic(
                                pItem,
                                pOut,
                                aOrigBackRect,
                                aRect, // aRegion[i],
                                GRFNUM_NO,
                                bConsiderBackgroundTransparency );
                        //}
                    }
                }
                if( pCol )
@@ -6384,7 +6506,10 @@ const Color& SwPageFrm::GetDrawBackgrdColor() const
    const Color* pDummyColor;
    SwRect aDummyRect;

    if ( GetBackgroundBrush( pBrushItem, pDummyColor, aDummyRect, true) )
    //UUUU
    FillAttributesPtr aFillAttributes;

    if ( GetBackgroundBrush( aFillAttributes, pBrushItem, pDummyColor, aDummyRect, true) )
    {
        const Graphic* pGraphic = pBrushItem->GetGraphic();

@@ -6554,10 +6679,12 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const

    @return true, if a background brush for the frame is found
*/
sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
                                const Color*& rpCol,
                                SwRect &rOrigRect,
                                sal_Bool bLowerMode ) const
sal_Bool SwFrm::GetBackgroundBrush(
    FillAttributesPtr& rFillAttributes,
    const SvxBrushItem* & rpBrush,
    const Color*& rpCol,
    SwRect &rOrigRect,
    sal_Bool bLowerMode ) const
{
    const SwFrm *pFrm = this;
    ViewShell *pSh = getRootFrm()->GetCurrShell();
@@ -6568,7 +6695,21 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
    {   if ( pFrm->IsPageFrm() && !pOpt->IsPageBack() )
            return sal_False;

        //UUUU
        const SwLayoutFrm* pSwLayoutFrm = dynamic_cast< const SwLayoutFrm* >(pFrm);

        if(pSwLayoutFrm)
        {
            const SwFrmFmt* pSwFrmFmt = dynamic_cast< const SwFrmFmt* >(pSwLayoutFrm->GetFmt());

            if(pSwFrmFmt  && RES_FLYFRMFMT == pSwFrmFmt->Which())
            {
                rFillAttributes = pSwFrmFmt->getFillAttributes();
            }
        }

        const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground();

        if( pFrm->IsSctFrm() )
        {
            const SwSection* pSection = ((SwSectionFrm*)pFrm)->GetSection();
@@ -6604,20 +6745,31 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
        ///     --> Status Quo: background transparency have to be
        ///                     considered for fly frames
        const sal_Bool bConsiderBackgroundTransparency = pFrm->IsFlyFrm();

        /// OD 20.08.2002 #99657#
        ///     add condition:
        ///     If <bConsiderBackgroundTransparency> is set - see above -,
        ///     return brush of frame <pFrm>, if its color is *not* "no fill"/"auto fill"
        if ( !rBack.GetColor().GetTransparency() ||
             rBack.GetGraphicPos() != GPOS_NONE ||
             rpCol ||
             (bConsiderBackgroundTransparency && (rBack.GetColor() != COL_TRANSPARENT))
        if (
            // done when FillAttributesare set
            (rFillAttributes.get() && rFillAttributes->isUsed()) ||

            // done when SvxBrushItem is used
            !rBack.GetColor().GetTransparency() || rBack.GetGraphicPos() != GPOS_NONE ||

            // done when direct color is forced
            rpCol ||

            // done when consider BG transparency and color is not completely transparent
            (bConsiderBackgroundTransparency && (rBack.GetColor() != COL_TRANSPARENT))
           )
        {
            rpBrush = &rBack;
            if ( pFrm->IsPageFrm() &&
                 pSh->GetViewOptions()->getBrowseMode() )

            if ( pFrm->IsPageFrm() && pSh->GetViewOptions()->getBrowseMode() )
            {
                rOrigRect = pFrm->Frm();
            }
            else
            {
                if ( pFrm->Frm().SSize() != pFrm->Prt().SSize() )
@@ -6632,21 +6784,27 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
                    rOrigRect += pFrm->Frm().Pos();
                }
            }

            return sal_True;
        }

        if ( bLowerMode )
        {
            /// Do not try to get background brush from parent (anchor/upper)
            return sal_False;
        }

        /// get parent frame - anchor or upper - for next loop
        if ( pFrm->IsFlyFrm() )
        {
            /// OD 20.08.2002 - use "static_cast" instead of "old C-cast"
            pFrm = (static_cast<const SwFlyFrm*>(pFrm))->GetAnchorFrm();
            ///pFrm = ((SwFlyFrm*)pFrm)->GetAnchor();
        }
        else
        {
            pFrm = pFrm->GetUpper();

        }
    } while ( pFrm );

    return sal_False;
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index e32c8d2..acba487 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -358,6 +358,11 @@ void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
            break;

        default:
            //UUUU the new FillStyle has to do the same as previous RES_BACKGROUND
            if(nWhich >= XATTR_FILL_FIRST && nWhich <= XATTR_FILL_LAST)
            {
                rInvFlags |= 0x28;
            }
            /* do Nothing */;
    }
}
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 0dc3dae..7b28257 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -70,6 +70,9 @@
#include <cstdio>
#include <EnhancedPDFExportHelper.hxx>

//UUUU
#include <frmfmt.hxx>

#include <unomid.h>

using namespace ::com::sun::star;
@@ -606,13 +609,16 @@ sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf )
        const SvxBrushItem* pItem;
        SwRect aOrigBackRect;

        //UUUU
        FillAttributesPtr aFillAttributes;

        /// OD 21.08.2002
        ///     consider, that [GetBackgroundBrush(...)] can set <pCol>
        ///     - see implementation in /core/layout/paintfrm.cxx
        /// OD 21.08.2002 #99657#
        ///     There is a background color, if there is a background brush and
        ///     its color is *not* "no fill"/"auto fill".
        if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, sal_False ) )
        if( rInf.GetTxtFrm()->GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, sal_False ) )
        {
            if ( !pCol )
                pCol = &pItem->GetColor();
@@ -986,8 +992,14 @@ void SwTxtPaintInfo::DrawRect( const SwRect &rRect, sal_Bool bNoGraphic,
            pOut->DrawRect( rRect.SVRect() );
        else
        {
            ASSERT( ((SvxBrushItem*)-1) != pBrushItem, "DrawRect: Uninitialized BrushItem!" );
            ::DrawGraphic( pBrushItem, pOut, aItemRect, rRect );
            if(pBrushItem != ((SvxBrushItem*)-1))
            {
                ::DrawGraphic( pBrushItem, pOut, aItemRect, rRect );
            }
            else
            {
                OSL_ENSURE(false, "DrawRect: Uninitialized BrushItem!" );
            }
        }
    }
}
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index a19a99c..c7f82cf 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -49,7 +49,6 @@
#include <porftn.hxx>   // SwFtnPortion
#include <accessibilityoptions.hxx>
#include <editeng/lrspitem.hxx>

#include <unicode/ubidi.h>

using namespace ::com::sun::star;
@@ -1036,8 +1035,10 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
    }

    if( bDraw && aTmp.HasArea() )
    {
        DrawGraphic( pBrush, (OutputDevice*)rInf.GetOut(),
            aTmp, aRepaint, bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
    }
}

void SwGrfNumPortion::SetBase( long nLnAscent, long nLnDescent,
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 8b421bb..9a818cc 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1114,13 +1114,19 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
    for( MSHORT i = 0; i < aRegion.Count(); ++i )
    {
        if ( bNoGraphic )
        {
            pOut->DrawRect( aRegion[i].SVRect() );
        }
        else
        {
            ASSERT( ((SvxBrushItem*)-1) != rInf.GetBrushItem(),
                    "DrawRect: Uninitialized BrushItem!" );
            ::DrawGraphic( rInf.GetBrushItem(), pOut, rInf.GetBrushRect(),
                       aRegion[i] );
            if(((SvxBrushItem*)-1) != rInf.GetBrushItem())
            {
                ::DrawGraphic(rInf.GetBrushItem(), pOut, rInf.GetBrushRect(), aRegion[i] );
            }
            else
            {
                OSL_ENSURE(false, "DrawRect: Uninitialized BrushItem!" );
            }
        }
    }
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index ee8b527..4ef7f67 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2670,13 +2670,16 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont )
                const SvxBrushItem* pItem;
                SwRect aOrigBackRect;

                //UUUU
                FillAttributesPtr aFillAttributes;

                /// OD 21.08.2002
                ///     consider, that [GetBackgroundBrush(...)] can set <pCol>
                ///     - see implementation in /core/layout/paintfrm.cxx
                /// OD 21.08.2002 #99657#
                ///     There is a user defined setting for the background, if there
                ///     is a background brush and its color is *not* "no fill"/"auto fill".
                if( GetFrm()->GetBackgroundBrush( pItem, pCol, aOrigBackRect, sal_False ) )
                if( GetFrm()->GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect, sal_False ) )
                {
                    if ( !pCol )
                    {
diff --git a/sw/source/core/unocore/unobrushitemhelper.cxx b/sw/source/core/unocore/unobrushitemhelper.cxx
new file mode 100644
index 0000000..65ab4df
--- /dev/null
+++ b/sw/source/core/unocore/unobrushitemhelper.cxx
@@ -0,0 +1,309 @@
/**************************************************************
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
 *************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"

#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>
#include <hintids.hxx>

//UUUU
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxItemSet& rToSet)
{
    if(0xff != rBrush.GetColor().GetTransparency())
    {
        const Color aColor(rBrush.GetColor().GetRGBColor());
        const sal_uInt8 nTransparency(rBrush.GetColor().GetTransparency());

        rToSet.Put(XFillStyleItem(XFILL_SOLID));
        rToSet.Put(XFillColorItem(String(), aColor));

        if(0xff != nTransparency)
        {
            // nTransparency is in range [0..255]
            rToSet.Put(XFillTransparenceItem((((sal_Int32)nTransparency * 100) + 127) / 255));
        }
    }
    else if(GPOS_NONE != rBrush.GetGraphicPos())
    {
        const Graphic* pGraphic = rBrush.GetGraphic();

        if(pGraphic)
        {
            // set fill style and graphic itself
            rToSet.Put(XFillStyleItem(XFILL_BITMAP));
            rToSet.Put(XFillBitmapItem(String(), *pGraphic));

            // set defaults
            // already pool default rToSet.Put(XFillBmpPosItem(RP_MM));
            // already pool default rToSet.Put(XFillBmpTileOffsetXItem(0));
            // already pool default rToSet.Put(XFillBmpTileOffsetYItem(0));
            // already pool default rToSet.Put(XFillBmpPosOffsetXItem(0));
            // already pool default rToSet.Put(XFillBmpPosOffsetYItem(0));
            // already pool default rToSet.Put(XFillBmpSizeLogItem(true));
            // already pool default rToSet.Put(XFillBmpSizeXItem(0));
            // already pool default rToSet.Put(XFillBmpSizeYItem(0));

            if(GPOS_AREA == rBrush.GetGraphicPos())
            {
                // stretch, also means no tile (both items are defaulted to true)
                // rToSet.Put(XFillBmpStretchItem(true));
                rToSet.Put(XFillBmpTileItem(false));

                // default for strech is also top-left, but this will not be visible
                // rToSet.Put(XFillBmpPosItem(RP_LT));
            }
            else if(GPOS_TILED == rBrush.GetGraphicPos())
            {
                // tiled, also means no stretch (both items are defaulted to true)
                rToSet.Put(XFillBmpStretchItem(false));
                //rToSet.Put(XFillBmpTileItem(true));

                // default for tiled is top-left
                rToSet.Put(XFillBmpPosItem(RP_LT));
            }
            else
            {
                // everything else means no tile and no stretch
                rToSet.Put(XFillBmpStretchItem(false));
                rToSet.Put(XFillBmpTileItem(false));

                switch(rBrush.GetGraphicPos())
                {
                    case GPOS_LT: rToSet.Put(XFillBmpPosItem(RP_LT)); break;
                    case GPOS_MT: rToSet.Put(XFillBmpPosItem(RP_MT)); break;
                    case GPOS_RT: rToSet.Put(XFillBmpPosItem(RP_RT)); break;
                    case GPOS_LM: rToSet.Put(XFillBmpPosItem(RP_LM)); break;
                    case GPOS_MM: rToSet.Put(XFillBmpPosItem(RP_MM)); break;
                    case GPOS_RM: rToSet.Put(XFillBmpPosItem(RP_RM)); break;
                    case GPOS_LB: rToSet.Put(XFillBmpPosItem(RP_LB)); break;
                    case GPOS_MB: rToSet.Put(XFillBmpPosItem(RP_MB)); break;
                    case GPOS_RB: rToSet.Put(XFillBmpPosItem(RP_RB)); break;
                    default: break; // already handled GPOS_AREA, GPOS_TILED and GPOS_NONE
                }
            }

            // check for transparency
            const sal_Int8 nTransparency(rBrush.getGraphicTransparency());

            if(0 != nTransparency)
            {
                // nTransparency is in range [0..100]
                rToSet.Put(XFillTransparenceItem(nTransparency));
            }
        }
        else
        {
            OSL_ENSURE(false, "Could not get Graphic from SvxBrushItem (!)");
        }
    }
}

//UUUU
sal_uInt16 getTransparenceForSvxBrushItem(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents)
{
    sal_uInt16 nFillTransparence(static_cast< const XFillTransparenceItem& >(rSourceSet.Get(XATTR_FILLTRANSPARENCE, bSearchInParents)).GetValue());
    const SfxPoolItem* pGradientItem = 0;

    if(SFX_ITEM_SET == rSourceSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, bSearchInParents, &pGradientItem)
        && static_cast< const XFillFloatTransparenceItem* >(pGradientItem)->IsEnabled())
    {
        const XGradient& rGradient = static_cast< const XFillFloatTransparenceItem* >(pGradientItem)->GetGradientValue();
        const sal_uInt16 nStartLuminance(rGradient.GetStartColor().GetLuminance());
        const sal_uInt16 nEndLuminance(rGradient.GetEndColor().GetLuminance());

        // luminance is [0..255], transparence needs to be in [0..100].Maximum is 51200, thus sal_uInt16 is okay to use
        nFillTransparence = static_cast< sal_uInt16 >(((nStartLuminance + nEndLuminance) * 100) / 512);
    }

    return nFillTransparence;
}

//UUUU
SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents)
{
    Color aFillColor(static_cast< const XFillColorItem& >(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents)).GetColorValue());

    // get evtl. mixed transparence
    const sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents));

    if(0 != nFillTransparence)
    {
        // nFillTransparence is in range [0..100] and needs to be in [0..255] unsigned
        aFillColor.SetTransparency(static_cast< sal_uInt8 >((nFillTransparence * 255) / 100));
    }

    return SvxBrushItem(aFillColor, RES_BACKGROUND);
}

//UUUU
SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents)
{
    SvxBrushItem aRetval(RES_BACKGROUND);

    const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem*  >(rSourceSet.GetItem(XATTR_FILLSTYLE, bSearchInParents)));

    if(!pXFillStyleItem)
    {
        return aRetval;
    }

    switch(pXFillStyleItem->GetValue())
    {
        case XFILL_NONE:
        {
            // done; return default item
            break;
        }
        case XFILL_SOLID:
        {
            // create SvxBrushItem with fill color
            aRetval = getSvxBrushItemForSolid(rSourceSet, bSearchInParents);
            break;
        }
        case XFILL_GRADIENT:
        {
            // cannot be directly supported, but do the best possible
            const XGradient aXGradient(static_cast< const XFillGradientItem& >(rSourceSet.Get(XATTR_FILLGRADIENT)).GetGradientValue());
            const basegfx::BColor aStartColor(aXGradient.GetStartColor().getBColor() * (aXGradient.GetStartIntens() * 0.01));
            const basegfx::BColor aEndColor(aXGradient.GetEndColor().getBColor() * (aXGradient.GetEndIntens() * 0.01));

            // use half/half mixed color from gradient start and end
            Color aMixedColor((aStartColor + aEndColor) * 0.5);

            // get evtl. mixed transparence
            const sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents));

            if(0 != nFillTransparence)
            {
                // nFillTransparence is in range [0..100] and needs to be in [0..255] unsigned
                aMixedColor.SetTransparency(static_cast< sal_uInt8 >((nFillTransparence * 255) / 100));
            }

            aRetval = SvxBrushItem(aMixedColor, RES_BACKGROUND);
            break;
        }
        case XFILL_HATCH:
        {
            // cannot be directly supported, but do the best possible
            const XHatch& rHatch(static_cast< const XFillHatchItem& >(rSourceSet.Get(XATTR_FILLHATCH)).GetHatchValue());
            const bool bFillBackground(static_cast< const XFillBackgroundItem& >(rSourceSet.Get(XATTR_FILLBACKGROUND)).GetValue());

            if(bFillBackground)
            {
                // hatch is background-filled, use FillColor as if XFILL_SOLID
                aRetval = getSvxBrushItemForSolid(rSourceSet, bSearchInParents);
            }
            else
            {
                // hatch is not background-filled and using hatch color would be too dark; compensate
                // somewhat by making it more transparent
                Color aHatchColor(rHatch.GetColor());

                // get evtl. mixed transparence
                sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents));

                // take half orig transparence, add half transparent, clamp result
                nFillTransparence = basegfx::clamp((sal_uInt16)((nFillTransparence / 2) + 50), (sal_uInt16)0, (sal_uInt16)255);

                // nFillTransparence is in range [0..100] and needs to be in [0..255] unsigned
                aHatchColor.SetTransparency(static_cast< sal_uInt8 >((nFillTransparence * 255) / 100));

                aRetval = SvxBrushItem(aHatchColor, RES_BACKGROUND);
            }

            break;
        }
        case XFILL_BITMAP:
        {
            // create SvxBrushItem with bitmap info and flags
            const XFillBitmapItem& rBmpItm = static_cast< const XFillBitmapItem& >(rSourceSet.Get(XATTR_FILLBITMAP, bSearchInParents));
            const Graphic aGraphic(rBmpItm.GetGraphicObject().GetGraphic());

            if(GRAPHIC_NONE != aGraphic.GetType())
            {
                // get graphic position
                SvxGraphicPosition aSvxGraphicPosition(GPOS_NONE);
                const XFillBmpStretchItem& rStretchItem = static_cast< const XFillBmpStretchItem& >(rSourceSet.Get(XATTR_FILLBMP_STRETCH, bSearchInParents));
                const XFillBmpTileItem& rTileItem = static_cast< const XFillBmpTileItem& >(rSourceSet.Get(XATTR_FILLBMP_TILE, bSearchInParents));

                if(rTileItem.GetValue())
                {
                    aSvxGraphicPosition = GPOS_TILED;
                }
                else if(rStretchItem.GetValue())
                {
                    aSvxGraphicPosition = GPOS_AREA;
                }
                else
                {
                    const XFillBmpPosItem& rPosItem = static_cast< const XFillBmpPosItem& >(rSourceSet.Get(XATTR_FILLBMP_POS, bSearchInParents));

                    switch(rPosItem.GetValue())
                    {
                        case RP_LT: aSvxGraphicPosition = GPOS_LT; break;
                        case RP_MT: aSvxGraphicPosition = GPOS_MT; break;
                        case RP_RT: aSvxGraphicPosition = GPOS_RT; break;
                        case RP_LM: aSvxGraphicPosition = GPOS_LM; break;
                        case RP_MM: aSvxGraphicPosition = GPOS_MM; break;
                        case RP_RM: aSvxGraphicPosition = GPOS_RM; break;
                        case RP_LB: aSvxGraphicPosition = GPOS_LB; break;
                        case RP_MB: aSvxGraphicPosition = GPOS_MB; break;
                        case RP_RB: aSvxGraphicPosition = GPOS_RB; break;
                    }
                }

                // create with given graphic and position
                aRetval = SvxBrushItem(aGraphic, aSvxGraphicPosition, RES_BACKGROUND);

                // get evtl. mixed transparence
                const sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents));

                if(0 != nFillTransparence)
                {
                    // nFillTransparence is in range [0..100] and needs to be in [0..100] signed
                    aRetval.setGraphicTransparency(static_cast< sal_Int8 >(nFillTransparence));
                }
            }

            break;
        }
    }

    return aRetval;
}

//eof
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index dd66cb0..e0237e9 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -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::XStyleFamiliesSupplier;
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,51 +210,384 @@ sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet,
        if(GetProperty(RES_ANCHOR, MID_ANCHOR_ANCHORTYPE, pAnchorType))
            bRet &= ((SfxPoolItem&)aAnchor).PutValue(*pAnchorType, MID_ANCHOR_ANCHORTYPE);
    }

    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)
    {
        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     );
        //UUUU create a temporary SvxBrushItem, fill the attributes to it and use it to set
        // the corresponding FillAttributes
        SvxBrushItem aBrush(RES_BACKGROUND);

        if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc ||
                            pGrTranparency || pColTrans || pRGBCol)
        if(pCol)
        {
            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);
            bRet &= ((SfxPoolItem&)aBrush).PutValue(*pCol,MID_BACK_COLOR    );
        }

            rToSet.Put(aBrush);
        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));
        }
    }
    {
@@ -966,7 +1317,7 @@ SwFrmFmt *lcl_GetFrmFmt( const :: uno::Any& rValue, SwDoc *pDoc )
    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 :: OUString& rPropertyName, const :: uno::
    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 :: OUString& rPropertyName, const :: uno::
                            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 :: OUString& rPropertyName, const :: uno::
                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 :: OUString& rPropertyName, const :: uno::
    }
    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(const OUString& rPropertyName)
    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(const OUString& rPropertyName)
            }
        }
        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(const OUString& rPropertyName)
        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,6 +2207,46 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
    }
    else
        throw uno::RuntimeException();

    //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;
}

@@ -1769,6 +2289,42 @@ beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
    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 > SwXFrame::getPropertyStates(
            {
                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( const OUString& rPropertyName )
            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( const OUString& rPropertyName )
            {
                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::Reference< text::XTextRange > & xTextRan
        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[] =
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 010a221..a9fa159 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -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::~SwUnoPropertyMapProvider()
                    { 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* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                    // 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* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
            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* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                    { 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* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
        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;
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 5e3f472..c74c0ba 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -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 )
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index f126cdb..23c0f56 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -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,14 +1831,119 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                                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 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 ) )
            if ( !( aValue >>= sTmp ) )
                throw lang::IllegalArgumentException();
            if ( sTmp.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "[From printer settings]" ) ) )
                nBin = USHRT_MAX-1;
@@ -1855,14 +1968,16 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                rPropSet.setPropertyValue(rEntry, uno::makeAny ( static_cast < sal_Int8 > ( nBin == USHRT_MAX-1 ? -1 : nBin ) ), aSet);
                rStyleSet.Put(aSet);
            }

            bDone = true;
            break;
        }
        break;
        case  FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
        {
            if(rValue.getValueType() == ::getCppuType((uno::Reference< container::XIndexReplace>*)0) )
            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,96 +2058,110 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
            }
            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 );

            bDone = true;
            break;  //<-end,zhaojianwei
        }
        break;                                      //<-end,zhaojianwei
        case FN_UNO_FOLLOW_STYLE:
        {
            OUString sTmp;
            rValue >>= sTmp;
            aValue >>= sTmp;
            String aString;
            SwStyleNameMapper::FillUIName(sTmp, aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True ) ;
            rBase.mxNewBase->SetFollow( aString );
        }
        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();

            SwFmtPageDesc* pNewDesc = 0;
            const SfxPoolItem* pItem;
            if(SFX_ITEM_SET == rStyleSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
            bDone = true;
            break;
        }
        case RES_PAGEDESC :
        {
            if( MID_PAGEDESC_PAGEDESCNAME == nMemberId)
            {
                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())
                // 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 ) )
                {
                    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();
                        }
                    }
                    if(!bPut)
                    {
                        rStyleSet.ClearItem(RES_BREAK);
                        rStyleSet.Put(SwFmtPageDesc());
                    }
                    else
                    {
                        throw lang::IllegalArgumentException();
                    }
                        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))
            if (!(aValue >>= aSeq))
                throw lang::IllegalArgumentException();

            DBG_ASSERT(COND_COMMAND_COUNT == 28,
@@ -2049,7 +2178,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                {
                    // 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
@@ -2080,14 +2209,15 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
            if (bFailed)
                throw lang::IllegalArgumentException();
            rBase.GetItemSet().Put( aCondItem );
            bDone = true;
            break;
        }
        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,13 +2242,15 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                    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);
@@ -2126,13 +2258,15 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
            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;
@@ -2156,13 +2290,13 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                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,7 +2307,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                    if(!pDrop)
                        pDrop = new SwFmtDrop();
                    OUString uStyle;
                    rValue >>= uStyle;
                    aValue >>= uStyle;
                    String sStyle;
                    SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
                    SwDocStyleSheet* pStyle =
@@ -2187,36 +2321,42 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                }
                else
                    throw lang::IllegalArgumentException();
                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

                bDone = true;
            }
            break;
        }
        default:
        {
            // 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() )
            {
                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
                }
                // 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
            }
        }
    }
@@ -2323,6 +2463,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                        SwDoc *pDoc) throw(uno::RuntimeException)
{
    uno::Any aRet;

    if(FN_UNO_IS_PHYSICAL == rEntry.nWID)
    {
        sal_Bool bPhys = pBase != 0;
@@ -2340,7 +2481,17 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
    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:
@@ -2359,14 +2510,19 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                        sTmp = pPrinter->GetPaperBinName ( nBin );
                    aRet <<= sTmp;
                }

                bDone = true;
                break;
            }
            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 SfxItemPropertySimpleEntry& rEntry,
            //    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
            {
                DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
                int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
                    aRet <<= static_cast<sal_Int16>( nLevel );
            }
            break;                                      //<-end,zhaojianwei

                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);
                aRet <<= OUString( aString );
                bDone = true;
                break;
            }
            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)
                    // Sonderbehandlung RES_PAGEDESC
                    const SfxPoolItem* pItem;
                    if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState( RES_PAGEDESC, sal_True, &pItem ) )
                    {
                        String aString;
                        SwStyleNameMapper::FillProgName(pDesc->GetName(), aString,  nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
                        aRet <<= OUString( aString );
                        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,14 +2582,18 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                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,
@@ -2454,12 +2623,15 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                    pSeq[n].Value <<= rtl::OUString( aStyleName );
                }
                aRet <<= aSeq;

                bDone = true;
                break;
            }
            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,9 +2653,11 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                        nRet = style::ParagraphStyleCategory::HTML;
                        break;
                }

                aRet <<= nRet;
                bDone = true;
                break;
            }
            break;
            case SID_SWREGISTER_COLLECTION:
            {
                const SwPageDesc *pPageDesc = rBase.mxNewBase->GetPageDesc();
@@ -2494,19 +2668,104 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
                if( pCol )
                    SwStyleNameMapper::FillProgName(
                                pCol->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True );

                aRet <<= OUString ( aString );
                bDone = true;
                break;
            }
            break;
            default:
query_itemset:
            case RES_BACKGROUND:
            {
                SfxItemSet& rSet = rBase.GetItemSet();
                rPropSet.getPropertyValue(rEntry, rSet, aRet);
                //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;
            }
            default:
            {
                // 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--------------------------------
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index f2f8691..8eb1932 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -508,6 +508,9 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
    Beschreibung:   Edit
 --------------------------------------------------------------------*/

//UUUU
//#include <svx/svdmodel.hxx>
//#include <svx/drawitem.hxx>

sal_uInt16 SwDocShell::Edit(
    const String &rName,
@@ -666,6 +669,20 @@ sal_uInt16 SwDocShell::Edit(
    }
    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);

@@ -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() )
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 6571453..b303634 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -410,27 +410,36 @@ SwDocStyleSheet::SwDocStyleSheet(   SwDoc&          rDocument,
    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( const String& rStr)
    Beschreibung:   ueber Name und Family, Mask den ItemSet rausholen
 --------------------------------------------------------------------*/

//UUUU
#include <svx/svdmodel.hxx>
#include <svx/drawitem.hxx>

SfxItemSet&   SwDocStyleSheet::GetItemSet()
{
    if(!bPhysical)
@@ -1057,6 +1070,15 @@ SfxItemSet&   SwDocStyleSheet::GetItemSet()
                    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& rSet,
        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 )
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 5a59d90..b699e78 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -250,7 +250,14 @@ SwTemplateDlg::SwTemplateDlg(Window*            pParent,
                                        SwWrapTabPage::GetRanges );
            DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
            DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
            AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );

            //UUUU remove?
            //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );

            //UUUU add Area and Transparence TabPages
            AddTabPage(RID_SVXPAGE_AREA);
            AddTabPage(RID_SVXPAGE_TRANSPARENCE);

            DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
            DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
            AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
@@ -510,6 +517,8 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
            ((SwColumnPage&)rPage).SetFormatUsed( sal_True );
            break;

        //UUUU do not remove; many other style dialog combinations still use the SfxTabPage
        // for the SvxBrushItem (see RID_SVXPAGE_BACKGROUND)
        case TP_BACKGROUND:
        {
            sal_Int32 nFlagType = 0;
@@ -633,8 +642,34 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
            rPage.PageCreated(aSet);

        break;

        //UUUU inits for Area and Transparency TabPages
        // The selection attribute lists (XPropertyList derivates, e.g. XColorList for
        // the color table) need to be added as items (e.g. SvxColorTableItem) to make
        // these pages find the needed attributes for fill style suggestions.
        // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on
        // demand, but could also be directly added from the DrawModel.
        case RID_SVXPAGE_AREA:
        {
            SfxItemSet aNew(*aSet.GetPool(),
                SID_COLOR_TABLE, SID_BITMAP_LIST,
                SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0);

            aNew.Put(GetStyleSheet().GetItemSet());

            // add flag for direct graphic content selection
            aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true));

            rPage.PageCreated(aNew);
        }
        break;

        case RID_SVXPAGE_TRANSPARENCE:
        {
            rPage.PageCreated(GetStyleSheet().GetItemSet());
        }
        break;
    }
}



// eof
diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src
index 6e69dc9..f9b23a4 100644
--- a/sw/source/ui/fmtui/tmpdlg.src
+++ b/sw/source/ui/fmtui/tmpdlg.src
@@ -305,14 +305,31 @@ TabDialog DLG_TEMPLATE_3
                Text [ en-US ] = "Wrap" ;
                PageResID = TP_FRM_WRAP ;
            };

            //UUUU new Area and Transparence TabPages
            PageItem
            {
                Identifier = TP_BACKGROUND ;
                Text [ en-US ] = "Background" ;
                PageResID = TP_BACKGROUND ;
                Identifier = RID_SVXPAGE_AREA;
                PageResID = RID_SVXPAGE_AREA;
                Text [ en-US ] = "Area" ;
            };
            PageItem
            {
                Identifier = RID_SVXPAGE_TRANSPARENCE;
                PageResID = RID_SVXPAGE_TRANSPARENCE;
                Text [ en-US ] = "Transparency" ;
            };

            //UUUU Remove?
            //PageItem
            //{
            //    Identifier = TP_BACKGROUND ;
            //    Text [ en-US ] = "Background" ;
            //    PageResID = TP_BACKGROUND ;
            //};

            PageItem
            {
                Identifier = TP_BORDER ;
                Text [ en-US ] = "Borders" ;
                PageResID = TP_BORDER ;
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index 643bc11..0538a54 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -105,7 +105,14 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame*       pViewFrame,
    }
    SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
    DBG_ASSERT(pFact, "Dialogdiet fail!");
    AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );

    //UUUU remove?
    // AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );

    //UUUU add Area and Transparence TabPages
    AddTabPage(RID_SVXPAGE_AREA);
    AddTabPage(RID_SVXPAGE_TRANSPARENCE);

    AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
    AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );

@@ -126,9 +133,12 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame*       pViewFrame,
                RemoveTabPage(RID_SVXPAGE_GRFCROP);
            break;
        }
        if( 0  == (nHtmlMode & HTMLMODE_SOME_ABS_POS) ||
            m_nDlgType != DLG_FRM_STD )
            RemoveTabPage(TP_BACKGROUND);
        if( 0  == (nHtmlMode & HTMLMODE_SOME_ABS_POS) || m_nDlgType != DLG_FRM_STD )
        {
            //UUUU RemoveTabPage(TP_BACKGROUND);
            RemoveTabPage(RID_SVXPAGE_AREA);
            RemoveTabPage(RID_SVXPAGE_TRANSPARENCE);
        }
    }

    if (m_bNew)
@@ -151,7 +161,6 @@ SwFrmDlg::~SwFrmDlg()

void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
    SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
    switch ( nId )
    {
    case TP_FRM_STD:
@@ -186,7 +195,7 @@ void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )

    case TP_MACRO_ASSIGN:
        {
        SfxAllItemSet aNewSet(*aSet.GetPool());
        SfxAllItemSet aNewSet(*GetInputSetImpl()->GetPool());
        aNewSet.Put( SwMacroAssignDlg::AddEvents(
            DLG_FRM_GRF == m_nDlgType ? MACASSGN_GRAPHIC : DLG_FRM_OLE == m_nDlgType ? MACASSGN_OLE : MACASSGN_FRMURL ) );
        if ( m_pWrtShell )
@@ -195,23 +204,54 @@ void SwFrmDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
        break;
        }

    case TP_BACKGROUND:
        if( DLG_FRM_STD == m_nDlgType )
    //UUUU
    //case TP_BACKGROUND:
    //    if( DLG_FRM_STD == m_nDlgType )
    //    {
    //        sal_Int32 nFlagType = SVX_SHOW_SELECTOR;
    //        if(!m_bHTMLMode)
    //            nFlagType |= SVX_ENABLE_TRANSPARENCY;
    //        SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
    //        aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlagType));
    //        rPage.PageCreated(aSet);
    //    }
    //  break;

    case TP_BORDER:
        {
            sal_Int32 nFlagType = SVX_SHOW_SELECTOR;
            if(!m_bHTMLMode)
                nFlagType |= SVX_ENABLE_TRANSPARENCY;
            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlagType));
            SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
            aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
            rPage.PageCreated(aSet);
        }
        break;

    case TP_BORDER:
        //UUUU inits for Area and Transparency TabPages
        // The selection attribute lists (XPropertyList derivates, e.g. XColorList for
        // the color table) need to be added as items (e.g. SvxColorTableItem) to make
        // these pages find the needed attributes for fill style suggestions.
        // These are set in preparation to trigger this dialog (FN_FORMAT_FRAME_DLG and
        // FN_DRAW_WRAP_DLG), but could also be directly added from the DrawModel.
        case RID_SVXPAGE_AREA:
        {
            aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
            rPage.PageCreated(aSet);
            SfxItemSet aNew(*GetInputSetImpl()->GetPool(),
                SID_COLOR_TABLE, SID_BITMAP_LIST,
                SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0);

            aNew.Put(m_rSet);

            // add flag for direct graphic content selection
            aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true));

            rPage.PageCreated(aNew);
        }
        break;

        case RID_SVXPAGE_TRANSPARENCE:
        {
            rPage.PageCreated(m_rSet);
        }
        break;
    }
}

// eof
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index 6c4a180..e1840cc 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -54,6 +54,10 @@ using namespace ::com::sun::star;

static sal_uInt16 __FAR_DATA aFrmMgrRange[] = {
                            RES_FRMATR_BEGIN, RES_FRMATR_END-1,

                            //UUUU FillAttribute support
                            XATTR_FILL_FIRST, XATTR_FILL_LAST,

                            SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
                            FN_SET_FRM_NAME, FN_SET_FRM_NAME,
                            0};
diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src
index 205f6fa..82f0a39 100644
--- a/sw/source/ui/frmdlg/frmpage.src
+++ b/sw/source/ui/frmdlg/frmpage.src
@@ -68,14 +68,31 @@ TabDialog DLG_FRM_STD
                PageResID = TP_BORDER ;
                Text [ en-US ] = "Borders" ;
            };

            //UUUU new Area and Transparence TabPages
            PageItem
            {
                Identifier = TP_BACKGROUND ;
                PageResID = TP_BACKGROUND ;
                Text [ en-US ] = "Background" ;
                Identifier = RID_SVXPAGE_AREA;
                PageResID = RID_SVXPAGE_AREA;
                Text [ en-US ] = "Area" ;
            };
            PageItem
            {
                Identifier = RID_SVXPAGE_TRANSPARENCE;
                PageResID = RID_SVXPAGE_TRANSPARENCE;
                Text [ en-US ] = "Transparency" ;
            };

            //UUUU remove?
            //PageItem
            //{
            //  Identifier = TP_BACKGROUND ;
            //  PageResID = TP_BACKGROUND ;
            //  Text [ en-US ] = "Background" ;
            //};

            PageItem
            {
                Identifier = TP_COLUMN ;
                PageResID = TP_COLUMN ;
                Text [ en-US ] = "Columns" ;
diff --git a/sw/source/ui/inc/frmsh.hxx b/sw/source/ui/inc/frmsh.hxx
index a730716..d4423e8 100644
--- a/sw/source/ui/inc/frmsh.hxx
+++ b/sw/source/ui/inc/frmsh.hxx
@@ -41,6 +41,14 @@ public:
    void    StateInsert(SfxItemSet &rSet);

    void    StateStatusline(SfxItemSet &rSet);

    //UUUU
    void GetDrawAttrStateTextFrame(SfxItemSet &rSet);
    void ExecDrawAttrArgsTextFrame(SfxRequest& rReq);

    //UUUU
    void ExecDrawDlgTextFrame(SfxRequest& rReq);
    void DisableStateTextFrame(SfxItemSet &rSet);
};

#endif
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index a04211e..1442721 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2279,15 +2279,42 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
    SvxBrushItem aBrushItem( RES_BACKGROUND );

    if( nsSelectionType::SEL_TBL_CELLS & nSelType )
    {
        rSh.GetBoxBackground( aBrushItem );
    }
    else
    {
        SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
        if( nSelType & nsSelectionType::SEL_GRF || nsSelectionType::SEL_FRM & nSelType )
        //UUUU
        if(nSelType & nsSelectionType::SEL_GRF)
        {
            SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);

            rSh.GetFlyFrmAttr( aCoreSet );
            aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
        }
        else if(nsSelectionType::SEL_FRM & nSelType)
        {
            SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
            const XFillStyleItem& rXFillStyleItem(static_cast< const XFillStyleItem&  >(aCoreSet.Get(XATTR_FILLSTYLE)));

            if(XFILL_SOLID == rXFillStyleItem.GetValue())
            {
                const Color aFillColor(static_cast< const XFillColorItem& >(aCoreSet.Get(XATTR_FILLCOLOR)).GetColorValue());

                aBrushItem.SetColor(aFillColor);
            }
            else
            {
                // keep default in SvxBrushItem which equals no fill
            }
        }
        else
        {
            SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);

            rSh.GetCurAttr( aCoreSet );
        aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
            aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
        }
    }

    while ( nWhich )
@@ -2335,12 +2362,37 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
    }
    else
    {
        SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
        if( (nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType) )
        //UUUU
        if(nSelType & nsSelectionType::SEL_GRF)
        {
            SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);

            rSh.GetFlyFrmAttr( aCoreSet );
            aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
        }
        else if(nsSelectionType::SEL_FRM & nSelType)
        {
            SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
            const XFillStyleItem& rXFillStyleItem(static_cast< const XFillStyleItem&  >(aCoreSet.Get(XATTR_FILLSTYLE)));

            if(XFILL_SOLID == rXFillStyleItem.GetValue())
            {
                const Color aFillColor(static_cast< const XFillColorItem& >(aCoreSet.Get(XATTR_FILLCOLOR)).GetColorValue());

                aBrushItem.SetColor(aFillColor);
            }
            else
            {
                // keep default in SvxBrushItem which equals no fill
            }
        }
        else
        {
            SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);

            rSh.GetCurAttr( aCoreSet );
        aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
            aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND);
        }
    }

//  sal_Bool bMsgOk = sal_False;
@@ -2389,8 +2441,8 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
    {
        rSh.SetBoxBackground( aBrushItem );
    }
    else if( (nsSelectionType::SEL_FRM & nSelType) ||
        (nsSelectionType::SEL_GRF & nSelType)  )
    //UUUU
    else if(nsSelectionType::SEL_GRF & nSelType)
    {
        SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND);
        aCoreSet.Put( aBrushItem );
@@ -2401,6 +2453,27 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
        else
            rSh.SetFlyFrmAttr( aCoreSet );
    }
    else if(nsSelectionType::SEL_FRM & nSelType)
    {
        SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
        const XubString aNullStr;

        // set FillStyle and color when applying
        aCoreSet.Put(XFillStyleItem(XFILL_SOLID));
        aCoreSet.Put(XFillColorItem(aNullStr, aBrushItem.GetColor()));

        // Vorlagen-AutoUpdate
        SwFrmFmt* pFmt = rSh.GetCurFrmFmt();

        if(pFmt && pFmt->IsAutoUpdateFmt())
        {
            rSh.AutoUpdateFrame( pFmt, aCoreSet);
        }
        else
        {
            rSh.SetFlyFrmAttr( aCoreSet );
        }
    }
    else
    {
        SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index ca63f79..ad759ea 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -101,10 +101,11 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)

            SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
            DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
            AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( NULL,
                                                                            &aNewAttr,
                                                                            pDoc,
                                                                            pView);
            AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog(
                NULL,
                &aNewAttr,
                pDoc,
                true);
            DBG_ASSERT(pDlg, "Dialogdiet fail!");
            // const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
                                    GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index b520a12..d845869 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -19,12 +19,9 @@
 *
 *************************************************************/



// MARKER(update_precomp.py): autogen include statement, do not remove
 // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"


#include <hintids.hxx>
#include <svl/whiter.hxx>
#include <svtools/imapobj.hxx>
@@ -46,11 +43,8 @@
#include <sfx2/objface.hxx>
#include <sfx2/sidebar/EnumContext.hxx>
#include <svx/hlnkitem.hxx>
// --> OD 2009-07-07 #i73249#
#include <svx/svdview.hxx>
#include <vcl/msgbox.hxx>
// <--

#include <doc.hxx>
#include <fmturl.hxx>
#include <fmtclds.hxx>
@@ -71,10 +65,8 @@
#include <swwait.hxx>
#include <docstat.hxx>
#include <IDocumentStatistics.hxx>

#include <comphelper/processfactory.hxx>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>

#include <helpid.h>
#include <cmdid.h>
#include <cfgitems.hxx>
@@ -83,9 +75,10 @@
#include <shells.hrc>
#include "swabstdlg.hxx"
#include "misc.hrc"
// --> OD 2009-07-14 #i73249#
#include <svx/dialogs.hrc>
// <--

#include <docsh.hxx>
#include <svx/drawitem.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -426,22 +419,44 @@ void SwFrameShell::Execute(SfxRequest &rReq)
            }
            else
            {
                SfxItemSet aSet(GetPool(),  RES_FRMATR_BEGIN,       RES_FRMATR_END-1,
                                            SID_ATTR_BORDER_INNER,  SID_ATTR_BORDER_INNER,
                                            FN_GET_PRINT_AREA,      FN_GET_PRINT_AREA,
                                            SID_ATTR_PAGE_SIZE,     SID_ATTR_PAGE_SIZE,
                                            SID_ATTR_BRUSH,         SID_ATTR_BRUSH,
                                            SID_ATTR_LRSPACE,       SID_ATTR_ULSPACE,
                                            FN_SURROUND,            FN_HORI_ORIENT,
                                            FN_SET_FRM_NAME,        FN_SET_FRM_NAME,
                                            FN_KEEP_ASPECT_RATIO,   FN_KEEP_ASPECT_RATIO,
                                            SID_DOCFRAME,           SID_DOCFRAME,
                                            SID_HTML_MODE,          SID_HTML_MODE,
                                            FN_SET_FRM_ALT_NAME,    FN_SET_FRM_ALT_NAME,
                                            FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT,
                                            FN_OLE_IS_MATH,         FN_OLE_IS_MATH,
                                            FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT,
                                            0);
                SfxItemSet aSet(GetPool(),  //UUUU sorted by indices
                    RES_FRMATR_BEGIN,       RES_FRMATR_END-1,                       // [82

                    //UUUU FillAttribute support
                    XATTR_FILL_FIRST,       XATTR_FILL_LAST,                        // [1014

                    SID_DOCFRAME,           SID_DOCFRAME,                           // [5598

                    SID_ATTR_BRUSH,         SID_ATTR_BRUSH,                         // [10001
                    SID_ATTR_BORDER_INNER,  SID_ATTR_BORDER_INNER,                  // [10023
                    SID_ATTR_LRSPACE,       SID_ATTR_ULSPACE,                       // [10048
                    SID_ATTR_PAGE_SIZE,     SID_ATTR_PAGE_SIZE,                     // [10051

                    //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_HTML_MODE,          SID_HTML_MODE,                          // [10414
                    FN_GET_PRINT_AREA,      FN_GET_PRINT_AREA,                      // [21032
                    FN_SURROUND,            FN_HORI_ORIENT,                         // [21303
                    FN_SET_FRM_NAME,        FN_SET_FRM_NAME,                        // [21306
                    FN_KEEP_ASPECT_RATIO,   FN_KEEP_ASPECT_RATIO,                   // [21307
                    FN_SET_FRM_ALT_NAME,    FN_SET_FRM_ALT_NAME,                    // [21318
                    FN_OLE_IS_MATH,         FN_OLE_IS_MATH,                         // [22314
                    FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT,         // [22315
                    FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT,                   // [22420

                    0);

                //UUUU create needed items for XPropertyList entries from the DrawModel so that
                // the Area TabPage can access them
                const SdrModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel();

                aSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE));
                aSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST));
                aSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST));
                aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST));

                const SwViewOption* pVOpt = rSh.GetViewOptions();
                if(nSel & nsSelectionType::SEL_OLE)
@@ -1227,3 +1242,158 @@ void  SwFrameShell::StateInsert(SfxItemSet &rSet)
        rSet.DisableItem(FN_INSERT_FRAME);
    }
}

//UUUU
void SwFrameShell::GetDrawAttrStateTextFrame(SfxItemSet &rSet)
{
    SwWrtShell &rSh = GetShell();

    if(rSh.IsFrmSelected())
    {
        rSh.GetFlyFrmAttr(rSet);
    }
    else
    {
        SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();

        if(pSdrView)
        {
            rSet.Put(pSdrView->GetDefaultAttr());
        }
    }
}

//UUUU
void SwFrameShell::ExecDrawAttrArgsTextFrame(SfxRequest& rReq)
{
    const SfxItemSet* pArgs = rReq.GetArgs();
    SwWrtShell& rSh = GetShell();

    if(pArgs)
    {
        if(rSh.IsFrmSelected())
        {
            rSh.SetFlyFrmAttr(const_cast< SfxItemSet& >(*pArgs));
        }
        else
        {
            SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();

            if(pSdrView)
            {
                pSdrView->SetDefaultAttr(*pArgs, sal_False);
            }
        }
    }
    else
    {
        SfxDispatcher* pDis = rSh.GetView().GetViewFrame()->GetDispatcher();

        switch(rReq.GetSlot())
        {
            case SID_ATTR_FILL_STYLE:
            case SID_ATTR_FILL_COLOR:
            case SID_ATTR_FILL_GRADIENT:
            case SID_ATTR_FILL_HATCH:
            case SID_ATTR_FILL_BITMAP:
            case SID_ATTR_FILL_TRANSPARENCE:
            case SID_ATTR_FILL_FLOATTRANSPARENCE:
            {
                pDis->Execute(SID_ATTRIBUTES_AREA, sal_False);
                break;
            }
        }
    }
}

//UUUU
void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest& rReq)
{
    switch(rReq.GetSlot())
    {
        case SID_ATTRIBUTES_AREA:
        {
            SwWrtShell& rSh = GetShell();

            if(rSh.IsFrmSelected())
            {
                SdrView* pView = rSh.GetDrawView();
                SdrModel* pDoc = pView->GetModel();
                SfxItemSet aNewAttr(pDoc->GetItemPool());

                // get attributes from FlyFrame
                rSh.GetFlyFrmAttr(aNewAttr);

                SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                DBG_ASSERT(pFact, "Dialogdiet Factory fail!");
                AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog(
                    NULL,
                    &aNewAttr,
                    pDoc,
                    false);
                DBG_ASSERT(pDlg, "Dialogdiet fail!");

                if(RET_OK == pDlg->Execute())
                {
                    // set attributes at FlyFrame
                    rSh.SetFlyFrmAttr(const_cast< SfxItemSet& >(*pDlg->GetOutputItemSet()));

                    static sal_uInt16 __READONLY_DATA aInval[] =
                    {
                        SID_ATTR_FILL_STYLE,
                        SID_ATTR_FILL_COLOR,
                        SID_ATTR_FILL_TRANSPARENCE,
                        SID_ATTR_FILL_FLOATTRANSPARENCE,
                        0
                    };

                    SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();

                    rBnd.Invalidate(aInval);
                    rBnd.Update(SID_ATTR_FILL_STYLE);
                    rBnd.Update(SID_ATTR_FILL_COLOR);
                    rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
                    rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
                }

                delete pDlg;
            }

            break;
        }
    }
}

//UUUU
void SwFrameShell::DisableStateTextFrame(SfxItemSet &rSet)
{
    SfxWhichIter aIter(rSet);
    sal_uInt16 nWhich(aIter.FirstWhich());

    while(nWhich)
    {
        switch(nWhich)
        {
            case SID_ATTRIBUTES_AREA:
            {
                SwWrtShell& rSh = GetShell();

                if(!rSh.IsFrmSelected())
                {
                    rSet.DisableItem(nWhich);
                }

                break;
            }
            default:
            {
                rSet.DisableItem(nWhich);
                break;
            }
        }

        nWhich = aIter.NextWhich();
    }
}

// eof
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index d427e96..057c433 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -791,22 +791,22 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize )

        case( GRAPHIC_BITMAP ):
        {
            //UUUU used when importing a writer FlyFrame with SVG as graphic, added conversion
            // to allow setting the PrefSize at the BitmapEx to hold it
            if(maSvgData.get() && maEx.IsEmpty())
            {
                // use maEx as local buffer for rendered svg
                const_cast< ImpGraphic* >(this)->maEx = maSvgData->getReplacement();
            }

            // #108077# Push through pref size to animation object,
            // will be lost on copy otherwise
            if(maSvgData.get())
            if( ImplIsAnimated() )
            {
                // ignore for Svg. If this is really used (except the grfcache)
                // it can be extended by using maEx as buffer for maSvgData->getReplacement()
                const_cast< BitmapEx& >(mpAnimation->GetBitmapEx()).SetPrefSize( rPrefSize );
            }
            else
            {
                if( ImplIsAnimated() )
                {
                    const_cast< BitmapEx& >(mpAnimation->GetBitmapEx()).SetPrefSize( rPrefSize );
                }

                maEx.SetPrefSize( rPrefSize );
            }
            maEx.SetPrefSize( rPrefSize );
        }
        break;

diff --git a/xmloff/inc/xmloff/txtprmap.hxx b/xmloff/inc/xmloff/txtprmap.hxx
index 45f40e0..4f7f862 100644
--- a/xmloff/inc/xmloff/txtprmap.hxx
+++ b/xmloff/inc/xmloff/txtprmap.hxx
@@ -182,6 +182,14 @@
#define CTF_MARGINTOP                       (XML_TEXT_CTF_START + 151)
#define CTF_MARGINBOTTOM                    (XML_TEXT_CTF_START + 152)

//UUUU
#define CTF_SW_REPEAT_OFFSET_X              (XML_TEXT_CTF_START + 153)
#define CTF_SW_REPEAT_OFFSET_Y              (XML_TEXT_CTF_START + 154)
#define CTF_SW_FILLGRADIENTNAME             (XML_TEXT_CTF_START + 155)
#define CTF_SW_FILLHATCHNAME                (XML_TEXT_CTF_START + 156)
#define CTF_SW_FILLBITMAPNAME               (XML_TEXT_CTF_START + 157)
#define CTF_SW_FILLTRANSNAME                (XML_TEXT_CTF_START + 158)

#define TEXT_PROP_MAP_TEXT 0
#define TEXT_PROP_MAP_PARA 1
#define TEXT_PROP_MAP_FRAME 2
diff --git a/xmloff/inc/xmloff/xmltypes.hxx b/xmloff/inc/xmloff/xmltypes.hxx
index da83e9a..2a8fbc4 100644
--- a/xmloff/inc/xmloff/xmltypes.hxx
+++ b/xmloff/inc/xmloff/xmltypes.hxx
@@ -274,6 +274,14 @@
#define XML_TYPE_TEXT_OVERLINE_WIDTH    (XML_TEXT_TYPES_START + 111)
#define XML_TYPE_TEXT_OVERLINE_COLOR    (XML_TEXT_TYPES_START + 112)
#define XML_TYPE_TEXT_OVERLINE_HASCOLOR (XML_TEXT_TYPES_START + 113)
//UUUU
#define XML_SW_TYPE_FILLSTYLE           (XML_TEXT_TYPES_START + 114)
#define XML_SW_TYPE_FILLBITMAPSIZE      (XML_TEXT_TYPES_START + 115)
#define XML_SW_TYPE_LOGICAL_SIZE        (XML_TEXT_TYPES_START + 116)
#define XML_SW_TYPE_BITMAP_REFPOINT     (XML_TEXT_TYPES_START + 117)
#define XML_SW_TYPE_BITMAP_MODE         (XML_TEXT_TYPES_START + 118)
#define XML_SW_TYPE_BITMAPREPOFFSETX    (XML_TEXT_TYPES_START + 119)
#define XML_SW_TYPE_BITMAPREPOFFSETY    (XML_TEXT_TYPES_START + 120)

#define XML_SCH_TYPES_START (0x4 << XML_TYPE_APP_SHIFT)
#define XML_PM_TYPES_START  (0x5 << XML_TYPE_APP_SHIFT) // page master
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index fa67f8de..9f59cd8 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -467,6 +467,10 @@ void XMLTextExportPropertySetMapper::ContextFilter(
    XMLPropertyState* pAllParaMargin = NULL;
    XMLPropertyState* pAllMargin = NULL;

    //UUUU
    XMLPropertyState* pRepeatOffsetX = NULL;
    XMLPropertyState* pRepeatOffsetY = NULL;

    sal_Bool bNeedsAnchor = sal_False;

    for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
@@ -585,9 +589,41 @@ void XMLTextExportPropertySetMapper::ContextFilter(
        case CTF_TEXT_CLIP:             pClipState = propertie; break;
        case CTF_PARAMARGINALL:         pAllParaMargin = propertie; break;
        case CTF_MARGINALL:             pAllMargin = propertie; break;

        //UUUU
        case CTF_SW_REPEAT_OFFSET_X:
            pRepeatOffsetX = propertie;
            break;

        //UUUU
        case CTF_SW_REPEAT_OFFSET_Y:
            pRepeatOffsetY = propertie;
            break;

        //UUUU
        case CTF_SW_FILLGRADIENTNAME:
        case CTF_SW_FILLHATCHNAME:
        case CTF_SW_FILLBITMAPNAME:
        case CTF_SW_FILLTRANSNAME:
            {
                OUString aStr;
                if( (propertie->maValue >>= aStr) && 0 == aStr.getLength() )
                    propertie->mnIndex = -1;
            }
            break;
        }
    }

    //UUUU
    if( pRepeatOffsetX && pRepeatOffsetY )
    {
        sal_Int32 nOffset = 0;
        if( ( pRepeatOffsetX->maValue >>= nOffset ) && ( nOffset == 0 ) )
            pRepeatOffsetX->mnIndex = -1;
        else
            pRepeatOffsetY->mnIndex = -1;
    }

    if( pFontNameState )
        ContextFontFilter( pFontNameState, pFontFamilyNameState,
                           pFontStyleNameState, pFontFamilyState,
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index c82f333..c5fb255 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -65,6 +65,8 @@ using namespace ::com::sun::star::style;
//using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::text;
using namespace ::xmloff::token;
//UUUU
using namespace ::com::sun::star::drawing;


#define CONSTASCII_USTRINGPARAM_CMP(s) s, sizeof(s)-1
@@ -1269,6 +1271,18 @@ public:
    ~XMLTextPropertyHandlerFactory_Impl();
};

//UUUU
#include <xmloff/EnumPropertyHdl.hxx>
#include <com/sun/star/drawing/FillStyle.hpp>
#include "XMLFillBitmapSizePropertyHandler.hxx"
#include "XMLBitmapLogicalSizePropertyHandler.hxx"
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
#include "XMLBitmapRepeatOffsetPropertyHandler.hxx"
extern SvXMLEnumMapEntry aXML_FillStyle_EnumMap[];
extern SvXMLEnumMapEntry aXML_RefPoint_EnumMap[];
extern SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[];

const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
    ( sal_Int32 nType ) const
{
@@ -1441,6 +1455,28 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
    case XML_TYPE_TEXT_NUMBER8_ONE_BASED:
        pHdl = new XMLNumber8OneBasedHdl();
        break;

    //UUUU
    case XML_SW_TYPE_FILLSTYLE:
        pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, ::getCppuType((const FillStyle*)0) );
        break;
    case XML_SW_TYPE_FILLBITMAPSIZE:
        pHdl = new XMLFillBitmapSizePropertyHandler();
        break;
    case XML_SW_TYPE_LOGICAL_SIZE:
        pHdl = new XMLBitmapLogicalSizePropertyHandler();
        break;
    case XML_SW_TYPE_BITMAP_REFPOINT:
        pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, getCppuType((const RectanglePoint*)0) );
        break;
    case XML_SW_TYPE_BITMAP_MODE:
        pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, getCppuType((const BitmapMode*)0) );
        break;
    case XML_SW_TYPE_BITMAPREPOFFSETX:
    case XML_SW_TYPE_BITMAPREPOFFSETY:
        pHdl = new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX == nType);
        break;

    }

    return pHdl;
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 7ce6e39..45b7697 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -80,6 +80,9 @@ using namespace ::xmloff::token;
#define M_END() \
    { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 }

//UUUU
#define _MAP(name,prefix,token,type,context)  { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 }
#define GMAP(name,prefix,token,type,context) _MAP(name,prefix,token,static_cast<sal_Int32>(type|XML_TYPE_PROP_GRAPHIC),context)

XMLPropertyMapEntry aXMLParaPropMap[] =
{
@@ -630,6 +633,28 @@ XMLPropertyMapEntry aXMLFramePropMap[] =
    MG_E( "BackGraphicFilter",STYLE,    FILTER_NAME,    MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ),
    MG_E( "BackGraphicURL", STYLE,  BACKGROUND_IMAGE,   MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ),

    //UUUU fill attributes
    GMAP( "FillStyle",                      XML_NAMESPACE_DRAW, XML_FILL,                   XML_SW_TYPE_FILLSTYLE, 0 ),
    GMAP( "FillColor",                      XML_NAMESPACE_DRAW, XML_FILL_COLOR,             XML_TYPE_COLOR, 0 ),
    GMAP( "FillColor2",                     XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR,   XML_TYPE_COLOR, 0 ),
    GMAP( "FillGradientName",               XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME,     XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLGRADIENTNAME ),
    GMAP( "FillGradientStepCount",          XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT,    XML_TYPE_NUMBER16, 0 ),
    GMAP( "FillHatchName",                  XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME,        XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLHATCHNAME ),
    GMAP( "FillBackground",                 XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID,       XML_TYPE_BOOL, 0 ),
    GMAP( "FillBitmapName",                 XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME,        XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLBITMAPNAME ),
    GMAP( "FillTransparence",               XML_NAMESPACE_DRAW, XML_OPACITY,                XML_TYPE_NEG_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 ),    // exists in SW, too
    GMAP( "FillTransparenceGradientName",   XML_NAMESPACE_DRAW, XML_OPACITY_NAME,           XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLTRANSNAME ),
    GMAP( "FillBitmapSizeX",                XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH,       XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
    GMAP( "FillBitmapLogicalSize",          XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH,       XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
    GMAP( "FillBitmapSizeY",                XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT,      XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
    GMAP( "FillBitmapLogicalSize",          XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT,      XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ),
    GMAP( "FillBitmapMode",                 XML_NAMESPACE_STYLE,XML_REPEAT,                 XML_SW_TYPE_BITMAP_MODE|MID_FLAG_MULTI_PROPERTY, 0 ),
    GMAP( "FillBitmapPositionOffsetX",      XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, 0 ),
    GMAP( "FillBitmapPositionOffsetY",      XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, 0 ),
    GMAP( "FillBitmapRectanglePoint",       XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT,   XML_SW_TYPE_BITMAP_REFPOINT, 0 ),
    GMAP( "FillBitmapOffsetX",              XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET,     XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_SW_REPEAT_OFFSET_X ),
    GMAP( "FillBitmapOffsetY",              XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET,     XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_SW_REPEAT_OFFSET_Y ),

    // RES_BOX
    MG_ED( "LeftBorder",            STYLE,  BORDER_LINE_WIDTH,        XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ),
    MG_ED( "LeftBorder",            STYLE,  BORDER_LINE_WIDTH_LEFT,   XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ),