diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-08-29 07:48:25 -0700 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-08-29 20:27:24 -0700 |
commit | 382ac86a3ab9ba105aa3e469566b7cd86c6ca39f (patch) | |
tree | a7c56e228d81363cd6f0984f81ec04f6fa17f969 /svx | |
parent | 9914f6402909edbe5ce461307f4d26bcd864eacc (diff) |
Remove the now obsolete XPropertyTable class
XColorTable was the last class using this code and it's now based on
XPropertyList instead.
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/xtable.hxx | 56 | ||||
-rw-r--r-- | svx/source/xoutdev/xtable.cxx | 222 |
2 files changed, 0 insertions, 278 deletions
diff --git a/svx/inc/svx/xtable.hxx b/svx/inc/svx/xtable.hxx index 26306346f2ff..8635bff1b7d7 100644 --- a/svx/inc/svx/xtable.hxx +++ b/svx/inc/svx/xtable.hxx @@ -186,62 +186,6 @@ public: XOBitmap& GetXBitmap() { return aXOBitmap; } }; -// --------------------- -// class XPropertyTable -// --------------------- - -class SVX_DLLPUBLIC XPropertyTable -{ -protected: - String aName; // nicht persistent ! - String aPath; - XOutdevItemPool* pXPool; - - Table aTable; - Table* pBmpTable; - - sal_Bool bTableDirty; - sal_Bool bBitmapsDirty; - sal_Bool bOwnPool; - - XPropertyTable( - const String& rPath, - XOutdevItemPool* pXPool = NULL, - sal_uInt16 nInitSize = 16, - sal_uInt16 nReSize = 16 - ); - void Clear(); - -public: - virtual ~XPropertyTable(); - - long Count() const; - - sal_Bool Insert(long nIndex, XPropertyEntry* pEntry); - XPropertyEntry* Replace(long nIndex, XPropertyEntry* pEntry); - XPropertyEntry* Remove(long nIndex); - - // Note: Get(long) & Get( String& ) are ambiguous - XPropertyEntry* Get( long nIndex, sal_uInt16 nDummy ) const; - long Get(const String& rName); - - Bitmap* GetBitmap( long nIndex ) const; - - const String& GetName() const { return aName; } - void SetName( const String& rString ); - const String& GetPath() const { return aPath; } - void SetPath( const String& rString ) { aPath = rString; } - sal_Bool IsDirty() const { return bTableDirty && bBitmapsDirty; } - void SetDirty( sal_Bool bDirty = sal_True ) - { bTableDirty = bDirty; bBitmapsDirty = bDirty; } - - virtual sal_Bool Load() = 0; - virtual sal_Bool Save() = 0; - virtual sal_Bool Create() = 0; - virtual sal_Bool CreateBitmapsForUI() = 0; - virtual Bitmap* CreateBitmapForUI( long nIndex, sal_Bool bDelete = sal_True ) = 0; -}; - // -------------------- // class XPropertyList // -------------------- diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index b34cf777edb5..a5630433b050 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -46,228 +46,6 @@ Color RGB_Color( ColorData nColorName ) return aRGBColor; } -// --------------------- -// class XPropertyTable -// --------------------- - -/************************************************************************* -|* -|* XPropertyTable::XPropertyTable() -|* -*************************************************************************/ - -XPropertyTable::XPropertyTable( - const String& rPath, - XOutdevItemPool* pInPool, - sal_uInt16 nInitSize, - sal_uInt16 nReSize -) : aName ( pszStandard, 8 ) - , aPath ( rPath ) - , pXPool ( pInPool ) - , aTable ( nInitSize, nReSize ) - , pBmpTable ( NULL ) - , bTableDirty ( sal_True ) - , bBitmapsDirty ( sal_True ) - , bOwnPool ( sal_False ) -{ - if( !pXPool ) - { - bOwnPool = sal_True; - pXPool = new XOutdevItemPool; - DBG_ASSERT( pXPool, "XOutPool konnte nicht erzeugt werden!" ); - } -} - -/************************************************************************* -|* -|* XPropertyTable::~XPropertyTable() -|* -*************************************************************************/ - -XPropertyTable::~XPropertyTable() -{ - XPropertyEntry* pEntry = (XPropertyEntry*)aTable.First(); - Bitmap* pBitmap = NULL; - for (sal_uIntPtr nIndex = 0; nIndex < aTable.Count(); nIndex++) - { - delete pEntry; - pEntry = (XPropertyEntry*)aTable.Next(); - } - // Hier wird die Bitmaptabelle geloescht - if( pBmpTable ) - { - pBitmap = (Bitmap*) pBmpTable->First(); - - for( sal_uIntPtr nIndex = 0; nIndex < pBmpTable->Count(); nIndex++ ) - { - delete pBitmap; - pBitmap = (Bitmap*) pBmpTable->Next(); - } - delete pBmpTable; - pBmpTable = NULL; - } - // Eigener Pool wird geloescht - if( bOwnPool && pXPool ) - { - SfxItemPool::Free(pXPool); - } -} - -/************************************************************************* -|* -|* XPropertyTable::Clear() -|* -*************************************************************************/ - -void XPropertyTable::Clear() -{ - aTable.Clear(); - if( pBmpTable ) - pBmpTable->Clear(); -} - -/************************************************************************/ - -long XPropertyTable::Count() const -{ - if( bTableDirty ) - { - // ( (XPropertyTable*) this )->bTableDirty = sal_False; <- im Load() - if( !( (XPropertyTable*) this )->Load() ) - ( (XPropertyTable*) this )->Create(); - } - return( aTable.Count() ); -} - -/************************************************************************* -|* -|* XPropertyEntry* XPropertyTable::Get() -|* -*************************************************************************/ - -XPropertyEntry* XPropertyTable::Get( long nIndex, sal_uInt16 /*nDummy*/) const -{ - if( bTableDirty ) - { - // ( (XPropertyTable*) this )->bTableDirty = sal_False; <- im Load() - if( !( (XPropertyTable*) this )->Load() ) - ( (XPropertyTable*) this )->Create(); - } - return (XPropertyEntry*) aTable.GetObject( (sal_uIntPtr) nIndex ); -} - -/************************************************************************* -|* -|* long XPropertyTable::Get(const String& rName) -|* -*************************************************************************/ - -long XPropertyTable::Get(const XubString& rName) -{ - if( bTableDirty ) - { - // bTableDirty = sal_False; - if( !Load() ) - Create(); - } - long nPos = 0; - XPropertyEntry* pEntry = (XPropertyEntry*)aTable.First(); - while (pEntry && pEntry->GetName() != rName) - { - nPos++; - pEntry = (XPropertyEntry*)aTable.Next(); - } - if (!pEntry) nPos = -1; - return nPos; -} - -/************************************************************************* -|* -|* Bitmap* XPropertyTable::GetBitmap() -|* -*************************************************************************/ - -Bitmap* XPropertyTable::GetBitmap( long nIndex ) const -{ - if( pBmpTable ) - { - if( bBitmapsDirty ) - { - ( (XPropertyTable*) this )->bBitmapsDirty = sal_False; - ( (XPropertyTable*) this )->CreateBitmapsForUI(); - } - - if( pBmpTable->Count() >= (sal_uIntPtr) nIndex ) - return (Bitmap*) pBmpTable->GetObject( (sal_uIntPtr) nIndex ); - } - return( NULL ); -} - -/************************************************************************* -|* -|* void XPropertyTable::Insert() -|* -*************************************************************************/ - -sal_Bool XPropertyTable::Insert( long nIndex, XPropertyEntry* pEntry ) -{ - sal_Bool bReturn = aTable.Insert( (sal_uIntPtr) nIndex, pEntry ); - - if( pBmpTable && !bBitmapsDirty ) - { - Bitmap* pBmp = CreateBitmapForUI( (sal_uIntPtr) nIndex ); - pBmpTable->Insert( (sal_uIntPtr) nIndex, pBmp ); - } - return bReturn; -} - -/************************************************************************* -|* -|* void XPropertyTable::Replace() -|* -*************************************************************************/ - -XPropertyEntry* XPropertyTable::Replace( long nIndex, XPropertyEntry* pEntry ) -{ - XPropertyEntry* pOldEntry = (XPropertyEntry*) aTable.Replace( (sal_uIntPtr) nIndex, pEntry ); - - if( pBmpTable && !bBitmapsDirty ) - { - Bitmap* pBmp = CreateBitmapForUI( (sal_uIntPtr) nIndex ); - Bitmap* pOldBmp = (Bitmap*) pBmpTable->Replace( (sal_uIntPtr) nIndex, pBmp ); - if( pOldBmp ) - delete pOldBmp; - } - return pOldEntry; -} - -/************************************************************************* -|* -|* void XPropertyTable::Remove() -|* -*************************************************************************/ - -XPropertyEntry* XPropertyTable::Remove( long nIndex ) -{ - if( pBmpTable && !bBitmapsDirty ) - { - Bitmap* pOldBmp = (Bitmap*) pBmpTable->Remove( (sal_uIntPtr) nIndex ); - if( pOldBmp ) - delete pOldBmp; - } - return (XPropertyEntry*) aTable.Remove((sal_uIntPtr)nIndex); -} - -/************************************************************************/ - -void XPropertyTable::SetName( const String& rString ) -{ - if(rString.Len()) - { - aName = rString; - } -} - // -------------------- // class XPropertyList // -------------------- |