diff options
Diffstat (limited to 'sw/source/core/layout/atrfrm.cxx')
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 58 |
1 files changed, 12 insertions, 46 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 6bd42a366ff4..3b5cdbd087dd 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -109,7 +109,7 @@ #include <pagedeschint.hxx> //UUUU -#include <fillattributes.hxx> +#include <svx/sdr/attribute/sdrallfillattributeshelper.hxx> #include <svx/xfillit0.hxx> using namespace ::com::sun::star; @@ -2496,23 +2496,6 @@ SwFrmFmt::SwFrmFmt( 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( @@ -2526,23 +2509,6 @@ SwFrmFmt::SwFrmFmt( 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 ) @@ -2560,7 +2526,7 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) RES_FOOTER, sal_False, (const SfxPoolItem**)&pF ); //UUUU reset fill information - if(RES_FLYFRMFMT == Which() && maFillAttributes.get()) + if(maFillAttributes.get() && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())) { SfxItemIter aIter(*((SwAttrSetChg*)pNew)->GetChgSet()); bool bReset(false); @@ -2576,10 +2542,10 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } } } - else if(RES_FMT_CHG == nWhich) //UUUU + else if(RES_FMT_CHG == nWhich) { //UUUU reset fill information on format change (e.g. style changed) - if(RES_FLYFRMFMT == Which() && maFillAttributes.get()) + if(maFillAttributes.get() && (RES_FLYFRMFMT == Which() || RES_FRMFMT == Which())) { maFillAttributes.reset(); } @@ -3122,9 +3088,9 @@ const String SwFlyFrmFmt::GetObjDescription() const sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const { //UUUU - if(RES_FLYFRMFMT == Which() && getFillAttributes()) + if((RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) && getSdrAllFillAttributesHelper()) { - return getFillAttributes()->isTransparent(); + return getSdrAllFillAttributesHelper()->isTransparent(); } /// NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT) @@ -3166,9 +3132,9 @@ sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const sal_Bool SwFlyFrmFmt::IsBackgroundBrushInherited() const { //UUUU - if(RES_FLYFRMFMT == Which() && getFillAttributes()) + if((RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) && getSdrAllFillAttributesHelper()) { - return !getFillAttributes()->isUsed(); + return !getSdrAllFillAttributesHelper()->isUsed(); } else if ( (GetBackground().GetColor() == COL_TRANSPARENT) && !(GetBackground().GetGraphicObject()) ) @@ -3410,20 +3376,20 @@ SwFrmFmt* SwFrmFmt::GetCaptionFmt() const } //UUUU -FillAttributesPtr SwFrmFmt::getFillAttributes() const +drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrmFmt::getSdrAllFillAttributesHelper() const { - if(RES_FLYFRMFMT == Which()) + if(RES_FLYFRMFMT == Which() || RES_FRMFMT == Which()) { // create FillAttributes on demand if(!maFillAttributes.get()) { - const_cast< SwFrmFmt* >(this)->maFillAttributes.reset(new FillAttributes(GetAttrSet())); + const_cast< SwFrmFmt* >(this)->maFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(GetAttrSet())); } } else { // FALLBACKBREAKHERE assert wrong usage - OSL_ENSURE(false, "getFillAttributes() call only valid for RES_FLYFRMFMT currently (!)"); + OSL_ENSURE(false, "getSdrAllFillAttributesHelper() call only valid for RES_FLYFRMFMT and RES_FRMFMT (!)"); } return maFillAttributes; |