diff options
author | Daniel Rentz <dr@openoffice.org> | 2000-10-19 04:32:52 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2000-10-19 04:32:52 +0000 |
commit | 1716bff44744aacfb5ecec9b6894d16a4eee1b39 (patch) | |
tree | f2182029ac62274cb8c7025799de28f1641985e6 /xmloff | |
parent | ac4e357e295b4ef8c43386210d26bd7ce03c3afb (diff) |
add: names of page-master-name in master pages
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/XMLPageExport.cxx | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index e37b376334ff..49735476d723 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLPageExport.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2000-10-18 11:32:20 $ + * last change: $Author: dr $ $Date: 2000-10-19 05:32:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,19 +112,35 @@ using namespace ::com::sun::star::style; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; -void XMLPageExport::collectPageMasterAutoStyle( - const Reference < XPropertySet > & rPropSet ) + +//______________________________________________________________________________ + +sal_Bool XMLPageExport::findPageMasterName( const OUString& rStyleName, OUString& rPMName ) const { - std::vector<XMLPropertyState> xPropStates = rExport.GetPageMasterPropSetMapper()->Filter( rPropSet ); - if(xPropStates.size()) + for( ::std::vector< XMLPageExportNameEntry >::const_iterator pEntry = aNameVector.begin(); + pEntry != aNameVector.end(); pEntry++ ) { - rtl::OUString sParent; - rtl::OUString sName( rExport.GetAutoStylePool()->Find( XML_STYLE_FAMILY_PAGE_MASTER, sParent, xPropStates) ); - if (!sName.getLength()) + if( pEntry->sStyleName == rStyleName ) { - sName = rExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_PAGE_MASTER, sParent, xPropStates); + rPMName = pEntry->sPageMasterName; + return sal_True; } } + return sal_False; +} + +void XMLPageExport::collectPageMasterAutoStyle( + const Reference < XPropertySet > & rPropSet, + OUString& rPageMasterName ) +{ + ::std::vector<XMLPropertyState> xPropStates = rExport.GetPageMasterPropSetMapper()->Filter( rPropSet ); + if(xPropStates.size()) + { + OUString sParent; + rPageMasterName = rExport.GetAutoStylePool()->Find( XML_STYLE_FAMILY_PAGE_MASTER, sParent, xPropStates ); + if (!rPageMasterName.getLength()) + rPageMasterName = rExport.GetAutoStylePool()->Add(XML_STYLE_FAMILY_PAGE_MASTER, sParent, xPropStates); + } } void XMLPageExport::exportMasterPageContent( @@ -154,7 +170,11 @@ sal_Bool XMLPageExport::exportStyle( if( bAutoStyles ) { - collectPageMasterAutoStyle( xPropSet ); + XMLPageExportNameEntry aEntry; + collectPageMasterAutoStyle( xPropSet, aEntry.sPageMasterName ); + aEntry.sStyleName = rStyle->getName(); + aNameVector.push_back( aEntry ); + exportMasterPageContent( xPropSet, sal_True ); } else @@ -162,6 +182,10 @@ sal_Bool XMLPageExport::exportStyle( OUString sName( rStyle->getName() ); GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_name, sName ); + OUString sPMName; + if( findPageMasterName( sName, sPMName ) ) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_page_master_name, sPMName ); + aAny = xPropSet->getPropertyValue( sFollowStyle ); OUString sNextName; aAny >>= sNextName; |