Update ooo320-m1
[ooovba.git] / xmloff / source / style / PageHeaderFooterContext.cxx
blobdd4aa73b00d9a81464020ccbc7771182d37384bb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PageHeaderFooterContext.cxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
37 // INCLUDE ---------------------------------------------------------------
39 #ifndef _XMLOFF_PAGEPHEADERFOOTERCONTEXT_HXX
40 #include "PageHeaderFooterContext.hxx"
41 #endif
42 #include "xmlnmspe.hxx"
43 #include <xmloff/xmltoken.hxx>
44 #include "PagePropertySetContext.hxx"
46 using namespace com::sun::star;
47 using ::xmloff::token::IsXMLToken;
48 using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES;
50 //------------------------------------------------------------------
52 PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport,
53 USHORT nPrfx,
54 const rtl::OUString& rLName,
55 const ::com::sun::star::uno::Reference<
56 ::com::sun::star::xml::sax::XAttributeList>&,
57 ::std::vector< XMLPropertyState > & rTempProperties,
58 const UniReference < SvXMLImportPropertyMapper > &rTempMap,
59 sal_Int32 nStart, sal_Int32 nEnd,
60 const sal_Bool bTempHeader ) :
61 SvXMLImportContext( rImport, nPrfx, rLName ),
62 rProperties(rTempProperties),
63 nStartIndex(nStart),
64 nEndIndex(nEnd),
65 rMap(rTempMap)
67 bHeader = bTempHeader;
70 PageHeaderFooterContext::~PageHeaderFooterContext()
74 SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( USHORT nPrefix,
75 const rtl::OUString& rLName,
76 const ::com::sun::star::uno::Reference<
77 ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
79 SvXMLImportContext *pContext = 0;
81 if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
83 PageContextType aType = Header;
84 if (!bHeader)
85 aType = Footer;
86 pContext = new PagePropertySetContext( GetImport(), nPrefix,
87 rLName, xAttrList,
88 XML_TYPE_PROP_HEADER_FOOTER,
89 rProperties,
90 rMap, nStartIndex, nEndIndex, aType);
94 if( !pContext )
95 pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
97 return pContext;
100 void PageHeaderFooterContext::EndElement()