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 <xmloff/xmltypes.hxx>
24 : #include "PagePropertySetContext.hxx"
25 :
26 : using namespace com::sun::star;
27 : using ::xmloff::token::IsXMLToken;
28 : using ::xmloff::token::XML_HEADER_FOOTER_PROPERTIES;
29 :
30 1506 : 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 1506 : rMap(rTempMap)
44 : {
45 1506 : bHeader = bTempHeader;
46 1506 : }
47 :
48 3012 : PageHeaderFooterContext::~PageHeaderFooterContext()
49 : {
50 3012 : }
51 :
52 777 : 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 )
56 : {
57 777 : SvXMLImportContext *pContext = 0;
58 :
59 777 : if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLName, XML_HEADER_FOOTER_PROPERTIES ) )
60 : {
61 777 : PageContextType aType = Header;
62 777 : if (!bHeader)
63 395 : aType = Footer;
64 777 : pContext = new PagePropertySetContext( GetImport(), nPrefix,
65 : rLName, xAttrList,
66 : XML_TYPE_PROP_HEADER_FOOTER,
67 : rProperties,
68 777 : rMap, nStartIndex, nEndIndex, aType);
69 : }
70 :
71 777 : if( !pContext )
72 0 : pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
73 :
74 777 : return pContext;
75 : }
76 :
77 1506 : void PageHeaderFooterContext::EndElement()
78 : {
79 1506 : }
80 :
81 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|