diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-01-07 19:56:15 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-01-07 19:56:15 -0800 |
commit | ed0151aff248fa609847820d7ef9edd2a5273406 (patch) | |
tree | 468f876d702c504dc5fb767e4b19f696f997534a /xmloff | |
parent | 20c7bb186b1750dd8833f350a942b6762dc29cb1 (diff) |
Remove DECLARE_LIST( SvXMLAutoStylePoolCache_Impl, OUStringPtr )
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/impastp1.cxx | 21 | ||||
-rw-r--r-- | xmloff/source/style/impastp4.cxx | 21 | ||||
-rw-r--r-- | xmloff/source/style/impastpl.hxx | 9 |
3 files changed, 26 insertions, 25 deletions
diff --git a/xmloff/source/style/impastp1.cxx b/xmloff/source/style/impastp1.cxx index 0b72276687..20e246433f 100644 --- a/xmloff/source/style/impastp1.cxx +++ b/xmloff/source/style/impastp1.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,7 +51,7 @@ XMLFamilyData_Impl::XMLFamilyData_Impl( sal_Bool bAsFam ) : pCache( 0 ), mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ), mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), bAsFamily( bAsFam ) - + { mpParentList = new SvXMLAutoStylePoolParentsP_Impl( 5, 5 ); mpNameList = new SvXMLAutoStylePoolNamesP_Impl( 5, 5 ); @@ -61,12 +61,13 @@ XMLFamilyData_Impl::~XMLFamilyData_Impl() { if( mpParentList ) delete mpParentList; if( mpNameList ) delete mpNameList; - DBG_ASSERT( !pCache || !pCache->Count(), - "auto style pool cache is not empty!" ); + DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" ); if( pCache ) { - while( pCache->Count() ) - delete pCache->Remove( 0UL ); + for ( size_t i = 0, n = pCache->size(); i < n; ++i ) + delete (*pCache)[ i ]; + pCache->clear(); + delete pCache; } } @@ -75,12 +76,12 @@ void XMLFamilyData_Impl::ClearEntries() if( mpParentList ) delete mpParentList; mpParentList = new SvXMLAutoStylePoolParentsP_Impl( 5, 5 ); - DBG_ASSERT( !pCache || !pCache->Count(), - "auto style pool cache is not empty!" ); + DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" ); if( pCache ) { - while( pCache->Count() ) - delete pCache->Remove( 0UL ); + for ( size_t i = 0, n = pCache->size(); i < n; ++i ) + delete (*pCache)[ i ]; + pCache->clear(); } } diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 0ae9397612..9aea30d8e3 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -221,10 +221,9 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily, if( bCache ) { if( !pFamily->pCache ) - pFamily->pCache = new SvXMLAutoStylePoolCache_Impl( 256, 256 ); - if( pFamily->pCache->Count() < MAX_CACHE_SIZE ) - pFamily->pCache->Insert( new OUString( rName ), - pFamily->pCache->Count() ); + pFamily->pCache = new SvXMLAutoStylePoolCache_Impl(); + if( pFamily->pCache->size() < MAX_CACHE_SIZE ) + pFamily->pCache->push_back( new OUString( rName ) ); } } @@ -288,10 +287,9 @@ OUString SvXMLAutoStylePoolP_Impl::AddToCache( sal_Int32 nFamily, if( pFamily ) { if( !pFamily->pCache ) - pFamily->pCache = new SvXMLAutoStylePoolCache_Impl( 256, 256 ); - if( pFamily->pCache->Count() < MAX_CACHE_SIZE ) - pFamily->pCache->Insert( new OUString( rParent ), - pFamily->pCache->Count() ); + pFamily->pCache = new SvXMLAutoStylePoolCache_Impl(); + if( pFamily->pCache->size() < MAX_CACHE_SIZE ) + pFamily->pCache->push_back( new OUString( rParent ) ); } return rParent; @@ -350,9 +348,10 @@ OUString SvXMLAutoStylePoolP_Impl::FindAndRemoveCached( sal_Int32 nFamily ) cons // The cache may be empty already. This happens if it was filled // completly. - if( pFamily->pCache && pFamily->pCache->Count() ) + if( pFamily->pCache && !pFamily->pCache->empty() ) { - OUString *pName = pFamily->pCache->Remove( 0UL ); + OUString *pName = (*pFamily->pCache)[ 0 ]; + pFamily->pCache->erase( pFamily->pCache->begin() ); sName = *pName; delete pName; } diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index e22bb895f4..5d391de9bb 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,6 +39,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <xmloff/maptype.hxx> #include <xmloff/xmlexppr.hxx> +#include <vector> class SvXMLAutoStylePoolP; class SvXMLAutoStylePoolParentsP_Impl; @@ -54,8 +55,8 @@ class SvXMLExport; // Implementationclass for stylefamily-information // -typedef ::rtl::OUString *OUStringPtr; -DECLARE_LIST( SvXMLAutoStylePoolCache_Impl, OUStringPtr ) +typedef ::rtl::OUString* OUStringPtr; +typedef ::std::vector< OUStringPtr > SvXMLAutoStylePoolCache_Impl; class XMLFamilyData_Impl { @@ -81,7 +82,7 @@ public: pCache( 0 ), mnFamily( nFamily ), mpParentList( NULL ), mpNameList( NULL ), mnCount( 0 ), mnName( 0 ) - + {} ~XMLFamilyData_Impl(); |