diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-28 11:56:10 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-28 13:49:41 +0100 |
commit | a1bef744a24b072adc22035b5b15b376961351d8 (patch) | |
tree | 9bb035b3db18f8d85769469a7621bce710628f8c /sw | |
parent | SwXTextFrame: use XFillStyleItem instead of extending SvxBrushItem (diff) | |
download | core-a1bef744a24b072adc22035b5b15b376961351d8.tar.gz core-a1bef744a24b072adc22035b5b15b376961351d8.zip |
SwXTextFrame: use XFillGradientItem instead of extending SvxBrushItem
Change-Id: I8863cbe1d01fceac0f4b4152264c1464c90e02b8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/frmatr.hxx | 2 | ||||
-rw-r--r-- | sw/inc/hintids.hxx | 1 | ||||
-rw-r--r-- | sw/inc/swatrset.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/access/accpara.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/inc/frame.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/frmtool.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 27 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/text/porfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 4 |
15 files changed, 59 insertions, 24 deletions
diff --git a/sw/inc/frmatr.hxx b/sw/inc/frmatr.hxx index 2266c14932a5..402005d02b79 100644 --- a/sw/inc/frmatr.hxx +++ b/sw/inc/frmatr.hxx @@ -46,6 +46,8 @@ inline const SvxBrushItem &SwAttrSet::GetBackground(sal_Bool bInP) const { return (const SvxBrushItem&)Get( RES_BACKGROUND,bInP); } inline const XFillStyleItem &SwAttrSet::GetFillStyle(sal_Bool bInP) const { return (const XFillStyleItem&)Get( RES_FILL_STYLE,bInP); } +inline const XFillGradientItem &SwAttrSet::GetFillGradient(sal_Bool bInP) const + { return (const XFillGradientItem&)Get( RES_FILL_GRADIENT,bInP); } inline const SvxShadowItem &SwAttrSet::GetShadow(sal_Bool bInP) const { return (const SvxShadowItem&)Get( RES_SHADOW,bInP); } inline const SvxFmtBreakItem &SwAttrSet::GetBreak(sal_Bool bInP) const diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 8c27a86286e1..e6c5c7930c08 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -221,6 +221,7 @@ RES_FRMATR_BEGIN = RES_PARATR_LIST_END, RES_FRMATR_STYLE_NAME, // 120 RES_FRMATR_CONDITIONAL_STYLE_NAME, // 121 RES_FILL_STYLE, + RES_FILL_GRADIENT, RES_FRMATR_END }; diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx index 48893466e532..65572db04478 100644 --- a/sw/inc/swatrset.hxx +++ b/sw/inc/swatrset.hxx @@ -75,6 +75,7 @@ class SwFmtAnchor; class SvxBoxItem; class SvxBrushItem; class XFillStyleItem; +class XFillGradientItem; class SvxShadowItem; class SwFmtPageDesc; class SvxFmtBreakItem; @@ -272,6 +273,7 @@ public: inline const SvxFmtKeepItem &GetKeep( sal_Bool = sal_True ) const; inline const SvxBrushItem &GetBackground( sal_Bool = sal_True ) const; inline const XFillStyleItem &GetFillStyle( sal_Bool = sal_True ) const; + inline const XFillGradientItem &GetFillGradient( 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; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 983fb29e9664..9268639bc6f5 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -914,10 +914,11 @@ static bool lcl_GetBackgroundColor( Color & rColor, { const SvxBrushItem* pBackgrdBrush = 0; const XFillStyleItem* pFillStyleItem = 0; + const XFillGradientItem* pFillGradientItem = 0; const Color* pSectionTOXColor = 0; SwRect aDummyRect; if ( pFrm && - pFrm->GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pSectionTOXColor, aDummyRect, false ) ) + pFrm->GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pFillGradientItem, pSectionTOXColor, aDummyRect, false ) ) { if ( pSectionTOXColor ) { diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 77829f440931..8bc36232ee91 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -111,6 +111,7 @@ #include <svl/macitem.hxx> #include <svx/dialogs.hrc> #include <svx/xfillit0.hxx> +#include <svx/xflgrit.hxx> #include <swcalwrp.hxx> #include <SwStyleNameMapper.hxx> #include <tblafmt.hxx> @@ -381,6 +382,7 @@ SfxItemInfo aSlotTab[] = { 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_STYLE_NAME { 0, SFX_ITEM_POOLABLE }, // RES_FRMATR_CONDITIONAL_STYLE_NAME { 0, SFX_ITEM_POOLABLE }, // RES_FILL_STYLE + { 0, SFX_ITEM_POOLABLE }, // RES_FILL_GRADIENT { 0, SFX_ITEM_POOLABLE }, // RES_GRFATR_MIRRORGRF { SID_ATTR_GRAF_CROP, SFX_ITEM_POOLABLE }, // RES_GRFATR_CROPGRF @@ -597,6 +599,7 @@ void _InitCore() aAttrTab[ RES_FRMATR_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_STYLE_NAME, aEmptyStr ); aAttrTab[ RES_FRMATR_CONDITIONAL_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_CONDITIONAL_STYLE_NAME, aEmptyStr ); aAttrTab[ RES_FILL_STYLE - POOLATTR_BEGIN ] = new XFillStyleItem(XFILL_SOLID, RES_FILL_STYLE); + aAttrTab[ RES_FILL_GRADIENT - POOLATTR_BEGIN ] = new XFillGradientItem(RES_FILL_GRADIENT); aAttrTab[ RES_GRFATR_MIRRORGRF- POOLATTR_BEGIN ] = new SwMirrorGrf; aAttrTab[ RES_GRFATR_CROPGRF- POOLATTR_BEGIN ] = new SwCropGrf; diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 84fc446483c8..137ade35dbdc 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -209,10 +209,10 @@ static void lcl_ClearArea( const SwFrm &rFrm, if ( !aRegion.empty() ) { - const SvxBrushItem *pItem; const XFillStyleItem* pFillStyleItem; const Color *pCol; SwRect aOrigRect; - if ( rFrm.GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigRect, sal_False ) ) + const SvxBrushItem *pItem; const XFillStyleItem* pFillStyleItem; const XFillGradientItem* pFillGradientItem; const Color *pCol; SwRect aOrigRect; + if ( rFrm.GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigRect, sal_False ) ) for( sal_uInt16 i = 0; i < aRegion.size(); ++i ) - ::DrawGraphic( pItem, pFillStyleItem, &rOut, aOrigRect, aRegion[i] ); + ::DrawGraphic( pItem, pFillStyleItem, pFillGradientItem, &rOut, aOrigRect, aRegion[i] ); else { rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR ); diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 96d59bf6d0a8..febaa8d517c3 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -49,6 +49,7 @@ class SwBorderAttrs; class SwCache; class SvxBrushItem; class XFillStyleItem; +class XFillGradientItem; class SwSelectionList; struct SwPosition; struct SwCrsrMoveState; @@ -503,6 +504,7 @@ public: sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush, const XFillStyleItem* & rpFillStyle, + const XFillGradientItem* & rpFillGradient, const Color*& rpColor, SwRect &rOrigRect, sal_Bool bLowerMode ) const; diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 78af6f009085..fc2e76324c43 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -37,6 +37,7 @@ class SdrObject; class BigInt; class SvxBrushItem; class XFillStyleItem; +class XFillGradientItem; class SdrMarkList; class SwNodeIndex; class OutputDevice; @@ -51,7 +52,7 @@ class SwPageDesc; // draw background with brush or graphics // The 6th parameter indicates that the method should consider background // transparency, saved in the color of the brush item. -void DrawGraphic( const SvxBrushItem *, const XFillStyleItem*, OutputDevice *, +void DrawGraphic( const SvxBrushItem *, const XFillStyleItem*, const XFillGradientItem*, OutputDevice *, const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum = GRFNUM_NO, const sal_Bool bConsiderBackgroundTransparency = sal_False ); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 94dedda3386e..e0d024699a68 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <hintids.hxx> #include <vcl/lazydelete.hxx> +#include <vcl/gradient.hxx> #include <tools/poly.hxx> #include <svx/xoutbmp.hxx> #include <sfx2/progress.hxx> @@ -30,6 +31,7 @@ #include <editeng/shaditem.hxx> #include <editeng/ulspitem.hxx> #include <svx/framelink.hxx> +#include <svx/xflgrit.hxx> #include <vcl/graph.hxx> #include <svx/svdpagv.hxx> #include <tgrditem.hxx> @@ -1786,6 +1788,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut, void DrawGraphic( const SvxBrushItem *pBrush, const XFillStyleItem* pFillStyleItem, + const XFillGradientItem* pFillGradientItem, OutputDevice *pOutDev, const SwRect &rOrg, const SwRect &rOut, @@ -2077,7 +2080,7 @@ void DrawGraphic( const SvxBrushItem *pBrush, /// draw poly-polygon transparent pOutDev->DrawTransparent( aDrawPoly, nTransparencyPercent ); } - else if (!pFillStyleItem || pFillStyleItem->GetValue() != XFILL_GRADIENT) + else if (!pFillStyleItem || pFillStyleItem->GetValue() != XFILL_GRADIENT || !pFillGradientItem) { SwRegionRects aRegion( rOut, 4 ); if ( !bGrfIsTransparent ) @@ -2091,7 +2094,7 @@ void DrawGraphic( const SvxBrushItem *pBrush, } } else - pOutDev->DrawGradient(rOut.SVRect(), pBrush->GetGradient()); + pOutDev->DrawGradient(rOut.SVRect(), pFillGradientItem->GetGradientValue().VclGradient()); pOutDev ->Pop(); } @@ -3712,9 +3715,10 @@ sal_Bool SwFlyFrm::IsBackgroundTransparent() const { const SvxBrushItem* pBackgrdBrush = 0; const XFillStyleItem* pFillStyleItem = 0; + const XFillGradientItem* pFillGradientItem = 0; const Color* pSectionTOXColor = 0; SwRect aDummyRect; - if ( GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pSectionTOXColor, aDummyRect, false) ) + if ( GetBackgroundBrush( pBackgrdBrush, pFillStyleItem, pFillGradientItem, pSectionTOXColor, aDummyRect, false) ) { if ( pSectionTOXColor && (pSectionTOXColor->GetTransparency() != 0) && @@ -6086,6 +6090,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, const SvxBrushItem* pItem; const XFillStyleItem* pFillStyleItem; + const XFillGradientItem* pFillGradientItem; /// OD 05.09.2002 #102912# /// temporary background brush for a fly frame without a background brush SvxBrushItem* pTmpBackBrush = 0; @@ -6094,7 +6099,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, const bool bPageFrm = IsPageFrm(); sal_Bool bLowMode = sal_True; - sal_Bool bBack = GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, bLowerMode ); + sal_Bool bBack = GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, bLowerMode ); //- Output if a separate background is used. bool bNoFlyBackground = !bFlyMetafile && !bBack && IsFlyFrm(); if ( bNoFlyBackground ) @@ -6104,7 +6109,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, // <GetBackgroundBrush> disabled this option with the parameter <bLowerMode> if ( bLowerMode ) { - bBack = GetBackgroundBrush( pItem, pFillStyleItem, pCol, aOrigBackRect, false ); + bBack = GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, false ); } // If still no background found for the fly frame, initialize the // background brush <pItem> with global retouche color and set <bBack> @@ -6195,7 +6200,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, /// Set missing 5th parameter to the default value GRFNUM_NO /// - see declaration in /core/inc/frmtool.hxx. if (IsTxtFrm() || !bOnlyTxtBackground) - ::DrawGraphic( pItem, pFillStyleItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO, + ::DrawGraphic( pItem, pFillStyleItem, pFillGradientItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO, bConsiderBackgroundTransparency ); } } @@ -6873,9 +6878,10 @@ const Color& SwPageFrm::GetDrawBackgrdColor() const { const SvxBrushItem* pBrushItem; const XFillStyleItem* pFillStyleItem; + const XFillGradientItem* pFillGradientItem; const Color* pDummyColor; SwRect aDummyRect; - if ( GetBackgroundBrush( pBrushItem, pFillStyleItem, pDummyColor, aDummyRect, true) ) + if ( GetBackgroundBrush( pBrushItem, pFillStyleItem, pFillGradientItem, pDummyColor, aDummyRect, true) ) return pBrushItem->GetColor(); else return aGlobalRetoucheColor; @@ -7003,6 +7009,9 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const @param rpFillStyle output parameter - constant reference pointer the found background fill style + @param rpFillGradient + output parameter - constant reference pointer the found background fill gradient + @param rpCol output parameter - constant reference pointer to the color of the index shading set under special conditions, if background brush is taken from an index section. @@ -7020,6 +7029,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const */ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush, const XFillStyleItem* & rpFillStyle, + const XFillGradientItem* & rpFillGradient, const Color*& rpCol, SwRect &rOrigRect, sal_Bool bLowerMode ) const @@ -7029,6 +7039,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush, const SwViewOption *pOpt = pSh->GetViewOptions(); rpBrush = 0; rpFillStyle = 0; + rpFillGradient = 0; rpCol = NULL; do { if ( pFrm->IsPageFrm() && !pOpt->IsPageBack() ) @@ -7036,6 +7047,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush, const SvxBrushItem &rBack = pFrm->GetAttrSet()->GetBackground(); const XFillStyleItem &rFillStyle = pFrm->GetAttrSet()->GetFillStyle(); + const XFillGradientItem &rFillGradient = pFrm->GetAttrSet()->GetFillGradient(); if( pFrm->IsSctFrm() ) { const SwSection* pSection = ((SwSectionFrm*)pFrm)->GetSection(); @@ -7082,6 +7094,7 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush, { rpBrush = &rBack; rpFillStyle = &rFillStyle; + rpFillGradient = &rFillGradient; if ( pFrm->IsPageFrm() && pSh->GetViewOptions()->getBrowseMode() ) rOrigRect = pFrm->Frm(); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 8d8543d9ab3c..3696cb880fec 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -514,13 +514,14 @@ static sal_Bool lcl_IsDarkBackground( const SwTxtPaintInfo& rInf ) { const SvxBrushItem* pItem; const XFillStyleItem* pFillStyleItem; + const XFillGradientItem* pFillGradientItem; SwRect aOrigBackRect; // Consider, that [GetBackgroundBrush(...)] can set <pCol> // See implementation in /core/layout/paintfrm.cxx // 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, pFillStyleItem, pCol, aOrigBackRect, sal_False ) ) + if( rInf.GetTxtFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, sal_False ) ) { if ( !pCol ) pCol = &pItem->GetColor(); @@ -885,7 +886,7 @@ void SwTxtPaintInfo::DrawRect( const SwRect &rRect, sal_Bool bNoGraphic, else { OSL_ENSURE( ((SvxBrushItem*)-1) != pBrushItem, "DrawRect: Uninitialized BrushItem!" ); - ::DrawGraphic( pBrushItem, 0, pOut, aItemRect, rRect ); + ::DrawGraphic( pBrushItem, 0, 0, pOut, aItemRect, rRect ); } } } diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 9217a05ee512..a054df49c318 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -1021,7 +1021,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const } if( bDraw && aTmp.HasArea() ) - DrawGraphic( pBrush, 0, (OutputDevice*)rInf.GetOut(), + DrawGraphic( pBrush, 0, 0, (OutputDevice*)rInf.GetOut(), aTmp, aRepaint, bReplace ? GRFNUM_REPLACE : GRFNUM_YES ); } diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index bc9ee742f51c..e38086a7f971 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -658,7 +658,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect, { OSL_ENSURE( ((SvxBrushItem*)-1) != rInf.GetBrushItem(), "DrawRect: Uninitialized BrushItem!" ); - ::DrawGraphic( rInf.GetBrushItem(), 0, pOut, rInf.GetBrushRect(), + ::DrawGraphic( rInf.GetBrushItem(), 0, 0, pOut, rInf.GetBrushRect(), aRegion[i] ); } } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 030e3efa4278..21408f80d180 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2540,6 +2540,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont ) { const SvxBrushItem* pItem; const XFillStyleItem* pFillStyleItem; + const XFillGradientItem* pFillGradientItem; SwRect aOrigBackRect; /// OD 21.08.2002 @@ -2548,7 +2549,7 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFont ) /// 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, pFillStyleItem, pCol, aOrigBackRect, sal_False ) ) + if( GetFrm()->GetBackgroundBrush( pItem, pFillStyleItem, pFillGradientItem, pCol, aOrigBackRect, sal_False ) ) { if ( !pCol ) { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 07362cad3e3b..c3814192410e 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/embed/XClassifiedObject.hpp> #include <com/sun/star/embed/XVisualObject.hpp> #include <com/sun/star/embed/XComponentSupplier.hpp> @@ -28,6 +29,7 @@ #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <svx/svxids.hrc> #include <svx/xfillit0.hxx> +#include <svx/xflgrit.hxx> #include <editeng/memberids.hrc> #include <swtypes.hxx> @@ -175,8 +177,6 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI 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* pGradient = 0; - GetProperty(RES_BACKGROUND, MID_FILL_GRADIENT, pGradient); const ::uno::Any* pTrans = 0; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pTrans ); const ::uno::Any* pGrLoc = 0; @@ -189,15 +189,13 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency ); if(pCol || pTrans || pGrURL || pGrFilter || pGrLoc || - pGrTranparency || pColTrans || pRGBCol || pGradient) + pGrTranparency || pColTrans || pRGBCol) { SvxBrushItem aBrush ( static_cast < const :: SvxBrushItem & > ( rFromSet.Get ( RES_BACKGROUND ) ) ); if(pCol ) bRet &= ((SfxPoolItem&)aBrush).PutValue(*pCol,MID_BACK_COLOR ); if(pColTrans) bRet &= ((SfxPoolItem&)aBrush).PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY); - if(pGradient) - bRet &= ((SfxPoolItem&)aBrush).PutValue(*pGradient, MID_FILL_GRADIENT); if(pRGBCol) bRet &= ((SfxPoolItem&)aBrush).PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B); if(pTrans) @@ -229,6 +227,16 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI } } { + const ::uno::Any* pFillGradient = 0; + GetProperty(RES_FILL_GRADIENT, MID_FILLGRADIENT, pFillGradient); + if (pFillGradient) + { + XFillGradientItem aFillGradient( static_cast <const :: XFillGradientItem & > ( rFromSet.Get ( RES_FILL_GRADIENT ) ) ); + bRet &= ((SfxPoolItem&)aFillGradient).PutValue(*pFillGradient, MID_FILLGRADIENT); + rToSet.Put(aFillGradient); + } + } + { const ::uno::Any* pCont = 0; GetProperty(RES_PROTECT, MID_PROTECT_CONTENT, pCont ); const ::uno::Any* pPos = 0; diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index e80c7cbe8b82..061f76c59444 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -289,7 +289,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { SW_PROP_NMID(UNO_NAME_BACK_COLOR_R_G_B), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR_R_G_B}, \ { SW_PROP_NMID(UNO_NAME_BACK_COLOR_TRANSPARENCY), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE ,MID_BACK_COLOR_TRANSPARENCY}, \ { SW_PROP_NMID(UNO_NAME_FILL_STYLE), RES_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0}, \ - { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILL_GRADIENT}, \ + { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT}, \ { SW_PROP_NMID(UNO_NAME_CONTENT_PROTECTED), RES_PROTECT, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_PROTECT_CONTENT }, \ { SW_PROP_NMID(UNO_NAME_FRAME_STYLE_NAME), FN_UNO_FRAME_STYLE_NAME,CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0}, \ { SW_PROP_NMID(UNO_NAME_BACK_GRAPHIC_URL), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_GRAPHIC_URL }, \ @@ -667,7 +667,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_BACK_COLOR_R_G_B), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE ,MID_BACK_COLOR_R_G_B}, { SW_PROP_NMID(UNO_NAME_BACK_COLOR_TRANSPARENCY), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE ,MID_BACK_COLOR_TRANSPARENCY}, \ { SW_PROP_NMID(UNO_NAME_FILL_STYLE), RES_FILL_STYLE, CPPU_E2T(CPPUTYPE_FILLSTYLE), PROPERTY_NONE ,0}, - { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_BACKGROUND, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILL_GRADIENT}, + { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT}, // { SW_PROP_NMID(UNO_NAME_CHAIN_NEXT_NAME), RES_CHAIN, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_CHAIN_NEXTNAME}, // { SW_PROP_NMID(UNO_NAME_CHAIN_PREV_NAME), RES_CHAIN, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_CHAIN_PREVNAME}, /*not impl*/ { SW_PROP_NMID(UNO_NAME_CLIENT_MAP), RES_URL, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE ,MID_URL_CLIENTMAP }, |