diff options
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 31 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 12 |
2 files changed, 43 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 0414d038aaa0..ec30110775fc 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -38,6 +38,7 @@ #include <sfx2/objface.hxx> #include <sfx2/objsh.hxx> #include <svl/whiter.hxx> +#include <svl/grabbagitem.hxx> #include <svtools/colorcfg.hxx> #include <tools/bigint.hxx> #include <tools/diagnose_ex.h> @@ -433,6 +434,7 @@ SdrObject::SdrObject() ,pUserCall(NULL) ,pPlusData(NULL) ,nOrdNum(0) + ,pGrabBagItem(NULL) ,mnNavigationPosition(SAL_MAX_UINT32) ,mnLayerID(0) ,mpSvxShape( NULL ) @@ -501,6 +503,8 @@ SdrObject::~SdrObject() SendUserCall(SDRUSERCALL_DELETE, GetLastBoundRect()); delete pPlusData; + delete pGrabBagItem; + if(mpProperties) { delete mpProperties; @@ -906,6 +910,27 @@ void SdrObject::SetOrdNum(sal_uInt32 nNum) nOrdNum = nNum; } +void SdrObject::GetGrabBagItem(com::sun::star::uno::Any& rVal) const +{ + if (pGrabBagItem != NULL) + pGrabBagItem->QueryValue(rVal); + else { + uno::Sequence<beans::PropertyValue> aValue(0); + rVal = uno::makeAny(aValue); + } +} + +void SdrObject::SetGrabBagItem(const com::sun::star::uno::Any& rVal) +{ + if (pGrabBagItem == NULL) + pGrabBagItem = new SfxGrabBagItem; + + pGrabBagItem->PutValue(rVal); + + SetChanged(); + BroadcastObjectChange(); +} + sal_uInt32 SdrObject::GetNavigationPosition (void) { if (pObjList!=NULL && pObjList->RecalcNavigationPositions()) @@ -1086,6 +1111,12 @@ SdrObject& SdrObject::operator=(const SdrObject& rObj) delete pPlusData->pBroadcast; // broadcaster isn't copied pPlusData->pBroadcast=NULL; } + + delete pGrabBagItem; + pGrabBagItem=NULL; + if (rObj.pGrabBagItem!=NULL) + pGrabBagItem=static_cast< SfxGrabBagItem* >( rObj.pGrabBagItem->Clone() ); + aGridOffset = rObj.aGridOffset; return *this; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 012d56728c55..50330d4778f2 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2451,6 +2451,12 @@ bool SvxShape::setPropertyValueImpl( const OUString&, const SfxItemPropertySimpl break; } + case OWN_ATTR_INTEROPGRABBAG: + { + mpObj->SetGrabBagItem(rValue); + return true; + } + case SDRATTR_OBJMOVEPROTECT: { sal_Bool bMoveProtect = sal_Bool(); @@ -2854,6 +2860,12 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertySimpl rValue <<= (sal_Int32)mpObj->GetShearAngle(); break; + case OWN_ATTR_INTEROPGRABBAG: + { + mpObj->GetGrabBagItem(rValue); + break; + } + case SDRATTR_OBJMOVEPROTECT: rValue = uno::makeAny( (sal_Bool) mpObj->IsMoveProtect() ); break; |