summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-01-05 10:36:18 +0000
committerOliver Bolte <obo@openoffice.org>2005-01-05 10:36:18 +0000
commit12a5cda33bb63e44280bd8e5e8ccd9912177e89a (patch)
treee76bb9bc38ca8309cf748bbea3ec9adefedde036 /xmloff
parent2a0e9b740532d6d805c4ae758285e30d51b44500 (diff)
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
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/impastp4.cxx43
1 files changed, 41 insertions, 2 deletions
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
@@ -169,6 +169,45 @@ void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString&
///////////////////////////////////////////////////////////////////////////////
//
+// Retrieve the list of registered names
+//
+
+void SvXMLAutoStylePoolP_Impl::GetRegisteredNames(
+ uno::Sequence<sal_Int32>& rFamilies,
+ uno::Sequence<OUString>& rNames )
+{
+ // collect registered names + families
+ vector<sal_Int32> aFamilies;
+ vector<OUString> 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
// if not added, yet.
//