From 12a5cda33bb63e44280bd8e5e8ccd9912177e89a Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Wed, 5 Jan 2005 10:36:18 +0000 Subject: INTEGRATION: CWS swqcore02 (1.13.104); FILE MERGED 2004/11/24 16:00:29 dvo 1.13.104.1: #i30054# prevent name-collision of styles and automatic-styles in storage format --- xmloff/source/style/impastp4.cxx | 43 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index cb046f0a55bd..0bc6f99f0053 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: impastp4.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: rt $ $Date: 2004-07-13 08:23:58 $ + * last change: $Author: obo $ $Date: 2005-01-05 11:36:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -167,6 +167,45 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& } } +/////////////////////////////////////////////////////////////////////////////// +// +// Retrieve the list of registered names +// + +void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( + uno::Sequence& rFamilies, + uno::Sequence& rNames ) +{ + // collect registered names + families + vector aFamilies; + vector aNames; + + // iterate over families + sal_uInt32 nCount = maFamilyList.Count(); + for( sal_uInt32 i = 0; i < nCount; i++ ) + { + XMLFamilyData_Impl* pFamily = maFamilyList.GetObject( i ); + + // iterate over names + SvXMLAutoStylePoolNamesP_Impl* pNames = pFamily->mpNameList; + sal_uInt32 nNames = ( pNames != NULL ) ? pNames->Count() : 0; + for( sal_uInt32 j = 0; j < nNames; j++ ) + { + aFamilies.push_back( pFamily->mnFamily ); + aNames.push_back( *pNames->GetObject( j ) ); + } + } + + // copy the families + names into the sequence types + DBG_ASSERT( aFamilies.size() == aNames.size(), "families != names" ); + + rFamilies.realloc( aFamilies.size() ); + std::copy( aFamilies.begin(), aFamilies.end(), rFamilies.getArray() ); + + rNames.realloc( aNames.size() ); + std::copy( aNames.begin(), aNames.end(), rNames.getArray() ); +} + /////////////////////////////////////////////////////////////////////////////// // // Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list -- cgit