Kaydet (Commit) 382ac86a authored tarafından Joseph Powers's avatar Joseph Powers

Remove the now obsolete XPropertyTable class

XColorTable was the last class using this code and it's now based on
XPropertyList instead.
üst 9914f640
...@@ -186,62 +186,6 @@ public: ...@@ -186,62 +186,6 @@ public:
XOBitmap& GetXBitmap() { return aXOBitmap; } 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 // class XPropertyList
// -------------------- // --------------------
......
...@@ -46,228 +46,6 @@ Color RGB_Color( ColorData nColorName ) ...@@ -46,228 +46,6 @@ Color RGB_Color( ColorData nColorName )
return aRGBColor; 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 // class XPropertyList
// -------------------- // --------------------
......
...@@ -1622,8 +1622,6 @@ XMLTextParagraphExport::FindTextStyle(com::sun::star::uno::Reference<com::sun::s ...@@ -1622,8 +1622,6 @@ XMLTextParagraphExport::FindTextStyle(com::sun::star::uno::Reference<com::sun::s
XMLTextParagraphExport::GetHeadingLevel(rtl::OUString const&) XMLTextParagraphExport::GetHeadingLevel(rtl::OUString const&)
XMLVisAreaContext::XMLVisAreaContext(SvXMLImport&, unsigned short, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, Rectangle&, MapUnit) XMLVisAreaContext::XMLVisAreaContext(SvXMLImport&, unsigned short, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, Rectangle&, MapUnit)
XPropertyList::Clear() XPropertyList::Clear()
XPropertyTable::Clear()
XPropertyTable::GetBitmap(long) const
XSecController::collectToSign(int, rtl::OUString const&) XSecController::collectToSign(int, rtl::OUString const&)
XSecController::getErrorMessage() XSecController::getErrorMessage()
XSecController::setSAXChainConnector(com::sun::star::uno::Reference<com::sun::star::xml::sax::XParser> const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> const&, com::sun::star::uno::Reference<com::sun::star::xml::crypto::sax::XElementStackKeeper> const&) XSecController::setSAXChainConnector(com::sun::star::uno::Reference<com::sun::star::xml::sax::XParser> const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> const&, com::sun::star::uno::Reference<com::sun::star::xml::crypto::sax::XElementStackKeeper> const&)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment