Kaydet (Commit) c3669975 authored tarafından Rafael Dominguez's avatar Rafael Dominguez Kaydeden (comit) Petr Mladek

Replace List for std::vector<ExcRecord*>.

üst f642d233
...@@ -182,15 +182,15 @@ sal_Size ExcEmptyRec::GetLen() const ...@@ -182,15 +182,15 @@ sal_Size ExcEmptyRec::GetLen() const
ExcRecordList::~ExcRecordList() ExcRecordList::~ExcRecordList()
{ {
for( ExcRecord* pRec = First(); pRec; pRec = Next() ) for (iterator pIter = maRecords.begin(); pIter != maRecords.end(); ++pIter)
delete pRec; delete (*pIter);
} }
void ExcRecordList::Save( XclExpStream& rStrm ) void ExcRecordList::Save( XclExpStream& rStrm )
{ {
for( ExcRecord* pRec = First(); pRec; pRec = Next() ) for (iterator pIter = maRecords.begin(); pIter != maRecords.end(); ++pIter)
pRec->Save( rStrm ); (*pIter)->Save( rStrm );
} }
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
class SvStream; class SvStream;
class Font; class Font;
class List;
class ScPatternAttr; class ScPatternAttr;
class ScTokenArray; class ScTokenArray;
class ScRangeData; class ScRangeData;
...@@ -101,20 +100,18 @@ public: ...@@ -101,20 +100,18 @@ public:
//------------------------------------------------------- class ExcRecordList - //------------------------------------------------------- class ExcRecordList -
class ExcRecordList : protected List, public ExcEmptyRec class ExcRecordList : public ExcEmptyRec
{ {
private: private:
protected: std::vector<ExcRecord*> maRecords;
public: public:
virtual ~ExcRecordList();
using List::Count; typedef std::vector<ExcRecord*>::iterator iterator;
inline ExcRecord* First( void ) { return ( ExcRecord* ) List::First(); } virtual ~ExcRecordList();
inline ExcRecord* Next( void ) { return ( ExcRecord* ) List::Next(); }
inline void Append( ExcRecord* pNew ) { if( pNew ) List::Insert( pNew, LIST_APPEND ); } inline void Append( ExcRecord* pNew ) { if( pNew ) maRecords.push_back( pNew ); }
inline const ExcRecord* Get( sal_uInt32 nNum ) const { return ( ExcRecord* ) List::GetObject( nNum ); }
virtual void Save( XclExpStream& rStrm ); virtual void Save( XclExpStream& rStrm );
}; };
......
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