diff options
author | Armin Weiss <aw@openoffice.org> | 2000-11-25 18:00:47 +0000 |
---|---|---|
committer | Armin Weiss <aw@openoffice.org> | 2000-11-25 18:00:47 +0000 |
commit | a6be686523dce67c8dc6ffc2a3b90525e95a15cf (patch) | |
tree | 18e21af034dd747d189ede5f575ef1d14d5cc91e /sw | |
parent | 5780687807fca1705811451b639993f39aa88fe2 (diff) |
#80371# objects like SwFlyDrawObj which are derived directly from SdrObject
need the new mechanism for delivering an ItemSet. Added this functionality
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 28 | ||||
-rw-r--r-- | sw/source/core/inc/dflyobj.hxx | 11 |
2 files changed, 35 insertions, 4 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 82d9cc6ec7f5..4f0c3e600e2b 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dflyobj.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:18 $ + * last change: $Author: aw $ $Date: 2000-11-25 18:59:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,6 +128,30 @@ TYPEINIT1( SwVirtFlyDrawObj, SdrVirtObj ) SwFlyDrawObj::SwFlyDrawObj() { bNotPersistent = TRUE; + mpLocalItemSet = NULL; +} + +SwFlyDrawObj::~SwFlyDrawObj() +{ + if(mpLocalItemSet) + delete mpLocalItemSet; +} + +SfxItemSet* SwFlyDrawObj::CreateNewItemSet(SfxItemPool& rPool) +{ + return new SfxItemSet(rPool); +} + +const SfxItemSet& SwFlyDrawObj::GetItemSet() const +{ + if(!mpLocalItemSet) + { + ((SwFlyDrawObj*)this)->mpLocalItemSet = + ((SwFlyDrawObj*)this)->CreateNewItemSet((SfxItemPool&)(*GetItemPool())); + DBG_ASSERT(mpLocalItemSet, "Could not create an SfxItemSet(!)"); + } + + return *mpLocalItemSet; } /************************************************************************* diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index b0471353d679..a02822f56be3 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dflyobj.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:20 $ + * last change: $Author: aw $ $Date: 2000-11-25 19:00:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,13 +84,20 @@ const UINT16 SwDrawFirst = 0x0001; class SwFlyDrawObj : public SdrObject { + SfxItemSet* mpLocalItemSet; + public: TYPEINFO(); SwFlyDrawObj(); + ~SwFlyDrawObj(); virtual FASTBOOL Paint(ExtOutputDevice& rOut, const SdrPaintInfoRec& rInfoRec) const; + // ItemSet access + virtual const SfxItemSet& GetItemSet() const; + virtual SfxItemSet* CreateNewItemSet(SfxItemPool& rPool); + //Damit eine Instanz dieser Klasse beim laden erzeugt werden kann //(per Factory). virtual UINT32 GetObjInventor() const; |