Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include "PageHeaderFooterContext.hxx"
21 : #include <xmloff/xmlnmspe.hxx>
22 : #include <xmloff/xmltoken.hxx>
23 : #include "PagePropertySetContext.hxx"
24 :
25 : using namespace com::sun::star;
26 : using ::xmloff::token::IsXMLToken;
27 : using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES;
28 :
29 0 : PageHeaderFooterContext::PageHeaderFooterContext( SvXMLImport& rImport,
30 : sal_uInt16 nPrfx,
31 : const OUString& rLName,
32 : const ::com::sun::star::uno::Reference<
33 : ::com::sun::star::xml::sax::XAttributeList>&,
34 : ::std::vector< XMLPropertyState > & rTempProperties,
35 : const UniReference < SvXMLImportPropertyMapper > &rTempMap,
36 : sal_Int32 nStart, sal_Int32 nEnd,
37 : const sal_Bool bTempHeader ) :
38 : SvXMLImportContext( rImport, nPrfx, rLName ),
39 : rProperties(rTempProperties),
40 : nStartIndex(nStart),
41 : nEndIndex(nEnd),
42 0 : rMap(rTempMap)
43 : {
44 0 : bHeader = bTempHeader;
45 0 : }
46 :
47 0 : PageHeaderFooterContext::~PageHeaderFooterContext()
48 : {
49 0 : }
50 :
51 0 : SvXMLImportContext *PageHeaderFooterContext::CreateChildContext( sal_uInt16 nPrefix,
52 : const OUString& rLName,
53 : const ::com::sun::star::uno::Reference<
54 : ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
55 : {
56 0 : SvXMLImportContext *pContext = 0;
57 :
58 0 : if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
59 : {
60 0 : PageContextType aType = Header;
61 0 : if (!bHeader)
62 0 : aType = Footer;
63 0 : pContext = new PagePropertySetContext( GetImport(), nPrefix,
64 : rLName, xAttrList,
65 : XML_TYPE_PROP_HEADER_FOOTER,
66 : rProperties,
67 0 : rMap, nStartIndex, nEndIndex, aType);
68 : }
69 :
70 0 : if( !pContext )
71 0 : pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
72 :
73 0 : return pContext;
74 : }
75 :
76 0 : void PageHeaderFooterContext::EndElement()
77 : {
78 0 : }
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|