diff options
Diffstat (limited to 'svl/inc')
58 files changed, 1427 insertions, 1192 deletions
diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx index 34029c7563f4..b9ff02a69e78 100644 --- a/svl/inc/svl/aeitem.hxx +++ b/svl/inc/svl/aeitem.hxx @@ -40,32 +40,32 @@ class SVL_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem SvUShorts* pDisabledValues; protected: - USHORT _GetPosByValue( USHORT nValue ) const; + sal_uInt16 _GetPosByValue( sal_uInt16 nValue ) const; public: TYPEINFO(); SfxAllEnumItem(); - SfxAllEnumItem( USHORT nWhich); - SfxAllEnumItem( USHORT nWhich, USHORT nVal ); - SfxAllEnumItem( USHORT nWhich, USHORT nVal, const XubString &rText ); - SfxAllEnumItem( USHORT nWhich, SvStream &rStream ); + SfxAllEnumItem( sal_uInt16 nWhich); + SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal ); + SfxAllEnumItem( sal_uInt16 nWhich, sal_uInt16 nVal, const XubString &rText ); + SfxAllEnumItem( sal_uInt16 nWhich, SvStream &rStream ); SfxAllEnumItem( const SfxAllEnumItem & ); ~SfxAllEnumItem(); - void InsertValue( USHORT nValue ); - void InsertValue( USHORT nValue, const XubString &rText ); - void RemoveValue( USHORT nValue ); + void InsertValue( sal_uInt16 nValue ); + void InsertValue( sal_uInt16 nValue, const XubString &rText ); + void RemoveValue( sal_uInt16 nValue ); void RemoveAllValues(); - USHORT GetPosByValue( USHORT nValue ) const; + sal_uInt16 GetPosByValue( sal_uInt16 nValue ) const; - virtual USHORT GetValueCount() const; - virtual USHORT GetValueByPos( USHORT nPos ) const; - virtual XubString GetValueTextByPos( USHORT nPos ) const; + virtual sal_uInt16 GetValueCount() const; + virtual sal_uInt16 GetValueByPos( sal_uInt16 nPos ) const; + virtual XubString GetValueTextByPos( sal_uInt16 nPos ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; - virtual BOOL IsEnabled( USHORT ) const; - void DisableValue( USHORT ); + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; + virtual sal_Bool IsEnabled( sal_uInt16 ) const; + void DisableValue( sal_uInt16 ); }; #endif diff --git a/svl/inc/svl/brdcst.hxx b/svl/inc/svl/brdcst.hxx index b55d78f99540..87eeab351b3c 100644 --- a/svl/inc/svl/brdcst.hxx +++ b/svl/inc/svl/brdcst.hxx @@ -47,7 +47,7 @@ friend class SfxListener; SfxListenerArr_Impl aListeners; private: - BOOL AddListener( SfxListener& rListener ); + sal_Bool AddListener( SfxListener& rListener ); void RemoveListener( SfxListener& rListener ); const SfxBroadcaster& operator=(const SfxBroadcaster &); // verboten @@ -66,9 +66,9 @@ public: void BroadcastDelayed( const SfxHint& rHint ); void BroadcastInIdle( const SfxHint& rHint ); - BOOL HasListeners() const; - USHORT GetListenerCount() const { return aListeners.Count(); } - SfxListener* GetListener( USHORT nNo ) const + sal_Bool HasListeners() const; + sal_uInt16 GetListenerCount() const { return aListeners.Count(); } + SfxListener* GetListener( sal_uInt16 nNo ) const { return (SfxListener*) aListeners[nNo]; } }; diff --git a/svl/inc/svl/broadcast.hxx b/svl/inc/svl/broadcast.hxx index 2acddb5e4f6b..758906877bc1 100644 --- a/svl/inc/svl/broadcast.hxx +++ b/svl/inc/svl/broadcast.hxx @@ -59,7 +59,7 @@ public: void Broadcast( const SfxHint &rHint ); - BOOL HasListeners() const { return 0 != pRoot; } + sal_Bool HasListeners() const { return 0 != pRoot; } }; diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx index 42c9d60373db..0d0cf3d7c053 100644 --- a/svl/inc/svl/cenumitm.hxx +++ b/svl/inc/svl/cenumitm.hxx @@ -38,7 +38,7 @@ DBG_NAMEEX(SfxEnumItemInterface) class SVL_DLLPUBLIC SfxEnumItemInterface: public SfxPoolItem { protected: - SfxEnumItemInterface(USHORT which): SfxPoolItem(which) {} + SfxEnumItemInterface(sal_uInt16 which): SfxPoolItem(which) {} SfxEnumItemInterface(const SfxEnumItemInterface & rItem): SfxPoolItem(rItem) {} @@ -54,15 +54,15 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any & rVal, BYTE = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any & rVal, sal_uInt8 = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any & rVal, BYTE = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any & rVal, sal_uInt8 = 0); - virtual USHORT GetValueCount() const = 0; + virtual sal_uInt16 GetValueCount() const = 0; - virtual XubString GetValueTextByPos(USHORT nPos) const; + virtual XubString GetValueTextByPos(sal_uInt16 nPos) const; - virtual USHORT GetValueByPos(USHORT nPos) const; + virtual sal_uInt16 GetValueByPos(sal_uInt16 nPos) const; /// Return the position of some value within this enumeration. /// @@ -74,19 +74,19 @@ public: /// /// @return The position of nValue within this enumeration, or USHRT_MAX /// if not included. - virtual USHORT GetPosByValue(USHORT nValue) const; + virtual sal_uInt16 GetPosByValue(sal_uInt16 nValue) const; - virtual BOOL IsEnabled(USHORT nValue) const; + virtual sal_Bool IsEnabled(sal_uInt16 nValue) const; - virtual USHORT GetEnumValue() const = 0; + virtual sal_uInt16 GetEnumValue() const = 0; - virtual void SetEnumValue(USHORT nValue) = 0; + virtual void SetEnumValue(sal_uInt16 nValue) = 0; virtual int HasBoolValue() const; - virtual BOOL GetBoolValue() const; + virtual sal_Bool GetBoolValue() const; - virtual void SetBoolValue(BOOL bValue); + virtual void SetBoolValue(sal_Bool bValue); }; //============================================================================ @@ -94,13 +94,13 @@ DBG_NAMEEX(CntEnumItem) class SVL_DLLPUBLIC CntEnumItem: public SfxEnumItemInterface { - USHORT m_nValue; + sal_uInt16 m_nValue; protected: - CntEnumItem(USHORT which = 0, USHORT nTheValue = 0): + CntEnumItem(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0): SfxEnumItemInterface(which), m_nValue(nTheValue) {} - CntEnumItem(USHORT which, SvStream & rStream); + CntEnumItem(sal_uInt16 which, SvStream & rStream); CntEnumItem(const CntEnumItem & rItem): SfxEnumItemInterface(rItem), m_nValue(rItem.m_nValue) {} @@ -108,18 +108,18 @@ protected: public: TYPEINFO(); - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; - virtual USHORT GetEnumValue() const; + virtual sal_uInt16 GetEnumValue() const; - virtual void SetEnumValue(USHORT nTheValue); + virtual void SetEnumValue(sal_uInt16 nTheValue); - USHORT GetValue() const { return m_nValue; } + sal_uInt16 GetValue() const { return m_nValue; } - inline void SetValue(USHORT nTheValue); + inline void SetValue(sal_uInt16 nTheValue); }; -inline void CntEnumItem::SetValue(USHORT nTheValue) +inline void CntEnumItem::SetValue(sal_uInt16 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntEnumItem::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -130,15 +130,15 @@ DBG_NAMEEX(CntBoolItem) class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem { - BOOL m_bValue; + sal_Bool m_bValue; public: TYPEINFO(); - CntBoolItem(USHORT which = 0, BOOL bTheValue = FALSE): + CntBoolItem(sal_uInt16 which = 0, sal_Bool bTheValue = sal_False): SfxPoolItem(which), m_bValue(bTheValue) {} - CntBoolItem(USHORT nWhich, SvStream & rStream); + CntBoolItem(sal_uInt16 nWhich, SvStream & rStream); CntBoolItem(const CntBoolItem & rItem): SfxPoolItem(rItem), m_bValue(rItem.m_bValue) {} @@ -154,23 +154,23 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, BYTE = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, BYTE = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual USHORT GetValueCount() const; + virtual sal_uInt16 GetValueCount() const; - virtual UniString GetValueTextByVal(BOOL bTheValue) const; + virtual UniString GetValueTextByVal(sal_Bool bTheValue) const; - BOOL GetValue() const { return m_bValue; } + sal_Bool GetValue() const { return m_bValue; } - void SetValue(BOOL bTheValue) { m_bValue = bTheValue; } + void SetValue(sal_Bool bTheValue) { m_bValue = bTheValue; } }; #endif // _SVTOOLS_CENUMITM_HXX diff --git a/svl/inc/svl/cintitem.hxx b/svl/inc/svl/cintitem.hxx index 929521d57cb1..68a532cee613 100644 --- a/svl/inc/svl/cintitem.hxx +++ b/svl/inc/svl/cintitem.hxx @@ -37,15 +37,15 @@ DBG_NAMEEX_VISIBILITY(CntByteItem, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem { - BYTE m_nValue; + sal_uInt8 m_nValue; public: TYPEINFO(); - CntByteItem(USHORT which = 0, BYTE nTheValue = 0): + CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); } - CntByteItem(USHORT which, SvStream & rStream); + CntByteItem(sal_uInt16 which, SvStream & rStream); CntByteItem(const CntByteItem & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -64,30 +64,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual BYTE GetMin() const; + virtual sal_uInt8 GetMin() const; - virtual BYTE GetMax() const; + virtual sal_uInt8 GetMax() const; virtual SfxFieldUnit GetUnit() const; - BYTE GetValue() const { return m_nValue; } + sal_uInt8 GetValue() const { return m_nValue; } - inline void SetValue(BYTE nTheValue); + inline void SetValue(sal_uInt8 nTheValue); }; -inline void CntByteItem::SetValue(BYTE nTheValue) +inline void CntByteItem::SetValue(sal_uInt8 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -98,16 +98,16 @@ DBG_NAMEEX_VISIBILITY(CntUInt16Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem { - UINT16 m_nValue; + sal_uInt16 m_nValue; public: TYPEINFO(); - CntUInt16Item(USHORT which = 0, UINT16 nTheValue = 0): + CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntUInt16Item, 0); } - CntUInt16Item(USHORT which, SvStream & rStream); + CntUInt16Item(sal_uInt16 which, SvStream & rStream); CntUInt16Item(const CntUInt16Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -126,30 +126,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual UINT16 GetMin() const; + virtual sal_uInt16 GetMin() const; - virtual UINT16 GetMax() const; + virtual sal_uInt16 GetMax() const; virtual SfxFieldUnit GetUnit() const; - INT16 GetValue() const { return m_nValue; } + sal_Int16 GetValue() const { return m_nValue; } - inline void SetValue(UINT16 nTheValue); + inline void SetValue(sal_uInt16 nTheValue); }; -inline void CntUInt16Item::SetValue(UINT16 nTheValue) +inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -160,16 +160,16 @@ DBG_NAMEEX_VISIBILITY(CntInt32Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem { - INT32 m_nValue; + sal_Int32 m_nValue; public: TYPEINFO(); - CntInt32Item(USHORT which = 0, INT32 nTheValue = 0): + CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntInt32Item, 0); } - CntInt32Item(USHORT which, SvStream & rStream); + CntInt32Item(sal_uInt16 which, SvStream & rStream); CntInt32Item(const CntInt32Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -188,30 +188,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream &, USHORT) const; + virtual SvStream & Store(SvStream &, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual INT32 GetMin() const; + virtual sal_Int32 GetMin() const; - virtual INT32 GetMax() const; + virtual sal_Int32 GetMax() const; virtual SfxFieldUnit GetUnit() const; - INT32 GetValue() const { return m_nValue; } + sal_Int32 GetValue() const { return m_nValue; } - inline void SetValue(INT32 nTheValue); + inline void SetValue(sal_Int32 nTheValue); }; -inline void CntInt32Item::SetValue(INT32 nTheValue) +inline void CntInt32Item::SetValue(sal_Int32 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item"); m_nValue = nTheValue; @@ -222,16 +222,16 @@ DBG_NAMEEX_VISIBILITY(CntUInt32Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem { - UINT32 m_nValue; + sal_uInt32 m_nValue; public: TYPEINFO(); - CntUInt32Item(USHORT which = 0, UINT32 nTheValue = 0): + CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntUInt32Item, 0); } - CntUInt32Item(USHORT nWhich, SvStream & rStream); + CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream); CntUInt32Item(const CntUInt32Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -250,30 +250,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual UINT32 GetMin() const; + virtual sal_uInt32 GetMin() const; - virtual UINT32 GetMax() const; + virtual sal_uInt32 GetMax() const; virtual SfxFieldUnit GetUnit() const; - UINT32 GetValue() const { return m_nValue; } + sal_uInt32 GetValue() const { return m_nValue; } - inline void SetValue(UINT32 nTheValue); + inline void SetValue(sal_uInt32 nTheValue); }; -inline void CntUInt32Item::SetValue(UINT32 nTheValue) +inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item"); m_nValue = nTheValue; diff --git a/svl/inc/svl/cntnrsrt.hxx b/svl/inc/svl/cntnrsrt.hxx index 48ebef50ea58..7c0dc6863371 100644 --- a/svl/inc/svl/cntnrsrt.hxx +++ b/svl/inc/svl/cntnrsrt.hxx @@ -63,17 +63,17 @@ public: \ using Container::Count; \ \ - ClassName( USHORT InitSize, USHORT ReSize ) : \ + ClassName( sal_uInt16 InitSize, sal_uInt16 ReSize ) : \ Container( CONTAINER_MAXBLOCKSIZE, InitSize, ReSize ) {} \ \ - BOOL Insert( Type* pObj ); \ + sal_Bool Insert( Type* pObj ); \ \ - Type *Remove( ULONG nPos ) \ + Type *Remove( sal_uLong nPos ) \ { return (Type *)Container::Remove( nPos ); } \ \ Type *Remove( Type* pObj ); \ \ - void DeleteAndDestroy( ULONG nPos ) \ + void DeleteAndDestroy( sal_uLong nPos ) \ { \ Type *pObj = Remove( nPos ); \ if( pObj ) \ @@ -83,15 +83,15 @@ public: \ void DeleteAndDestroy() \ { while( Count() ) DeleteAndDestroy( 0 ); } \ \ - Type* GetObject( ULONG nPos ) const \ + Type* GetObject( sal_uLong nPos ) const \ { return (Type *)Container::GetObject( nPos ); } \ \ - Type* operator[]( ULONG nPos ) const \ + Type* operator[]( sal_uLong nPos ) const \ { return GetObject(nPos); } \ \ - BOOL Seek_Entry( const Type *pObj, ULONG* pPos ) const; \ + sal_Bool Seek_Entry( const Type *pObj, sal_uLong* pPos ) const; \ \ - ULONG GetPos( const Type* pObj ) const; \ + sal_uLong GetPos( const Type* pObj ) const; \ #define DECLARE_CONTAINER_SORT( ClassName, Type ) \ @@ -111,10 +111,10 @@ class ClassName : private Container \ #define IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) \ -BOOL ClassName::Insert( Type *pObj ) \ +sal_Bool ClassName::Insert( Type *pObj ) \ { \ - ULONG nPos; \ - BOOL bExist = Seek_Entry( pObj, &nPos ); \ + sal_uLong nPos; \ + sal_Bool bExist = Seek_Entry( pObj, &nPos ); \ if( !bExist ) \ Container::Insert( pObj, nPos ); \ return !bExist; \ @@ -122,25 +122,25 @@ BOOL ClassName::Insert( Type *pObj ) \ \ Type *ClassName::Remove( Type* pObj ) \ { \ - ULONG nPos; \ + sal_uLong nPos; \ if( Seek_Entry( pObj, &nPos ) ) \ return Remove( nPos ); \ else \ return 0; \ } \ \ -ULONG ClassName::GetPos( const Type* pObj ) const \ +sal_uLong ClassName::GetPos( const Type* pObj ) const \ { \ - ULONG nPos; \ + sal_uLong nPos; \ if( Seek_Entry( pObj, &nPos ) ) \ return nPos; \ else \ return CONTAINER_ENTRY_NOTFOUND; \ } \ \ -BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \ +sal_Bool ClassName::Seek_Entry( const Type* pObj, sal_uLong* pPos ) const \ { \ - register ULONG nO = Count(), \ + register sal_uLong nO = Count(), \ nM, \ nU = 0; \ if( nO > 0 ) \ @@ -154,21 +154,21 @@ BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \ if( 0 == nCmp ) \ { \ if( pPos ) *pPos = nM; \ - return TRUE; \ + return sal_True; \ } \ else if( nCmp < 0 ) \ nU = nM + 1; \ else if( nM == 0 ) \ { \ if( pPos ) *pPos = nU; \ - return FALSE; \ + return sal_False; \ } \ else \ nO = nM - 1; \ } \ } \ if( pPos ) *pPos = nU; \ - return FALSE; \ + return sal_False; \ } \ #endif diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx index a7f3dd0111a6..070795e6faf3 100644 --- a/svl/inc/svl/cntwall.hxx +++ b/svl/inc/svl/cntwall.hxx @@ -43,35 +43,35 @@ class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem private: UniString _aURL; Color _nColor; - USHORT _nStyle; + sal_uInt16 _nStyle; public: TYPEINFO(); - CntWallpaperItem( USHORT nWhich ); - CntWallpaperItem( USHORT nWhich, SvStream& rStream, USHORT nVersion ); + CntWallpaperItem( sal_uInt16 nWhich ); + CntWallpaperItem( sal_uInt16 nWhich, SvStream& rStream, sal_uInt16 nVersion ); CntWallpaperItem( const CntWallpaperItem& rCpy ); ~CntWallpaperItem(); - virtual USHORT GetVersion(USHORT) const; + virtual sal_uInt16 GetVersion(sal_uInt16) const; virtual int operator==( const SfxPoolItem& ) const; - virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; - virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const; + virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; } void SetColor( Color nColor ) { _nColor = nColor; } - void SetStyle( USHORT nStyle ) { _nStyle = nStyle; } + void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; } const UniString& GetBitmapURL() const { return _aURL; } Color GetColor() const { return _nColor; } - USHORT GetStyle() const { return _nStyle; } + sal_uInt16 GetStyle() const { return _nStyle; } }; //////////////////////////////////////////////////////////////////////////////// diff --git a/svl/inc/svl/converter.hxx b/svl/inc/svl/converter.hxx index 062feafe6f29..c208a370bceb 100644 --- a/svl/inc/svl/converter.hxx +++ b/svl/inc/svl/converter.hxx @@ -33,8 +33,8 @@ class SvDbaseConverter { public: - SVL_DLLPUBLIC static INT32 ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale); - SVL_DLLPUBLIC static INT32 ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale); + SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale); + SVL_DLLPUBLIC static sal_Int32 ConvertPrecisionToOdbc(sal_Int32 _nLen, sal_Int32 _nScale); }; #endif //_CONVERTER_HXX_ diff --git a/svl/inc/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx index e83d37b8925e..bb3efc756187 100644 --- a/svl/inc/svl/ctypeitm.hxx +++ b/svl/inc/svl/ctypeitm.hxx @@ -42,17 +42,17 @@ public: TYPEINFO(); CntContentTypeItem(); - CntContentTypeItem( USHORT nWhich, const XubString& rType ); - CntContentTypeItem( USHORT nWhich, const INetContentType eType ); + CntContentTypeItem( sal_uInt16 nWhich, const XubString& rType ); + CntContentTypeItem( sal_uInt16 nWhich, const INetContentType eType ); CntContentTypeItem( const CntContentTypeItem& rOrig ); virtual SfxPoolItem* Create( SvStream& rStream, - USHORT nItemVersion ) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + sal_uInt16 nItemVersion ) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual int operator==( const SfxPoolItem& rOrig ) const; - virtual USHORT GetVersion(USHORT) const; + virtual sal_uInt16 GetVersion(sal_uInt16) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const; @@ -68,10 +68,10 @@ public: XubString &rText, const IntlWrapper* pIntlWrapper = 0 ) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); INetContentType GetEnumValue() const; diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx index a24135e392c2..f0e01a6a7c32 100644 --- a/svl/inc/svl/custritm.hxx +++ b/svl/inc/svl/custritm.hxx @@ -42,10 +42,10 @@ class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem public: TYPEINFO(); - CntUnencodedStringItem(USHORT which = 0): SfxPoolItem(which) + CntUnencodedStringItem(sal_uInt16 which = 0): SfxPoolItem(which) { DBG_CTOR(CntUnencodedStringItem, 0); } - CntUnencodedStringItem(USHORT which, const XubString & rTheValue): + CntUnencodedStringItem(sal_uInt16 which, const XubString & rTheValue): SfxPoolItem(which), m_aValue(rTheValue) { DBG_CTOR(CntUnencodedStringItem, 0); } @@ -68,11 +68,11 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0) const; + virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0) const; - virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0); + virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0); virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; diff --git a/svl/inc/svl/dateitem.hxx b/svl/inc/svl/dateitem.hxx index 3ae5506d809a..bf2c7a3c6e54 100644 --- a/svl/inc/svl/dateitem.hxx +++ b/svl/inc/svl/dateitem.hxx @@ -46,8 +46,8 @@ private: public: TYPEINFO(); - SfxDateTimeItem( USHORT nWhich ); - SfxDateTimeItem( USHORT nWhich, + SfxDateTimeItem( sal_uInt16 nWhich ); + SfxDateTimeItem( sal_uInt16 nWhich, const DateTime& rDT ); SfxDateTimeItem( const SfxDateTimeItem& rCpy ); @@ -57,8 +57,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; using SfxPoolItem::Compare; virtual int Compare( const SfxPoolItem &rWith ) const; - virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; - virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nItemVersion ) const; + virtual SvStream& Store( SvStream&, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -74,10 +74,10 @@ public: "SetDateTime() with pooled item" ); aDateTime = rDT; } - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; class SfxColumnDateTimeItem : public SfxDateTimeItem @@ -85,8 +85,8 @@ class SfxColumnDateTimeItem : public SfxDateTimeItem public: TYPEINFO(); - SfxColumnDateTimeItem( USHORT nWhich ); - SfxColumnDateTimeItem( USHORT nWhich, + SfxColumnDateTimeItem( sal_uInt16 nWhich ); + SfxColumnDateTimeItem( sal_uInt16 nWhich, const DateTime& rDT ); SfxColumnDateTimeItem( const SfxDateTimeItem& rCpy ); diff --git a/svl/inc/svl/eitem.hxx b/svl/inc/svl/eitem.hxx index bc65db9c31dc..f6dbb9951d84 100644 --- a/svl/inc/svl/eitem.hxx +++ b/svl/inc/svl/eitem.hxx @@ -35,10 +35,10 @@ class SVL_DLLPUBLIC SfxEnumItem: public CntEnumItem { protected: - SfxEnumItem(USHORT which = 0, USHORT nValue = 0): + SfxEnumItem(sal_uInt16 which = 0, sal_uInt16 nValue = 0): CntEnumItem(which, nValue) {} - SfxEnumItem(USHORT which, SvStream & rStream): + SfxEnumItem(sal_uInt16 which, SvStream & rStream): CntEnumItem(which, rStream) {} public: @@ -52,13 +52,13 @@ class SVL_DLLPUBLIC SfxBoolItem: public CntBoolItem public: TYPEINFO(); - SfxBoolItem(USHORT which = 0, BOOL bValue = FALSE): + SfxBoolItem(sal_uInt16 which = 0, sal_Bool bValue = sal_False): CntBoolItem(which, bValue) {} - SfxBoolItem(USHORT which, SvStream & rStream): + SfxBoolItem(sal_uInt16 which, SvStream & rStream): CntBoolItem(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxBoolItem(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx index d0cc27b94b96..eef347ab772b 100644 --- a/svl/inc/svl/filerec.hxx +++ b/svl/inc/svl/filerec.hxx @@ -35,24 +35,24 @@ #include <tools/stream.hxx> #include <svl/svarray.hxx> -SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) +SV_DECL_VARARR( SfxUINT32s, sal_uInt32, 8, 8 ) //------------------------------------------------------------------------ -#define SFX_BOOL_DONTCARE BOOL(2) // Don't-Care-Wert f"ur BOOLs +#define SFX_BOOL_DONTCARE sal_Bool(2) // Don't-Care-Wert f"ur BOOLs -#define SFX_REC_PRETAG_EXT BYTE(0x00) // Pre-Tag f"ur Extended-Records -#define SFX_REC_PRETAG_EOR BYTE(0xFF) // Pre-Tag f"ur End-Of-Records +#define SFX_REC_PRETAG_EXT sal_uInt8(0x00) // Pre-Tag f"ur Extended-Records +#define SFX_REC_PRETAG_EOR sal_uInt8(0xFF) // Pre-Tag f"ur End-Of-Records -#define SFX_REC_TYPE_NONE BYTE(0x00) // unbekannter Record-Typ -#define SFX_REC_TYPE_FIRST BYTE(0x01) -#define SFX_REC_TYPE_SINGLE BYTE(0x01) // Single-Content-Record -#define SFX_REC_TYPE_FIXSIZE BYTE(0x02) // Fix-Size-Multi-Content-Record -#define SFX_REC_TYPE_VARSIZE_RELOC BYTE(0x03) // variable Rec-Size -#define SFX_REC_TYPE_VARSIZE BYTE(0x04) // alt (nicht verschiebbar) -#define SFX_REC_TYPE_MIXTAGS_RELOC BYTE(0x07) // Mixed Tag Content-Record -#define SFX_REC_TYPE_MIXTAGS BYTE(0x08) // alt (nicht verschiebbar) -#define SFX_REC_TYPE_LAST BYTE(0x08) +#define SFX_REC_TYPE_NONE sal_uInt8(0x00) // unbekannter Record-Typ +#define SFX_REC_TYPE_FIRST sal_uInt8(0x01) +#define SFX_REC_TYPE_SINGLE sal_uInt8(0x01) // Single-Content-Record +#define SFX_REC_TYPE_FIXSIZE sal_uInt8(0x02) // Fix-Size-Multi-Content-Record +#define SFX_REC_TYPE_VARSIZE_RELOC sal_uInt8(0x03) // variable Rec-Size +#define SFX_REC_TYPE_VARSIZE sal_uInt8(0x04) // alt (nicht verschiebbar) +#define SFX_REC_TYPE_MIXTAGS_RELOC sal_uInt8(0x07) // Mixed Tag Content-Record +#define SFX_REC_TYPE_MIXTAGS sal_uInt8(0x08) // alt (nicht verschiebbar) +#define SFX_REC_TYPE_LAST sal_uInt8(0x08) #define SFX_REC_TYPE_MINI 0x100 // Mini-Record #define SFX_REC_TYPE_DRAWENG 0x400 // Drawing-Engine-Record #define SFX_REC_TYPE_EOR 0xF00 // End-Of-Records @@ -124,9 +124,9 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) Struktur des Mini-Records: - 1 BYTE Pre-Tag - 3 BYTE OffsetToEndOfRec - OffsetToEndOfRec* 1 BYTE Content + 1 sal_uInt8 Pre-Tag + 3 sal_uInt8 OffsetToEndOfRec + OffsetToEndOfRec* 1 sal_uInt8 Content Bei den Extended-Reords folgt auf diesen 4-Byte-Header ein erweiterter Header, der zun"achst den o.g. Record-Typ, dann eine Versions-Kennung @@ -134,13 +134,13 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) Struktur des Extended-Records: - 1 BYTE Pre-Tag (==0x00) - 3 BYTE OffsetToEndOfRec - OffsetToEndOfRec* 1 BYTE Content - 1 BYTE Record-Type - 1 BYTE Version - 2 BYTE Tag - ContentSize* 1 BYTE Content + 1 sal_uInt8 Pre-Tag (==0x00) + 3 sal_uInt8 OffsetToEndOfRec + OffsetToEndOfRec* 1 sal_uInt8 Content + 1 sal_uInt8 Record-Type + 1 sal_uInt8 Version + 2 sal_uInt8 Tag + ContentSize* 1 sal_uInt8 Content (ContentSize = OffsetToEndOfRec - 8) @@ -160,7 +160,7 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) m"ussen. => die Bytes 2-4 werden bei allen Records als Offset zum Ende des Records interpretiert, so da\s die Gesamt-Recors-Size sich wie - folgt berechnet: sizeof(UINT32) + OffsetToEndOfRec + folgt berechnet: sizeof(sal_uInt32) + OffsetToEndOfRec Die Records sollten einfach zu parsen un einheitlich aufgebaut sein. => Sie bauen aufeinander auf, so ist z.B. der SfxMiniRecord in jedem @@ -191,7 +191,7 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter /* [Beschreibung] Mit Instanzen dieser Klasse kann ein einfacher Record in einen Stream - geschrieben werden, der sich durch ein BYTE-Tag identifiziert, sowie + geschrieben werden, der sich durch ein sal_uInt8-Tag identifiziert, sowie seine eigene L"ange speichert und somit auch von "alteren Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen werden kann. Es wird keine Version-Nummer gespeichert. @@ -206,9 +206,9 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter [Fileformat] - 1* BYTE Content-Tag (!= 0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - SizeOfContent* BYTE Content + 1* sal_uInt8 Content-Tag (!= 0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + SizeOfContent* sal_uInt8 Content [Beispiel] @@ -222,18 +222,18 @@ class SVL_DLLPUBLIC SfxMiniRecordWriter { protected: SvStream* _pStream; // <SvStream>, in dem der Record liegt - UINT32 _nStartPos; // Start-Position des Gesamt-Records im Stream - FASTBOOL _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; + sal_uInt32 _nStartPos; // Start-Position des Gesamt-Records im Stream + FASTBOOL _bHeaderOk; /* sal_True, wenn der Header schon geschrieben ist; bei DBG_UTIL wird SFX_BOOL_DONTCARE ver- wendet, um die Gr"o\se von Fix-Sized-Records zu pr"ufen. */ - BYTE _nPreTag; // in den Header zu schreibendes 'Pre-Tag' + sal_uInt8 _nPreTag; // in den Header zu schreibendes 'Pre-Tag' public: inline SfxMiniRecordWriter( SvStream *pStream, - BYTE nTag ); - inline SfxMiniRecordWriter( SvStream *pStream, BYTE nTag, - UINT32 nSize ); + sal_uInt8 nTag ); + inline SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag, + sal_uInt32 nSize ); inline ~SfxMiniRecordWriter(); @@ -241,7 +241,7 @@ public: inline void Reset(); - UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); + sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); private: // not implementend, not allowed @@ -280,35 +280,35 @@ class SVL_DLLPUBLIC SfxMiniRecordReader { protected: SvStream* _pStream; // <SvStream>, aus dem gelesen wird - UINT32 _nEofRec; // Position direkt hinter dem Record - FASTBOOL _bSkipped; // TRUE: der Record wurde explizit geskippt - BYTE _nPreTag; // aus dem Header gelesenes Pre-Tag + sal_uInt32 _nEofRec; // Position direkt hinter dem Record + FASTBOOL _bSkipped; // sal_True: der Record wurde explizit geskippt + sal_uInt8 _nPreTag; // aus dem Header gelesenes Pre-Tag // Drei-Phasen-Ctor f"ur Subklassen SfxMiniRecordReader() {} - void Construct_Impl( SvStream *pStream, BYTE nTag ) + void Construct_Impl( SvStream *pStream, sal_uInt8 nTag ) { _pStream = pStream; - _bSkipped = FALSE; + _bSkipped = sal_False; _nPreTag = nTag; } - inline FASTBOOL SetHeader_Impl( UINT32 nHeader ); + inline FASTBOOL SetHeader_Impl( sal_uInt32 nHeader ); // als ung"ultig markieren und zur"uck-seeken - void SetInvalid_Impl( UINT32 nRecordStartPos ) + void SetInvalid_Impl( sal_uInt32 nRecordStartPos ) { _nPreTag = SFX_REC_PRETAG_EOR; _pStream->Seek( nRecordStartPos ); } public: - static USHORT ScanRecordType( SvStream *pStream ); + static sal_uInt16 ScanRecordType( SvStream *pStream ); SfxMiniRecordReader( SvStream *pStream ); - SfxMiniRecordReader( SvStream *pStream, BYTE nTag ); + SfxMiniRecordReader( SvStream *pStream, sal_uInt8 nTag ); inline ~SfxMiniRecordReader(); - inline BYTE GetTag() const; + inline sal_uInt8 GetTag() const; inline FASTBOOL IsValid() const; inline SvStream& operator*() const; @@ -328,8 +328,8 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter /* [Beschreibung] Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben - werden, dessen einziger Inhalt sich durch ein UINT16-Tag und eine - BYTE-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert + werden, dessen einziger Inhalt sich durch ein sal_uInt16-Tag und eine + sal_uInt8-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert und somit auch von "alteren Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen werden kann. @@ -343,12 +343,12 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter [Fileformat] - 1* BYTE Pre-Tag (!= 0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_REC_TYPE_SINGLE) - 1* BYTE Content-Version - 1* USHORT Content-Tag - SizeOfContent* BYTE Content + 1* sal_uInt8 Pre-Tag (!= 0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_SINGLE) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Content-Tag + SizeOfContent* sal_uInt8 Content [Beispiel] @@ -361,20 +361,20 @@ class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter { protected: - SfxSingleRecordWriter( BYTE nRecordType, + SfxSingleRecordWriter( sal_uInt8 nRecordType, SvStream *pStream, - UINT16 nTag, BYTE nCurVer ); + sal_uInt16 nTag, sal_uInt8 nCurVer ); public: SfxSingleRecordWriter( SvStream *pStream, - UINT16 nTag, BYTE nCurVer ); + sal_uInt16 nTag, sal_uInt8 nCurVer ); SfxSingleRecordWriter( SvStream *pStream, - UINT16 nTag, BYTE nCurVer, - UINT32 nSize ); + sal_uInt16 nTag, sal_uInt8 nCurVer, + sal_uInt32 nSize ); inline void Reset(); - UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); + sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); }; //------------------------------------------------------------------------ @@ -409,9 +409,9 @@ class SVL_DLLPUBLIC SfxSingleRecordReader: public SfxMiniRecordReader { protected: - UINT16 _nRecordTag; // Art des Gesamt-Inhalts - BYTE _nRecordVer; // Version des Gesamt-Inhalts - BYTE _nRecordType; // Record Type aus dem Header + sal_uInt16 _nRecordTag; // Art des Gesamt-Inhalts + sal_uInt8 _nRecordVer; // Version des Gesamt-Inhalts + sal_uInt8 _nRecordType; // Record Type aus dem Header // Drei-Phasen-Ctor f"ur Subklassen SfxSingleRecordReader() {} @@ -420,17 +420,17 @@ protected: SfxMiniRecordReader::Construct_Impl( pStream, SFX_REC_PRETAG_EXT ); } - FASTBOOL FindHeader_Impl( UINT16 nTypes, UINT16 nTag ); - FASTBOOL ReadHeader_Impl( USHORT nTypes ); + FASTBOOL FindHeader_Impl( sal_uInt16 nTypes, sal_uInt16 nTag ); + FASTBOOL ReadHeader_Impl( sal_uInt16 nTypes ); public: SfxSingleRecordReader( SvStream *pStream ); - SfxSingleRecordReader( SvStream *pStream, USHORT nTag ); + SfxSingleRecordReader( SvStream *pStream, sal_uInt16 nTag ); - inline UINT16 GetTag() const; + inline sal_uInt16 GetTag() const; - inline BYTE GetVersion() const; - inline FASTBOOL HasVersion( USHORT nVersion ) const; + inline sal_uInt8 GetVersion() const; + inline FASTBOOL HasVersion( sal_uInt16 nVersion ) const; }; //------------------------------------------------------------------------ @@ -458,22 +458,22 @@ class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter [Fileformat] - 1* BYTE Pre-Tag (==0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_REC_TYPE_FIXSIZE) - 1* BYTE Content-Version - 1* UINT16 Content-Tag - 1* UINT16 NumberOfContents - 1* UINT32 SizeOfEachContent + 1* sal_uInt8 Pre-Tag (==0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_FIXSIZE) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Content-Tag + 1* sal_uInt16 NumberOfContents + 1* sal_uInt32 SizeOfEachContent NumberOfContents* ( - SizeOfEachContent BYTE Content + SizeOfEachContent sal_uInt8 Content ) [Beispiel] { SfxMultiFixRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); - for ( USHORT n = 0; n < Count(); ++n ) + for ( sal_uInt16 n = 0; n < Count(); ++n ) { aRecord.NewContent(); *aRecord << aMember1[n]; @@ -484,28 +484,28 @@ class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter { protected: - UINT32 _nContentStartPos; /* Startposition des jeweiligen + sal_uInt32 _nContentStartPos; /* Startposition des jeweiligen Contents - nur bei DBG_UTIL und f"ur Subklassen */ - UINT32 _nContentSize; // Gr"o\se jedes Contents - UINT16 _nContentCount; // jeweilige Anzahl der Contents + sal_uInt32 _nContentSize; // Gr"o\se jedes Contents + sal_uInt16 _nContentCount; // jeweilige Anzahl der Contents - SfxMultiFixRecordWriter( BYTE nRecordType, + SfxMultiFixRecordWriter( sal_uInt8 nRecordType, SvStream *pStream, - UINT16 nTag, BYTE nCurVer, - UINT32 nContentSize ); + sal_uInt16 nTag, sal_uInt8 nCurVer, + sal_uInt32 nContentSize ); public: SfxMultiFixRecordWriter( SvStream *pStream, - UINT16 nTag, BYTE nCurVer, - UINT32 nContentSize ); + sal_uInt16 nTag, sal_uInt8 nCurVer, + sal_uInt32 nContentSize ); inline ~SfxMultiFixRecordWriter(); inline void NewContent(); inline void Reset(); - UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); + sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); }; //------------------------------------------------------------------------ @@ -531,23 +531,23 @@ class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter [Fileformat] - 1* BYTE Pre-Tag (==0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_FILETYPE_TYPE_VARSIZE) - 1* BYTE Content-Version - 1* USHORT Content-Tag - 1* UINT16 NumberOfContents - 1* UINT32 OffsetToOfsTable + 1* sal_uInt8 Pre-Tag (==0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_FILETYPE_TYPE_VARSIZE) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Content-Tag + 1* sal_uInt16 NumberOfContents + 1* sal_uInt32 OffsetToOfsTable NumberOfContents* ( - ContentSize* BYTE Content + ContentSize* sal_uInt8 Content ) - NumberOfContents* UINT32 ContentOfs (je per <<8 verschoben) + NumberOfContents* sal_uInt32 ContentOfs (je per <<8 verschoben) [Beispiel] { SfxMultiVarRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); - for ( USHORT n = 0; n < Count(); ++n ) + for ( sal_uInt16 n = 0; n < Count(); ++n ) { aRecord.NewContent(); *aRecord << aMember1[n]; @@ -559,24 +559,24 @@ class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter { protected: SfxUINT32s _aContentOfs; - USHORT _nContentVer; // nur f"ur SfxMultiMixRecordWriter + sal_uInt16 _nContentVer; // nur f"ur SfxMultiMixRecordWriter - SfxMultiVarRecordWriter( BYTE nRecordType, + SfxMultiVarRecordWriter( sal_uInt8 nRecordType, SvStream *pStream, - USHORT nRecordTag, - BYTE nRecordVer ); + sal_uInt16 nRecordTag, + sal_uInt8 nRecordVer ); void FlushContent_Impl(); public: SfxMultiVarRecordWriter( SvStream *pStream, - USHORT nRecordTag, - BYTE nRecordVer ); + sal_uInt16 nRecordTag, + sal_uInt8 nRecordVer ); virtual ~SfxMultiVarRecordWriter(); void NewContent(); - virtual UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); + virtual sal_uInt32 Close( FASTBOOL bSeekToEndOfRec = sal_True ); }; //------------------------------------------------------------------------ @@ -601,27 +601,27 @@ class SVL_DLLPUBLIC SfxMultiMixRecordWriter: public SfxMultiVarRecordWriter [Fileformat] - 1* BYTE Pre-Tag (==0) - 1* 3-BYTE OffsetToEndOfRec in Bytes - 1* BYTE Record-Type (==SFX_REC_TYPE_MIXTAGS) - 1* BYTE Content-Version - 1* USHORT Record-Tag - 1* UINT16 NumberOfContents - 1* UINT32 OffsetToOfsTable + 1* sal_uInt8 Pre-Tag (==0) + 1* 3-sal_uInt8 OffsetToEndOfRec in Bytes + 1* sal_uInt8 Record-Type (==SFX_REC_TYPE_MIXTAGS) + 1* sal_uInt8 Content-Version + 1* sal_uInt16 Record-Tag + 1* sal_uInt16 NumberOfContents + 1* sal_uInt32 OffsetToOfsTable NumberOfContents* ( - 1* USHORT Content-Tag - ContentSize* BYTE Content + 1* sal_uInt16 Content-Tag + ContentSize* sal_uInt8 Content ) - NumberOfContents* UINT32 ( ContentOfs << 8 + Version ) + NumberOfContents* sal_uInt32 ( ContentOfs << 8 + Version ) */ { public: inline SfxMultiMixRecordWriter( SvStream *pStream, - USHORT nRecordTag, - BYTE nRecordVer ); + sal_uInt16 nRecordTag, + sal_uInt8 nRecordVer ); - void NewContent( USHORT nTag, BYTE nVersion ); + void NewContent( sal_uInt16 nTag, sal_uInt8 nVersion ); // private: geht nicht, da einige Compiler dann auch vorherige privat machen void NewContent() @@ -646,7 +646,7 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader { SfxMultiRecordReader aRecord( pStream ); - for ( USHORT nRecNo = 0; aRecord.GetContent(); ++nRecNo ) + for ( sal_uInt16 nRecNo = 0; aRecord.GetContent(); ++nRecNo ) { switch ( aRecord.GetTag() ) { @@ -665,30 +665,30 @@ class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader */ { - UINT32 _nStartPos; // Start-Position des Records - UINT32* _pContentOfs; // Offsets der Startpositionen - UINT32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos - UINT16 _nContentCount; // Anzahl der Contents im Record - UINT16 _nContentNo; /* der Index des aktuellen Contents + sal_uInt32 _nStartPos; // Start-Position des Records + sal_uInt32* _pContentOfs; // Offsets der Startpositionen + sal_uInt32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos + sal_uInt16 _nContentCount; // Anzahl der Contents im Record + sal_uInt16 _nContentNo; /* der Index des aktuellen Contents enth"alt jeweils den Index des Contents, der beim n"achsten GetContent() geholt wird */ - UINT16 _nContentTag; // Art-Kennung des aktuellen Contents - BYTE _nContentVer; // Versions-Kennung des akt. Contents + sal_uInt16 _nContentTag; // Art-Kennung des aktuellen Contents + sal_uInt8 _nContentVer; // Versions-Kennung des akt. Contents FASTBOOL ReadHeader_Impl(); public: SfxMultiRecordReader( SvStream *pStream ); - SfxMultiRecordReader( SvStream *pStream, UINT16 nTag ); + SfxMultiRecordReader( SvStream *pStream, sal_uInt16 nTag ); ~SfxMultiRecordReader(); FASTBOOL GetContent(); - inline UINT16 GetContentTag(); - inline BYTE GetContentVersion() const; - inline FASTBOOL HasContentVersion( USHORT nVersion ) const; + inline sal_uInt16 GetContentTag(); + inline sal_uInt8 GetContentVersion() const; + inline FASTBOOL HasContentVersion( sal_uInt16 nVersion ) const; - inline UINT32 ContentCount() const; + inline sal_uInt32 ContentCount() const; }; //========================================================================= @@ -696,7 +696,7 @@ public: inline SfxMiniRecordWriter::SfxMiniRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - BYTE nTag // Record-Tag zwischen 0x01 und 0xFE + sal_uInt8 nTag // Record-Tag zwischen 0x01 und 0xFE ) /* [Beschreibung] @@ -708,7 +708,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter : _pStream( pStream ), _nStartPos( pStream->Tell() ), - _bHeaderOk(FALSE), + _bHeaderOk(sal_False), _nPreTag( nTag ) { DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" ); @@ -722,8 +722,8 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter inline SfxMiniRecordWriter::SfxMiniRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - BYTE nTag, // Record-Tag zwischen 0x01 und 0xFE - UINT32 nSize // Gr"o\se der Daten in Bytes + sal_uInt8 nTag, // Record-Tag zwischen 0x01 und 0xFE + sal_uInt32 nSize // Gr"o\se der Daten in Bytes ) /* [Beschreibung] @@ -757,7 +757,7 @@ inline SfxMiniRecordWriter::~SfxMiniRecordWriter() { // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden - if ( !_bHeaderOk DBG(||TRUE) ) + if ( !_bHeaderOk DBG(||sal_True) ) Close(); } @@ -781,7 +781,7 @@ inline SvStream& SfxMiniRecordWriter::operator*() const inline void SfxMiniRecordWriter::Reset() { _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI ); - _bHeaderOk = FALSE; + _bHeaderOk = sal_False; } //========================================================================= @@ -813,12 +813,12 @@ inline void SfxMiniRecordReader::Skip() { _pStream->Seek(_nEofRec); - _bSkipped = TRUE; + _bSkipped = sal_True; } //------------------------------------------------------------------------- -inline BYTE SfxMiniRecordReader::GetTag() const +inline sal_uInt8 SfxMiniRecordReader::GetTag() const /* [Beschreibung] @@ -865,18 +865,18 @@ inline SvStream& SfxMiniRecordReader::operator*() const //========================================================================= -inline UINT32 SfxSingleRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) +inline sal_uInt32 SfxSingleRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) // siehe <SfxMiniRecordWriter::Close(FASTBOOL)> { - UINT32 nRet = 0; + sal_uInt32 nRet = 0; // wurde der Header noch nicht geschrieben? if ( !_bHeaderOk ) { // Basisklassen-Header schreiben - UINT32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec ); + sal_uInt32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec ); // ggf. ans Ende des eigenen Headers seeken oder hinter Rec bleiben if ( !bSeekToEndOfRec ) @@ -900,12 +900,12 @@ inline void SfxSingleRecordWriter::Reset() { _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + SFX_REC_HEADERSIZE_SINGLE ); - _bHeaderOk = FALSE; + _bHeaderOk = sal_False; } //========================================================================= -inline UINT16 SfxSingleRecordReader::GetTag() const +inline sal_uInt16 SfxSingleRecordReader::GetTag() const /* [Beschreibung] @@ -918,7 +918,7 @@ inline UINT16 SfxSingleRecordReader::GetTag() const //------------------------------------------------------------------------- -inline BYTE SfxSingleRecordReader::GetVersion() const +inline sal_uInt8 SfxSingleRecordReader::GetVersion() const /* [Beschreibung] @@ -931,7 +931,7 @@ inline BYTE SfxSingleRecordReader::GetVersion() const //------------------------------------------------------------------------- -inline FASTBOOL SfxSingleRecordReader::HasVersion( USHORT nVersion ) const +inline FASTBOOL SfxSingleRecordReader::HasVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -973,7 +973,7 @@ inline void SfxMultiFixRecordWriter::NewContent() { #ifdef DBG_UTIL - ULONG nOldStartPos; + sal_uLong nOldStartPos; // Startposition des aktuellen Contents merken - Achtung Subklassen! nOldStartPos = _nContentStartPos; #endif @@ -998,8 +998,8 @@ inline void SfxMultiFixRecordWriter::NewContent() inline SfxMultiMixRecordWriter::SfxMultiMixRecordWriter ( SvStream* pStream, // Stream, in dem der Record angelegt wird - USHORT nRecordTag, // Gesamt-Record-Art-Kennung - BYTE nRecordVer // Gesamt-Record-Versions-Kennung + sal_uInt16 nRecordTag, // Gesamt-Record-Art-Kennung + sal_uInt8 nRecordVer // Gesamt-Record-Versions-Kennung ) /* [Beschreibung] @@ -1021,12 +1021,12 @@ inline void SfxMultiFixRecordWriter::Reset() _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + SFX_REC_HEADERSIZE_SINGLE + SFX_REC_HEADERSIZE_MULTI ); - _bHeaderOk = FALSE; + _bHeaderOk = sal_False; } //========================================================================= -inline UINT16 SfxMultiRecordReader::GetContentTag() +inline sal_uInt16 SfxMultiRecordReader::GetContentTag() /* [Beschreibung] @@ -1040,7 +1040,7 @@ inline UINT16 SfxMultiRecordReader::GetContentTag() //------------------------------------------------------------------------- -inline BYTE SfxMultiRecordReader::GetContentVersion() const +inline sal_uInt8 SfxMultiRecordReader::GetContentVersion() const /* [Beschreibung] @@ -1054,7 +1054,7 @@ inline BYTE SfxMultiRecordReader::GetContentVersion() const //------------------------------------------------------------------------- -inline FASTBOOL SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const +inline FASTBOOL SfxMultiRecordReader::HasContentVersion( sal_uInt16 nVersion ) const /* [Beschreibung] @@ -1069,7 +1069,7 @@ inline FASTBOOL SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const //------------------------------------------------------------------------- -inline UINT32 SfxMultiRecordReader::ContentCount() const +inline sal_uInt32 SfxMultiRecordReader::ContentCount() const /* [Beschreibung] diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx index f7fd52d2e714..ce9d3cb635e7 100644 --- a/svl/inc/svl/flagitem.hxx +++ b/svl/inc/svl/flagitem.hxx @@ -34,7 +34,7 @@ class SvStream; -extern USHORT nSfxFlagVal[16]; +extern sal_uInt16 nSfxFlagVal[16]; // ----------------------------------------------------------------------- @@ -42,24 +42,24 @@ DBG_NAMEEX_VISIBILITY(SfxFlagItem, SVL_DLLPUBLIC) class SVL_DLLPUBLIC SfxFlagItem: public SfxPoolItem { - USHORT nVal; + sal_uInt16 nVal; public: TYPEINFO(); - SfxFlagItem( USHORT nWhich = 0, USHORT nValue = 0 ); - SfxFlagItem( USHORT nWhich, SvStream & ); + SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0 ); + SfxFlagItem( sal_uInt16 nWhich, SvStream & ); SfxFlagItem( const SfxFlagItem& ); ~SfxFlagItem() { DBG_DTOR(SfxFlagItem, 0); } - virtual BYTE GetFlagCount() const; - virtual XubString GetFlagText( BYTE nFlag ) const; + virtual sal_uInt8 GetFlagCount() const; + virtual XubString GetFlagText( sal_uInt8 nFlag ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -67,14 +67,14 @@ public: SfxMapUnit ePresMetric, XubString &rText, const IntlWrapper * = 0 ) const; - USHORT GetValue() const { return nVal; } - void SetValue( USHORT nNewVal ) { + sal_uInt16 GetValue() const { return nVal; } + void SetValue( sal_uInt16 nNewVal ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); nVal = nNewVal; } - int GetFlag( BYTE nFlag ) const { + int GetFlag( sal_uInt8 nFlag ) const { return ( (nVal & nSfxFlagVal[nFlag]) != 0 ); } - void SetFlag( BYTE nFlag, int bVal ); + void SetFlag( sal_uInt8 nFlag, int bVal ); }; #endif diff --git a/svl/inc/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx index 727f06681b45..897bb09fc8ba 100644 --- a/svl/inc/svl/globalnameitem.hxx +++ b/svl/inc/svl/globalnameitem.hxx @@ -42,17 +42,17 @@ class SVL_DLLPUBLIC SfxGlobalNameItem: public SfxPoolItem public: TYPEINFO(); SfxGlobalNameItem(); - SfxGlobalNameItem( USHORT nWhich, const SvGlobalName& ); + SfxGlobalNameItem( sal_uInt16 nWhich, const SvGlobalName& ); ~SfxGlobalNameItem(); virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; SvGlobalName GetValue() const { return m_aName; } - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx index f8f64fbd759b..a523ac68224f 100644 --- a/svl/inc/svl/hint.hxx +++ b/svl/inc/svl/hint.hxx @@ -44,26 +44,26 @@ public: class Visibility Name: public SfxHint \ { \ Type* pObj; \ - BOOL bIsOwner; \ + sal_Bool bIsOwner; \ \ public: \ TYPEINFO(); \ - Name( Type* Object, BOOL bOwnedByHint = FALSE ); \ + Name( Type* Object, sal_Bool bOwnedByHint = sal_False ); \ ~Name(); \ \ Type* GetObject() const { return pObj; } \ - BOOL IsOwner() const { return bIsOwner; } \ + sal_Bool IsOwner() const { return bIsOwner; } \ } #define IMPL_PTRHINT_AUTODELETE(Name, Type) \ TYPEINIT1(Name, SfxHint); \ - Name::Name( Type* pObject, BOOL bOwnedByHint ) \ + Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \ { pObj = pObject; bIsOwner = bOwnedByHint; } \ Name::~Name() { if ( bIsOwner ) delete pObj; } #define IMPL_PTRHINT(Name, Type) \ TYPEINIT1(Name, SfxHint); \ - Name::Name( Type* pObject, BOOL bOwnedByHint ) \ + Name::Name( Type* pObject, sal_Bool bOwnedByHint ) \ { pObj = pObject; bIsOwner = bOwnedByHint; } \ Name::~Name() {} diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx index b7b4a3cb0e90..9d2555d77848 100644 --- a/svl/inc/svl/httpcook.hxx +++ b/svl/inc/svl/httpcook.hxx @@ -61,8 +61,8 @@ struct CntHTTPCookie String m_aDomain; String m_aPath; DateTime m_aExpires; - USHORT m_nFlags; - USHORT m_nPolicy; + sal_uInt16 m_nFlags; + sal_uInt16 m_nPolicy; CntHTTPCookie (void) : m_aExpires (Date(0), Time(0)), @@ -70,14 +70,14 @@ struct CntHTTPCookie m_nPolicy (CNTHTTP_COOKIE_POLICY_INTERACTIVE) {} - BOOL replaces (const CntHTTPCookie& rOther) const + sal_Bool replaces (const CntHTTPCookie& rOther) const { return ((m_aDomain == rOther.m_aDomain) && (m_aPath == rOther.m_aPath ) && (m_aName == rOther.m_aName ) ); } - BOOL operator== (const CntHTTPCookie& rOther) const + sal_Bool operator== (const CntHTTPCookie& rOther) const { return ((m_aName == rOther.m_aName ) && (m_aValue == rOther.m_aValue ) && @@ -136,7 +136,7 @@ struct CntHTTPCookieRequest const String& m_rURL; List& m_rCookieList; CntHTTPCookieRequestType m_eType; - USHORT m_nRet; + sal_uInt16 m_nRet; CntHTTPCookieRequest ( const String& rURL, diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx index 6ecc317f7299..eddbe9e0efaa 100644 --- a/svl/inc/svl/ilstitem.hxx +++ b/svl/inc/svl/ilstitem.hxx @@ -42,7 +42,7 @@ public: TYPEINFO(); SfxIntegerListItem(); - SfxIntegerListItem( USHORT nWhich, const SvULongs& rList ); + SfxIntegerListItem( sal_uInt16 nWhich, const SvULongs& rList ); SfxIntegerListItem( const SfxIntegerListItem& rItem ); ~SfxIntegerListItem(); @@ -55,8 +55,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; }; #endif // _SFXINTITEM_HXX diff --git a/svl/inc/svl/imageitm.hxx b/svl/inc/svl/imageitm.hxx index 63dc4c470a55..4dff6f5faebe 100644 --- a/svl/inc/svl/imageitm.hxx +++ b/svl/inc/svl/imageitm.hxx @@ -39,20 +39,20 @@ class SVL_DLLPUBLIC SfxImageItem : public SfxInt16Item SfxImageItem_Impl* pImp; public: TYPEINFO(); - SfxImageItem( USHORT nWhich = 0, UINT16 nImage = 0 ); - SfxImageItem( USHORT nWhich, const String& rURL ); + SfxImageItem( sal_uInt16 nWhich = 0, sal_uInt16 nImage = 0 ); + SfxImageItem( sal_uInt16 nWhich, const String& rURL ); SfxImageItem( const SfxImageItem& ); virtual ~SfxImageItem(); virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); void SetRotation( long nValue ); long GetRotation() const; - void SetMirrored( BOOL bSet ); - BOOL IsMirrored() const; + void SetMirrored( sal_Bool bSet ); + sal_Bool IsMirrored() const; String GetURL() const; }; diff --git a/svl/inc/svl/inethist.hxx b/svl/inc/svl/inethist.hxx index aceac630924f..65e9f026a072 100644 --- a/svl/inc/svl/inethist.hxx +++ b/svl/inc/svl/inethist.hxx @@ -62,7 +62,7 @@ class INetURLHistory : public SfxBroadcaster static void NormalizeUrl_Impl (INetURLObject &rUrl); SVL_DLLPUBLIC void PutUrl_Impl (const INetURLObject &rUrl); - SVL_DLLPUBLIC BOOL QueryUrl_Impl (const INetURLObject &rUrl); + SVL_DLLPUBLIC sal_Bool QueryUrl_Impl (const INetURLObject &rUrl); /** Not implemented. */ @@ -76,7 +76,7 @@ public: /** QueryProtocol. */ - BOOL QueryProtocol (INetProtocol eProto) const + sal_Bool QueryProtocol (INetProtocol eProto) const { return ((eProto == INET_PROT_FILE ) || (eProto == INET_PROT_FTP ) || @@ -86,22 +86,22 @@ public: /** QueryUrl. */ - BOOL QueryUrl (const INetURLObject &rUrl) + sal_Bool QueryUrl (const INetURLObject &rUrl) { if (QueryProtocol (rUrl.GetProtocol())) return QueryUrl_Impl (rUrl); else - return FALSE; + return sal_False; } - BOOL QueryUrl (const String &rUrl) + sal_Bool QueryUrl (const String &rUrl) { INetProtocol eProto = INetURLObject::CompareProtocolScheme (rUrl); if (QueryProtocol (eProto)) return QueryUrl_Impl (INetURLObject (rUrl)); else - return FALSE; + return sal_False; } /** PutUrl. diff --git a/svl/inc/svl/instrm.hxx b/svl/inc/svl/instrm.hxx index d7585c13c3b7..124c80a21630 100644 --- a/svl/inc/svl/instrm.hxx +++ b/svl/inc/svl/instrm.hxx @@ -47,19 +47,19 @@ class SVL_DLLPUBLIC SvInputStream: public SvStream com::sun::star::uno::Reference< com::sun::star::io::XSeekable > m_xSeekable; SvDataPipe_Impl * m_pPipe; - ULONG m_nSeekedFrom; + sal_uLong m_nSeekedFrom; SVL_DLLPRIVATE bool open(); - SVL_DLLPRIVATE virtual ULONG GetData(void * pData, ULONG nSize); + SVL_DLLPRIVATE virtual sal_uLong GetData(void * pData, sal_uLong nSize); - SVL_DLLPRIVATE virtual ULONG PutData(void const *, ULONG); + SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong); - SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG nPos); + SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos); SVL_DLLPRIVATE virtual void FlushData(); - SVL_DLLPRIVATE virtual void SetSize(ULONG); + SVL_DLLPRIVATE virtual void SetSize(sal_uLong); public: SvInputStream( @@ -69,11 +69,11 @@ public: virtual ~SvInputStream(); - virtual USHORT IsA() const; + virtual sal_uInt16 IsA() const; - virtual void AddMark(ULONG nPos); + virtual void AddMark(sal_uLong nPos); - virtual void RemoveMark(ULONG nPos); + virtual void RemoveMark(sal_uLong nPos); }; #endif // SVTOOLS_INSTRM_HXX diff --git a/svl/inc/svl/intitem.hxx b/svl/inc/svl/intitem.hxx index f0fff8440518..0ee15d1738e5 100644 --- a/svl/inc/svl/intitem.hxx +++ b/svl/inc/svl/intitem.hxx @@ -37,13 +37,13 @@ class SVL_DLLPUBLIC SfxByteItem: public CntByteItem public: TYPEINFO(); - SfxByteItem(USHORT which = 0, BYTE nValue = 0): + SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0): CntByteItem(which, nValue) {} - SfxByteItem(USHORT which, SvStream & rStream): + SfxByteItem(sal_uInt16 which, SvStream & rStream): CntByteItem(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const { return new SfxByteItem(*this); } @@ -54,16 +54,16 @@ DBG_NAMEEX_VISIBILITY(SfxInt16Item, SVL_DLLPUBLIC) class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem { - INT16 m_nValue; + sal_Int16 m_nValue; public: TYPEINFO(); - SfxInt16Item(USHORT which = 0, INT16 nTheValue = 0): + SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0): SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(SfxInt16Item, 0); } - SfxInt16Item(USHORT nWhich, SvStream & rStream); + SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream); SfxInt16Item(const SfxInt16Item & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -82,30 +82,30 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual INT16 GetMin() const; + virtual sal_Int16 GetMin() const; - virtual INT16 GetMax() const; + virtual sal_Int16 GetMax() const; virtual SfxFieldUnit GetUnit() const; - INT16 GetValue() const { return m_nValue; } + sal_Int16 GetValue() const { return m_nValue; } - inline void SetValue(INT16 nTheValue); + inline void SetValue(sal_Int16 nTheValue); }; -inline void SfxInt16Item::SetValue(INT16 nTheValue) +inline void SfxInt16Item::SetValue(sal_Int16 nTheValue) { DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item"); m_nValue = nTheValue; @@ -117,13 +117,13 @@ class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item public: TYPEINFO(); - SfxUInt16Item(USHORT which = 0, UINT16 nValue = 0): + SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0): CntUInt16Item(which, nValue) {} - SfxUInt16Item(USHORT which, SvStream & rStream): + SfxUInt16Item(sal_uInt16 which, SvStream & rStream): CntUInt16Item(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxUInt16Item(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const @@ -136,13 +136,13 @@ class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item public: TYPEINFO(); - SfxInt32Item(USHORT which = 0, INT32 nValue = 0): + SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0): CntInt32Item(which, nValue) {} - SfxInt32Item(USHORT which, SvStream & rStream): + SfxInt32Item(sal_uInt16 which, SvStream & rStream): CntInt32Item(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxInt32Item(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const @@ -156,13 +156,13 @@ class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item public: TYPEINFO(); - SfxUInt32Item(USHORT which = 0, UINT32 nValue = 0): + SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0): CntUInt32Item(which, nValue) {} - SfxUInt32Item(USHORT which, SvStream & rStream): + SfxUInt32Item(sal_uInt16 which, SvStream & rStream): CntUInt32Item(which, rStream) {} - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const { return new SfxUInt32Item(Which(), rStream); } virtual SfxPoolItem * Clone(SfxItemPool * = 0) const diff --git a/svl/inc/svl/itemiter.hxx b/svl/inc/svl/itemiter.hxx index f80031871caf..db3f8d4cea8d 100644 --- a/svl/inc/svl/itemiter.hxx +++ b/svl/inc/svl/itemiter.hxx @@ -39,7 +39,7 @@ class SVL_DLLPUBLIC SfxItemIter { // Item-Feld - Start & Ende const SfxItemSet& _rSet; - USHORT _nStt, _nEnd, _nAkt; + sal_uInt16 _nStt, _nEnd, _nAkt; public: SfxItemIter( const SfxItemSet& rSet ); @@ -57,12 +57,12 @@ public: const SfxPoolItem* NextItem(); const SfxPoolItem* PrevItem(); - BOOL IsAtStart() const { return _nAkt == _nStt; } - BOOL IsAtEnd() const { return _nAkt == _nEnd; } + sal_Bool IsAtStart() const { return _nAkt == _nStt; } + sal_Bool IsAtEnd() const { return _nAkt == _nEnd; } - USHORT GetCurPos() const { return _nAkt; } - USHORT GetFirstPos() const { return _nStt; } - USHORT GetLastPos() const { return _nEnd; } + sal_uInt16 GetCurPos() const { return _nAkt; } + sal_uInt16 GetFirstPos() const { return _nStt; } + sal_uInt16 GetLastPos() const { return _nEnd; } }; #endif diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index daaa2b481ba3..735f9b1162aa 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -70,8 +70,8 @@ DBG_NAMEEX(SfxItemPool) struct SfxItemInfo { - USHORT _nSID; - USHORT _nFlags; + sal_uInt16 _nSID; + sal_uInt16 _nFlags; }; //==================================================================== @@ -104,23 +104,23 @@ class SVL_DLLPUBLIC SfxItemPool */ { - SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt32 nCount, USHORT nVersion, + SVL_DLLPRIVATE void readTheItems(SvStream & rStream, sal_uInt32 nCount, sal_uInt16 nVersion, SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr); UniString aName; - USHORT nStart, nEnd; - USHORT _nFileFormatVersion; + sal_uInt16 nStart, nEnd; + sal_uInt16 _nFileFormatVersion; #ifdef TF_POOLABLE const SfxItemInfo* pItemInfos; #else - USHORT* pSlotIds; + sal_uInt16* pSlotIds; #endif SfxItemPool_Impl* pImp; SfxPoolItem** ppStaticDefaults; SfxPoolItem** ppPoolDefaults; SfxItemPool* pSecondary; SfxItemPool* pMaster; - USHORT* _pPoolRanges; + sal_uInt16* _pPoolRanges; FASTBOOL bPersistentRefCounts; private: @@ -137,16 +137,16 @@ public: friend class SfxPoolWhichMap; private: - inline USHORT GetIndex_Impl(USHORT nWhich) const; - inline USHORT GetSize_Impl() const { return nEnd - nStart + 1; } + inline sal_uInt16 GetIndex_Impl(sal_uInt16 nWhich) const; + inline sal_uInt16 GetSize_Impl() const { return nEnd - nStart + 1; } SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream ); - SVL_DLLPRIVATE FASTBOOL IsItemFlag_Impl( USHORT nWhich, USHORT nFlag ) const; + SVL_DLLPRIVATE FASTBOOL IsItemFlag_Impl( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; public: // fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges - void FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const; - const USHORT* GetFrozenIdRanges() const + void FillItemIdRanges_Impl( sal_uInt16*& pWhichRanges ) const; + const sal_uInt16* GetFrozenIdRanges() const { return _pPoolRanges; } FASTBOOL IsVer2_Impl() const; @@ -154,23 +154,23 @@ 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, sal_uLong n ); + static inline sal_uLong AddRef( const SfxPoolItem& rItem, sal_uLong n = 1 ); + static inline sal_uLong ReleaseRef( const SfxPoolItem& rItem, sal_uLong n = 1); public: SfxItemPool( const SfxItemPool &rPool, - BOOL bCloneStaticDefaults = FALSE ); + sal_Bool bCloneStaticDefaults = sal_False ); SfxItemPool( const UniString &rName, - USHORT nStart, USHORT nEnd, + sal_uInt16 nStart, sal_uInt16 nEnd, #ifdef TF_POOLABLE const SfxItemInfo *pItemInfos, #endif SfxPoolItem **pDefaults = 0, #ifndef TF_POOLABLE - USHORT *pSlotIds = 0, + sal_uInt16 *pSlotIds = 0, #endif - FASTBOOL bLoadRefCounts = TRUE ); + FASTBOOL bLoadRefCounts = sal_True ); protected: virtual ~SfxItemPool(); public: @@ -179,14 +179,14 @@ public: SfxBroadcaster& BC(); void SetPoolDefaultItem( const SfxPoolItem& ); - const SfxPoolItem* GetPoolDefaultItem( USHORT nWhich ) const; - void ResetPoolDefaultItem( USHORT nWhich ); + const SfxPoolItem* GetPoolDefaultItem( sal_uInt16 nWhich ) const; + void ResetPoolDefaultItem( sal_uInt16 nWhich ); void SetDefaults( SfxPoolItem **pDefaults ); - void ReleaseDefaults( BOOL bDelete = FALSE ); - static void ReleaseDefaults( SfxPoolItem **pDefaults, USHORT nCount, BOOL bDelete = FALSE ); + void ReleaseDefaults( sal_Bool bDelete = sal_False ); + static void ReleaseDefaults( SfxPoolItem **pDefaults, sal_uInt16 nCount, sal_Bool bDelete = sal_False ); - virtual SfxMapUnit GetMetric( USHORT nWhich ) const; + virtual SfxMapUnit GetMetric( sal_uInt16 nWhich ) const; void SetDefaultMetric( SfxMapUnit eNewMetric ); virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem, SfxItemPresentation ePresentation, @@ -197,22 +197,22 @@ public: virtual SfxItemPool* Clone() const; UniString const & GetName() const { return aName; } - virtual const SfxPoolItem& Put( const SfxPoolItem&, USHORT nWhich = 0 ); + virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 ); virtual void Remove( const SfxPoolItem& ); - virtual const SfxPoolItem& GetDefaultItem( USHORT nWhich ) const; + virtual const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const; const SfxPoolItem* LoadItem( SvStream &rStream, - FASTBOOL bDirect = FALSE, + FASTBOOL bDirect = sal_False, const SfxItemPool *pRefPool = 0 ); FASTBOOL StoreItem( SvStream &rStream, const SfxPoolItem &rItem, - FASTBOOL bDirect = FALSE ) const; + FASTBOOL bDirect = sal_False ) const; sal_uInt32 GetSurrogate(const SfxPoolItem *) const; - const SfxPoolItem * GetItem2(USHORT nWhich, sal_uInt32 nSurrogate) const; - sal_uInt32 GetItemCount2(USHORT nWhich) const; + const SfxPoolItem * GetItem2(sal_uInt16 nWhich, sal_uInt32 nSurrogate) const; + sal_uInt32 GetItemCount2(sal_uInt16 nWhich) const; const SfxPoolItem* LoadSurrogate(SvStream& rStream, - USHORT &rWhich, USHORT nSlotId, + sal_uInt16 &rWhich, sal_uInt16 nSlotId, const SfxItemPool* pRefPool = 0 ); FASTBOOL StoreSurrogate(SvStream& rStream, const SfxPoolItem *pItem ) const; @@ -223,14 +223,14 @@ public: return bPersistentRefCounts; } void LoadCompleted(); - USHORT GetFirstWhich() const { return nStart; } - USHORT GetLastWhich() const { return nEnd; } - FASTBOOL IsInRange( USHORT nWhich ) const { + sal_uInt16 GetFirstWhich() const { return nStart; } + sal_uInt16 GetLastWhich() const { return nEnd; } + FASTBOOL IsInRange( sal_uInt16 nWhich ) const { return nWhich >= nStart && nWhich <= nEnd; } - FASTBOOL IsInVersionsRange( USHORT nWhich ) const; - FASTBOOL IsInStoringRange( USHORT nWhich ) const; - void SetStoringRange( USHORT nFrom, USHORT nTo ); + FASTBOOL IsInVersionsRange( sal_uInt16 nWhich ) const; + FASTBOOL IsInStoringRange( sal_uInt16 nWhich ) const; + void SetStoringRange( sal_uInt16 nFrom, sal_uInt16 nTo ); void SetSecondaryPool( SfxItemPool *pPool ); SfxItemPool* GetSecondaryPool() const { return pSecondary; } @@ -242,35 +242,35 @@ public: void Delete(); #ifdef TF_POOLABLE - FASTBOOL IsItemFlag( USHORT nWhich, USHORT nFlag ) const; - FASTBOOL IsItemFlag( const SfxPoolItem &rItem, USHORT nFlag ) const + FASTBOOL IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const; + FASTBOOL IsItemFlag( const SfxPoolItem &rItem, sal_uInt16 nFlag ) const { return IsItemFlag( rItem.Which(), nFlag ); } void SetItemInfos( const SfxItemInfo *pInfos ) { pItemInfos = pInfos; } #else int HasMap() const { return 0 != pSlotIds; } - void SetMap( USHORT *pNewSlotIds ) + void SetMap( sal_uInt16 *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; - - void SetVersionMap( USHORT nVer, - USHORT nOldStart, USHORT nOldEnd, - USHORT *pWhichIdTab ); - USHORT GetNewWhich( USHORT nOldWhich ) const; - USHORT GetVersion() const; - USHORT GetFileFormatVersion() const + sal_uInt16 GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const; + sal_uInt16 GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const; + sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const; + sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const; + + void SetVersionMap( sal_uInt16 nVer, + sal_uInt16 nOldStart, sal_uInt16 nOldEnd, + sal_uInt16 *pWhichIdTab ); + sal_uInt16 GetNewWhich( sal_uInt16 nOldWhich ) const; + sal_uInt16 GetVersion() const; + sal_uInt16 GetFileFormatVersion() const { return _nFileFormatVersion; } - void SetFileFormatVersion( USHORT nFileFormatVersion ); - USHORT GetLoadingVersion() const; + void SetFileFormatVersion( sal_uInt16 nFileFormatVersion ); + sal_uInt16 GetLoadingVersion() const; FASTBOOL IsCurrentVersionLoading() const; - static int IsWhich(USHORT nId) { + static int IsWhich(sal_uInt16 nId) { return nId && nId <= SFX_WHICH_MAX; } - static int IsSlot(USHORT nId) { + static int IsSlot(sal_uInt16 nId) { return nId && nId > SFX_WHICH_MAX; } static const SfxItemPool* GetStoringPool(); @@ -283,19 +283,19 @@ private: // --------------- Inline Implementierungen ------------------------------ // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, ULONG n ) +inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, sal_uLong n ) { rItem.SetRefCount(n); } // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline ULONG SfxItemPool::AddRef( const SfxPoolItem& rItem, ULONG n ) +inline sal_uLong SfxItemPool::AddRef( const SfxPoolItem& rItem, sal_uLong n ) { return rItem.AddRef(n); } // nur der Pool darf den Referenz-Zaehler manipulieren !!! -inline ULONG SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, ULONG n ) +inline sal_uLong SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, sal_uLong n ) { return rItem.ReleaseRef(n); } diff --git a/svl/inc/svl/itemprop.hxx b/svl/inc/svl/itemprop.hxx index 3a993b47ed47..c755f6e93f34 100644 --- a/svl/inc/svl/itemprop.hxx +++ b/svl/inc/svl/itemprop.hxx @@ -44,20 +44,20 @@ struct SfxItemPropertyMapEntry { const char* pName; - USHORT nNameLen; - USHORT nWID; + sal_uInt16 nNameLen; + sal_uInt16 nWID; const com::sun::star::uno::Type* pType; long nFlags; - BYTE nMemberId; + sal_uInt8 nMemberId; }; struct SfxItemPropertySimpleEntry { - USHORT nWID; + sal_uInt16 nWID; const com::sun::star::uno::Type* pType; long nFlags; - BYTE nMemberId; + sal_uInt8 nMemberId; SfxItemPropertySimpleEntry() : nWID( 0 ), @@ -65,8 +65,8 @@ struct SfxItemPropertySimpleEntry nFlags( 0 ), nMemberId( 0 ){} - SfxItemPropertySimpleEntry(USHORT _nWID, const com::sun::star::uno::Type* _pType, - long _nFlags, BYTE _nMemberId) : + SfxItemPropertySimpleEntry(sal_uInt16 _nWID, const com::sun::star::uno::Type* _pType, + long _nFlags, sal_uInt8 _nMemberId) : nWID( _nWID ), pType( _pType ), nFlags( _nFlags ), @@ -116,7 +116,7 @@ class SVL_DLLPUBLIC SfxItemPropertySet SfxItemPropertyMap m_aMap; mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo; protected: - virtual BOOL FillItem(SfxItemSet& rSet, USHORT nWhich, BOOL bGetProperty) const; + virtual sal_Bool FillItem(SfxItemSet& rSet, sal_uInt16 nWhich, sal_Bool bGetProperty) const; public: SfxItemPropertySet( const SfxItemPropertyMapEntry *pMap ) : diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx index 30c4cc411fad..7e6429ca37ab 100644 --- a/svl/inc/svl/itemset.hxx +++ b/svl/inc/svl/itemset.hxx @@ -50,8 +50,8 @@ typedef SfxPoolItem const** SfxItemArray; #ifndef DBG #ifdef DBG_UTILx #define DBG(s) s -#define _pChildCount(THIS) ( *(USHORT**)SfxPointerServer::GetServer()->GetPointer(THIS) ) -#define _pChildCountCtor ( (*(USHORT**)SfxPointerServer::GetServer()->CreatePointer(this)) = new USHORT ) +#define _pChildCount(THIS) ( *(sal_uInt16**)SfxPointerServer::GetServer()->GetPointer(THIS) ) +#define _pChildCountCtor ( (*(sal_uInt16**)SfxPointerServer::GetServer()->CreatePointer(this)) = new sal_uInt16 ) #define _pChildCountDtor ( SfxPointerServer::GetServer()->ReleasePointer(this) ) #else #define DBG(s) @@ -79,8 +79,8 @@ class SVL_DLLPUBLIC SfxItemSet SfxItemPool* _pPool; // der verwendete Pool const SfxItemSet* _pParent; // Ableitung SfxItemArray _aItems; // Item-Feld - USHORT* _pWhichRanges; // Array von Which-Bereichen - USHORT _nCount; // Anzahl Items + sal_uInt16* _pWhichRanges; // Array von Which-Bereichen + sal_uInt16 _nCount; // Anzahl Items //--------------------------------------------------------------------- #ifndef _SFXITEMS_HXX @@ -90,9 +90,9 @@ friend class SfxAllItemSet; friend const char *DbgCheckItemSet( const void* ); private: - SVL_DLLPRIVATE void InitRanges_Impl(const USHORT *nWhichPairTable); - SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, USHORT n1, USHORT n2, USHORT n3); - SVL_DLLPRIVATE void InitRanges_Impl(USHORT nWh1, USHORT nWh2); + SVL_DLLPRIVATE void InitRanges_Impl(const sal_uInt16 *nWhichPairTable); + SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, sal_uInt16 n1, sal_uInt16 n2, sal_uInt16 n3); + SVL_DLLPRIVATE void InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2); public: SfxItemArray GetItems_Impl() const { return _aItems; } @@ -113,64 +113,64 @@ protected: public: SfxItemSet( const SfxItemSet& ); - SfxItemSet( SfxItemPool&, BOOL bTotalPoolRanges = FALSE ); - SfxItemSet( SfxItemPool&, USHORT nWhich1, USHORT nWhich2 ); + SfxItemSet( SfxItemPool&, sal_Bool bTotalPoolRanges = sal_False ); + SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 ); SfxItemSet( SfxItemPool&, USHORT_ARG nWh1, USHORT_ARG nWh2, USHORT_ARG nNull, ... ); - SfxItemSet( SfxItemPool&, const USHORT* nWhichPairTable ); + SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable ); virtual ~SfxItemSet(); - virtual SfxItemSet * Clone(BOOL bItems = TRUE, SfxItemPool *pToPool = 0) const; + virtual SfxItemSet * Clone(sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0) const; // Items erfragen - USHORT Count() const { return _nCount; } - USHORT TotalCount() const; + sal_uInt16 Count() const { return _nCount; } + sal_uInt16 TotalCount() const; - virtual const SfxPoolItem& Get( USHORT nWhich, BOOL bSrchInParent = TRUE ) const; - const SfxPoolItem* GetItem( USHORT nWhich, BOOL bSrchInParent = TRUE, + virtual const SfxPoolItem& Get( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True ) const; + const SfxPoolItem* GetItem( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True, TypeId aItemType = 0 ) const; // Which-Wert des Items an der Position nPos erfragen - USHORT GetWhichByPos(USHORT nPos) const; + sal_uInt16 GetWhichByPos(sal_uInt16 nPos) const; // Item-Status erfragen - SfxItemState GetItemState( USHORT nWhich, - BOOL bSrchInParent = TRUE, + SfxItemState GetItemState( sal_uInt16 nWhich, + sal_Bool bSrchInParent = sal_True, const SfxPoolItem **ppItem = 0 ) const; - virtual void DisableItem(USHORT nWhich); - virtual void InvalidateItem( USHORT nWhich ); - virtual USHORT ClearItem( USHORT nWhich = 0); - virtual void ClearInvalidItems( BOOL bHardDefault = FALSE ); + virtual void DisableItem(sal_uInt16 nWhich); + virtual void InvalidateItem( sal_uInt16 nWhich ); + virtual sal_uInt16 ClearItem( sal_uInt16 nWhich = 0); + virtual void ClearInvalidItems( sal_Bool bHardDefault = sal_False ); void InvalidateAllItems(); HACK(via nWhich = 0) inline void SetParent( const SfxItemSet* pNew ); // Items hinzufuegen, loeschen etc. - virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich ); + virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich ); const SfxPoolItem* Put( const SfxPoolItem& rItem ) { return Put(rItem, rItem.Which()); } virtual int Put( const SfxItemSet&, - BOOL bInvalidAsDefault = TRUE ); + sal_Bool bInvalidAsDefault = sal_True ); void PutExtended( const SfxItemSet&, SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN, SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN ); - virtual int Set( const SfxItemSet&, BOOL bDeep = TRUE ); + virtual int Set( const SfxItemSet&, sal_Bool bDeep = sal_True ); virtual void Intersect( const SfxItemSet& rSet ); - virtual void MergeValues( const SfxItemSet& rSet, BOOL bOverwriteDefaults = FALSE ); + virtual void MergeValues( const SfxItemSet& rSet, sal_Bool bOverwriteDefaults = sal_False ); virtual void Differentiate( const SfxItemSet& rSet ); - virtual void MergeValue( const SfxPoolItem& rItem, BOOL bOverwriteDefaults = FALSE ); + virtual void MergeValue( const SfxPoolItem& rItem, sal_Bool bOverwriteDefaults = sal_False ); SfxItemPool* GetPool() const { return _pPool; } - const USHORT* GetRanges() const { return _pWhichRanges; } - void SetRanges( const USHORT *pRanges ); - void MergeRange( USHORT nFrom, USHORT nTo ); + const sal_uInt16* GetRanges() const { return _pWhichRanges; } + void SetRanges( const sal_uInt16 *pRanges ); + void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo ); const SfxItemSet* GetParent() const { return _pParent; } - virtual SvStream & Load( SvStream &, FASTBOOL bDirect = FALSE, + virtual SvStream & Load( SvStream &, FASTBOOL bDirect = sal_False, const SfxItemPool *pRefPool = 0 ); - virtual SvStream & Store( SvStream &, FASTBOOL bDirect = FALSE ) const; + virtual SvStream & Store( SvStream &, FASTBOOL bDirect = sal_False ) const; virtual int operator==(const SfxItemSet &) const; }; @@ -194,19 +194,19 @@ class SVL_DLLPUBLIC SfxAllItemSet: public SfxItemSet { SfxVoidItem aDefault; - USHORT nFree; + sal_uInt16 nFree; public: SfxAllItemSet( SfxItemPool &rPool ); SfxAllItemSet( const SfxItemSet & ); SfxAllItemSet( const SfxAllItemSet & ); - virtual SfxItemSet * Clone( BOOL bItems = TRUE, SfxItemPool *pToPool = 0 ) const; - virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich ); + virtual SfxItemSet * Clone( sal_Bool bItems = sal_True, SfxItemPool *pToPool = 0 ) const; + virtual const SfxPoolItem* Put( const SfxPoolItem&, sal_uInt16 nWhich ); const SfxPoolItem* Put( const SfxPoolItem& rItem ) { return Put(rItem, rItem.Which()); } virtual int Put( const SfxItemSet&, - BOOL bInvalidAsDefault = TRUE ); + sal_Bool bInvalidAsDefault = sal_True ); }; #endif // #ifndef _SFXITEMSET_HXX diff --git a/svl/inc/svl/lckbitem.hxx b/svl/inc/svl/lckbitem.hxx index 2204a57c17d4..6535264eeb78 100644 --- a/svl/inc/svl/lckbitem.hxx +++ b/svl/inc/svl/lckbitem.hxx @@ -42,23 +42,23 @@ class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem public: TYPEINFO(); SfxLockBytesItem(); - SfxLockBytesItem( USHORT nWhich, + SfxLockBytesItem( sal_uInt16 nWhich, SvLockBytes *pLockBytes ); - SfxLockBytesItem( USHORT nWhich, SvStream & ); + SfxLockBytesItem( sal_uInt16 nWhich, SvStream & ); SfxLockBytesItem( const SfxLockBytesItem& ); ~SfxLockBytesItem(); virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const; SvLockBytes* GetValue() const { return _xVal; } - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/listener.hxx b/svl/inc/svl/listener.hxx index 3107f5ceee56..e3bdea45169e 100644 --- a/svl/inc/svl/listener.hxx +++ b/svl/inc/svl/listener.hxx @@ -50,12 +50,12 @@ public: SvtListener( const SvtListener &rCopy ); virtual ~SvtListener(); - BOOL StartListening( SvtBroadcaster& rBroadcaster ); - BOOL EndListening( SvtBroadcaster& rBroadcaster ); + sal_Bool StartListening( SvtBroadcaster& rBroadcaster ); + sal_Bool EndListening( SvtBroadcaster& rBroadcaster ); void EndListeningAll(); - BOOL IsListening( SvtBroadcaster& rBroadcaster ) const; + sal_Bool IsListening( SvtBroadcaster& rBroadcaster ) const; - BOOL HasBroadcaster() const { return 0 != pBrdCastLst; } + sal_Bool HasBroadcaster() const { return 0 != pBrdCastLst; } virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint ); }; diff --git a/svl/inc/svl/lngmisc.hxx b/svl/inc/svl/lngmisc.hxx index 5143d147227d..9dbe2d4740d0 100644 --- a/svl/inc/svl/lngmisc.hxx +++ b/svl/inc/svl/lngmisc.hxx @@ -45,29 +45,29 @@ namespace linguistic { -inline BOOL IsHyphen( sal_Unicode cChar ) +inline sal_Bool IsHyphen( sal_Unicode cChar ) { return cChar == SVT_SOFT_HYPHEN || cChar == SVT_HARD_HYPHEN; } -inline BOOL IsControlChar( sal_Unicode cChar ) +inline sal_Bool IsControlChar( sal_Unicode cChar ) { return cChar < (sal_Unicode) ' '; } -inline BOOL HasHyphens( const rtl::OUString &rTxt ) +inline sal_Bool HasHyphens( const rtl::OUString &rTxt ) { return rTxt.indexOf( SVT_SOFT_HYPHEN ) != -1 || rTxt.indexOf( SVT_HARD_HYPHEN ) != -1; } -SVL_DLLPUBLIC INT32 GetNumControlChars( const rtl::OUString &rTxt ); -SVL_DLLPUBLIC BOOL RemoveHyphens( rtl::OUString &rTxt ); -SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt ); +SVL_DLLPUBLIC sal_Int32 GetNumControlChars( const rtl::OUString &rTxt ); +SVL_DLLPUBLIC sal_Bool RemoveHyphens( rtl::OUString &rTxt ); +SVL_DLLPUBLIC sal_Bool RemoveControlChars( rtl::OUString &rTxt ); -SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); +SVL_DLLPUBLIC sal_Bool ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); SVL_DLLPUBLIC String GetThesaurusReplaceText( const String &rText ); diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx index bc95573228f5..963ab3f2b654 100644 --- a/svl/inc/svl/lstner.hxx +++ b/svl/inc/svl/lstner.hxx @@ -57,15 +57,15 @@ public: SfxListener( const SfxListener &rCopy ); virtual ~SfxListener(); - BOOL StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups = FALSE ); - BOOL EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups = FALSE ); - void EndListening( USHORT nNo ); + sal_Bool StartListening( SfxBroadcaster& rBroadcaster, sal_Bool bPreventDups = sal_False ); + sal_Bool EndListening( SfxBroadcaster& rBroadcaster, sal_Bool bAllDups = sal_False ); + void EndListening( sal_uInt16 nNo ); void EndListeningAll(); - BOOL IsListening( SfxBroadcaster& rBroadcaster ) const; + sal_Bool IsListening( SfxBroadcaster& rBroadcaster ) const; - USHORT GetBroadcasterCount() const + sal_uInt16 GetBroadcasterCount() const { return aBCs.Count(); } - SfxBroadcaster* GetBroadcasterJOE( USHORT nNo ) const + SfxBroadcaster* GetBroadcasterJOE( sal_uInt16 nNo ) const { return (SfxBroadcaster*) aBCs.GetObject(nNo); } virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx index 48bc55cd1aa0..a82f4d11d58c 100644 --- a/svl/inc/svl/macitem.hxx +++ b/svl/inc/svl/macitem.hxx @@ -93,7 +93,7 @@ public: ScriptType GetScriptType() const { return eType; } - BOOL HasMacro() const { return aMacName.Len() ? TRUE : FALSE; } + sal_Bool HasMacro() const { return aMacName.Len() ? sal_True : sal_False; } #ifdef SOLAR_JAVA // JavaScript-Function-Objekt holen @@ -125,7 +125,7 @@ DECLARE_TABLE( _SvxMacroTableDtor, SvxMacro* ) class SVL_DLLPUBLIC SvxMacroTableDtor : public _SvxMacroTableDtor { public: - inline SvxMacroTableDtor( const USHORT nInitSz = 0, const USHORT nReSz = 1 ); + inline SvxMacroTableDtor( const sal_uInt16 nInitSz = 0, const sal_uInt16 nReSz = 1 ); inline SvxMacroTableDtor( const SvxMacroTableDtor &rCpy ) : _SvxMacroTableDtor() { *this = rCpy; } inline ~SvxMacroTableDtor() { DelDtor(); } SvxMacroTableDtor& operator=( const SvxMacroTableDtor &rCpy ); @@ -133,14 +133,14 @@ public: // loescht alle Eintraege void DelDtor(); - SvStream& Read( SvStream &, USHORT nVersion = SVX_MACROTBL_AKTVERSION ); + SvStream& Read( SvStream &, sal_uInt16 nVersion = SVX_MACROTBL_AKTVERSION ); SvStream& Write( SvStream & ) const; - USHORT GetVersion() const { return SVX_MACROTBL_AKTVERSION; } + sal_uInt16 GetVersion() const { return SVX_MACROTBL_AKTVERSION; } }; -inline SvxMacroTableDtor::SvxMacroTableDtor( const USHORT nInitSz, - const USHORT nReSz) +inline SvxMacroTableDtor::SvxMacroTableDtor( const sal_uInt16 nInitSz, + const sal_uInt16 nReSz) : _SvxMacroTableDtor( nInitSz, nReSz ) {} @@ -154,7 +154,7 @@ class SVL_DLLPUBLIC SvxMacroItem: public SfxPoolItem public: TYPEINFO(); - inline SvxMacroItem ( const USHORT nId /*= ITEMID_MACRO*/ ); + inline SvxMacroItem ( const sal_uInt16 nId /*= ITEMID_MACRO*/ ); // "pure virtual Methoden" vom SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; @@ -164,17 +164,17 @@ public: XubString &rText, const IntlWrapper * = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; - virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const; + virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; inline const SvxMacroTableDtor& GetMacroTable() const { return aMacroTable;} inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aMacroTable = rTbl; } - inline const SvxMacro& GetMacro( USHORT nEvent ) const; - inline BOOL HasMacro( USHORT nEvent ) const; - void SetMacro( USHORT nEvent, const SvxMacro& ); - inline BOOL DelMacro( USHORT nEvent ); + inline const SvxMacro& GetMacro( sal_uInt16 nEvent ) const; + inline sal_Bool HasMacro( sal_uInt16 nEvent ) const; + void SetMacro( sal_uInt16 nEvent, const SvxMacro& ); + inline sal_Bool DelMacro( sal_uInt16 nEvent ); private: SvxMacroTableDtor aMacroTable; @@ -183,7 +183,7 @@ private: SvxMacroItem &operator=( const SvxMacroItem & ); }; -inline SvxMacroItem::SvxMacroItem( const USHORT nId ) +inline SvxMacroItem::SvxMacroItem( const sal_uInt16 nId ) : SfxPoolItem( nId ) {} inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy ) @@ -191,15 +191,15 @@ inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy ) aMacroTable( rCpy.GetMacroTable() ) {} -inline BOOL SvxMacroItem::HasMacro( USHORT nEvent ) const +inline sal_Bool SvxMacroItem::HasMacro( sal_uInt16 nEvent ) const { return aMacroTable.IsKeyValid( nEvent ); } -inline const SvxMacro& SvxMacroItem::GetMacro( USHORT nEvent ) const +inline const SvxMacro& SvxMacroItem::GetMacro( sal_uInt16 nEvent ) const { return *(aMacroTable.Get(nEvent)); } -inline BOOL SvxMacroItem::DelMacro( USHORT nEvent ) +inline sal_Bool SvxMacroItem::DelMacro( sal_uInt16 nEvent ) { SvxMacro *pMacro = aMacroTable.Remove( nEvent ); delete pMacro; diff --git a/svl/inc/svl/mailenum.hxx b/svl/inc/svl/mailenum.hxx index e25fd2cfdcd2..bfce28ed00db 100644 --- a/svl/inc/svl/mailenum.hxx +++ b/svl/inc/svl/mailenum.hxx @@ -85,10 +85,10 @@ enum MailAction // Textformat zum Versenden von Nachrichten ------------------------------ -#define TXTFORMAT_ASCII ((BYTE)0x01) -#define TXTFORMAT_HTML ((BYTE)0x02) -#define TXTFORMAT_RTF ((BYTE)0x04) -#define TXTFORMAT_OFFICE ((BYTE)0x08) +#define TXTFORMAT_ASCII ((sal_uInt8)0x01) +#define TXTFORMAT_HTML ((sal_uInt8)0x02) +#define TXTFORMAT_RTF ((sal_uInt8)0x04) +#define TXTFORMAT_OFFICE ((sal_uInt8)0x08) #endif diff --git a/svl/inc/svl/metitem.hxx b/svl/inc/svl/metitem.hxx index 5e7e792b61e7..a5eecbebfa61 100644 --- a/svl/inc/svl/metitem.hxx +++ b/svl/inc/svl/metitem.hxx @@ -38,8 +38,8 @@ class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item { public: TYPEINFO(); - SfxMetricItem( USHORT nWhich = 0, UINT32 nValue = 0 ); - SfxMetricItem( USHORT nWhich, SvStream & ); + SfxMetricItem( sal_uInt16 nWhich = 0, sal_uInt32 nValue = 0 ); + SfxMetricItem( sal_uInt16 nWhich, SvStream & ); SfxMetricItem( const SfxMetricItem& ); ~SfxMetricItem() { DBG_DTOR(SfxMetricItem, 0); } diff --git a/svl/inc/svl/nranges.hxx b/svl/inc/svl/nranges.hxx index b04f131d6e89..c7ba2029f5a6 100644 --- a/svl/inc/svl/nranges.hxx +++ b/svl/inc/svl/nranges.hxx @@ -35,12 +35,12 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxNumRanges SfxUShortRanges #include <svl/nranges.hxx> #undef NUMTYPE -#define NUMTYPE ULONG +#define NUMTYPE sal_uLong #define SfxNumRanges SfxULongRanges #include <svl/nranges.hxx> @@ -66,8 +66,8 @@ public: ~SfxNumRanges() { delete [] _pRanges; } - BOOL operator == ( const SfxNumRanges & ) const; - BOOL operator != ( const SfxNumRanges & rRanges ) const + sal_Bool operator == ( const SfxNumRanges & ) const; + sal_Bool operator != ( const SfxNumRanges & rRanges ) const { return !( *this == rRanges ); } SfxNumRanges& operator = ( const SfxNumRanges & ); @@ -77,10 +77,10 @@ public: SfxNumRanges& operator /= ( const SfxNumRanges & ); NUMTYPE Count() const; - BOOL IsEmpty() const + sal_Bool IsEmpty() const { return !_pRanges || 0 == *_pRanges; } - BOOL Contains( NUMTYPE n ) const; - BOOL Intersects( const SfxNumRanges & ) const; + sal_Bool Contains( NUMTYPE n ) const; + sal_Bool Intersects( const SfxNumRanges & ) const; operator const NUMTYPE* () const { return _pRanges; } diff --git a/svl/inc/svl/outstrm.hxx b/svl/inc/svl/outstrm.hxx index f80f6f2c9616..b48cea2e04da 100644 --- a/svl/inc/svl/outstrm.hxx +++ b/svl/inc/svl/outstrm.hxx @@ -42,15 +42,15 @@ class SVL_DLLPUBLIC SvOutputStream: public SvStream com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > m_xStream; - SVL_DLLPRIVATE virtual ULONG GetData(void *, ULONG); + SVL_DLLPRIVATE virtual sal_uLong GetData(void *, sal_uLong); - SVL_DLLPRIVATE virtual ULONG PutData(void const * pData, ULONG nSize); + SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize); - SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG); + SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong); SVL_DLLPRIVATE virtual void FlushData(); - SVL_DLLPRIVATE virtual void SetSize(ULONG); + SVL_DLLPRIVATE virtual void SetSize(sal_uLong); public: SvOutputStream(com::sun::star::uno::Reference< @@ -59,7 +59,7 @@ public: virtual ~SvOutputStream(); - virtual USHORT IsA() const; + virtual sal_uInt16 IsA() const; }; #endif // SVTOOLS_OUTSTRM_HXX diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 41f6cbff40d1..801441c297a1 100644 --- a/svl/inc/svl/ownlist.hxx +++ b/svl/inc/svl/ownlist.hxx @@ -86,10 +86,10 @@ class SVL_DLLPUBLIC SvCommandList { PRV_SV_DECL_OWNER_LIST(SvCommandList,SvCommand); SvCommand & Append( const String & rCommand, const String & rArg ); - BOOL AppendCommands( const String & rCmd, USHORT * pEaten ); + sal_Bool AppendCommands( const String & rCmd, sal_uInt16 * pEaten ); String GetCommands() const; - BOOL FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); + sal_Bool FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); SVL_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & ); diff --git a/svl/inc/svl/poolcach.hxx b/svl/inc/svl/poolcach.hxx index 78bdca8177e6..182c9739f0cf 100644 --- a/svl/inc/svl/poolcach.hxx +++ b/svl/inc/svl/poolcach.hxx @@ -61,7 +61,7 @@ public: const SfxItemSet *pPutSet ); ~SfxItemPoolCache(); - const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, BOOL bNew = FALSE ); + const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, sal_Bool bNew = sal_False ); }; diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index d78e32877440..48e5a80166b7 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -143,7 +143,7 @@ enum SfxItemPresentation // ----------------------------------------------------------------------- -typedef USHORT SfxItemState; +typedef sal_uInt16 SfxItemState; #define SFX_ITEM_UNKNOWN 0x0000 @@ -183,17 +183,17 @@ friend class SfxItemPoolCache; friend class SfxItemSet; friend class SfxVoidItem; - ULONG nRefCount; // Referenzzaehler - USHORT nWhich; - USHORT nKind; + sal_uLong nRefCount; // Referenzzaehler + sal_uInt16 nWhich; + sal_uInt16 nKind; private: - inline void SetRefCount( ULONG n ); - inline void SetKind( USHORT n ); + inline void SetRefCount( sal_uLong n ); + inline void SetKind( sal_uInt16 n ); public: - inline ULONG AddRef( ULONG n = 1 ) const; + inline sal_uLong AddRef( sal_uLong n = 1 ) const; private: - inline ULONG ReleaseRef( ULONG n = 1 ) const; + inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const; SVL_DLLPRIVATE long Delete_Impl(void*); #if 0 @@ -203,17 +203,17 @@ private: #endif protected: - SfxPoolItem( USHORT nWhich = 0 ); + SfxPoolItem( sal_uInt16 nWhich = 0 ); SfxPoolItem( const SfxPoolItem& ); public: TYPEINFO(); virtual ~SfxPoolItem(); - void SetWhich( USHORT nId ) { + void SetWhich( sal_uInt16 nId ) { DBG_CHKTHIS(SfxPoolItem, 0); nWhich = nId; } - USHORT Which() const { + sal_uInt16 Which() const { DBG_CHKTHIS(SfxPoolItem, 0); return nWhich; } virtual int operator==( const SfxPoolItem& ) const = 0; @@ -228,19 +228,19 @@ public: XubString &rText, const IntlWrapper * pIntlWrapper = 0 ) const; - virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + virtual sal_uInt16 GetVersion( sal_uInt16 nFileFormatVersion ) const; virtual int ScaleMetrics( long lMult, long lDiv ); virtual int HasMetrics() const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual SfxPoolItem* Create( SvStream &, USHORT nItemVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nItemVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; - ULONG GetRefCount() const { return nRefCount; } - inline USHORT GetKind() const { return nKind; } + sal_uLong GetRefCount() const { return nRefCount; } + inline sal_uInt16 GetKind() const { return nKind; } /** Read in a Unicode string from a streamed byte string representation. @@ -295,21 +295,21 @@ private: // ----------------------------------------------------------------------- -inline void SfxPoolItem::SetRefCount( ULONG n ) +inline void SfxPoolItem::SetRefCount( sal_uLong n ) { DBG_CHKTHIS( SfxPoolItem, 0 ); nRefCount = n; nKind = 0; } -inline void SfxPoolItem::SetKind( USHORT n ) +inline void SfxPoolItem::SetKind( sal_uInt16 n ) { DBG_CHKTHIS( SfxPoolItem, 0 ); nRefCount = SFX_ITEMS_SPECIAL; nKind = n; } -inline ULONG SfxPoolItem::AddRef( ULONG n ) const +inline sal_uLong SfxPoolItem::AddRef( sal_uLong n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); @@ -317,7 +317,7 @@ inline ULONG SfxPoolItem::AddRef( ULONG n ) const return ( ((SfxPoolItem *)this)->nRefCount += n ); } -inline ULONG SfxPoolItem::ReleaseRef( ULONG n ) const +inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const { DBG_CHKTHIS( SfxPoolItem, 0 ); DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); @@ -360,8 +360,8 @@ class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented. public: TYPEINFO(); - SfxVoidItem( USHORT nWhich ); - SfxVoidItem( USHORT nWhich, SvStream & ); + SfxVoidItem( sal_uInt16 nWhich ); + SfxVoidItem( sal_uInt16 nWhich, SvStream & ); SfxVoidItem( const SfxVoidItem& ); ~SfxVoidItem(); @@ -375,7 +375,7 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - void SetWhich(USHORT nWh) { nWhich = nWh; } + void SetWhich(sal_uInt16 nWh) { nWhich = nWh; } }; // ----------------------------------------------------------------------- @@ -388,8 +388,8 @@ class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem public: TYPEINFO(); - SfxSetItem( USHORT nWhich, SfxItemSet *pSet ); - SfxSetItem( USHORT nWhich, const SfxItemSet &rSet ); + SfxSetItem( sal_uInt16 nWhich, SfxItemSet *pSet ); + SfxSetItem( sal_uInt16 nWhich, const SfxItemSet &rSet ); SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 ); ~SfxSetItem(); @@ -403,8 +403,8 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const = 0; - virtual SvStream& Store(SvStream &, USHORT nVer) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const = 0; + virtual SvStream& Store(SvStream &, sal_uInt16 nVer) const; const SfxItemSet& GetItemSet() const { return *pSet; } @@ -423,7 +423,7 @@ friend class SfxItemSet; private: TYPEINFO(); - SfxInvalidItem( USHORT nWhich, const SfxPoolItem &rDefault ); + SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault ); SfxInvalidItem( const SfxInvalidItem& ); virtual ~SfxInvalidItem(); @@ -439,8 +439,8 @@ public: // von sich selbst eine Kopie erzeugen virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; - virtual SvStream& Store(SvStream &, USHORT nVer ) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nVer ) const; }; #endif /* @@@ NOT USED @@@ */ @@ -449,7 +449,7 @@ public: class SVL_DLLPUBLIC SfxItemHandle { - USHORT *pRef; + sal_uInt16 *pRef; SfxPoolItem *pItem; public: SfxItemHandle( SfxPoolItem& ); diff --git a/svl/inc/svl/ptitem.hxx b/svl/inc/svl/ptitem.hxx index 1911ac997527..c3072acdb933 100644 --- a/svl/inc/svl/ptitem.hxx +++ b/svl/inc/svl/ptitem.hxx @@ -44,8 +44,8 @@ class SVL_DLLPUBLIC SfxPointItem: public SfxPoolItem public: TYPEINFO(); SfxPointItem(); - SfxPointItem( USHORT nWhich, const Point& rVal ); - SfxPointItem( USHORT nWhich, SvStream & ); + SfxPointItem( sal_uInt16 nWhich, const Point& rVal ); + SfxPointItem( sal_uInt16 nWhich, SvStream & ); SfxPointItem( const SfxPointItem& ); ~SfxPointItem() { DBG_DTOR(SfxPointItem, 0); } @@ -59,8 +59,8 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; const Point& GetValue() const { return aVal; } void SetValue( const Point& rNewVal ) { @@ -68,10 +68,10 @@ public: aVal = rNewVal; } - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); }; #endif diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx index da080ac95e11..b63d06096bd8 100644 --- a/svl/inc/svl/rectitem.hxx +++ b/svl/inc/svl/rectitem.hxx @@ -45,8 +45,8 @@ class SVL_DLLPUBLIC SfxRectangleItem: public SfxPoolItem public: TYPEINFO(); SfxRectangleItem(); - SfxRectangleItem( USHORT nWhich, const Rectangle& rVal ); - SfxRectangleItem( USHORT nWhich, SvStream & ); + SfxRectangleItem( sal_uInt16 nWhich, const Rectangle& rVal ); + SfxRectangleItem( sal_uInt16 nWhich, SvStream & ); SfxRectangleItem( const SfxRectangleItem& ); ~SfxRectangleItem() { DBG_DTOR(SfxRectangleItem, 0); } @@ -59,18 +59,18 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; const Rectangle& GetValue() const { return aVal; } void SetValue( const Rectangle& rNewVal ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); aVal = rNewVal; } - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); }; #endif diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx index 890c9d4438c0..320c358f5520 100644 --- a/svl/inc/svl/rngitem.hxx +++ b/svl/inc/svl/rngitem.hxx @@ -29,7 +29,7 @@ #ifndef NUMTYPE -#define NUMTYPE USHORT +#define NUMTYPE sal_uInt16 #define SfxXRangeItem SfxRangeItem #define SfxXRangesItem SfxUShortRangesItem #include <svl/rngitem.hxx> @@ -38,7 +38,7 @@ #undef SfxXRangesItem #ifndef _SFXITEMS_HXX -#define NUMTYPE ULONG +#define NUMTYPE sal_uLong #define SfxXRangeItem SfxULongRangeItem #define SfxXRangesItem SfxULongRangesItem #include <svl/rngitem.hxx> @@ -65,8 +65,8 @@ private: public: TYPEINFO(); SfxXRangeItem(); - SfxXRangeItem( USHORT nWID, NUMTYPE nFrom, NUMTYPE nTo ); - SfxXRangeItem( USHORT nWID, SvStream &rStream ); + SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo ); + SfxXRangeItem( sal_uInt16 nWID, SvStream &rStream ); SfxXRangeItem( const SfxXRangeItem& rItem ); virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -79,9 +79,9 @@ public: inline NUMTYPE From() const { return nFrom; } inline NUMTYPE& To() { return nTo; } inline NUMTYPE To() const { return nTo; } - inline BOOL HasRange() const { return nTo>nFrom; } - virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + inline sal_Bool HasRange() const { return nTo>nFrom; } + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; }; // ----------------------------------------------------------------------- @@ -94,8 +94,8 @@ private: public: TYPEINFO(); SfxXRangesItem(); - SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges ); - SfxXRangesItem( USHORT nWID, SvStream &rStream ); + SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges ); + SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream ); SfxXRangesItem( const SfxXRangesItem& rItem ); virtual ~SfxXRangesItem(); virtual int operator==( const SfxPoolItem& ) const; @@ -106,8 +106,8 @@ public: const IntlWrapper * = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; inline const NUMTYPE* GetRanges() const { return _pRanges; } - virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; }; #endif diff --git a/svl/inc/svl/sfontitm.hxx b/svl/inc/svl/sfontitm.hxx index e7a6ecb366d0..3ce183ecbead 100644 --- a/svl/inc/svl/sfontitm.hxx +++ b/svl/inc/svl/sfontitm.hxx @@ -62,13 +62,13 @@ class SfxFontItem: public SfxPoolItem public: TYPEINFO(); - inline SfxFontItem(USHORT nWhich); + inline SfxFontItem(sal_uInt16 nWhich); virtual int operator ==(const SfxPoolItem & rItem) const; - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const { return new SfxFontItem(*this); } @@ -142,7 +142,7 @@ public: inline void setLanguage(LanguageType nTheLanguage); }; -inline SfxFontItem::SfxFontItem(USHORT which): +inline SfxFontItem::SfxFontItem(sal_uInt16 which): SfxPoolItem(which), m_nCharSet(RTL_TEXTENCODING_DONTKNOW), m_nLanguage(LANGUAGE_DONTKNOW), diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx index 0936524c298a..d3f0249c18ea 100644 --- a/svl/inc/svl/slstitm.hxx +++ b/svl/inc/svl/slstitm.hxx @@ -44,8 +44,8 @@ public: TYPEINFO(); SfxStringListItem(); - SfxStringListItem( USHORT nWhich, const List* pList=NULL ); - SfxStringListItem( USHORT nWhich, SvStream& rStream ); + SfxStringListItem( sal_uInt16 nWhich, const List* pList=NULL ); + SfxStringListItem( sal_uInt16 nWhich, SvStream& rStream ); SfxStringListItem( const SfxStringListItem& rItem ); ~SfxStringListItem(); @@ -72,13 +72,13 @@ public: XubString &rText, const IntlWrapper * = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; - virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; - void Sort( BOOL bAscending = TRUE, List* pParallelList = 0 ); + virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const; + virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const; + void Sort( sal_Bool bAscending = sal_True, List* pParallelList = 0 ); - virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool PutValue ( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; }; #endif diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx index cf705b41c5ae..9e3e867b1703 100644 --- a/svl/inc/svl/smplhint.hxx +++ b/svl/inc/svl/smplhint.hxx @@ -68,11 +68,11 @@ class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint { private: - ULONG nId; + sal_uLong nId; public: TYPEINFO(); - SfxSimpleHint( ULONG nId ); - ULONG GetId() const { return nId; } + SfxSimpleHint( sal_uLong nId ); + sal_uLong GetId() const { return nId; } }; //-------------------------------------------------------------------- @@ -84,14 +84,14 @@ public: \ public: \ TYPEINFO(); \ - Name( USHORT nId, const Type& rObject ); \ + Name( sal_uInt16 nId, const Type& rObject ); \ ~Name(); \ const Type& GetObject() const { return aObj; } \ } #define IMPL_OBJHINT(Name, Type) \ TYPEINIT1(Name, SfxSimpleHint); \ - Name::Name( USHORT nID, const Type& rObject ): \ + Name::Name( sal_uInt16 nID, const Type& rObject ): \ SfxSimpleHint( nID ), aObj(rObject) \ { } \ Name::~Name() {} diff --git a/svl/inc/svl/srchitem.hxx b/svl/inc/svl/srchitem.hxx index 3974a8f57b80..8053a204881a 100644 --- a/svl/inc/svl/srchitem.hxx +++ b/svl/inc/svl/srchitem.hxx @@ -89,8 +89,8 @@ public: SvxSearchItem( const SvxSearchItem& rItem ); virtual ~SvxSearchItem(); - virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; - virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); virtual int operator == ( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, @@ -234,7 +234,7 @@ sal_Bool SvxSearchItem::IsLEVRelaxed() const sal_uInt16 SvxSearchItem::GetLEVOther() const { - return (INT16) aSearchOpt.changedChars; + return (sal_Int16) aSearchOpt.changedChars; } void SvxSearchItem::SetLEVOther( sal_uInt16 nVal ) @@ -244,7 +244,7 @@ void SvxSearchItem::SetLEVOther( sal_uInt16 nVal ) sal_uInt16 SvxSearchItem::GetLEVShorter() const { - return (INT16) aSearchOpt.insertedChars; + return (sal_Int16) aSearchOpt.insertedChars; } void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal ) @@ -254,7 +254,7 @@ void SvxSearchItem::SetLEVShorter( sal_uInt16 nVal ) sal_uInt16 SvxSearchItem::GetLEVLonger() const { - return (INT16) aSearchOpt.deletedChars; + return (sal_Int16) aSearchOpt.deletedChars; } void SvxSearchItem::SetLEVLonger( sal_uInt16 nVal ) diff --git a/svl/inc/svl/stritem.hxx b/svl/inc/svl/stritem.hxx index 5604eb3de6ed..e7885f9065da 100644 --- a/svl/inc/svl/stritem.hxx +++ b/svl/inc/svl/stritem.hxx @@ -39,14 +39,14 @@ public: SfxStringItem() {} - SfxStringItem(USHORT which, const XubString & rValue): + SfxStringItem(sal_uInt16 which, const XubString & rValue): CntUnencodedStringItem(which, rValue) {} - SfxStringItem(USHORT nWhich, SvStream & rStream); + SfxStringItem(sal_uInt16 nWhich, SvStream & rStream); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; }; diff --git a/svl/inc/svl/strmadpt.hxx b/svl/inc/svl/strmadpt.hxx index 76ecf0223543..936e33071706 100644 --- a/svl/inc/svl/strmadpt.hxx +++ b/svl/inc/svl/strmadpt.hxx @@ -51,23 +51,23 @@ public: rTheOutputStream): m_xOutputStream(rTheOutputStream), m_nPosition(0) {} - virtual ErrCode ReadAt(ULONG, void *, ULONG, ULONG *) const; + virtual ErrCode ReadAt(sal_uLong, void *, sal_uLong, sal_uLong *) const; - virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount, - ULONG * pWritten); + virtual ErrCode WriteAt(sal_uLong nPos, const void * pBuffer, sal_uLong nCount, + sal_uLong * pWritten); virtual ErrCode Flush() const; - virtual ErrCode SetSize(ULONG); + virtual ErrCode SetSize(sal_uLong); virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const; - virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount, - ULONG * pWritten); + virtual ErrCode FillAppend(const void * pBuffer, sal_uLong nCount, + sal_uLong * pWritten); - virtual ULONG Tell() const; + virtual sal_uLong Tell() const; - virtual ULONG Seek(ULONG); + virtual sal_uLong Seek(sal_uLong); virtual void Terminate(); }; diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx index b3138309293f..5ae5cb8e673b 100644 --- a/svl/inc/svl/style.hxx +++ b/svl/inc/svl/style.hxx @@ -76,7 +76,7 @@ SfxSimpleHint(SFX_HINT_DYING) from: SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) from: SfxStyleSheetBasePool::Make( const String& rName, - SfxStyleFamily eFam, USHORT mask, USHORT nPos) + SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) from: SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet ) @@ -100,17 +100,17 @@ protected: rtl::OUString maDisplayName; String aHelpFile; // Name der Hilfedatei SfxItemSet* pSet; // ItemSet - USHORT nMask; // Flags + sal_uInt16 nMask; // Flags - ULONG nHelpId; // Hilfe-ID + sal_uLong nHelpId; // Hilfe-ID - BOOL bMySet; // TRUE: Set loeschen im dtor + sal_Bool bMySet; // sal_True: Set loeschen im dtor SfxStyleSheetBase(); // do not use! - SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, USHORT mask ); + SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, sal_uInt16 mask ); SfxStyleSheetBase( const SfxStyleSheetBase& ); virtual ~SfxStyleSheetBase(); - virtual void Load( SvStream&, USHORT ); + virtual void Load( SvStream&, sal_uInt16 ); virtual void Store( SvStream& ); public: @@ -120,7 +120,7 @@ public: virtual const UniString& GetName() const; // sets the internal name of this style - virtual BOOL SetName( const UniString& ); + virtual sal_Bool SetName( const UniString& ); /** returns the display name of this style, it is used at the user interface. If the display name is empty, this method returns the internal name. */ @@ -130,13 +130,13 @@ public: virtual void SetDisplayName( const rtl::OUString& ); virtual const UniString& GetParent() const; - virtual BOOL SetParent( const UniString& ); + virtual sal_Bool SetParent( const UniString& ); virtual const UniString& GetFollow() const; - virtual BOOL SetFollow( const UniString& ); - virtual BOOL HasFollowSupport() const; // Default TRUE - virtual BOOL HasParentSupport() const; // Default TRUE - virtual BOOL HasClearParentSupport() const; // Default FALSE - virtual BOOL IsUsed() const; // Default TRUE + virtual sal_Bool SetFollow( const UniString& ); + virtual sal_Bool HasFollowSupport() const; // Default sal_True + virtual sal_Bool HasParentSupport() const; // Default sal_True + virtual sal_Bool HasClearParentSupport() const; // Default sal_False + virtual sal_Bool IsUsed() const; // Default sal_True // Default aus dem Itemset; entweder dem uebergebenen // oder aus dem per GetItemSet() zurueckgelieferten Set virtual UniString GetDescription(); @@ -144,16 +144,16 @@ public: SfxStyleSheetBasePool& GetPool() { return rPool; } SfxStyleFamily GetFamily() const { return nFamily; } - USHORT GetMask() const { return nMask; } - void SetMask( USHORT mask) { nMask = mask; } - BOOL IsUserDefined() const - { return BOOL( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); } + sal_uInt16 GetMask() const { return nMask; } + void SetMask( sal_uInt16 mask) { nMask = mask; } + sal_Bool IsUserDefined() const + { return sal_Bool( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); } - virtual ULONG GetHelpId( String& rFile ); - virtual void SetHelpId( const String& r, ULONG nId ); + virtual sal_uLong GetHelpId( String& rFile ); + virtual void SetHelpId( const String& r, sal_uLong nId ); virtual SfxItemSet& GetItemSet(); - virtual USHORT GetVersion() const; + virtual sal_uInt16 GetVersion() const; }; //========================================================================= @@ -173,11 +173,11 @@ class SVL_DLLPUBLIC SfxStyleSheetIterator { public: SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase, - SfxStyleFamily eFam, USHORT n=0xFFFF ); - virtual USHORT GetSearchMask() const; + SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); + virtual sal_uInt16 GetSearchMask() const; virtual SfxStyleFamily GetSearchFamily() const; - virtual USHORT Count(); - virtual SfxStyleSheetBase *operator[](USHORT nIdx); + virtual sal_uInt16 Count(); + virtual SfxStyleSheetBase *operator[](sal_uInt16 nIdx); virtual SfxStyleSheetBase* First(); virtual SfxStyleSheetBase* Next(); virtual SfxStyleSheetBase* Find(const UniString& rStr); @@ -187,18 +187,18 @@ protected: SfxStyleSheetBasePool* pBasePool; SfxStyleFamily nSearchFamily; - USHORT nMask; - BOOL SearchUsed() const { return bSearchUsed; } + sal_uInt16 nMask; + sal_Bool SearchUsed() const { return bSearchUsed; } private: - USHORT GetPos(){return nAktPosition;} - SVL_DLLPRIVATE BOOL IsTrivialSearch(); - SVL_DLLPRIVATE BOOL DoesStyleMatch(SfxStyleSheetBase *pStyle); + sal_uInt16 GetPos(){return nAktPosition;} + SVL_DLLPRIVATE sal_Bool IsTrivialSearch(); + SVL_DLLPRIVATE sal_Bool DoesStyleMatch(SfxStyleSheetBase *pStyle); void* pImp; SfxStyleSheetBase* pAktStyle; - USHORT nAktPosition; - BOOL bSearchUsed; + sal_uInt16 nAktPosition; + sal_Bool bSearchUsed; friend class SfxStyleSheetBasePool; }; @@ -215,18 +215,18 @@ friend class SfxStyleSheetBase; SfxStyleSheetBasePool_Impl *pImp; private: - SVL_DLLPRIVATE BOOL Load1_Impl( SvStream& ); + SVL_DLLPRIVATE sal_Bool Load1_Impl( SvStream& ); SVL_DLLPRIVATE SfxStyleSheetIterator& GetIterator_Impl(); protected: String aAppName; SfxItemPool& rPool; SfxStyles aStyles; SfxStyleFamily nSearchFamily; - USHORT nMask; + sal_uInt16 nMask; SfxStyleSheetBase& Add( SfxStyleSheetBase& ); - void ChangeParent( const UniString&, const UniString&, BOOL bVirtual = TRUE ); - virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, USHORT ); + void ChangeParent( const UniString&, const UniString&, sal_Bool bVirtual = sal_True ); + virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 ); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); ~SfxStyleSheetBasePool(); @@ -242,14 +242,14 @@ public: SfxItemPool& GetPool(); const SfxItemPool& GetPool() const; - virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, USHORT nMask); - virtual USHORT Count(); - virtual SfxStyleSheetBase* operator[](USHORT nIdx); + virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, sal_uInt16 nMask); + virtual sal_uInt16 Count(); + virtual SfxStyleSheetBase* operator[](sal_uInt16 nIdx); virtual SfxStyleSheetBase& Make(const UniString&, SfxStyleFamily eFam, - USHORT nMask = 0xffff , - USHORT nPos = 0xffff); + sal_uInt16 nMask = 0xffff , + sal_uInt16 nPos = 0xffff); virtual void Replace( SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget ); @@ -265,21 +265,21 @@ public: const SfxStyles& GetStyles(); virtual SfxStyleSheetBase* First(); virtual SfxStyleSheetBase* Next(); - virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, USHORT n=0xFFFF ); + virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); - virtual BOOL SetParent(SfxStyleFamily eFam, + virtual sal_Bool SetParent(SfxStyleFamily eFam, const UniString &rStyle, const UniString &rParent); SfxStyleSheetBase* Find(const UniString& rStr) { return Find(rStr, nSearchFamily, nMask); } - void SetSearchMask(SfxStyleFamily eFam, USHORT n=0xFFFF ); - USHORT GetSearchMask() const; + void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); + sal_uInt16 GetSearchMask() const; SfxStyleFamily GetSearchFamily() const { return nSearchFamily; } - BOOL Load( SvStream& ); - BOOL Store( SvStream&, BOOL bUsed = TRUE ); + sal_Bool Load( SvStream& ); + sal_Bool Store( SvStream&, sal_Bool bUsed = sal_True ); }; //========================================================================= @@ -290,11 +290,11 @@ class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase, public: TYPEINFO(); - SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, USHORT ); + SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, sal_uInt16 ); SfxStyleSheet( const SfxStyleSheet& ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - virtual BOOL SetParent( const UniString& ); + virtual sal_Bool SetParent( const UniString& ); protected: SfxStyleSheet(); // do not use! @@ -307,13 +307,13 @@ class SVL_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool { protected: using SfxStyleSheetBasePool::Create; - virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, USHORT mask); + virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, sal_uInt16 mask); virtual SfxStyleSheetBase* Create(const SfxStyleSheet &); public: SfxStyleSheetPool( SfxItemPool const& ); -// virtual BOOL CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName); +// virtual sal_Bool CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName); }; //========================================================================= @@ -333,13 +333,13 @@ public: class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint { - USHORT nHint; + sal_uInt16 nHint; public: TYPEINFO(); - SfxStyleSheetPoolHint(USHORT nArgHint) : nHint(nArgHint){} - USHORT GetHint() const + SfxStyleSheetPoolHint(sal_uInt16 nArgHint) : nHint(nArgHint){} + sal_uInt16 GetHint() const { return nHint; } }; @@ -348,16 +348,16 @@ public: class SVL_DLLPUBLIC SfxStyleSheetHint: public SfxHint { SfxStyleSheetBase* pStyleSh; - USHORT nHint; + sal_uInt16 nHint; public: TYPEINFO(); - SfxStyleSheetHint( USHORT ); - SfxStyleSheetHint( USHORT, SfxStyleSheetBase& ); + SfxStyleSheetHint( sal_uInt16 ); + SfxStyleSheetHint( sal_uInt16, SfxStyleSheetBase& ); SfxStyleSheetBase* GetStyleSheet() const { return pStyleSh; } - USHORT GetHint() const + sal_uInt16 GetHint() const { return nHint; } }; @@ -369,9 +369,9 @@ public: TYPEINFO(); SfxStyleSheetHintExtended( - USHORT, const String& rOld ); + sal_uInt16, const String& rOld ); SfxStyleSheetHintExtended( - USHORT, const String& rOld, + sal_uInt16, const String& rOld, SfxStyleSheetBase& ); const String& GetOldName() { return aName; } }; @@ -379,7 +379,7 @@ public: class SVL_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel > { public: - SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske ); + SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, sal_uInt16 _nMaske ); SfxUnoStyleSheet( const SfxStyleSheet& _rSheet ); static SfxUnoStyleSheet* getUnoStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle ); diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index d48998247eeb..19ee3a9e5077 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -118,15 +118,15 @@ inline void operator delete( void*, DummyType* ) {} #if defined(PRODUCT) #define _SVVARARR_DEF_GET_OP_INLINE( nm, ArrElem ) \ -ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\ +ArrElem& operator[](sal_uInt16 nP) const { return *(pData+nP); }\ \ -void Insert( const nm * pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX )\ +void Insert( const nm * pI, sal_uInt16 nP,\ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX )\ {\ if( USHRT_MAX == nE ) \ nE = pI->nA; \ if( nS < nE ) \ - Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\ + Insert( (const ArrElem*)pI->pData+nS, (sal_uInt16)nE-nS, nP );\ } #define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem ) @@ -134,64 +134,64 @@ void Insert( const nm * pI, USHORT nP,\ #else #define _SVVARARR_DEF_GET_OP_INLINE( nm,ArrElem )\ -ArrElem& operator[](USHORT nP) const;\ -void Insert( const nm *pI, USHORT nP,\ - USHORT nS = 0, USHORT nE = USHRT_MAX ); +ArrElem& operator[](sal_uInt16 nP) const;\ +void Insert( const nm *pI, sal_uInt16 nP,\ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ); #define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ -ArrElem& nm::operator[](USHORT nP) const\ +ArrElem& nm::operator[](sal_uInt16 nP) const\ {\ DBG_ASSERT( pData && nP < nA,"Op[]");\ return *(pData+nP);\ }\ -void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE)\ +void nm::Insert( const nm *pI, sal_uInt16 nP, sal_uInt16 nStt, sal_uInt16 nE)\ {\ DBG_ASSERT(nP<=nA,"Ins,Ar[Start.End]");\ if( USHRT_MAX == nE ) \ nE = pI->nA; \ if( nStt < nE ) \ - Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\ + Insert( (const ArrElem*)pI->pData+nStt, (sal_uInt16)nE-nStt, nP );\ } #endif #define _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ -typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ class vis nm\ {\ protected:\ AE *pData;\ - USHORT nFree;\ - USHORT nA;\ + sal_uInt16 nFree;\ + sal_uInt16 nA;\ \ void _resize(size_t n);\ \ public:\ - nm( USHORT= IS, BYTE= GS );\ + nm( sal_uInt16= IS, sal_uInt8= GS );\ ~nm() { rtl_freeMemory( pData ); }\ \ _SVVARARR_DEF_GET_OP_INLINE(nm, AE )\ - AERef GetObject(USHORT nP) const { return (*this)[nP]; } \ + AERef GetObject(sal_uInt16 nP) const { return (*this)[nP]; } \ \ - void Insert( const AERef aE, USHORT nP );\ - void Insert( const AE *pE, USHORT nL, USHORT nP );\ - void Remove( USHORT nP, USHORT nL = 1 );\ - void Replace( const AERef aE, USHORT nP );\ - void Replace( const AE *pE, USHORT nL, USHORT nP );\ - USHORT Count() const { return nA; }\ + void Insert( const AERef aE, sal_uInt16 nP );\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\ + void Replace( const AERef aE, sal_uInt16 nP );\ + void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP );\ + sal_uInt16 Count() const { return nA; }\ const AE* GetData() const { return (const AE*)pData; }\ \ void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( 0, nA, fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, fnForEach, pArgs );\ }\ \ - void _ForEach( USHORT nStt, USHORT nE, \ + void _ForEach( sal_uInt16 nStt, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\ \ @@ -212,7 +212,7 @@ SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, ) SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, vis ) #define SV_IMPL_VARARR_GEN( nm, AE, AERef )\ -nm::nm( USHORT nInit, BYTE )\ +nm::nm( sal_uInt16 nInit, sal_uInt8 )\ : pData (0),\ nFree (nInit),\ nA (0)\ @@ -226,7 +226,7 @@ nm::nm( USHORT nInit, BYTE )\ \ void nm::_resize (size_t n)\ {\ - USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\ + sal_uInt16 nL = ((n < USHRT_MAX) ? sal_uInt16(n) : USHRT_MAX);\ AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\ if ((pE != 0) || (nL == 0))\ {\ @@ -235,7 +235,7 @@ void nm::_resize (size_t n)\ }\ }\ \ -void nm::Insert( const AERef aE, USHORT nP )\ +void nm::Insert( const AERef aE, sal_uInt16 nP )\ {\ DBG_ASSERT(nP <= nA && nA < USHRT_MAX, "Ins 1");\ if (nFree < 1)\ @@ -246,7 +246,7 @@ void nm::Insert( const AERef aE, USHORT nP )\ ++nA; --nFree;\ }\ \ -void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ +void nm::Insert( const AE* pE, sal_uInt16 nL, sal_uInt16 nP )\ {\ DBG_ASSERT(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ if (nFree < nL)\ @@ -258,13 +258,13 @@ void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ nA = nA + nL; nFree = nFree - nL;\ }\ \ -void nm::Replace( const AERef aE, USHORT nP )\ +void nm::Replace( const AERef aE, sal_uInt16 nP )\ {\ if( nP < nA )\ *(pData+nP) = (AE&)aE;\ }\ \ -void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ +void nm::Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP )\ {\ if( pE && nP < nA )\ {\ @@ -278,7 +278,7 @@ void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ }\ else \ {\ - USHORT nTmpLen = nA + nFree - nP; \ + sal_uInt16 nTmpLen = nA + nFree - nP; \ memcpy( pData + nP, pE, nTmpLen * sizeof( AE ));\ nA = nA + nFree; \ nFree = 0; \ @@ -287,7 +287,7 @@ void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ }\ }\ \ -void nm::Remove( USHORT nP, USHORT nL )\ +void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ {\ if( !nL )\ return;\ @@ -299,7 +299,7 @@ void nm::Remove( USHORT nP, USHORT nL )\ _resize (nA);\ }\ \ -void nm::_ForEach( USHORT nStt, USHORT nE, \ +void nm::_ForEach( sal_uInt16 nStt, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\ {\ if( nStt >= nE || nE > nA )\ @@ -315,36 +315,36 @@ SV_IMPL_VARARR_GEN( nm, AE, AE & ) #define _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AERef, vis )\ _SV_DECL_VARARR_GEN( nm, AE, IS, GS, AERef, vis)\ -USHORT GetPos( const AERef aE ) const;\ +sal_uInt16 GetPos( const AERef aE ) const;\ }; #define _SV_DECL_PTRARR_DEF( nm, AE, IS, GS, vis )\ _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, vis ) #define SV_DECL_PTRARR_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ -typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ class vis nm: public Base \ {\ public:\ - nm( USHORT nIni=IS, BYTE nG=GS )\ + nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\ : Base(nIni,nG) {}\ - void Insert( const nm *pI, USHORT nP, \ - USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + void Insert( const nm *pI, sal_uInt16 nP, \ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\ Base::Insert((const Base*)pI, nP, nS, nE);\ }\ - void Insert( const AERef aE, USHORT nP ) {\ + void Insert( const AERef aE, sal_uInt16 nP ) {\ Base::Insert( (const VPRef )aE, nP );\ }\ - void Insert( const AE *pE, USHORT nL, USHORT nP ) {\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Insert( (const VoidPtr*)pE, nL, nP );\ }\ - void Replace( const AERef aE, USHORT nP ) {\ + void Replace( const AERef aE, sal_uInt16 nP ) {\ Base::Replace( (const VPRef)aE, nP );\ }\ - void Replace( const AE *pE, USHORT nL, USHORT nP ) {\ + void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Replace( (const VoidPtr*)pE, nL, nP );\ }\ - void Remove( USHORT nP, USHORT nL = 1) {\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1) {\ Base::Remove(nP,nL);\ }\ const AE* GetData() const {\ @@ -354,20 +354,20 @@ public:\ {\ _ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\ }\ - AE operator[]( USHORT nP )const { \ + AE operator[]( sal_uInt16 nP )const { \ return (AE)Base::operator[](nP); }\ - AE GetObject(USHORT nP) const { \ + AE GetObject(sal_uInt16 nP) const { \ return (AE)Base::GetObject(nP); }\ \ - USHORT GetPos( const AERef aE ) const { \ + sal_uInt16 GetPos( const AERef aE ) const { \ return Base::GetPos((const VPRef)aE);\ }\ - void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\ + void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );\ private:\ nm( const nm& );\ nm& operator=( const nm& );\ @@ -380,30 +380,30 @@ SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis ) #define SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ -typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AERef, void* );\ class vis nm: public Base \ {\ public:\ - nm( USHORT nIni=IS, BYTE nG=GS )\ + nm( sal_uInt16 nIni=IS, sal_uInt8 nG=GS )\ : Base(nIni,nG) {}\ ~nm() { DeleteAndDestroy( 0, Count() ); }\ - void Insert( const nm *pI, USHORT nP, \ - USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + void Insert( const nm *pI, sal_uInt16 nP, \ + sal_uInt16 nS = 0, sal_uInt16 nE = USHRT_MAX ) {\ Base::Insert((const Base*)pI, nP, nS, nE);\ }\ - void Insert( const AERef aE, USHORT nP ) {\ + void Insert( const AERef aE, sal_uInt16 nP ) {\ Base::Insert((const VPRef)aE, nP );\ }\ - void Insert( const AE *pE, USHORT nL, USHORT nP ) {\ + void Insert( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Insert( (const VoidPtr *)pE, nL, nP );\ }\ - void Replace( const AERef aE, USHORT nP ) {\ + void Replace( const AERef aE, sal_uInt16 nP ) {\ Base::Replace( (const VPRef)aE, nP );\ }\ - void Replace( const AE *pE, USHORT nL, USHORT nP ) {\ + void Replace( const AE *pE, sal_uInt16 nL, sal_uInt16 nP ) {\ Base::Replace( (const VoidPtr*)pE, nL, nP );\ }\ - void Remove( USHORT nP, USHORT nL = 1) {\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1) {\ Base::Remove(nP,nL);\ }\ const AE* GetData() const {\ @@ -413,20 +413,20 @@ public:\ {\ _ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\ }\ - AE operator[]( USHORT nP )const { \ + AE operator[]( sal_uInt16 nP )const { \ return (AE)Base::operator[](nP); }\ - AE GetObject( USHORT nP )const { \ + AE GetObject( sal_uInt16 nP )const { \ return (AE)Base::GetObject(nP); }\ \ - USHORT GetPos( const AERef aE ) const { \ + sal_uInt16 GetPos( const AERef aE ) const { \ return Base::GetPos((const VPRef)aE);\ } \ - void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\ + void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 );\ private:\ nm( const nm& );\ nm& operator=( const nm& );\ @@ -439,11 +439,11 @@ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis) #define SV_IMPL_PTRARR_GEN(nm, AE, Base)\ -void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\ +void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\ { \ if( nL ) {\ DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ - for( USHORT n=nP; n < nP + nL; n++ ) \ + for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ Base::Remove( nP, nL ); \ } \ @@ -464,27 +464,27 @@ _SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC ) #endif #define _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ -typedef BOOL (*FnForEach_##nm)( const AE&, void* );\ +typedef sal_Bool (*FnForEach_##nm)( const AE&, void* );\ class vis nm : __MWERKS__PRIVATE nm##_SAR \ {\ public:\ - nm(USHORT nSize = IS, BYTE nG = GS)\ + nm(sal_uInt16 nSize = IS, sal_uInt8 nG = GS)\ : nm##_SAR(nSize,nG) {}\ - void Insert( const nm *pI, USHORT nS=0, USHORT nE=USHRT_MAX );\ - BOOL Insert( const AE& aE );\ - BOOL Insert( const AE& aE, USHORT& rP );\ - void Insert( const AE *pE, USHORT nL );\ - void Remove( USHORT nP, USHORT nL = 1 );\ - void Remove( const AE& aE, USHORT nL = 1 );\ - USHORT Count() const { return nm##_SAR::Count(); }\ + void Insert( const nm *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX );\ + sal_Bool Insert( const AE& aE );\ + sal_Bool Insert( const AE& aE, sal_uInt16& rP );\ + void Insert( const AE *pE, sal_uInt16 nL );\ + void Remove( sal_uInt16 nP, sal_uInt16 nL = 1 );\ + void Remove( const AE& aE, sal_uInt16 nL = 1 );\ + sal_uInt16 Count() const { return nm##_SAR::Count(); }\ const AE* GetData() const { return (const AE*)pData; }\ \ /* Das Ende stehe im DECL-Makro !!! */ #define _SV_SEEK_PTR(nm,AE)\ -BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ +sal_Bool nm::Seek_Entry( const AE aE, sal_uInt16* pP ) const\ {\ - register USHORT nO = nm##_SAR::Count(),\ + register sal_uInt16 nO = nm##_SAR::Count(),\ nM, \ nU = 0;\ if( nO > 0 )\ @@ -497,27 +497,27 @@ BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ if( (long)*(pData + nM) == rCmp )\ {\ if( pP ) *pP = nM;\ - return TRUE;\ + return sal_True;\ }\ else if( (long)*(pData+ nM) < (long)aE )\ nU = nM + 1;\ else if( nM == 0 )\ {\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ }\ else\ nO = nM - 1;\ }\ }\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ } #define _SV_SEEK_PTR_TO_OBJECT( nm,AE )\ -BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ +sal_Bool nm::Seek_Entry( const AE aE, sal_uInt16* pP ) const\ {\ - register USHORT nO = nm##_SAR::Count(),\ + register sal_uInt16 nO = nm##_SAR::Count(),\ nM, \ nU = 0;\ if( nO > 0 )\ @@ -529,27 +529,27 @@ BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ if( *(*((AE*)pData + nM)) == *(aE) )\ {\ if( pP ) *pP = nM;\ - return TRUE;\ + return sal_True;\ }\ else if( *(*((AE*)pData + nM)) < *(aE) )\ nU = nM + 1;\ else if( nM == 0 )\ {\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ }\ else\ nO = nM - 1;\ }\ }\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ } #define _SV_SEEK_OBJECT( nm,AE )\ -BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\ +sal_Bool nm::Seek_Entry( const AE & aE, sal_uInt16* pP ) const\ {\ - register USHORT nO = nm##_SAR::Count(),\ + register sal_uInt16 nO = nm##_SAR::Count(),\ nM, \ nU = 0;\ if( nO > 0 )\ @@ -561,29 +561,29 @@ BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\ if( *(pData + nM) == aE )\ {\ if( pP ) *pP = nM;\ - return TRUE;\ + return sal_True;\ }\ else if( *(pData + nM) < aE )\ nU = nM + 1;\ else if( nM == 0 )\ {\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ }\ else\ nO = nM - 1;\ }\ }\ if( pP ) *pP = nU;\ - return FALSE;\ + return sal_False;\ } #define _SV_IMPL_SORTAR_ALG(nm, AE)\ -void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\ +void nm::Insert( const nm * pI, sal_uInt16 nS, sal_uInt16 nE )\ {\ if( USHRT_MAX == nE )\ nE = pI->Count();\ - USHORT nP;\ + sal_uInt16 nP;\ const AE * pIArr = pI->GetData();\ for( ; nS < nE; ++nS )\ {\ @@ -597,39 +597,39 @@ void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\ }\ }\ \ -BOOL nm::Insert( const AE & aE )\ +sal_Bool nm::Insert( const AE & aE )\ {\ - USHORT nP;\ - BOOL bExist;\ + sal_uInt16 nP;\ + sal_Bool bExist;\ bExist = Seek_Entry( aE, &nP );\ if( ! bExist )\ nm##_SAR::Insert( aE, nP );\ return !bExist;\ }\ -BOOL nm::Insert( const AE & aE, USHORT& rP )\ +sal_Bool nm::Insert( const AE & aE, sal_uInt16& rP )\ {\ - BOOL bExist;\ + sal_Bool bExist;\ bExist = Seek_Entry( aE, &rP );\ if( ! bExist )\ nm##_SAR::Insert( aE, rP );\ return !bExist;\ }\ -void nm::Insert( const AE* pE, USHORT nL)\ +void nm::Insert( const AE* pE, sal_uInt16 nL)\ {\ - USHORT nP;\ - for( USHORT n = 0; n < nL; ++n )\ + sal_uInt16 nP;\ + for( sal_uInt16 n = 0; n < nL; ++n )\ if( ! Seek_Entry( *(pE+n), &nP ))\ nm##_SAR::Insert( *(pE+n), nP );\ }\ -void nm::Remove( USHORT nP, USHORT nL )\ +void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ {\ if( nL )\ nm##_SAR::Remove( nP, nL);\ }\ \ -void nm::Remove( const AE &aE, USHORT nL )\ +void nm::Remove( const AE &aE, sal_uInt16 nL )\ {\ - USHORT nP;\ + sal_uInt16 nP;\ if( nL && Seek_Entry( aE, &nP ) ) \ nm##_SAR::Remove( nP, nL);\ }\ @@ -637,20 +637,20 @@ void nm::Remove( const AE &aE, USHORT nL )\ #if defined(TCPP) #define _SORTARR_BLC_CASTS(nm, AE )\ - BOOL Insert( AE &aE ) {\ + sal_Bool Insert( AE &aE ) {\ return Insert( (const AE&)aE );\ }\ - USHORT GetPos( AE& aE ) const { \ + sal_uInt16 GetPos( AE& aE ) const { \ return SvPtrarr::GetPos((const VoidPtr&)aE);\ }\ - void Remove( AE& aE, USHORT nL = 1 ) { \ + void Remove( AE& aE, sal_uInt16 nL = 1 ) { \ Remove( (const AE&) aE, nL );\ } #else #define _SORTARR_BLC_CASTS(nm, AE )\ - USHORT GetPos( const AE& aE ) const { \ + sal_uInt16 GetPos( const AE& aE ) const { \ return SvPtrarr::GetPos((const VoidPtr&)aE);\ } @@ -659,23 +659,23 @@ void nm::Remove( const AE &aE, USHORT nL )\ #define _SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\ SV_DECL_PTRARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ - AE operator[](USHORT nP) const {\ + AE operator[](sal_uInt16 nP) const {\ return nm##_SAR::operator[]( nP );\ }\ - AE GetObject(USHORT nP) const {\ + AE GetObject(sal_uInt16 nP) const {\ return nm##_SAR::GetObject( nP );\ }\ - BOOL Seek_Entry( const AE aE, USHORT* pP = 0 ) const;\ + sal_Bool Seek_Entry( const AE aE, sal_uInt16* pP = 0 ) const;\ void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( 0, nA, (FnForEach_SvPtrarr)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_SvPtrarr)fnForEach, pArgs );\ }\ - void DeleteAndDestroy( USHORT nP, USHORT nL=1 ); \ + void DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL=1 ); \ _SORTARR_BLC_CASTS(nm, AE )\ \ /* Das Ende stehe im DECL-Makro !!! */ @@ -711,18 +711,18 @@ _SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS, vis) #define _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis)\ SV_DECL_VARARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ _SORT_CLASS_DEF(nm, AE, IS, GS, vis) \ - const AE& operator[](USHORT nP) const {\ + const AE& operator[](sal_uInt16 nP) const {\ return nm##_SAR::operator[]( nP );\ }\ - const AE& GetObject(USHORT nP) const {\ + const AE& GetObject(sal_uInt16 nP) const {\ return nm##_SAR::GetObject( nP );\ }\ - BOOL Seek_Entry( const AE & aE, USHORT* pP = 0 ) const;\ + sal_Bool Seek_Entry( const AE & aE, sal_uInt16* pP = 0 ) const;\ void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( 0, nA, (FnForEach_##nm##_SAR)fnForEach, pArgs );\ }\ - void ForEach( USHORT nS, USHORT nE, \ + void ForEach( sal_uInt16 nS, sal_uInt16 nE, \ CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ {\ _ForEach( nS, nE, (FnForEach_##nm##_SAR)fnForEach, pArgs );\ @@ -740,10 +740,10 @@ _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis) #define SV_IMPL_PTRARR_SORT( nm,AE )\ _SV_IMPL_SORTAR_ALG( nm,AE )\ - void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \ + void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ - for( USHORT n=nP; n < nP + nL; n++ ) \ + for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ } \ @@ -752,10 +752,10 @@ _SV_SEEK_PTR( nm, AE ) #define SV_IMPL_OP_PTRARR_SORT( nm,AE )\ _SV_IMPL_SORTAR_ALG( nm,AE )\ - void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \ + void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ - for( USHORT n=nP; n < nP + nL; n++ ) \ + for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ } \ diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx index bb14d0fcdcdf..35448521c459 100644 --- a/svl/inc/svl/svdde.hxx +++ b/svl/inc/svl/svdde.hxx @@ -92,11 +92,11 @@ class SVL_DLLPUBLIC DdeData //#if 0 // _SOLAR__PRIVATE SVL_DLLPRIVATE void Lock(); //#endif - void SetFormat( ULONG nFmt ); + void SetFormat( sal_uLong nFmt ); public: DdeData(); - DdeData( const void*, long, ULONG = FORMAT_STRING ); + DdeData( const void*, long, sal_uLong = FORMAT_STRING ); DdeData( const String& ); DdeData( const DdeData& ); ~DdeData(); @@ -104,12 +104,12 @@ public: operator const void*() const; operator long() const; - ULONG GetFormat() const; + sal_uLong GetFormat() const; DdeData& operator = ( const DdeData& ); - static ULONG GetExternalFormat( ULONG nFmt ); - static ULONG GetInternalFormat( ULONG nFmt ); + static sal_uLong GetExternalFormat( sal_uLong nFmt ); + static sal_uLong GetInternalFormat( sal_uLong nFmt ); }; // ------------------ // - DdeServiceList - @@ -156,7 +156,7 @@ class SVL_DLLPUBLIC DdeTransaction { public: virtual void Data( const DdeData* ); - virtual void Done( BOOL bDataValid ); + virtual void Done( sal_Bool bDataValid ); protected: DdeConnection& rDde; DdeData aDdeData; @@ -166,14 +166,14 @@ protected: long nTime; Link aData; Link aDone; - BOOL bBusy; + sal_Bool bBusy; DdeTransaction( DdeConnection&, const String&, long = 0 ); public: virtual ~DdeTransaction(); - BOOL IsBusy() { return bBusy; } + sal_Bool IsBusy() { return bBusy; } const String& GetName() const; void Execute(); @@ -184,8 +184,8 @@ public: void SetDoneHdl( const Link& rLink ) { aDone = rLink; } const Link& GetDoneHdl() const { return aDone; } - void SetFormat( ULONG nFmt ) { aDdeData.SetFormat( nFmt ); } - ULONG GetFormat() const { return aDdeData.GetFormat(); } + void SetFormat( sal_uLong nFmt ) { aDdeData.SetFormat( nFmt ); } + sal_uLong GetFormat() const { return aDdeData.GetFormat(); } long GetError(); @@ -253,7 +253,7 @@ class SVL_DLLPUBLIC DdePoke : public DdeTransaction { public: DdePoke( DdeConnection&, const String&, const char*, long, - ULONG = FORMAT_STRING, long = 0 ); + sal_uLong = FORMAT_STRING, long = 0 ); DdePoke( DdeConnection&, const String&, const DdeData&, long = 0 ); DdePoke( DdeConnection&, const String&, const String&, long = 0 ); }; @@ -290,7 +290,7 @@ public: static const DdeConnections& GetConnections(); - BOOL IsConnected(); + sal_Bool IsConnected(); const String& GetServiceName(); const String& GetTopicName(); @@ -312,11 +312,11 @@ class SVL_DLLPUBLIC DdeItem DdeTopic* pMyTopic; DdeItemImp* pImpData; - void IncMonitor( ULONG ); - void DecMonitor( ULONG ); + void IncMonitor( sal_uLong ); + void DecMonitor( sal_uLong ); protected: - BYTE nType; + sal_uInt8 nType; public: DdeItem( const sal_Unicode* ); @@ -340,9 +340,9 @@ public: DdeGetPutItem( const String& rStr ); DdeGetPutItem( const DdeItem& rItem ); - virtual DdeData* Get( ULONG ); - virtual BOOL Put( const DdeData* ); - virtual void AdviseLoop( BOOL ); // AdviseLoop starten/stoppen + virtual DdeData* Get( sal_uLong ); + virtual sal_Bool Put( const DdeData* ); + virtual void AdviseLoop( sal_Bool ); // AdviseLoop starten/stoppen }; // ------------ @@ -356,16 +356,16 @@ class SVL_DLLPUBLIC DdeTopic public: virtual void Connect( long ); virtual void Disconnect( long ); - virtual DdeData* Get( ULONG ); - virtual BOOL Put( const DdeData* ); - virtual BOOL Execute( const String* ); + virtual DdeData* Get( sal_uLong ); + virtual sal_Bool Put( const DdeData* ); + virtual sal_Bool Execute( const String* ); // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden - virtual BOOL MakeItem( const String& rItem ); + virtual sal_Bool MakeItem( const String& rItem ); // es wird ein Warm-/Hot-Link eingerichtet. Return-Wert // besagt ob es geklappt hat - virtual BOOL StartAdviseLoop(); - virtual BOOL StopAdviseLoop(); + virtual sal_Bool StartAdviseLoop(); + virtual sal_Bool StopAdviseLoop(); private: friend class DdeInternal; @@ -401,7 +401,7 @@ public: const Link& GetExecuteHdl() const { return aExecLink; } void NotifyClient( const String& ); - BOOL IsSystemTopic(); + sal_Bool IsSystemTopic(); void InsertItem( DdeItem* ); // fuer eigene Ableitungen! DdeItem* AddItem( const DdeItem& ); // werden kopiert ! @@ -423,10 +423,10 @@ class SVL_DLLPUBLIC DdeService friend class DdeInternal; public: - virtual BOOL IsBusy(); + virtual sal_Bool IsBusy(); virtual String GetHelp(); // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden - virtual BOOL MakeTopic( const String& rItem ); + virtual sal_Bool MakeTopic( const String& rItem ); protected: virtual String Topics(); @@ -434,7 +434,7 @@ protected: virtual String SysItems(); virtual String Status(); virtual String SysTopicGet( const String& ); - virtual BOOL SysTopicExecute( const String* ); + virtual sal_Bool SysTopicExecute( const String* ); const DdeTopic* GetSysTopic() const { return pSysTopic; } private: @@ -445,7 +445,7 @@ private: ConvList* pConv; short nStatus; - SVL_DLLPRIVATE BOOL HasCbFormat( USHORT ); + SVL_DLLPRIVATE sal_Bool HasCbFormat( sal_uInt16 ); public: DdeService( const String& ); @@ -460,9 +460,9 @@ public: void AddTopic( const DdeTopic& ); void RemoveTopic( const DdeTopic& ); - void AddFormat( ULONG ); - void RemoveFormat( ULONG ); - BOOL HasFormat( ULONG ); + void AddFormat( sal_uLong ); + void RemoveFormat( sal_uLong ); + sal_Bool HasFormat( sal_uLong ); private: // DdeService( const DdeService& ); diff --git a/svl/inc/svl/svldata.hxx b/svl/inc/svl/svldata.hxx index 24aef1fdf6d0..7d666a7e0d15 100644 --- a/svl/inc/svl/svldata.hxx +++ b/svl/inc/svl/svldata.hxx @@ -61,7 +61,7 @@ class SvtSimpleResId String m_sValue; public: - SvtSimpleResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { }; + SvtSimpleResId(sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvlData::GetSvlData().GetSimpleRM(aLocale)->ReadString(nId)) { }; operator String () const { return m_sValue; } }; diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 608705dca43d..88f318c2d5d3 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -44,27 +44,27 @@ #include <svl/svarray.hxx> #include <deque> -typedef std::deque< BOOL > SvBools; +typedef std::deque< sal_Bool > SvBools; -typedef std::deque< BYTE > SvBytes; +typedef std::deque< sal_uInt8 > SvBytes; //#ifdef _SVSTDARR_ULONGS #ifndef _SVSTDARR_ULONGS_DECL -SV_DECL_VARARR_VISIBILITY( SvULongs, ULONG, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvULongs, sal_uLong, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGS_DECL #endif //#endif //#ifdef _SVSTDARR_ULONGSSORT #ifndef _SVSTDARR_ULONGSSORT_DECL -SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, ULONG, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, sal_uLong, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_ULONGSSORT_DECL #endif //#endif //#ifdef _SVSTDARR_USHORTS #ifndef _SVSTDARR_USHORTS_DECL -SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, SVL_DLLPUBLIC ) +SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC ) #define _SVSTDARR_USHORTS_DECL #endif //#endif @@ -72,37 +72,37 @@ SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, SVL_DLLPUBLIC ) //#ifdef _SVSTDARR_USHORTSSORT #ifndef _SVSTDARR_USHORTSSORT_DECL -typedef BOOL (*FnForEach_SvUShortsSort)( const USHORT&, void* ); +typedef sal_Bool (*FnForEach_SvUShortsSort)( const sal_uInt16&, void* ); class SVL_DLLPUBLIC SvUShortsSort : __MWERKS__PRIVATE SvUShorts { public: - SvUShortsSort(BYTE nSize = 1, BYTE nG = 1) + SvUShortsSort(sal_uInt8 nSize = 1, sal_uInt8 nG = 1) : SvUShorts(nSize,nG) {} - void Insert( const SvUShortsSort *pI, USHORT nS=0, USHORT nE=USHRT_MAX ); - BOOL Insert( const USHORT aE ); - BOOL Insert( const USHORT aE, USHORT& rP ); - void Insert( const USHORT *pE, USHORT nL ); + void Insert( const SvUShortsSort *pI, sal_uInt16 nS=0, sal_uInt16 nE=USHRT_MAX ); + sal_Bool Insert( const sal_uInt16 aE ); + sal_Bool Insert( const sal_uInt16 aE, sal_uInt16& rP ); + void Insert( const sal_uInt16 *pE, sal_uInt16 nL ); // remove ab Pos - void RemoveAt( const USHORT nP, USHORT nL = 1 ); + void RemoveAt( const sal_uInt16 nP, sal_uInt16 nL = 1 ); // remove ab dem Eintrag - void Remove( const USHORT nP, USHORT nL = 1 ); - BOOL Seek_Entry( const USHORT aE, USHORT* pP = 0 ) const; + void Remove( const sal_uInt16 nP, sal_uInt16 nL = 1 ); + sal_Bool Seek_Entry( const sal_uInt16 aE, sal_uInt16* pP = 0 ) const; - USHORT Count() const { return SvUShorts::Count(); } - const USHORT* GetData() const { return (const USHORT*)pData; } + sal_uInt16 Count() const { return SvUShorts::Count(); } + const sal_uInt16* GetData() const { return (const sal_uInt16*)pData; } - const USHORT& operator[](USHORT nP) const { + const sal_uInt16& operator[](sal_uInt16 nP) const { return SvUShorts::operator[]( nP ); } - const USHORT& GetObject(USHORT nP) const { + const sal_uInt16& GetObject(sal_uInt16 nP) const { return SvUShorts::GetObject( nP ); } void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) { _ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs ); } - void ForEach( USHORT nS, USHORT nE, + void ForEach( sal_uInt16 nS, sal_uInt16 nE, FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) { _ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs ); diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx index 31878aa34be5..0e1aa5b365b1 100644 --- a/svl/inc/svl/szitem.hxx +++ b/svl/inc/svl/szitem.hxx @@ -46,8 +46,8 @@ private: public: TYPEINFO(); SfxSizeItem(); - SfxSizeItem( USHORT nWhich, const Size& rVal ); - SfxSizeItem( USHORT nWhich, SvStream & ); + SfxSizeItem( sal_uInt16 nWhich, const Size& rVal ); + SfxSizeItem( sal_uInt16 nWhich, SvStream & ); SfxSizeItem( const SfxSizeItem& ); ~SfxSizeItem() { DBG_DTOR(SfxSizeItem, 0); } @@ -58,14 +58,14 @@ public: const IntlWrapper * = 0 ) const; virtual int operator==( const SfxPoolItem& ) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; - virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; - virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + virtual SfxPoolItem* Create(SvStream &, sal_uInt16 nItemVersion) const; + virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; const Size& GetValue() const { return aVal; } void SetValue( const Size& rNewVal ) { diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx index 5aea03207626..3d2c46af496c 100644 --- a/svl/inc/svl/undo.hxx +++ b/svl/inc/svl/undo.hxx @@ -32,6 +32,10 @@ #include <tools/string.hxx> #include <svl/svarray.hxx> +#include <boost/scoped_ptr.hpp> + +#include <vector> + //==================================================================== class SVL_DLLPUBLIC SfxRepeatTarget @@ -43,26 +47,36 @@ public: //==================================================================== +class SVL_DLLPUBLIC SfxUndoContext +{ +public: + virtual ~SfxUndoContext() = 0; +}; + +//==================================================================== + class SVL_DLLPUBLIC SfxUndoAction { - BOOL bLinked; + sal_Bool bLinked; public: TYPEINFO(); SfxUndoAction(); virtual ~SfxUndoAction(); - virtual BOOL IsLinked(); - virtual void SetLinked( BOOL bIsLinked = TRUE ); + virtual sal_Bool IsLinked(); + virtual void SetLinked( sal_Bool bIsLinked = sal_True ); virtual void Undo(); + virtual void UndoWithContext( SfxUndoContext& i_context ); virtual void Redo(); + virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); - virtual BOOL CanRepeat(SfxRepeatTarget&) const; + virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); - virtual UniString GetComment() const; - virtual UniString GetRepeatComment(SfxRepeatTarget&) const; - virtual USHORT GetId() const; + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; private: SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!! @@ -70,19 +84,67 @@ private: //======================================================================== -SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 ) +/// is a mark on the Undo stack +typedef sal_Int32 UndoStackMark; +#define MARK_INVALID ::std::numeric_limits< UndoStackMark >::max() + +//======================================================================== + +struct MarkedUndoAction +{ + SfxUndoAction* pAction; + ::std::vector< UndoStackMark > aMarks; + + MarkedUndoAction( SfxUndoAction* i_action ) + :pAction( i_action ) + ,aMarks() + { + } +}; + +class SfxUndoActions +{ +private: + ::std::vector< MarkedUndoAction > m_aActions; + +public: + SfxUndoActions() + { + } + + bool empty() const { return m_aActions.empty(); } + size_t size() const { return m_aActions.size(); } + + const MarkedUndoAction& operator[]( size_t i ) const { return m_aActions[i]; } + MarkedUndoAction& operator[]( size_t i ) { return m_aActions[i]; } + + void Remove( size_t i_pos ) + { + m_aActions.erase( m_aActions.begin() + i_pos ); + } + + void Remove( size_t i_pos, size_t i_count ) + { + m_aActions.erase( m_aActions.begin() + i_pos, m_aActions.begin() + i_pos + i_count ); + } + + void Insert( SfxUndoAction* i_action, size_t i_pos ) + { + m_aActions.insert( m_aActions.begin() + i_pos, MarkedUndoAction( i_action ) ); + } +}; //==================================================================== -/** do not make use of this implementation details, unless you +/** do not make use of these implementation details, unless you really really have to! */ struct SVL_DLLPUBLIC SfxUndoArray { SfxUndoActions aUndoActions; - USHORT nMaxUndoActions; - USHORT nCurUndoAction; + size_t nMaxUndoActions; + size_t nCurUndoAction; SfxUndoArray *pFatherUndoArray; - SfxUndoArray(USHORT nMax=0): + SfxUndoArray(size_t nMax=0): nMaxUndoActions(nMax), nCurUndoAction(0), pFatherUndoArray(0) {} ~SfxUndoArray(); @@ -90,7 +152,7 @@ struct SVL_DLLPUBLIC SfxUndoArray //========================================================================= -/** do not make use of this implementation details, unless you +/** do not make use of these implementation details, unless you really really have to! */ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray @@ -109,87 +171,260 @@ class SVL_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArra TYPEINFO(); SfxListUndoAction( const UniString &rComment, - const UniString rRepeatComment, USHORT Id, SfxUndoArray *pFather); + const UniString rRepeatComment, sal_uInt16 Id, SfxUndoArray *pFather); virtual void Undo(); + virtual void UndoWithContext( SfxUndoContext& i_context ); virtual void Redo(); + virtual void RedoWithContext( SfxUndoContext& i_context ); virtual void Repeat(SfxRepeatTarget&); - virtual BOOL CanRepeat(SfxRepeatTarget&) const; + virtual sal_Bool CanRepeat(SfxRepeatTarget&) const; - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); - virtual UniString GetComment() const; - virtual UniString GetRepeatComment(SfxRepeatTarget&) const; - virtual USHORT GetId() const; + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; void SetComment( const UniString& rComment ); private: - USHORT nId; - UniString aComment, aRepeatComment; + sal_uInt16 nId; + UniString aComment; + UniString aRepeatComment; }; //========================================================================= -class SVL_DLLPUBLIC SfxUndoManager +/** is a callback interface for notifications about state changes of an SfxUndoManager +*/ +class SAL_NO_VTABLE SfxUndoListener { - friend class SfxLinkUndoAction; +public: + virtual void actionUndone( const String& i_actionComment ) = 0; + virtual void actionRedone( const String& i_actionComment ) = 0; + virtual void undoActionAdded( const String& i_actionComment ) = 0; + virtual void cleared() = 0; + virtual void clearedRedo() = 0; + virtual void resetAll() = 0; + virtual void listActionEntered( const String& i_comment ) = 0; + virtual void listActionLeft( const String& i_comment ) = 0; + virtual void listActionLeftAndMerged() = 0; + virtual void listActionCancelled() = 0; + virtual void undoManagerDying() = 0; +}; - SfxUndoArray *pUndoArray; - SfxUndoArray *pActUndoArray; - SfxUndoArray *pFatherUndoArray; +//========================================================================= - bool mbUndoEnabled; -public: - SfxUndoManager( USHORT nMaxUndoActionCount = 20 ); - virtual ~SfxUndoManager(); +namespace svl +{ + class SAL_NO_VTABLE IUndoManager + { + public: + enum + { + CurrentLevel = true, + TopLevel = false + }; - virtual void SetMaxUndoActionCount( USHORT nMaxUndoActionCount ); - virtual USHORT GetMaxUndoActionCount() const; - virtual void Clear(); + virtual ~IUndoManager() { }; + + virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ) = 0; + virtual size_t GetMaxUndoActionCount() const = 0; + + virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ) = 0; + + virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0; + virtual sal_uInt16 GetUndoActionId() const = 0; + virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0; + virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const = 0; - virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ); + virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0; + virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0; - virtual USHORT GetUndoActionCount() const; - virtual USHORT GetUndoActionId(USHORT nNo=0) const; - virtual UniString GetUndoActionComment( USHORT nNo=0 ) const; - /** returns the nNo'th undo action from the top */ - SfxUndoAction* GetUndoAction( USHORT nNo=0 ) const; + virtual sal_Bool Undo() = 0; + virtual sal_Bool Redo() = 0; - virtual BOOL Undo( USHORT nCount=1 ); - virtual void Undo( SfxUndoAction &rAction ); + /** clears both the Redo and the Undo stack. - virtual USHORT GetRedoActionCount() const; - virtual USHORT GetRedoActionId(USHORT nNo=0) const; - virtual UniString GetRedoActionComment( USHORT nNo=0 ) const; + Will assert and bail out when called while within a list action (<member>IsInListAction</member>). + */ + virtual void Clear() = 0; - virtual BOOL Redo( USHORT nCount=1 ); - virtual void Redo( SfxUndoAction &rAction ); + /** clears the Redo stack. + + Will assert and bail out when called while within a list action (<member>IsInListAction</member>). + */ + virtual void ClearRedo() = 0; + + /** leaves any possible open list action (<member>IsInListAction</member>), and clears both the Undo and the + Redo stack. + + Effectively, calling this method is equivalent to <code>while ( IsInListAction() ) LeaveListAction();</code>, + followed by <code>Clear()</code>. The only difference to this calling sequence is that Reset is an + atomar operation, also resulting in only one notification. + */ + virtual void Reset() = 0; + + /** determines whether an Undo or Redo is currently running + */ + virtual bool IsDoing() const = 0; + + virtual size_t GetRepeatActionCount() const = 0; + virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const = 0; + virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ) = 0; + virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const = 0; + + virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0) = 0; + + /** leaves the list action entered with EnterListAction + @return the number of the sub actions in the list which has just been left. Note that in case no such + actions exist, the list action does not contribute to the Undo stack, but is silently removed. + */ + virtual size_t LeaveListAction() = 0; + + /** leaves the list action entered with EnterListAction, and forcefully merges the previous + action on the stack into the newly created list action. + + Say you have an Undo action A on the stack, then call EnterListAction, followed by one or more calls to + AddUndoAction, followed by a call to LeaveAndMergeListAction. In opposite to LeaveListAction, your Undo + stack will now still contain one undo action: the newly created list action, whose first child is the + original A, whose other children are those you added via AddUndoAction, and whose comment is the same as + the comment of A. + + Effectively, this means that all actions added between EnterListAction and LeaveAndMergeListAction are + hidden from the user. + + @return the number of the sub actions in the list which has just been left. Note that in case no such + actions exist, the list action does not contribute to the Undo stack, but is silently removed. + */ + virtual size_t LeaveAndMergeListAction() = 0; + + /// determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction call is pending + virtual bool IsInListAction() const = 0; + + /// determines how many nested list actions are currently open + virtual size_t GetListActionDepth() const = 0; + + /** clears the redo stack and removes the top undo action */ + virtual void RemoveLastUndoAction() = 0; + + // enables (true) or disables (false) recording of undo actions + // If undo actions are added while undo is disabled, they are deleted. + // Disabling undo does not clear the current undo buffer! + virtual void EnableUndo( bool bEnable ) = 0; + + // returns true if undo is currently enabled + // This returns false if undo was disabled using EnableUndo( false ) and + // also during the runtime of the Undo() and Redo() methods. + virtual bool IsUndoEnabled() const = 0; + + /// adds a new listener to be notified about changes in the UndoManager's state + virtual void AddUndoListener( SfxUndoListener& i_listener ) = 0; + virtual void RemoveUndoListener( SfxUndoListener& i_listener ) = 0; + }; +} + +//========================================================================= + +namespace svl { namespace undo { namespace impl +{ + class UndoManagerGuard; + class LockGuard; +} } } + +struct SfxUndoManager_Data; +class SVL_DLLPUBLIC SfxUndoManager : public ::svl::IUndoManager +{ + friend class SfxLinkUndoAction; + + ::boost::scoped_ptr< SfxUndoManager_Data > + m_pData; +public: + SfxUndoManager( size_t nMaxUndoActionCount = 20 ); + virtual ~SfxUndoManager(); + + // IUndoManager overridables + virtual void SetMaxUndoActionCount( size_t nMaxUndoActionCount ); + virtual size_t GetMaxUndoActionCount() const; + virtual void AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg=sal_False ); + virtual size_t GetUndoActionCount( bool const i_currentLevel = CurrentLevel ) const; + virtual sal_uInt16 GetUndoActionId() const; + virtual UniString GetUndoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; + virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const; + virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const; + virtual UniString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const; + virtual sal_Bool Undo(); + virtual sal_Bool Redo(); + virtual void Clear(); virtual void ClearRedo(); + virtual void Reset(); + virtual bool IsDoing() const; + virtual size_t GetRepeatActionCount() const; + virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget) const; + virtual sal_Bool Repeat( SfxRepeatTarget &rTarget ); + virtual sal_Bool CanRepeat( SfxRepeatTarget &rTarget ) const; + virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId=0); + virtual size_t LeaveListAction(); + virtual size_t LeaveAndMergeListAction(); + virtual bool IsInListAction() const; + virtual size_t GetListActionDepth() const; + virtual void RemoveLastUndoAction(); + virtual void EnableUndo( bool bEnable ); + virtual bool IsUndoEnabled() const; + virtual void AddUndoListener( SfxUndoListener& i_listener ); + virtual void RemoveUndoListener( SfxUndoListener& i_listener ); + + /** marks the current top-level element of the Undo stack, and returns a unique ID for it + */ + UndoStackMark MarkTopUndoAction(); + + /** removes a mark given by its ID. + After the call, the mark ID is invalid. + */ + void RemoveMark( UndoStackMark const i_mark ); + + /** determines whether the top action on the Undo stack has a given mark + */ + bool HasTopUndoActionMark( UndoStackMark const i_mark ); + + /** removes the oldest Undo actions from the stack + */ + void RemoveOldestUndoActions( size_t const i_count ); + +protected: + sal_Bool UndoWithContext( SfxUndoContext& i_context ); + sal_Bool RedoWithContext( SfxUndoContext& i_context ); - virtual USHORT GetRepeatActionCount() const; - virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo = 0) const; - virtual BOOL Repeat( SfxRepeatTarget &rTarget, USHORT nFrom=0, USHORT nCount=1 ); - virtual void Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ); - virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo = 0 ) const; - virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const; + void ImplClearRedo_NoLock( bool const i_currentLevel ); - virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0); - virtual void LeaveListAction(); + /** clears all undo actions on the current level, plus all undo actions on superordinate levels, + as soon as those levels are reached. - /** clears the redo stack and removes the top undo action */ - void RemoveLastUndoAction(); + If no list action is active currently, i.e. we're on the top level already, this method is equivalent to + ->Clear. - // enables (true) or disables (false) recording of undo actions - // If undo actions are added while undo is disabled, they are deleted. - // Disabling undo does not clear the current undo buffer! - void EnableUndo( bool bEnable ); + Otherwise, the Undo actions on the current level are removed. Upon leaving the current list action, all + undo actions on the then-current level are removed, too. This is continued until the top level is reached. + */ + void ClearAllLevels(); - // returns true if undo is currently enabled - // This returns false if undo was disabled using EnableUndo( false ) and - // also during the runtime of the Undo() and Redo() methods. - bool IsUndoEnabled() const { return mbUndoEnabled; } +private: + size_t ImplLeaveListAction( const bool i_merge, ::svl::undo::impl::UndoManagerGuard& i_guard ); + bool ImplAddUndoAction_NoNotify( SfxUndoAction* pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard& i_guard ); + void ImplClearRedo( ::svl::undo::impl::UndoManagerGuard& i_guard, bool const i_currentLevel ); + void ImplClearUndo( ::svl::undo::impl::UndoManagerGuard& i_guard ); + void ImplClearCurrentLevel_NoNotify( ::svl::undo::impl::UndoManagerGuard& i_guard ); + size_t ImplGetRedoActionCount_Lock( bool const i_currentLevel = CurrentLevel ) const; + bool ImplIsUndoEnabled_Lock() const; + bool ImplIsInListAction_Lock() const; + void ImplEnableUndo_Lock( bool const i_enable ); + + sal_Bool ImplUndo( SfxUndoContext* i_contextOrNull ); + sal_Bool ImplRedo( SfxUndoContext* i_contextOrNull ); + + friend class ::svl::undo::impl::LockGuard; }; //========================================================================= @@ -213,23 +448,23 @@ class SVL_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction { public: TYPEINFO(); - SfxLinkUndoAction(SfxUndoManager *pManager); + SfxLinkUndoAction(::svl::IUndoManager *pManager); ~SfxLinkUndoAction(); virtual void Undo(); virtual void Redo(); - virtual BOOL CanRepeat(SfxRepeatTarget& r) const; + virtual sal_Bool CanRepeat(SfxRepeatTarget& r) const; virtual void Repeat(SfxRepeatTarget&r); - virtual UniString GetComment() const; - virtual UniString GetRepeatComment(SfxRepeatTarget&r) const; - virtual USHORT GetId() const; + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&r) const; + virtual sal_uInt16 GetId() const; SfxUndoAction* GetAction() const { return pAction; } protected: - SfxUndoManager *pUndoManager; + ::svl::IUndoManager *pUndoManager; SfxUndoAction *pAction; }; diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx index 9e9a0fcf4126..0305e0563938 100644 --- a/svl/inc/svl/visitem.hxx +++ b/svl/inc/svl/visitem.hxx @@ -43,14 +43,14 @@ class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem public: TYPEINFO(); - SfxVisibilityItem(USHORT which = 0, sal_Bool bVisible = sal_True): + SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True): SfxPoolItem(which) { m_nValue.bVisible = bVisible; DBG_CTOR(SfxVisibilityItem, 0); } - SfxVisibilityItem(USHORT which, SvStream & rStream); + SfxVisibilityItem(sal_uInt16 which, SvStream & rStream); SfxVisibilityItem(const SfxVisibilityItem & rItem): SfxPoolItem(rItem), m_nValue(rItem.m_nValue) @@ -69,25 +69,25 @@ public: const IntlWrapper * = 0) const; - virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ) const; + virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const; - virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId = 0 ); + virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ); - virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; - virtual SvStream & Store(SvStream & rStream, USHORT) const; + virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; - virtual USHORT GetValueCount() const; + virtual sal_uInt16 GetValueCount() const; - virtual UniString GetValueTextByVal(BOOL bTheValue) const; + virtual UniString GetValueTextByVal(sal_Bool bTheValue) const; - BOOL GetValue() const { return m_nValue.bVisible; } + sal_Bool GetValue() const { return m_nValue.bVisible; } - void SetValue(BOOL bVisible) { m_nValue.bVisible = bVisible; } + void SetValue(sal_Bool bVisible) { m_nValue.bVisible = bVisible; } }; #endif // _SFXVISIBILITYITEM_HXX diff --git a/svl/inc/svl/whiter.hxx b/svl/inc/svl/whiter.hxx index 83a3e21e2b0e..eb9bb7d7e732 100644 --- a/svl/inc/svl/whiter.hxx +++ b/svl/inc/svl/whiter.hxx @@ -42,19 +42,19 @@ class SfxItemSet; class SVL_DLLPUBLIC SfxWhichIter { - const USHORT *pRanges, *pStart; - USHORT nOfst, nFrom, nTo; + const sal_uInt16 *pRanges, *pStart; + sal_uInt16 nOfst, nFrom, nTo; public: - SfxWhichIter( const SfxItemSet& rSet, USHORT nFrom = 0, USHORT nTo = USHRT_MAX ); + SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFrom = 0, sal_uInt16 nTo = USHRT_MAX ); ~SfxWhichIter(); - USHORT GetCurWhich() const { return *pRanges + nOfst; } - USHORT NextWhich(); - USHORT PrevWhich(); + sal_uInt16 GetCurWhich() const { return *pRanges + nOfst; } + sal_uInt16 NextWhich(); + sal_uInt16 PrevWhich(); - USHORT FirstWhich(); - USHORT LastWhich(); + sal_uInt16 FirstWhich(); + sal_uInt16 LastWhich(); }; #endif diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 5492759d4d36..abb627567856 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -233,9 +233,9 @@ class SVL_DLLPUBLIC NfCurrencyEntry String aSymbol; /// currency symbol String aBankSymbol; /// currency abbreviation LanguageType eLanguage; /// language/country value - USHORT nPositiveFormat; /// position of symbol - USHORT nNegativeFormat; /// position of symbol and type and position of negative sign - USHORT nDigits; /// count of decimal digits + sal_uInt16 nPositiveFormat; /// position of symbol + sal_uInt16 nNegativeFormat; /// position of symbol and type and position of negative sign + sal_uInt16 nDigits; /// count of decimal digits sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits /// not implemented, prevent usage @@ -249,7 +249,7 @@ private: // nDecimalFormat := 0, 1, 2 // #,##0 or #,##0.00 or #,##0.-- are assigned SVL_DLLPRIVATE void Impl_BuildFormatStringNumChars( String&, - const LocaleDataWrapper&, USHORT nDecimalFormat ) const; + const LocaleDataWrapper&, sal_uInt16 nDecimalFormat ) const; //#endif // __PRIVATE public: @@ -264,11 +264,11 @@ public: ~NfCurrencyEntry() {} /// Symbols and language identical - BOOL operator==( const NfCurrencyEntry& r ) const; + sal_Bool operator==( const NfCurrencyEntry& r ) const; /// Set this format to be the EURo entry, overwrite other settings void SetEuro(); - BOOL IsEuro() const; + sal_Bool IsEuro() const; /** Apply format information (nPositiveFormat, nNegativeFormat, nDigits, cZeroChar) of another format. */ @@ -277,43 +277,43 @@ public: const String& GetSymbol() const { return aSymbol; } const String& GetBankSymbol() const { return aBankSymbol; } LanguageType GetLanguage() const { return eLanguage; } - USHORT GetPositiveFormat() const { return nPositiveFormat; } - USHORT GetNegativeFormat() const { return nNegativeFormat; } - USHORT GetDigits() const { return nDigits; } + sal_uInt16 GetPositiveFormat() const { return nPositiveFormat; } + sal_uInt16 GetNegativeFormat() const { return nNegativeFormat; } + sal_uInt16 GetDigits() const { return nDigits; } sal_Unicode GetZeroChar() const { return cZeroChar; } - /** [$DM-407] (bBank==FALSE) or [$DEM] (bBank==TRUE) - is assigned to rStr, if bBank==FALSE and - bWithoutExtension==TRUE only [$DM] */ - void BuildSymbolString( String& rStr, BOOL bBank, - BOOL bWithoutExtension = FALSE ) const; + /** [$DM-407] (bBank==sal_False) or [$DEM] (bBank==sal_True) + is assigned to rStr, if bBank==sal_False and + bWithoutExtension==sal_True only [$DM] */ + void BuildSymbolString( String& rStr, sal_Bool bBank, + sal_Bool bWithoutExtension = sal_False ) const; /** #,##0.00 [$DM-407] is assigned to rStr, separators from rLoc, incl. minus sign but without [RED] */ - void BuildPositiveFormatString( String& rStr, BOOL bBank, - const LocaleDataWrapper&, USHORT nDecimalFormat = 1 ) const; - void BuildNegativeFormatString( String& rStr, BOOL bBank, - const LocaleDataWrapper&, USHORT nDecimalFormat = 1 ) const; + void BuildPositiveFormatString( String& rStr, sal_Bool bBank, + const LocaleDataWrapper&, sal_uInt16 nDecimalFormat = 1 ) const; + void BuildNegativeFormatString( String& rStr, sal_Bool bBank, + const LocaleDataWrapper&, sal_uInt16 nDecimalFormat = 1 ) const; - /** [$DM-407] (or [$DEM] if bBank==TRUE) + /** [$DM-407] (or [$DEM] if bBank==sal_True) is appended/prepended to rStr, incl. minus sign */ - void CompletePositiveFormatString( String& rStr, BOOL bBank, - USHORT nPosiFormat ) const; - void CompleteNegativeFormatString( String& rStr, BOOL bBank, - USHORT nNegaFormat ) const; + void CompletePositiveFormatString( String& rStr, sal_Bool bBank, + sal_uInt16 nPosiFormat ) const; + void CompleteNegativeFormatString( String& rStr, sal_Bool bBank, + sal_uInt16 nNegaFormat ) const; /// rSymStr is appended/prepended to rStr, incl. minus sign static void CompletePositiveFormatString( String& rStr, - const String& rSymStr, USHORT nPosiFormat ); + const String& rSymStr, sal_uInt16 nPosiFormat ); static void CompleteNegativeFormatString( String& rStr, - const String& rSymStr, USHORT nNegaFormat ); + const String& rSymStr, sal_uInt16 nNegaFormat ); /** Representation of a currency (symbol position and negative sign) in other language settings */ - static USHORT GetEffectivePositiveFormat( USHORT nIntlFormat, - USHORT nCurrFormat, BOOL bBank ); - static USHORT GetEffectiveNegativeFormat( USHORT nIntlFormat, - USHORT nCurrFormat, BOOL bBank ); + static sal_uInt16 GetEffectivePositiveFormat( sal_uInt16 nIntlFormat, + sal_uInt16 nCurrFormat, sal_Bool bBank ); + static sal_uInt16 GetEffectiveNegativeFormat( sal_uInt16 nIntlFormat, + sal_uInt16 nCurrFormat, sal_Bool bBank ); /// General Unicode Euro symbol static inline sal_Unicode GetEuroSymbol() { return sal_Unicode(0x20AC); } @@ -359,23 +359,23 @@ public: /// Set CallBack to ColorTable void SetColorLink( const Link& rColorTableCallBack ) { aColorLink = rColorTableCallBack; } /// Do the CallBack to ColorTable - Color* GetUserDefColor(USHORT nIndex); + Color* GetUserDefColor(sal_uInt16 nIndex); /// Change language/country, also input and format scanner void ChangeIntl( LanguageType eLnge ); /// Change the reference null date - void ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear); + void ChangeNullDate(sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear); /// Change standard precision void ChangeStandardPrec(short nPrec); /// Set zero value suppression - void SetNoZero(BOOL bNZ) { bNoZero = bNZ; } + void SetNoZero(sal_Bool bNZ) { bNoZero = bNZ; } /** The language with which the formatter was initialized (system setting), NOT the current language after a ChangeIntl() */ LanguageType GetLanguage() const { return IniLnge; } // Determine whether two format types are input compatible or not - BOOL IsCompatible(short eOldType, short eNewType); + sal_Bool IsCompatible(short eOldType, short eNewType); /** Get table of formats of a specific type of a locale. A format FIndex is tested whether it has the type and locale requested, if it doesn't @@ -414,13 +414,13 @@ public: nType contains the type of the format. nKey contains the index key of the format. */ - BOOL PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, + sal_Bool PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge = LANGUAGE_DONTKNOW ); /** Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge */ - BOOL PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, + sal_Bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -428,7 +428,7 @@ public: is considered to be of the System language/country eLnge and is converted to another System language/country eNewLnge. In this case the automatic currency is converted too. */ - BOOL PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, + sal_Bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -466,20 +466,20 @@ public: was empty, could not be converted or has errors, the eLnge locale's standard number format is chosen instead. The index key is guaranteed to represent some valid number format. If - rNewInserted==FALSE and rCheckPos>0 the format code has errors + rNewInserted==sal_False and rCheckPos>0 the format code has errors and/or could not be converted. */ sal_uInt32 GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, LanguageType eSysLnge, short & rType, - BOOL & rNewInserted, + sal_Bool & rNewInserted, xub_StrLen & rCheckPos ); /** Create a format code string using format nIndex as a template and applying other settings (passed from the dialog) */ void GenerateFormat( String& sString, sal_uInt32 nIndex, LanguageType eLnge = LANGUAGE_DONTKNOW, - BOOL bThousand = FALSE, BOOL IsRed = FALSE, - USHORT nPrecision = 0, USHORT nAnzLeading = 1 ); + sal_Bool bThousand = sal_False, sal_Bool IsRed = sal_False, + sal_uInt16 nPrecision = 0, sal_uInt16 nAnzLeading = 1 ); /** Analyze an input string @return @@ -488,7 +488,7 @@ public: returned in fOutNumber <FALSE/> if input is not a number */ - BOOL IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber ); + sal_Bool IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber ); /// Format a number according to a format index, return string and color void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex, @@ -510,13 +510,13 @@ public: <FALSE/> if format code contains an error <TRUE/> else, in which case the string and color are returned. */ - BOOL GetPreviewString( const String& sFormatString, double fPreviewNumber, + sal_Bool GetPreviewString( const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); /** Same as <method>GetPreviewString</method> but the format code string may be either language/country eLnge or en_US english US */ - BOOL GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, + sal_Bool GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); @@ -525,7 +525,7 @@ public: <FALSE/> if format code contains an error <TRUE/> else, in which case the string and color are returned. */ - BOOL GetPreviewString( const String& sFormatString, const String& sPreviewString, + sal_Bool GetPreviewString( const String& sFormatString, const String& sPreviewString, String& sOutString, Color** ppColor, LanguageType eLnge = LANGUAGE_DONTKNOW ); @@ -537,14 +537,14 @@ public: LanguageType eLnge = LANGUAGE_DONTKNOW ); /// Whether format index nFIndex is of type text or not - BOOL IsTextFormat(sal_uInt32 nFIndex) const; + sal_Bool IsTextFormat(sal_uInt32 nFIndex) const; /// Whether the 4th string subcode of format index nFIndex is present - BOOL HasTextFormat(sal_uInt32 nFIndex) const; + sal_Bool HasTextFormat(sal_uInt32 nFIndex) const; /// Load all formats from a stream - BOOL Load( SvStream& rStream ); + sal_Bool Load( SvStream& rStream ); /// Save all formats to a stream - BOOL Save( SvStream& rStream ) const; + sal_Bool Save( SvStream& rStream ) const; /// Reset of "Used" flags void PrepareSave(); @@ -552,11 +552,11 @@ public: void SetFormatUsed(sal_uInt32 nFIndex); /// Get additional info of a format index, e.g. for dialog box - void GetFormatSpecialInfo(sal_uInt32 nFormat, BOOL& bThousand, BOOL& IsRed, - USHORT& nPrecision, USHORT& nAnzLeading); + void GetFormatSpecialInfo(sal_uInt32 nFormat, sal_Bool& bThousand, sal_Bool& IsRed, + sal_uInt16& nPrecision, sal_uInt16& nAnzLeading); /// Count of decimals - USHORT GetFormatPrecision( sal_uInt32 nFormat ) const; + sal_uInt16 GetFormatPrecision( sal_uInt32 nFormat ) const; /** Get additional info of a format code string, e.g. for dialog box. Uses a temporary parse, if possible use only if format code is not @@ -565,12 +565,12 @@ public: 0 if format code string parsed without errors, otherwise error position (like nCheckPos on <method>PutEntry</method>) */ - sal_uInt32 GetFormatSpecialInfo( const String&, BOOL& bThousand, BOOL& IsRed, - USHORT& nPrecision, USHORT& nAnzLeading, + sal_uInt32 GetFormatSpecialInfo( const String&, sal_Bool& bThousand, sal_Bool& IsRed, + sal_uInt16& nPrecision, sal_uInt16& nAnzLeading, LanguageType eLnge = LANGUAGE_DONTKNOW ); /// Check if format code string may be deleted by user - BOOL IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); + sal_Bool IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); /** Return the format index of the format code string for language/country, or NUMBERFORMAT_ENTRY_NOT_FOUND */ @@ -598,14 +598,14 @@ public: LanguageType eLnge ); /// Whether nFIndex is a special builtin format - BOOL IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge ); + sal_Bool IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge ); /// Return the reference date Date* GetNullDate(); /// Return the standard decimal precision sal_uInt16 GetStandardPrec(); /// Return whether zero suppression is switched on - BOOL GetNoZero() { return bNoZero; } + sal_Bool GetNoZero() { return bNoZero; } /** Get the type of a format (or NUMBERFORMAT_UNDEFINED if no entry), but with NUMBERFORMAT_DEFINED masked out */ short GetType(sal_uInt32 nFIndex); @@ -616,7 +616,7 @@ public: SvNumberFormatterIndexTable* MergeFormatter(SvNumberFormatter& rNewTable); /// Whether a merge table is present or not - inline BOOL HasMergeFmtTbl() const; + inline sal_Bool HasMergeFmtTbl() const; /// Return the new format index for an old format index, if a merge table exists inline sal_uInt32 GetMergeFmtIndex( sal_uInt32 nOldFmt ) const; @@ -626,7 +626,7 @@ public: SvNumberFormatterMergeMap ConvertMergeTableToMap(); /// Return the last used position ever of a language/country combination - USHORT GetLastInsertKey(sal_uInt32 CLOffset); + sal_uInt16 GetLastInsertKey(sal_uInt32 CLOffset); /** Return the format index of a builtin format for a specific language/country. If nFormat is not a builtin format nFormat is returned. */ @@ -659,12 +659,12 @@ public: The name Year2000 is kept although the actual functionality is now a TwoDigitYearStart which might be in any century. */ - void SetYear2000( USHORT nVal ); - USHORT GetYear2000() const; - static USHORT GetYear2000Default(); + void SetYear2000( sal_uInt16 nVal ); + sal_uInt16 GetYear2000() const; + static sal_uInt16 GetYear2000Default(); - USHORT ExpandTwoDigitYear( USHORT nYear ) const; - inline static USHORT ExpandTwoDigitYear( USHORT nYear, USHORT nTwoDigitYearStart ); + sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear ) const; + inline static sal_uInt16 ExpandTwoDigitYear( sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart ); /// DEPRICATED: Return first character of the decimal separator of the current language/country sal_Unicode GetDecSep() const { return GetNumDecimalSep().GetChar(0); } @@ -729,16 +729,16 @@ public: @return position of default format */ - USHORT GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&, - BOOL bBank ) const; + sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&, + sal_Bool bBank ) const; /** Whether nFormat is of type NUMBERFORMAT_CURRENCY and the format code contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn]. If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is returned, even if the format code only contains [$xxx] ! */ - BOOL GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol, - const NfCurrencyEntry** ppEntry = NULL, BOOL* pBank = NULL ) const; + sal_Bool GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol, + const NfCurrencyEntry** ppEntry = NULL, sal_Bool* pBank = NULL ) const; /** Look up the corresponding <type>NfCurrencyEntry</type> matching rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly @@ -776,9 +776,9 @@ public: The matching entry if unique (in which case bFoundBank is set), else <NULL/>. */ - static const NfCurrencyEntry* GetCurrencyEntry( BOOL & bFoundBank, + static const NfCurrencyEntry* GetCurrencyEntry( sal_Bool & bFoundBank, const String& rSymbol, const String& rExtension, - LanguageType eFormatLanguage, BOOL bOnlyStringLanguage = FALSE ); + LanguageType eFormatLanguage, sal_Bool bOnlyStringLanguage = sal_False ); /// Get compatibility ("automatic" old style) currency from I18N locale data void GetCompatibilityCurrency( String& rSymbol, String& rAbbrev ) const; @@ -791,7 +791,7 @@ public: /** Return a keyword for a language/country and <type>NfKeywordIndex</type> for XML import, to generate number format strings. */ - String GetKeyword( LanguageType eLnge, USHORT nIndex ); + String GetKeyword( LanguageType eLnge, sal_uInt16 nIndex ); /** Return the GENERAL keyword in proper case ("General") for a language/country, used in XML import */ @@ -821,7 +821,7 @@ private: LanguageType IniLnge; // Initialized setting language/country LanguageType ActLnge; // Current setting language/country NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation - BOOL bNoZero; // Zero value suppression + sal_Bool bNoZero; // Zero value suppression // cached locale data items needed almost any time String aDecimalSep; @@ -830,8 +830,8 @@ private: #ifdef _ZFORLIST_CXX // ----- private Methoden ----- - SVL_DLLPRIVATE static BOOL bCurrencyTableInitialized; - SVL_DLLPRIVATE static USHORT nSystemCurrencyPosition; + SVL_DLLPRIVATE static sal_Bool bCurrencyTableInitialized; + SVL_DLLPRIVATE static sal_uInt16 nSystemCurrencyPosition; SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry; // get the registry, create one if none exists @@ -842,29 +842,29 @@ private: // Changes initialized language/country, clears the entries and generates // new ones, may ONLY be called by the binary file format load - SVL_DLLPRIVATE void ImpChangeSysCL( LanguageType eLnge, BOOL bLoadingSO5 ); + SVL_DLLPRIVATE void ImpChangeSysCL( LanguageType eLnge, sal_Bool bLoadingSO5 ); // Generate builtin formats provided by i18n behind CLOffset, - // if bLoadingSO5==FALSE also generate additional i18n formats. - SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO5 ); + // if bLoadingSO5==sal_False also generate additional i18n formats. + SVL_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadingSO5 ); // Generate additional formats provided by i18n SVL_DLLPRIVATE void ImpGenerateAdditionalFormats( sal_uInt32 CLOffset, NumberFormatCodeWrapper& rNumberFormatCode, - BOOL bAfterLoadingSO5 ); + sal_Bool bAfterLoadingSO5 ); SVL_DLLPRIVATE SvNumberformat* ImpInsertFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode, sal_uInt32 nPos, - BOOL bAfterLoadingSO5 = FALSE, + sal_Bool bAfterLoadingSO5 = sal_False, sal_Int16 nOrgIndex = 0 ); // ImpInsertNewStandardFormat for new (since version ...) builtin formats SVL_DLLPRIVATE SvNumberformat* ImpInsertNewStandardFormat( const ::com::sun::star::i18n::NumberFormatCode& rCode, sal_uInt32 nPos, - USHORT nVersion, - BOOL bAfterLoadingSO5 = FALSE, + sal_uInt16 nVersion, + sal_Bool bAfterLoadingSO5 = sal_False, sal_Int16 nOrgIndex = 0 ); // Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country @@ -877,7 +877,7 @@ private: LanguageType eLnge ); // Create builtin formats for language/country if necessary, return CLOffset - SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, BOOL bLoadingSO5 = FALSE ); + SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, sal_Bool bLoadingSO5 = sal_False ); // Build negative currency format, old compatibility style SVL_DLLPRIVATE void ImpGetNegCurrFormat( String& sNegStr, const String& rCurrSymbol ); @@ -914,16 +914,16 @@ private: // FormatElement group. SVL_DLLPRIVATE sal_Int32 ImpAdjustFormatCodeDefault( ::com::sun::star::i18n::NumberFormatCode * pFormatArr, - sal_Int32 nCount, BOOL bCheckCorrectness = TRUE + sal_Int32 nCount, sal_Bool bCheckCorrectness = sal_True ); // used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry() #ifndef DBG_UTIL inline #endif - static BOOL ImpLookupCurrencyEntryLoopBody( - const NfCurrencyEntry*& pFoundEntry, BOOL& bFoundBank, - const NfCurrencyEntry* pData, USHORT nPos, const String& rSymbol ); + static sal_Bool ImpLookupCurrencyEntryLoopBody( + const NfCurrencyEntry*& pFoundEntry, sal_Bool& bFoundBank, + const NfCurrencyEntry* pData, sal_uInt16 nPos, const String& rSymbol ); // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method> DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* ); @@ -1006,15 +1006,15 @@ inline sal_uInt32 SvNumberFormatter::GetMergeFmtIndex( sal_uInt32 nOldFmt ) cons return pU ? *pU : nOldFmt; } -inline BOOL SvNumberFormatter::HasMergeFmtTbl() const +inline sal_Bool SvNumberFormatter::HasMergeFmtTbl() const { return pMergeTable && (0 != pMergeTable->Count()); } // static -inline USHORT SvNumberFormatter::ExpandTwoDigitYear( - USHORT nYear, USHORT nTwoDigitYearStart ) +inline sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear( + sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart ) { if ( nYear < 100 ) { diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index 7c361382796a..f610b44c4b6b 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -78,16 +78,16 @@ struct ImpSvNumberformatInfo // Struct for FormatInfo { String* sStrArray; // Array of symbols short* nTypeArray; // Array of infos - USHORT nThousand; // Count of group separator sequences - USHORT nCntPre; // Count of digits before decimal point - USHORT nCntPost; // Count of digits after decimal point - USHORT nCntExp; // Count of exponent digits, or AM/PM + sal_uInt16 nThousand; // Count of group separator sequences + sal_uInt16 nCntPre; // Count of digits before decimal point + sal_uInt16 nCntPost; // Count of digits after decimal point + sal_uInt16 nCntExp; // Count of exponent digits, or AM/PM short eScannedType; // Type determined by scan - BOOL bThousand; // Has group (AKA thousand) separator + sal_Bool bThousand; // Has group (AKA thousand) separator - void Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz ); - void Load(SvStream& rStream, USHORT nAnz); - void Save(SvStream& rStream, USHORT nAnz) const; + void Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz ); + void Load(SvStream& rStream, sal_uInt16 nAnz); + void Save(SvStream& rStream, sal_uInt16 nAnz) const; }; // NativeNumber, represent numbers using CJK or other digits if nNum>0, @@ -95,32 +95,32 @@ struct ImpSvNumberformatInfo // Struct for FormatInfo class SvNumberNatNum { LanguageType eLang; - BYTE nNum; - BOOL bDBNum :1; // DBNum, to be converted to NatNum - BOOL bDate :1; // Used in date? (needed for DBNum/NatNum mapping) - BOOL bSet :1; // If set, since NatNum0 is possible + sal_uInt8 nNum; + sal_Bool bDBNum :1; // DBNum, to be converted to NatNum + sal_Bool bDate :1; // Used in date? (needed for DBNum/NatNum mapping) + sal_Bool bSet :1; // If set, since NatNum0 is possible public: - static BYTE MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDate ); - static BYTE MapNatNumToDBNum( BYTE nNatNum, LanguageType eLang, BOOL bDate ); + static sal_uInt8 MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, sal_Bool bDate ); + static sal_uInt8 MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, sal_Bool bDate ); SvNumberNatNum() : eLang( LANGUAGE_DONTKNOW ), nNum(0), bDBNum(0), bDate(0), bSet(0) {} - BOOL IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; } - BYTE GetRawNum() const { return nNum; } - BYTE GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; } - BYTE GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); } + sal_Bool IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; } + sal_uInt8 GetRawNum() const { return nNum; } + sal_uInt8 GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; } + sal_uInt8 GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); } LanguageType GetLang() const { return eLang; } void SetLang( LanguageType e ) { eLang = e; } - void SetNum( BYTE nNumber, BOOL bDBNumber ) + void SetNum( sal_uInt8 nNumber, sal_Bool bDBNumber ) { nNum = nNumber; bDBNum = bDBNumber; - bSet = TRUE; + bSet = sal_True; } - BOOL IsSet() const { return bSet; } - void SetDate( BOOL bDateP ) { bDate = (bDateP != 0); } + sal_Bool IsSet() const { return bSet; } + void SetDate( sal_Bool bDateP ) { bDate = (bDateP != 0); } }; class CharClass; @@ -131,7 +131,7 @@ public: ImpSvNumFor(); // Ctor without filling the Info ~ImpSvNumFor(); - void Enlarge(USHORT nAnz); // Init of arrays to the right size + void Enlarge(sal_uInt16 nAnz); // Init of arrays to the right size void Load( SvStream& rStream, ImpSvNumberformatScan& rSc, String& rLoadedColorName); void Save( SvStream& rStream ) const; @@ -144,7 +144,7 @@ public: const ImpSvNumberformatInfo& Info() const { return aI; } // Get count of substrings (symbols) - USHORT GetnAnz() const { return nAnzStrings;} + sal_uInt16 GetnAnz() const { return nAnzStrings;} Color* GetColor() const { return pColor; } void SetColor( Color* pCol, String& rName ) @@ -152,22 +152,22 @@ public: const String& GetColorName() const { return sColorName; } // new SYMBOLTYPE_CURRENCY in subformat? - BOOL HasNewCurrency() const; - BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; + sal_Bool HasNewCurrency() const; + sal_Bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; void SaveNewCurrencyMap( SvStream& rStream ) const; void LoadNewCurrencyMap( SvStream& rStream ); // [NatNum1], [NatNum2], ... - void SetNatNumNum( BYTE nNum, BOOL bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); } + void SetNatNumNum( sal_uInt8 nNum, sal_Bool bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); } void SetNatNumLang( LanguageType eLang ) { aNatNum.SetLang( eLang ); } - void SetNatNumDate( BOOL bDate ) { aNatNum.SetDate( bDate ); } + void SetNatNumDate( sal_Bool bDate ) { aNatNum.SetDate( bDate ); } const SvNumberNatNum& GetNatNum() const { return aNatNum; } private: ImpSvNumberformatInfo aI; // Hilfsstruct fuer die restlichen Infos String sColorName; // color name Color* pColor; // pointer to color of subformat - USHORT nAnzStrings; // count of symbols + sal_uInt16 nAnzStrings; // count of symbols SvNumberNatNum aNatNum; // DoubleByteNumber }; @@ -184,7 +184,7 @@ public: ImpSvNumberInputScan* pISc, xub_StrLen& nCheckPos, LanguageType& eLan, - BOOL bStand = FALSE ); + sal_Bool bStand = sal_False ); // Copy ctor SvNumberformat( SvNumberformat& rFormat ); @@ -202,16 +202,16 @@ public: void SetType(const short eSetType) { eType = eSetType; } // Standard means the I18N defined standard format of this type - void SetStandard() { bStandard = TRUE; } - BOOL IsStandard() const { return bStandard; } + void SetStandard() { bStandard = sal_True; } + sal_Bool IsStandard() const { return bStandard; } // For versions before version nVer it is UserDefined, for newer versions // it is builtin. nVer of SV_NUMBERFORMATTER_VERSION_... - void SetNewStandardDefined( USHORT nVer ) + void SetNewStandardDefined( sal_uInt16 nVer ) { nNewStandardDefined = nVer; eType |= NUMBERFORMAT_DEFINED; } - USHORT GetNewStandardDefined() const { return nNewStandardDefined; } - BOOL IsAdditionalStandardDefined() const + sal_uInt16 GetNewStandardDefined() const { return nNewStandardDefined; } + sal_Bool IsAdditionalStandardDefined() const { return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; } LanguageType GetLanguage() const { return eLnge;} @@ -221,12 +221,12 @@ public: // Build a format string of application defined keywords String GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLoc, - BOOL bDontQuote = FALSE ) const; + sal_Bool bDontQuote = sal_False ) const; - void SetUsed(const BOOL b) { bIsUsed = b; } - BOOL GetUsed() const { return bIsUsed; } - BOOL IsStarFormatSupported() const { return bStarFlag; } - void SetStarFormatSupport( BOOL b ) { bStarFlag = b; } + void SetUsed(const sal_Bool b) { bIsUsed = b; } + sal_Bool GetUsed() const { return bIsUsed; } + sal_Bool IsStarFormatSupported() const { return bStarFlag; } + void SetStarFormatSupport( sal_Bool b ) { bStarFlag = b; } NfHackConversion Load( SvStream& rStream, ImpSvNumMultipleReadHeader& rHdr, SvNumberFormatter* pConverter, ImpSvNumberInputScan& rISc ); @@ -242,54 +242,54 @@ public: */ bool GetOutputString( double fNumber, sal_uInt16 nCharCount, String& rOutString ) const; - BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor ); - BOOL GetOutputString( String& sString, String& OutString, Color** ppColor ); + sal_Bool GetOutputString( double fNumber, String& OutString, Color** ppColor ); + sal_Bool GetOutputString( String& sString, String& OutString, Color** ppColor ); // True if type text - BOOL IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; } + sal_Bool IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; } // True if 4th subformat present - BOOL HasTextFormat() const + sal_Bool HasTextFormat() const { return (NumFor[3].GetnAnz() > 0) || (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT); } - void GetFormatSpecialInfo(BOOL& bThousand, - BOOL& IsRed, - USHORT& nPrecision, - USHORT& nAnzLeading) const; + void GetFormatSpecialInfo(sal_Bool& bThousand, + sal_Bool& IsRed, + sal_uInt16& nPrecision, + sal_uInt16& nAnzLeading) const; /// Count of decimal precision - USHORT GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } + sal_uInt16 GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } - //! Read/write access on a special USHORT component, may only be used on the + //! Read/write access on a special sal_uInt16 component, may only be used on the //! standard format 0, 5000, ... and only by the number formatter! - USHORT GetLastInsertKey() const + sal_uInt16 GetLastInsertKey() const { return NumFor[0].Info().nThousand; } - void SetLastInsertKey(USHORT nKey) + void SetLastInsertKey(sal_uInt16 nKey) { NumFor[0].Info().nThousand = nKey; } //! Only onLoad: convert from stored to current system language/country void ConvertLanguage( SvNumberFormatter& rConverter, - LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem = FALSE ); + LanguageType eConvertFrom, LanguageType eConvertTo, sal_Bool bSystem = sal_False ); // Substring of a subformat code nNumFor (0..3) // nPos == 0xFFFF => last substring - // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY - const String* GetNumForString( USHORT nNumFor, USHORT nPos, - BOOL bString = FALSE ) const; + // bString==sal_True: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY + const String* GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos, + sal_Bool bString = sal_False ) const; // Subtype of a subformat code nNumFor (0..3) // nPos == 0xFFFF => last substring - // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY - short GetNumForType( USHORT nNumFor, USHORT nPos, BOOL bString = FALSE ) const; + // bString==sal_True: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY + short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, sal_Bool bString = sal_False ) const; /** If the count of string elements (substrings, ignoring [modifiers] and so on) in a subformat code nNumFor (0..3) is equal to the given number. Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched format. */ - BOOL IsNumForStringElementCountEqual( USHORT nNumFor, USHORT nAllCount, - USHORT nNumCount ) const + sal_Bool IsNumForStringElementCountEqual( sal_uInt16 nNumFor, sal_uInt16 nAllCount, + sal_uInt16 nNumCount ) const { if ( nNumFor < 4 ) { @@ -298,19 +298,19 @@ public: // strings of the format were matched and not just the starting // sequence, so we don't have to check if GetnAnz() includes // [modifiers] or anything else if both counts are equal. - USHORT nCnt = NumFor[nNumFor].GetnAnz(); + sal_uInt16 nCnt = NumFor[nNumFor].GetnAnz(); if ( nAllCount == nCnt ) - return TRUE; + return sal_True; if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on return ImpGetNumForStringElementCount( nNumFor ) == (nAllCount - nNumCount); } - return FALSE; + return sal_False; } // Whether the second subformat code is really for negative numbers // or another limit set. - BOOL IsNegativeRealNegative() const + sal_Bool IsNegativeRealNegative() const { return fLimit1 == 0.0 && fLimit2 == 0.0 && ( (eOp1 == NUMBERFORMAT_OP_GE && eOp2 == NUMBERFORMAT_OP_NO) || @@ -319,37 +319,37 @@ public: } // Whether the negative format is without a sign or not - BOOL IsNegativeWithoutSign() const; + sal_Bool IsNegativeWithoutSign() const; // Whether a new SYMBOLTYPE_CURRENCY is contained in the format - BOOL HasNewCurrency() const; + sal_Bool HasNewCurrency() const; // Build string from NewCurrency for saving it SO50 compatible void Build50Formatstring( String& rStr ) const; // strip [$-yyy] from all [$xxx-yyy] leaving only xxx's, - // if bQuoteSymbol==TRUE the xxx will become "xxx" + // if bQuoteSymbol==sal_True the xxx will become "xxx" static String StripNewCurrencyDelimiters( const String& rStr, - BOOL bQuoteSymbol ); + sal_Bool bQuoteSymbol ); // If a new SYMBOLTYPE_CURRENCY is contained if the format is of type // NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn // of [$xxx-nnn] are returned - BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; + sal_Bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; - static BOOL HasStringNegativeSign( const String& rStr ); + static sal_Bool HasStringNegativeSign( const String& rStr ); /** Whether a character at position nPos is somewhere between two matching cQuote or not. - If nPos points to a cQuote, a TRUE is returned on an opening cQuote, - a FALSE is returned on a closing cQuote. + If nPos points to a cQuote, a sal_True is returned on an opening cQuote, + a sal_False is returned on a closing cQuote. A cQuote between quotes may be escaped by a cEscIn, a cQuote outside of quotes may be escaped by a cEscOut. The default '\0' results in no escapement possible. Defaults are set right according to the "unlogic" of the Numberformatter */ - static BOOL IsInQuote( const String& rString, xub_StrLen nPos, + static sal_Bool IsInQuote( const String& rString, xub_StrLen nPos, sal_Unicode cQuote = '"', sal_Unicode cEscIn = '\0', sal_Unicode cEscOut = '\\' ); @@ -401,23 +401,23 @@ public: // used in XML export void GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1, SvNumberformatLimitOps& rOper2, double& rVal2 ) const; - Color* GetColor( USHORT nNumFor ) const; - void GetNumForInfo( USHORT nNumFor, short& rScannedType, - BOOL& bThousand, USHORT& nPrecision, USHORT& nAnzLeading ) const; + Color* GetColor( sal_uInt16 nNumFor ) const; + void GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, + sal_Bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nAnzLeading ) const; // rAttr.Number not empty if NatNum attributes are to be stored void GetNatNumXml( ::com::sun::star::i18n::NativeNumberXmlAttributes& rAttr, - USHORT nNumFor ) const; + sal_uInt16 nNumFor ) const; /** @returns <TRUE/> if E,EE,R,RR,AAA,AAAA in format code of subformat nNumFor (0..3) and <b>no</b> preceding calendar was specified and the currently loaded calendar is "gregorian". */ - BOOL IsOtherCalendar( USHORT nNumFor ) const + sal_Bool IsOtherCalendar( sal_uInt16 nNumFor ) const { if ( nNumFor < 4 ) return ImpIsOtherCalendar( NumFor[nNumFor] ); - return FALSE; + return sal_False; } /** Switches to the first non-"gregorian" calendar, but only if the current @@ -439,13 +439,13 @@ public: <TRUE/> if a calendar was specified and switched to, <FALSE/> else. */ - BOOL SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, - USHORT nNumFor ) const + sal_Bool SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, + sal_uInt16 nNumFor ) const { if ( nNumFor < 4 ) return ImpSwitchToSpecifiedCalendar( rOrgCalendar, fOrgDateTime, NumFor[nNumFor] ); - return FALSE; + return sal_False; } private: @@ -458,17 +458,17 @@ private: LanguageType eLnge; // Language/country of the format SvNumberformatLimitOps eOp1; // Operator for first condition SvNumberformatLimitOps eOp2; // Operator for second condition - USHORT nNewStandardDefined; // new builtin formats as of version 6 + sal_uInt16 nNewStandardDefined; // new builtin formats as of version 6 short eType; // Type of format - BOOL bStarFlag; // Take *n format as ESC n - BOOL bStandard; // If this is a default standard format - BOOL bIsUsed; // Flag as used for storing + sal_Bool bStarFlag; // Take *n format as ESC n + sal_Bool bStandard; // If this is a default standard format + sal_Bool bIsUsed; // Flag as used for storing - SVL_DLLPRIVATE USHORT ImpGetNumForStringElementCount( USHORT nNumFor ) const; + SVL_DLLPRIVATE sal_uInt16 ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const; - SVL_DLLPRIVATE BOOL ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const; + SVL_DLLPRIVATE sal_Bool ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const; - SVL_DLLPRIVATE BOOL ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, + SVL_DLLPRIVATE sal_Bool ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const; #ifdef _ZFORMAT_CXX // ----- private implementation methods ----- @@ -504,25 +504,25 @@ private: double& fLimit, SvNumberformatLimitOps eOp); - SVL_DLLPRIVATE ULONG ImpGGT(ULONG x, ULONG y); - SVL_DLLPRIVATE ULONG ImpGGTRound(ULONG x, ULONG y); + SVL_DLLPRIVATE sal_uLong ImpGGT(sal_uLong x, sal_uLong y); + SVL_DLLPRIVATE sal_uLong ImpGGTRound(sal_uLong x, sal_uLong y); // Helper function for number strings // append string symbols, insert leading 0 or ' ', or ... - SVL_DLLPRIVATE BOOL ImpNumberFill( String& sStr, + SVL_DLLPRIVATE sal_Bool ImpNumberFill( String& sStr, double& rNumber, xub_StrLen& k, - USHORT& j, - USHORT nIx, + sal_uInt16& j, + sal_uInt16 nIx, short eSymbolType ); // Helper function to fill in the integer part and the group (AKA thousand) separators - SVL_DLLPRIVATE BOOL ImpNumberFillWithThousands( String& sStr, + SVL_DLLPRIVATE sal_Bool ImpNumberFillWithThousands( String& sStr, double& rNumber, xub_StrLen k, - USHORT j, - USHORT nIx, - USHORT nDigCnt ); + sal_uInt16 j, + sal_uInt16 nIx, + sal_uInt16 nDigCnt ); // Hilfsfunktion zum Auffuellen der Vor- // kommazahl auch mit Tausenderpunkt @@ -531,18 +531,18 @@ private: SVL_DLLPRIVATE void ImpDigitFill( String& sStr, xub_StrLen nStart, xub_StrLen& k, - USHORT nIx, + sal_uInt16 nIx, xub_StrLen & nDigitCount, utl::DigitGroupingIterator & ); - SVL_DLLPRIVATE BOOL ImpGetDateOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetDateOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); - SVL_DLLPRIVATE BOOL ImpGetTimeOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetTimeOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); - SVL_DLLPRIVATE BOOL ImpGetDateTimeOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetDateTimeOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); // Switches to the "gregorian" calendar if the current calendar is @@ -550,7 +550,7 @@ private: // know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and // rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was // empty the previous calendar name and date/time are returned. - SVL_DLLPRIVATE BOOL ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ); + SVL_DLLPRIVATE sal_Bool ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ); // Append a "G" short era string of the given calendar. In the case of a // Gengou calendar this is a one character abbreviation, for other @@ -558,8 +558,8 @@ private: SVL_DLLPRIVATE static void ImpAppendEraG( String& OutString, const CalendarWrapper& rCal, sal_Int16 nNatNum ); - SVL_DLLPRIVATE BOOL ImpGetNumberOutput( double fNumber, - USHORT nIx, + SVL_DLLPRIVATE sal_Bool ImpGetNumberOutput( double fNumber, + sal_uInt16 nIx, String& OutString ); SVL_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat ); @@ -567,9 +567,9 @@ private: // normal digits or other digits, depending on ImpSvNumFor.aNatNum, // [NatNum1], [NatNum2], ... SVL_DLLPRIVATE String ImpGetNatNumString( const SvNumberNatNum& rNum, sal_Int32 nVal, - USHORT nMinDigits = 0 ) const; + sal_uInt16 nMinDigits = 0 ) const; - String ImpIntToString( USHORT nIx, sal_Int32 nVal, USHORT nMinDigits = 0 ) const + String ImpIntToString( sal_uInt16 nIx, sal_Int32 nVal, sal_uInt16 nMinDigits = 0 ) const { const SvNumberNatNum& rNum = NumFor[nIx].GetNatNum(); if ( nMinDigits || rNum.IsComplete() ) |