summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2010-12-28 21:50:36 -0800
committerJoseph Powers <jpowers27@cox.net>2010-12-31 06:57:20 -0800
commit0e5c03764b8433cc0454aaa0058eef5e1e063031 (patch)
tree31e90689273c61ee58427615ca51a0829641ae73 /idl
parent3d23bcf8ae7645cd9752cbb66fb046e4b0913107 (diff)
Remove DECLARE_LIST(SvStringHashList,SvStringHashEntry *)
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/hash.hxx7
-rw-r--r--idl/source/cmptools/hash.cxx12
-rw-r--r--idl/source/prj/database.cxx5
3 files changed, 6 insertions, 18 deletions
diff --git a/idl/inc/hash.hxx b/idl/inc/hash.hxx
index 340b00c63522..8f13536265ce 100644
--- a/idl/inc/hash.hxx
+++ b/idl/inc/hash.hxx
@@ -29,10 +29,9 @@
#ifndef _HASH_HXX
#define _HASH_HXX
-
-
#include <tools/ref.hxx>
#include <tools/string.hxx>
+#include <vector>
/****************** H a s h - T a b l e **********************************/
class SvHashTable
@@ -99,11 +98,11 @@ public:
SV_DECL_IMPL_REF(SvStringHashEntry)
/****************** S t r i n g H a s h T a b l e ************************/
-DECLARE_LIST(SvStringHashList,SvStringHashEntry *)
+typedef ::std::vector< SvStringHashEntry* > SvStringHashList;
class SvStringHashTable : public SvHashTable
{
- SvStringHashEntry * pEntries;
+ SvStringHashEntry* pEntries;
protected:
virtual UINT32 HashFunc( const void * pElement ) const;
virtual StringCompare Compare( const void * pElement, UINT32 nIndex ) const;
diff --git a/idl/source/cmptools/hash.cxx b/idl/source/cmptools/hash.cxx
index f03e8e1133bb..b8a6d0464fa1 100644
--- a/idl/source/cmptools/hash.cxx
+++ b/idl/source/cmptools/hash.cxx
@@ -101,9 +101,6 @@ BOOL SvHashTable::Test_Insert( const void * pElement, BOOL bInsert,
nHash = HashFunc( pElement );
nIndex = nHash % nMax;
-// const char* s = ((ByteString*) pElement)->GetStr();
-// fprintf(stderr,"### Hash: %lu , Name: %s\n",nIndex,s );
-
nLoop = 0; // divide to range
while( (nMax != nLoop) && IsEntry( nIndex ) )
{ // is place occupied
@@ -180,14 +177,7 @@ SvStringHashTable::~SvStringHashTable()
}
#endif
-#ifdef MPW
- // der MPW-Compiler ruft sonst keine Dtoren!
- for ( USHORT n = 0; n < GetMax(); ++n )
- (pEntries+n)->SvStringHashEntry::~SvStringHashEntry();
- delete (void*) pEntries;
-#else
delete [] pEntries;
-#endif
}
/*************************************************************************
@@ -326,7 +316,7 @@ void SvStringHashTable::FillHashList( SvStringHashList * pList ) const
for( UINT32 n = 0; n < GetMax(); n++ )
{
if( IsEntry( n ) )
- pList->Insert( Get( n ), LIST_APPEND );
+ pList->push_back( Get( n ) );
}
// Hash Reihenfolge, jetzt sortieren
}
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 859f84d4d050..729fedaa3d83 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -852,15 +852,14 @@ BOOL SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm )
if( GetIdTable() )
{
GetIdTable()->FillHashList( &aList );
- SvStringHashEntry * pEntry = aList.First();
- while( pEntry )
+ for ( size_t i = 0, n = aList.size(); i < n; ++i )
{
+ SvStringHashEntry* pEntry = aList[ i ];
rOutStm << "#define " << pEntry->GetName().GetBuffer()
<< '\t'
<< ByteString::CreateFromInt64(
pEntry->GetValue() ).GetBuffer()
<< endl;
- pEntry = aList.Next();
}
}