diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-28 13:34:52 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-28 13:49:41 +0100 |
commit | abe9599b9dea6d7b3ad840dee88848ac10f55a04 (patch) | |
tree | 53cb8bf2fed4723cf0f976fdc8de390b63806341 /sw | |
parent | XFillGradientItem: don't assume the default Which ID (diff) | |
download | core-abe9599b9dea6d7b3ad840dee88848ac10f55a04.tar.gz core-abe9599b9dea6d7b3ad840dee88848ac10f55a04.zip |
text::BaseFrameProperties: add FillGradientName optional property
Change-Id: Iae428edb97e31ae578d2ab4679f6d346d5339a9f
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unoprnms.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 31 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoprnms.cxx | 1 |
4 files changed, 27 insertions, 10 deletions
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index a9834b3346b7..42027aff2028 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -818,8 +818,9 @@ enum SwPropNameIds /* 0756 */ UNO_NAME_HIDDEN, /* 0757 */ UNO_NAME_FILL_STYLE, /* 0758 */ UNO_NAME_FILL_GRADIENT, +/* 0759 */ UNO_NAME_FILL_GRADIENT_NAME, -/* 0759 */ SW_PROPNAME_END +/* 0760 */ SW_PROPNAME_END // new items in this array must match SwPropNameTab aPropNameTab }; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index c3814192410e..d9031a40aded 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -136,7 +136,7 @@ public: void SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal); bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& pAny ); - bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound); + bool FillBaseProperties(SwDoc* pDoc, SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound); virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, bool& rSizeFound) = 0; @@ -156,7 +156,7 @@ bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, return aAnyMap.FillValue( nWID, nMemberId, rpAny ); } -bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound) +bool BaseFrameProperties_Impl::FillBaseProperties(SwDoc* pDoc, SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound) { bool bRet = true; //Anker kommt auf jeden Fall in den Set @@ -229,11 +229,24 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI { const ::uno::Any* pFillGradient = 0; GetProperty(RES_FILL_GRADIENT, MID_FILLGRADIENT, pFillGradient); - if (pFillGradient) + const ::uno::Any* pName = 0; + GetProperty(RES_FILL_GRADIENT, MID_NAME, pName); + if (pFillGradient || pName) { XFillGradientItem aFillGradient( static_cast <const :: XFillGradientItem & > ( rFromSet.Get ( RES_FILL_GRADIENT ) ) ); - bRet &= ((SfxPoolItem&)aFillGradient).PutValue(*pFillGradient, MID_FILLGRADIENT); - rToSet.Put(aFillGradient); + XFillGradientItem* pItem = &aFillGradient; + if (pFillGradient) + bRet &= ((SfxPoolItem*)pItem)->PutValue(*pFillGradient, MID_FILLGRADIENT); + if (pName) + bRet &= ((SfxPoolItem*)pItem)->PutValue(*pName, MID_NAME); + SdrModel* pModel = pDoc->GetDrawModel(); + pItem = pItem->checkForUniqueItem( pModel ); + if (pItem) + { + rToSet.Put(*pItem); + if(pItem != &aFillGradient) + delete pItem; + } } } { @@ -578,13 +591,13 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItem { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) ); const :: SfxItemSet *pItemSet = &xStyle->GetItemSet(); - bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound ); + bRet = FillBaseProperties( pDoc, rSet, *pItemSet, rSizeFound ); lcl_FillCol ( rSet, *pItemSet, pColumns ); } else { const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_FRAME )->GetAttrSet(); - bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound ); + bRet = FillBaseProperties( pDoc, rSet, *pItemSet, rSizeFound ); lcl_FillCol ( rSet, *pItemSet, pColumns ); } const ::uno::Any* pEdit; @@ -659,13 +672,13 @@ bool SwGraphicProperties_Impl::AnyToItemSet( { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) ); const :: SfxItemSet *pItemSet = &xStyle->GetItemSet(); - bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound); + bRet = FillBaseProperties(pDoc, rFrmSet, *pItemSet, rSizeFound); lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet ); } else { const :: SfxItemSet *pItemSet = &pDoc->GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet(); - bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound); + bRet = FillBaseProperties(pDoc, rFrmSet, *pItemSet, rSizeFound); lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet ); } diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 061f76c59444..8e1f68257c09 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -290,6 +290,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { 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_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT}, \ + { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT_NAME), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_NAME}, \ { 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 }, \ @@ -668,6 +669,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { 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_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_GRADIENT), PROPERTY_NONE ,MID_FILLGRADIENT}, + { SW_PROP_NMID(UNO_NAME_FILL_GRADIENT_NAME), RES_FILL_GRADIENT, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE ,MID_NAME}, // { 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 }, diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index de7171257b3c..f1e0f196a4d0 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -788,6 +788,7 @@ const SwPropNameTab aPropNameTab = { /* 0756 UNO_NAME_HIDDEN */ {MAP_CHAR_LEN("Hidden")}, /* 0757 UNO_NAME_FILL_STYLE */ {MAP_CHAR_LEN("FillStyle")}, /* 0758 UNO_NAME_FILL_GRADIENT */ {MAP_CHAR_LEN("FillGradient")}, +/* 0759 UNO_NAME_FILL_GRADIENT_NAME */ {MAP_CHAR_LEN("FillGradientName")}, // new items in this array must match enum SwPropNameIds }; |