bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / style / PageHeaderFooterContext.cxx
blob155338cb335b2e76265c5f155941915f15b3d6c8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "PageHeaderFooterContext.hxx"
21 #include <xmloff/xmlnmspe.hxx>
22 #include <xmloff/xmltoken.hxx>
23 #include <xmloff/xmltypes.hxx>
24 #include "PagePropertySetContext.hxx"
26 using namespace com::sun::star;
27 using ::xmloff::token::IsXMLToken;
28 using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES;
30 PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport,
31 sal_uInt16 nPrfx,
32 const OUString& rLName,
33 const ::com::sun::star::uno::Reference<
34 ::com::sun::star::xml::sax::XAttributeList>&,
35 ::std::vector< XMLPropertyState > & rTempProperties,
36 const rtl::Reference < SvXMLImportPropertyMapper > &rTempMap,
37 sal_Int32 nStart, sal_Int32 nEnd,
38 const bool bTempHeader ) :
39 SvXMLImportContext( rImport, nPrfx, rLName ),
40 rProperties(rTempProperties),
41 nStartIndex(nStart),
42 nEndIndex(nEnd),
43 rMap(rTempMap)
45 bHeader = bTempHeader;
48 PageHeaderFooterContext::~PageHeaderFooterContext()
52 SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( sal_uInt16 nPrefix,
53 const OUString& rLName,
54 const ::com::sun::star::uno::Reference<
55 ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
57 SvXMLImportContext *pContext = 0;
59 if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
61 PageContextType aType = Header;
62 if (!bHeader)
63 aType = Footer;
64 pContext = new PagePropertySetContext( GetImport(), nPrefix,
65 rLName, xAttrList,
66 XML_TYPE_PROP_HEADER_FOOTER,
67 rProperties,
68 rMap, nStartIndex, nEndIndex, aType);
71 if( !pContext )
72 pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
74 return pContext;
77 void PageHeaderFooterContext::EndElement()
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */