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 "XMLIndexIllustrationSourceContext.hxx"
21 : #include <com/sun/star/beans/XPropertySet.hpp>
22 : #include "XMLIndexTemplateContext.hxx"
23 : #include <xmloff/xmlictxt.hxx>
24 : #include <xmloff/xmlimp.hxx>
25 : #include <xmloff/txtimp.hxx>
26 : #include <xmloff/xmlnmspe.hxx>
27 : #include <xmloff/nmspmap.hxx>
28 : #include <xmloff/xmltoken.hxx>
29 : #include <xmloff/xmluconv.hxx>
30 : #include <rtl/ustring.hxx>
31 :
32 : using ::com::sun::star::beans::XPropertySet;
33 : using ::com::sun::star::uno::Reference;
34 : using ::com::sun::star::uno::Any;
35 : using ::com::sun::star::xml::sax::XAttributeList;
36 : using ::xmloff::token::IsXMLToken;
37 : using ::xmloff::token::XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE;
38 : using ::xmloff::token::XML_TOKEN_INVALID;
39 :
40 0 : TYPEINIT1(XMLIndexIllustrationSourceContext, XMLIndexTableSourceContext);
41 :
42 :
43 3 : XMLIndexIllustrationSourceContext::XMLIndexIllustrationSourceContext(
44 : SvXMLImport& rImport,
45 : sal_uInt16 nPrfx,
46 : const OUString& rLocalName,
47 : Reference<XPropertySet> & rPropSet) :
48 3 : XMLIndexTableSourceContext(rImport, nPrfx, rLocalName, rPropSet)
49 : {
50 3 : }
51 :
52 6 : XMLIndexIllustrationSourceContext::~XMLIndexIllustrationSourceContext()
53 : {
54 6 : }
55 :
56 6 : SvXMLImportContext* XMLIndexIllustrationSourceContext::CreateChildContext(
57 : sal_uInt16 nPrefix,
58 : const OUString& rLocalName,
59 : const Reference<XAttributeList> & xAttrList )
60 : {
61 12 : if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
62 6 : ( IsXMLToken( rLocalName, XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE ) ) )
63 : {
64 3 : return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
65 : nPrefix, rLocalName,
66 : aLevelNameTableMap,
67 : XML_TOKEN_INVALID, // no outline-level attr
68 : aLevelStylePropNameTableMap,
69 3 : aAllowedTokenTypesTable);
70 : }
71 : else
72 : {
73 : return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
74 : rLocalName,
75 3 : xAttrList);
76 : }
77 :
78 : }
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|