diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-06-02 16:30:44 -0430 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-06-07 21:25:22 +0200 |
commit | 3c0cbc029db7d5b2989ac93086d0ca639b2f9cb0 (patch) | |
tree | 72b6a406b22cb172ae826eac021c639bd0f0fc28 /sc/source/filter/xcl97 | |
parent | 51d962e3dc34a774b466265adc9678aa00cb2c78 (diff) |
Replace List for std::vector<ExcEScenario*>.
Diffstat (limited to 'sc/source/filter/xcl97')
-rw-r--r-- | sc/source/filter/xcl97/xcl97rec.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 4c61797e43c3..20d679ab793c 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1328,7 +1328,7 @@ ExcEScenarioManager::ExcEScenarioManager( const XclExpRoot& rRoot, SCTAB nTab ) while( rDoc.IsScenario( nNewTab ) ) { - Append( new ExcEScenario( rRoot, nNewTab ) ); + aScenes.push_back( new ExcEScenario( rRoot, nNewTab ) ); if( rDoc.IsActiveScenario( nNewTab ) ) nActive = static_cast<sal_uInt16>(nNewTab - nFirstTab); @@ -1338,30 +1338,32 @@ ExcEScenarioManager::ExcEScenarioManager( const XclExpRoot& rRoot, SCTAB nTab ) ExcEScenarioManager::~ExcEScenarioManager() { - for( ExcEScenario* pScen = _First(); pScen; pScen = _Next() ) - delete pScen; + std::vector<ExcEScenario*>::iterator pIter; + for( pIter = aScenes.begin(); pIter != aScenes.end(); ++pIter ) + delete *pIter; } void ExcEScenarioManager::SaveCont( XclExpStream& rStrm ) { - rStrm << (sal_uInt16) List::Count() // number of scenarios + rStrm << (sal_uInt16) aScenes.size() // number of scenarios << nActive // active scen << nActive // last displayed - << (sal_uInt16) 0; // reference areas + << (sal_uInt16) 0; // reference areas } void ExcEScenarioManager::Save( XclExpStream& rStrm ) { - if( List::Count() ) + if( !aScenes.empty() ) ExcRecord::Save( rStrm ); - for( ExcEScenario* pScen = _First(); pScen; pScen = _Next() ) - pScen->Save( rStrm ); + std::vector<ExcEScenario*>::iterator pIter; + for( pIter = aScenes.begin(); pIter != aScenes.end(); ++pIter ) + (*pIter)->Save( rStrm ); } void ExcEScenarioManager::SaveXml( XclExpXmlStream& rStrm ) { - if( ! List::Count() ) + if( aScenes.empty() ) return; sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream(); @@ -1371,8 +1373,9 @@ void ExcEScenarioManager::SaveXml( XclExpXmlStream& rStrm ) // OOXTODO: XML_sqref, FSEND ); - for( ExcEScenario* pScen = _First(); pScen; pScen = _Next() ) - pScen->SaveXml( rStrm ); + std::vector<ExcEScenario*>::iterator pIter; + for( pIter = aScenes.begin(); pIter != aScenes.end(); ++pIter ) + (*pIter)->SaveXml( rStrm ); rWorkbook->endElement( XML_scenarios ); } |