1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_xmloff.hxx"
26 
27 
28 
29 
30 // INCLUDE ---------------------------------------------------------------
31 
32 #ifndef _XMLOFF_PAGEPHEADERFOOTERCONTEXT_HXX
33 #include "PageHeaderFooterContext.hxx"
34 #endif
35 #include "xmloff/xmlnmspe.hxx"
36 #include <xmloff/xmltoken.hxx>
37 #include "PagePropertySetContext.hxx"
38 
39 using namespace com::sun::star;
40 using ::xmloff::token::IsXMLToken;
41 using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES;
42 
43 //------------------------------------------------------------------
44 
PageHeaderFooterContext(SvXMLImport & rImport,sal_uInt16 nPrfx,const rtl::OUString & rLName,const::com::sun::star::uno::Reference<::com::sun::star::xml::sax::XAttributeList> &,::std::vector<XMLPropertyState> & rTempProperties,const UniReference<SvXMLImportPropertyMapper> & rTempMap,sal_Int32 nStart,sal_Int32 nEnd,const sal_Bool bTempHeader)45 PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport,
46 									  sal_uInt16 nPrfx,
47 									  const rtl::OUString& rLName,
48 									  const ::com::sun::star::uno::Reference<
49 									  ::com::sun::star::xml::sax::XAttributeList>&,
50 									  ::std::vector< XMLPropertyState > & rTempProperties,
51 									  const UniReference < SvXMLImportPropertyMapper > &rTempMap,
52 									  sal_Int32 nStart, sal_Int32 nEnd,
53 									  const sal_Bool bTempHeader ) :
54 	SvXMLImportContext( rImport, nPrfx, rLName ),
55 	rProperties(rTempProperties),
56 	nStartIndex(nStart),
57 	nEndIndex(nEnd),
58 	rMap(rTempMap)
59 {
60 	bHeader = bTempHeader;
61 }
62 
~PageHeaderFooterContext()63 PageHeaderFooterContext::~PageHeaderFooterContext()
64 {
65 }
66 
CreateChildContext(sal_uInt16 nPrefix,const rtl::OUString & rLName,const::com::sun::star::uno::Reference<::com::sun::star::xml::sax::XAttributeList> & xAttrList)67 SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( sal_uInt16 nPrefix,
68 											const rtl::OUString& rLName,
69 											const ::com::sun::star::uno::Reference<
70 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList )
71 {
72 	SvXMLImportContext *pContext = 0;
73 
74 	if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
75 	{
76 		PageContextType aType = Header;
77 		if (!bHeader)
78 			aType = Footer;
79 		pContext = new PagePropertySetContext( GetImport(), nPrefix,
80 												rLName, xAttrList,
81 												XML_TYPE_PROP_HEADER_FOOTER,
82 												rProperties,
83 												rMap,  nStartIndex, nEndIndex, aType);
84 	}
85 
86 
87 	if( !pContext )
88 		pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
89 
90 	return pContext;
91 }
92 
EndElement()93 void PageHeaderFooterContext::EndElement()
94 {
95 }
96 
97