diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-01 10:56:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-01 13:54:51 +0100 |
commit | 7e579295c8c07998d7e077fa7e1db24745726e5f (patch) | |
tree | 5a276e6f17e6094b578b9b6947db9398e7509c65 /xmloff/source/text | |
parent | 3515019f8aabebc6f0037fa2e8f4a271b64e3845 (diff) |
convert SvXMLAutoStylePoolNamesP_Impl to a std::set
Change-Id: I839edf8d0e941f78f6f6f9e6a9117f76587a5f39
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/XMLTextListAutoStylePool.cxx | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index 8becfb762b3e..acf904432c1a 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -46,18 +46,6 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::style; -int XMLTextListAutoStylePoolNameCmp_Impl( const OUString& r1, - const OUString& r2 ) -{ - return (int)r1.compareTo( r2 ); -} - -DECLARE_CONTAINER_SORT_DEL( XMLTextListAutoStylePoolNames_Impl, - OUString ) -IMPL_CONTAINER_SORT( XMLTextListAutoStylePoolNames_Impl, - OUString, - XMLTextListAutoStylePoolNameCmp_Impl ) - class XMLTextListAutoStylePoolEntry_Impl { OUString sName; @@ -132,7 +120,7 @@ XMLTextListAutoStylePoolEntry_Impl::XMLTextListAutoStylePoolEntry_Impl( sBuffer.append( (sal_Int32)rName ); sName = sBuffer.makeStringAndClear(); } - while( rNames.Seek_Entry( &sName, 0 ) ); + while (rNames.find(sName) != rNames.end()); } int XMLTextListAutoStylePoolEntryCmp_Impl( @@ -169,7 +157,6 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) : rExport( rExp ), sPrefix( RTL_CONSTASCII_USTRINGPARAM("L") ), pPool( new XMLTextListAutoStylePool_Impl( 5, 5 ) ), - pNames( new XMLTextListAutoStylePoolNames_Impl( 5, 5 ) ), nName( 0 ) { Reference<ucb::XAnyCompareFactory> xCompareFac( rExp.GetModel(), uno::UNO_QUERY ); @@ -189,18 +176,11 @@ XMLTextListAutoStylePool::~XMLTextListAutoStylePool() while ( nCount-- ) delete pPool->Remove(nCount); delete pPool; - - nCount = pNames->Count(); - while ( nCount-- ) - delete pNames->Remove(nCount); - delete pNames; } void XMLTextListAutoStylePool::RegisterName( const OUString& rName ) { - OUString *pName = new OUString( rName ); - if( !pNames->Insert( pName ) ) - delete pName; + m_aNames.insert(rName); } sal_uInt32 XMLTextListAutoStylePool::Find( XMLTextListAutoStylePoolEntry_Impl* pEntry ) const @@ -244,7 +224,7 @@ OUString XMLTextListAutoStylePool::Add( { XMLTextListAutoStylePoolEntry_Impl *pEntry = new XMLTextListAutoStylePoolEntry_Impl( pPool->Count(), - rNumRules, *pNames, sPrefix, + rNumRules, m_aNames, sPrefix, nName ); pPool->Insert( pEntry ); sName = pEntry->GetName(); |