summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2011-02-27 21:35:16 -0800
committerJoseph Powers <jpowers27@cox.net>2011-02-27 21:35:16 -0800
commitb091c9f867b87d085c0353f61b8f03fa7e6cbd2b (patch)
treee563ff700b391a17a6e170a440104a774c6bf99e /idl
parentcfc854af6e640efbda1a1f135a81bc5444a814a0 (diff)
PATCH 1/2] Remove SvULongs and replace it with std::vector<ULONG>
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/object.hxx10
-rw-r--r--idl/source/objects/object.cxx17
2 files changed, 8 insertions, 19 deletions
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 84965e1cc768..417885184dfb 100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -49,14 +49,6 @@ DECLARE_LIST( SvSlotElementList, SvSlotElement* )
class SvMetaClass;
typedef ::std::vector< SvMetaClass* > SvMetaClassList;
-class SvULongs : public List
-{
-public:
- void Insert( ULONG& rId, ULONG nPos ) { ULONG nId(rId ); List::Insert( (void*) nId, nPos ); }
- void Remove( ULONG& rId ){ ULONG nId(rId ); List::Remove( (void*) nId ); }
- ULONG GetObject( ULONG nPos ){ return (ULONG) List::GetObject( nPos ); }
-};
-
SV_DECL_REF(SvMetaClass)
class SvClassElement : public SvPersistBase
{
@@ -111,7 +103,7 @@ class SvMetaClass : public SvMetaType
SvIdlDataBase & rBase,
SvStream & rOutStm );
- void InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
+ void InsertSlots( SvSlotElementList& rList, std::vector<ULONG>& rSuperList,
SvMetaClassList & rClassList,
const ByteString & rPrefix, SvIdlDataBase& rBase );
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 92f8b7445d02..0cb39c367122 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -472,7 +472,7 @@ USHORT SvMetaClass::WriteSlots( const ByteString & rShellName,
return nSCount;
}
-void SvMetaClass::InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
+void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<ULONG>& rSuperList,
SvMetaClassList &rClassList,
const ByteString & rPrefix, SvIdlDataBase& rBase)
{
@@ -490,18 +490,15 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
SvMetaAttribute * pAttr = aAttrList.GetObject( n );
ULONG nId = pAttr->GetSlotId().GetValue();
- USHORT nPos;
- for ( nPos=0; nPos < rSuperList.Count(); nPos++ )
- {
- if ( rSuperList.GetObject(nPos) == nId )
- break;
- }
- if( nPos == rSuperList.Count() )
+ std::vector<ULONG>::iterator iter = std::find(rSuperList.begin(),
+ rSuperList.end(),nId);
+
+ if( iter == rSuperList.end() )
{
// Write only if not already written by subclass or
// imported interface.
- rSuperList.Insert( nId, nPos );
+ rSuperList.push_back(nId);
pAttr->Insert(rList, rPrefix, rBase);
}
}
@@ -591,7 +588,7 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
rOutStm << "SFX_ARGUMENTMAP(" << GetName().GetBuffer() << ')' << endl
<< '{' << endl;
- SvULongs aSuperList;
+ std::vector<ULONG> aSuperList;
SvMetaClassList classList;
SvSlotElementList aSlotList;
InsertSlots(aSlotList, aSuperList, classList, ByteString(), rBase);