diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-07 16:56:51 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-08-08 13:53:07 +0300 |
commit | 016918cf9459eccc177bfedbe75c6296b3b4bb67 (patch) | |
tree | d6966ad5b74e79d8aff54cefb6e34309b671f8df /tools/source | |
parent | 552cc040866bb2d25cf6187c92d9c4acd0db82d8 (diff) |
STL'ify SV_DECL_IMPL_PERSIST_LIST
Converts it to a template based on std::vector
Change-Id: Id7f89f494164c61a3a573cff443ac0e0488e93f1
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 1 | ||||
-rw-r--r-- | tools/source/ref/pstm.cxx | 31 |
2 files changed, 9 insertions, 23 deletions
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 46a36e93fcff..3940c115d1a3 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -22,6 +22,7 @@ #include <tools/inetmime.hxx> #include <tools/inetmsg.hxx> #include <tools/inetstrm.hxx> +#include <tools/list.hxx> #include <rtl/instance.hxx> #include <rtl/strbuf.hxx> #include <comphelper/string.hxx> diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 064a09bd8b35..ecd9e4763b88 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -52,16 +52,13 @@ TYPEINIT0( SvRttiBase ); /****************** SvPersistBaseMemberList ******************************/ -SvPersistBaseMemberList::SvPersistBaseMemberList(){} - #define PERSIST_LIST_VER (sal_uInt8)0 #define PERSIST_LIST_DBGUTIL (sal_uInt8)0x80 /************************************************************************ -|* SvPersistBaseMemberList::WriteOnlyStreamedObjects() +|* WritePersistListObjects() *************************************************************************/ -void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm, - sal_Bool bOnlyStreamed ) const +void TOOLS_DLLPUBLIC WritePersistListObjects(const SvPersistListWriteable& rList, SvPersistStream & rStm, bool bOnlyStreamed ) { #ifdef STOR_NO_OPTIMIZE rStm << (sal_uInt8)(PERSIST_LIST_VER | PERSIST_LIST_DBGUTIL); @@ -70,7 +67,7 @@ void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm, sal_uInt8 bTmp = PERSIST_LIST_VER; rStm << bTmp; #endif - sal_uInt32 nCountMember = Count(); + sal_uInt32 nCountMember = rList.size(); sal_uIntPtr nCountPos = rStm.Tell(); sal_uInt32 nWriteCount = 0; rStm << nCountMember; @@ -78,10 +75,10 @@ void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm, //wegen Seiteneffekten beim Save for( sal_uIntPtr n = 0; n < nCountMember; n++ ) { - SvPersistBase * pObj = GetObject( n ); + SvPersistBase * pObj = rList.GetPersistBase( n ); if( !bOnlyStreamed || rStm.IsStreamed( pObj ) ) { // Objekt soll geschrieben werden - rStm << GetObject( n ); + rStm << pObj; nWriteCount++; } } @@ -99,20 +96,9 @@ void SvPersistBaseMemberList::WriteObjects( SvPersistStream & rStm, } /************************************************************************ -|* operator << () -*************************************************************************/ -SvPersistStream& operator << ( SvPersistStream & rStm, - const SvPersistBaseMemberList & rLst ) -{ - rLst.WriteObjects( rStm ); - return rStm; -} - -/************************************************************************ -|* operator >> () +|* ReadObjects() *************************************************************************/ -SvPersistStream& operator >> ( SvPersistStream & rStm, - SvPersistBaseMemberList & rLst ) +void TOOLS_DLLPUBLIC ReadObjects( SvPersistListReadable& rLst, SvPersistStream & rStm ) { sal_uInt8 nVer; rStm >> nVer; @@ -134,7 +120,7 @@ SvPersistStream& operator >> ( SvPersistStream & rStm, SvPersistBase * pObj; rStm >> pObj; if( pObj ) - rLst.Append( pObj ); + rLst.push_back( pObj ); } #ifdef DBG_UTIL if( nObjLen + nObjPos != rStm.Tell() ) @@ -149,7 +135,6 @@ SvPersistStream& operator >> ( SvPersistStream & rStm, #else (void)nObjLen; #endif - return rStm; } //========================================================================= |