1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
,
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
),
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
;
64 pContext
= new PagePropertySetContext( GetImport(), nPrefix
,
66 XML_TYPE_PROP_HEADER_FOOTER
,
68 rMap
, nStartIndex
, nEndIndex
, aType
);
72 pContext
= new SvXMLImportContext( GetImport(), nPrefix
, rLName
);
77 void PageHeaderFooterContext::EndElement()
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */