diff options
Diffstat (limited to 'svl/inc/svl/itempool.hxx')
-rw-r--r-- | svl/inc/svl/itempool.hxx | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index 04ae4f07d29b..82be869fa13c 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,27 +51,27 @@ DBG_NAMEEX(SfxItemPool) //==================================================================== -#define SFX_ITEM_POOLABLE 0x0001 -#define SFX_ITEM_NOT_POOLABLE 0x0002 - -#define SFX_ITEM_USERFLAG0 0x0100 -#define SFX_ITEM_USERFLAG1 0x0200 -#define SFX_ITEM_USERFLAG2 0x0400 -#define SFX_ITEM_USERFLAG3 0x0800 -#define SFX_ITEM_USERFLAG4 0x1000 -#define SFX_ITEM_USERFLAG5 0x2000 -#define SFX_ITEM_USERFLAG6 0x4000 -#define SFX_ITEM_USERFLAG7 0x8000 -#define SFX_ITEM_USERFLAG8 0x0010 -#define SFX_ITEM_USERFLAG9 0x0020 -#define SFX_ITEM_USERFLAGA 0x0040 -#define SFX_ITEM_USERFLAGB 0x0080 +#define SFX_ITEM_POOLABLE 0x0001 +#define SFX_ITEM_NOT_POOLABLE 0x0002 + +#define SFX_ITEM_USERFLAG0 0x0100 +#define SFX_ITEM_USERFLAG1 0x0200 +#define SFX_ITEM_USERFLAG2 0x0400 +#define SFX_ITEM_USERFLAG3 0x0800 +#define SFX_ITEM_USERFLAG4 0x1000 +#define SFX_ITEM_USERFLAG5 0x2000 +#define SFX_ITEM_USERFLAG6 0x4000 +#define SFX_ITEM_USERFLAG7 0x8000 +#define SFX_ITEM_USERFLAG8 0x0010 +#define SFX_ITEM_USERFLAG9 0x0020 +#define SFX_ITEM_USERFLAGA 0x0040 +#define SFX_ITEM_USERFLAGB 0x0080 //==================================================================== struct SfxItemInfo { - USHORT _nSID; + USHORT _nSID; USHORT _nFlags; }; @@ -91,7 +91,7 @@ typedef ::std::vector< SfxItemPoolUser* > SfxItemPoolUserVector; class SVL_DLLPUBLIC SfxItemPool -/* [Beschreibung] +/* [Beschreibung] Die von dieser Klasse abgeleiteten Klassen dienen der Bereitstellung von Defaults von SfxPoolItems und halten konkrete (konstante) Instanzen, die @@ -108,20 +108,20 @@ class SVL_DLLPUBLIC SfxItemPool SVL_DLLPRIVATE void readTheItems(SvStream & rStream, USHORT nCount, USHORT nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr); - UniString aName; - USHORT nStart, nEnd; - USHORT _nFileFormatVersion; + UniString aName; + USHORT nStart, nEnd; + USHORT _nFileFormatVersion; #ifdef TF_POOLABLE - const SfxItemInfo* pItemInfos; + const SfxItemInfo* pItemInfos; #else - USHORT* pSlotIds; + USHORT* pSlotIds; #endif - SfxItemPool_Impl* pImp; - SfxPoolItem** ppStaticDefaults; - SfxPoolItem** ppPoolDefaults; - SfxItemPool* pSecondary; - SfxItemPool* pMaster; - USHORT* _pPoolRanges; + SfxItemPool_Impl* pImp; + SfxPoolItem** ppStaticDefaults; + SfxPoolItem** ppPoolDefaults; + SfxItemPool* pSecondary; + SfxItemPool* pMaster; + USHORT* _pPoolRanges; bool bPersistentRefCounts; private: @@ -138,16 +138,16 @@ public: friend class SfxPoolWhichMap; private: - inline USHORT GetIndex_Impl(USHORT nWhich) const; - inline USHORT GetSize_Impl() const { return nEnd - nStart + 1; } + inline USHORT GetIndex_Impl(USHORT nWhich) const; + inline USHORT GetSize_Impl() const { return nEnd - nStart + 1; } SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream ); SVL_DLLPRIVATE bool IsItemFlag_Impl( USHORT nWhich, USHORT nFlag ) const; public: // fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges - void FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const; - const USHORT* GetFrozenIdRanges() const + void FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const; + const USHORT* GetFrozenIdRanges() const { return _pPoolRanges; } bool IsVer2_Impl() const; @@ -155,9 +155,9 @@ public: //--------------------------------------------------------------------- protected: - static inline void SetRefCount( SfxPoolItem& rItem, ULONG n ); - static inline ULONG AddRef( const SfxPoolItem& rItem, ULONG n = 1 ); - static inline ULONG ReleaseRef( const SfxPoolItem& rItem, ULONG n = 1); + static inline void SetRefCount( SfxPoolItem& rItem, ULONG n ); + static inline ULONG AddRef( const SfxPoolItem& rItem, ULONG n = 1 ); + static inline ULONG ReleaseRef( const SfxPoolItem& rItem, ULONG n = 1); public: SfxItemPool( const SfxItemPool &rPool, @@ -173,74 +173,74 @@ public: #endif bool bLoadRefCounts = true ); protected: - virtual ~SfxItemPool(); + virtual ~SfxItemPool(); public: static void Free(SfxItemPool* pPool); - SfxBroadcaster& BC(); + SfxBroadcaster& BC(); - void SetPoolDefaultItem( const SfxPoolItem& ); - const SfxPoolItem* GetPoolDefaultItem( USHORT nWhich ) const; + void SetPoolDefaultItem( const SfxPoolItem& ); + const SfxPoolItem* GetPoolDefaultItem( USHORT nWhich ) const; void ResetPoolDefaultItem( USHORT nWhich ); void SetDefaults( SfxPoolItem **pDefaults ); - void ReleaseDefaults( BOOL bDelete = FALSE ); - static void ReleaseDefaults( SfxPoolItem **pDefaults, USHORT nCount, BOOL bDelete = FALSE ); + void ReleaseDefaults( BOOL bDelete = FALSE ); + static void ReleaseDefaults( SfxPoolItem **pDefaults, USHORT nCount, BOOL bDelete = FALSE ); - virtual SfxMapUnit GetMetric( USHORT nWhich ) const; - void SetDefaultMetric( SfxMapUnit eNewMetric ); - virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem, + virtual SfxMapUnit GetMetric( USHORT nWhich ) const; + void SetDefaultMetric( SfxMapUnit eNewMetric ); + virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem, SfxItemPresentation ePresentation, - SfxMapUnit ePresentationMetric, - XubString& rText, + SfxMapUnit ePresentationMetric, + XubString& rText, const IntlWrapper * pIntlWrapper = 0 ) const; - virtual SfxItemPool* Clone() const; - UniString const & GetName() const { return aName; } + virtual SfxItemPool* Clone() const; + UniString const & GetName() const { return aName; } - virtual const SfxPoolItem& Put( const SfxPoolItem&, USHORT nWhich = 0 ); - virtual void Remove( const SfxPoolItem& ); - virtual const SfxPoolItem& GetDefaultItem( USHORT nWhich ) const; + virtual const SfxPoolItem& Put( const SfxPoolItem&, USHORT nWhich = 0 ); + virtual void Remove( const SfxPoolItem& ); + virtual const SfxPoolItem& GetDefaultItem( USHORT nWhich ) const; - const SfxPoolItem* LoadItem( SvStream &rStream, + const SfxPoolItem* LoadItem( SvStream &rStream, bool bDirect = false, const SfxItemPool *pRefPool = 0 ); bool StoreItem( SvStream &rStream, const SfxPoolItem &rItem, bool bDirect = false ) const; - USHORT GetSurrogate(const SfxPoolItem *) const; - const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const; - USHORT GetItemCount(USHORT nWhich) const; - const SfxPoolItem* LoadSurrogate(SvStream& rStream, + USHORT GetSurrogate(const SfxPoolItem *) const; + const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const; + USHORT GetItemCount(USHORT nWhich) const; + const SfxPoolItem* LoadSurrogate(SvStream& rStream, USHORT &rWhich, USHORT nSlotId, const SfxItemPool* pRefPool = 0 ); bool StoreSurrogate(SvStream& rStream, const SfxPoolItem *pItem ) const; - virtual SvStream & Load(SvStream &); - virtual SvStream & Store(SvStream &) const; - int HasPersistentRefCounts() const { + virtual SvStream & Load(SvStream &); + virtual SvStream & Store(SvStream &) const; + int HasPersistentRefCounts() const { return bPersistentRefCounts; } - void LoadCompleted(); + void LoadCompleted(); - USHORT GetFirstWhich() const { return nStart; } - USHORT GetLastWhich() const { return nEnd; } + USHORT GetFirstWhich() const { return nStart; } + USHORT GetLastWhich() const { return nEnd; } bool IsInRange( USHORT nWhich ) const { return nWhich >= nStart && nWhich <= nEnd; } bool IsInVersionsRange( USHORT nWhich ) const; bool IsInStoringRange( USHORT nWhich ) const; - void SetStoringRange( USHORT nFrom, USHORT nTo ); - void SetSecondaryPool( SfxItemPool *pPool ); - SfxItemPool* GetSecondaryPool() const { + void SetStoringRange( USHORT nFrom, USHORT nTo ); + void SetSecondaryPool( SfxItemPool *pPool ); + SfxItemPool* GetSecondaryPool() const { return pSecondary; } - SfxItemPool* GetMasterPool() const { + SfxItemPool* GetMasterPool() const { return pMaster; } - void FreezeIdRanges(); + void FreezeIdRanges(); - void Cleanup(); - void Delete(); + void Cleanup(); + void Delete(); #ifdef TF_POOLABLE bool IsItemFlag( USHORT nWhich, USHORT nFlag ) const; @@ -249,36 +249,36 @@ public: void SetItemInfos( const SfxItemInfo *pInfos ) { pItemInfos = pInfos; } #else - int HasMap() const { return 0 != pSlotIds; } + int HasMap() const { return 0 != pSlotIds; } void SetMap( USHORT *pNewSlotIds ) { pSlotIds = pNewSlotIds; } #endif USHORT GetWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; - USHORT GetSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; - USHORT GetTrueWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; - USHORT GetTrueSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; + USHORT GetSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; + USHORT GetTrueWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; + USHORT GetTrueSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; - void SetVersionMap( USHORT nVer, + void SetVersionMap( USHORT nVer, USHORT nOldStart, USHORT nOldEnd, USHORT *pWhichIdTab ); - USHORT GetNewWhich( USHORT nOldWhich ) const; - USHORT GetVersion() const; - USHORT GetFileFormatVersion() const + USHORT GetNewWhich( USHORT nOldWhich ) const; + USHORT GetVersion() const; + USHORT GetFileFormatVersion() const { return _nFileFormatVersion; } - void SetFileFormatVersion( USHORT nFileFormatVersion ); - USHORT GetLoadingVersion() const; + void SetFileFormatVersion( USHORT nFileFormatVersion ); + USHORT GetLoadingVersion() const; bool IsCurrentVersionLoading() const; - static int IsWhich(USHORT nId) { + static int IsWhich(USHORT nId) { return nId && nId <= SFX_WHICH_MAX; } - static int IsSlot(USHORT nId) { + static int IsSlot(USHORT nId) { return nId && nId > SFX_WHICH_MAX; } - static const SfxItemPool* GetStoringPool(); + static const SfxItemPool* GetStoringPool(); static void SetStoringPool( const SfxItemPool * ); private: - const SfxItemPool& operator=(const SfxItemPool &); // n.i.!! + const SfxItemPool& operator=(const SfxItemPool &); // n.i.!! }; // --------------- Inline Implementierungen ------------------------------ |