summaryrefslogtreecommitdiff
path: root/tools/source/ref
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-03-08 13:36:58 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-03-08 13:54:39 +0200
commite36a9a64f14581b2c7d567d17a72be6d3ea8dccc (patch)
tree7f74a33b0d16087c95d0101b96d6eae4fe8a37ab /tools/source/ref
parent14ca52086ba3cdba0f767f69f9de9fa5fb9e5668 (diff)
Convert tools/table.hxx to std::map
Convert usage of tools/table.hxx to std::map in aPTable field of SvPersistStream class.
Diffstat (limited to 'tools/source/ref')
-rw-r--r--tools/source/ref/pstm.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 4c95a6fa6445..cba50700c7be 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -315,10 +315,15 @@ void SvPersistStream::FlushData()
*************************************************************************/
sal_uIntPtr SvPersistStream::GetIndex( SvPersistBase * pObj ) const
{
- sal_uIntPtr nId = (sal_uIntPtr)aPTable.Get( (sal_uIntPtr)pObj );
- if( !nId && pRefStm )
- return pRefStm->GetIndex( pObj );
- return nId;
+ PersistBaseMap::const_iterator it = aPTable.find( pObj );
+ if( it == aPTable.end() )
+ {
+ if ( pRefStm )
+ return pRefStm->GetIndex( pObj );
+ else
+ return 0;
+ }
+ return it->second;
}
/*************************************************************************
@@ -653,7 +658,7 @@ SvPersistStream& SvPersistStream::WritePointer
else
{
nId = aPUIdx.Insert( pObj );
- aPTable.Insert( (sal_uIntPtr)pObj, (void *)nId );
+ aPTable[ pObj ] = nId;
nP |= P_OBJ;
}
WriteId( *this, nP, nId, pObj->GetClassId() );
@@ -722,7 +727,7 @@ sal_uInt32 SvPersistStream::ReadObj
// unbedingt erst in Tabelle eintragen
sal_uIntPtr nNewId = aPUIdx.Insert( rpObj );
// um den gleichen Zustand, wie nach dem Speichern herzustellen
- aPTable.Insert( (sal_uIntPtr)rpObj, (void *)nNewId );
+ aPTable[ rpObj ] = nNewId;
DBG_ASSERT( !(nHdr & P_DBGUTIL) || nId == nNewId,
"read write id conflict: not the same" );
}
@@ -835,7 +840,7 @@ SvStream& operator >>
// Die Id eines Objektes wird nie modifiziert
rThis.aPUIdx.Insert( nId, pEle );
- rThis.aPTable.Insert( (sal_uIntPtr)pEle, (void *)nId );
+ rThis.aPTable[ pEle ] = nId;
}
}
else