diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-11-03 15:41:34 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-11-03 15:41:34 +0000 |
commit | 68e912bae2568e9186f69db45d8b2bbc82c0c781 (patch) | |
tree | 7b8069b9c83851184b9523b33c30229297d7848b | |
parent | 74d0d55d870bf72709e8a59192bba464c92cc434 (diff) |
INTEGRATION: CWS impress14 (1.42.16); FILE MERGED
2004/10/19 14:38:53 cl 1.42.16.1: #i35425# adapt impress header&footer to latest oasis spec
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 90 |
1 files changed, 88 insertions, 2 deletions
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index fe06721e31bc..03ff7a9c4203 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpstyl.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.43 $ * - * last change: $Author: rt $ $Date: 2004-09-17 19:32:01 $ + * last change: $Author: rt $ $Date: 2004-11-03 16:41:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -883,6 +883,21 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( maPageLayoutName = sValue; break; } + case XML_TOK_MASTERPAGE_USE_HEADER_NAME: + { + maUseHeaderDeclName = sValue; + break; + } + case XML_TOK_MASTERPAGE_USE_FOOTER_NAME: + { + maUseFooterDeclName = sValue; + break; + } + case XML_TOK_MASTERPAGE_USE_DATE_TIME_NAME: + { + maUseDateTimeDeclName = sValue; + break; + } } } @@ -1080,6 +1095,16 @@ SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext( } } + if(!pContext && nPrefix == XML_NAMESPACE_PRESENTATION ) + { + if( IsXMLToken( rLocalName, XML_HEADER_DECL ) || + IsXMLToken( rLocalName, XML_FOOTER_DECL ) || + IsXMLToken( rLocalName, XML_DATE_TIME_DECL ) ) + { + pContext = new SdXMLHeaderFooterDeclContext( GetImport(), nPrefix, rLocalName, xAttrList ); + } + } + // call base class if(!pContext) pContext = SvXMLStylesContext::CreateStyleChildContext(nPrefix, rLocalName, xAttrList); @@ -1585,4 +1610,65 @@ SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext( return pContext; } +/////////////////////////////////////////////////////////////////////// + +SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) +: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList ) +{ + const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + for(sal_Int16 i=0; i < nAttrCount; i++) + { + OUString aLocalName; + const OUString aValue( xAttrList->getValueByIndex(i) ); + sal_uInt16 nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(xAttrList->getNameByIndex(i), &aLocalName); + + if( nPrefix == XML_NAMESPACE_PRESENTATION ) + { + if( IsXMLToken( aLocalName, XML_NAME ) ) + { + maStrName = aValue; + } + else if( IsXMLToken( aLocalName, XML_SOURCE ) ) + { + mbFixed = IsXMLToken( aValue, XML_FIXED ); + } + } + else if( nPrefix == XML_NAMESPACE_STYLE ) + { + if( IsXMLToken( aLocalName, XML_DATA_STYLE_NAME ) ) + { + maStrDateTimeFormat = aValue; + } + } + } +} + +BOOL SdXMLHeaderFooterDeclContext::IsTransient() const +{ + return TRUE; +} + +void SdXMLHeaderFooterDeclContext::EndElement() +{ + SdXMLImport& rImport = *dynamic_cast< SdXMLImport* >( &GetImport() ); + if( IsXMLToken( GetLocalName(), XML_HEADER_DECL ) ) + { + rImport.AddHeaderDecl( maStrName, maStrText ); + } + else if( IsXMLToken( GetLocalName(), XML_FOOTER_DECL ) ) + { + rImport.AddFooterDecl( maStrName, maStrText ); + } + else if( IsXMLToken( GetLocalName(), XML_DATE_TIME_DECL ) ) + { + rImport.AddDateTimeDecl( maStrName, maStrText, mbFixed, maStrDateTimeFormat ); + } +} + +void SdXMLHeaderFooterDeclContext::Characters( const ::rtl::OUString& rChars ) +{ + maStrText += rChars; +} |