1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_xmloff.hxx"
26 
27 
28 #include "XMLIndexIllustrationSourceContext.hxx"
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include "XMLIndexTemplateContext.hxx"
31 #include <xmloff/xmlictxt.hxx>
32 #include <xmloff/xmlimp.hxx>
33 #include <xmloff/txtimp.hxx>
34 #include "xmloff/xmlnmspe.hxx"
35 #include <xmloff/nmspmap.hxx>
36 #include <xmloff/xmltoken.hxx>
37 #include <xmloff/xmluconv.hxx>
38 #include <tools/debug.hxx>
39 #include <rtl/ustring.hxx>
40 
41 using ::rtl::OUString;
42 using ::com::sun::star::beans::XPropertySet;
43 using ::com::sun::star::uno::Reference;
44 using ::com::sun::star::uno::Any;
45 using ::com::sun::star::xml::sax::XAttributeList;
46 using ::xmloff::token::IsXMLToken;
47 using ::xmloff::token::XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE;
48 using ::xmloff::token::XML_TOKEN_INVALID;
49 
50 TYPEINIT1(XMLIndexIllustrationSourceContext, XMLIndexTableSourceContext);
51 
52 
XMLIndexIllustrationSourceContext(SvXMLImport & rImport,sal_uInt16 nPrfx,const OUString & rLocalName,Reference<XPropertySet> & rPropSet)53 XMLIndexIllustrationSourceContext::XMLIndexIllustrationSourceContext(
54 	SvXMLImport& rImport,
55 	sal_uInt16 nPrfx,
56 	const OUString& rLocalName,
57 	Reference<XPropertySet> & rPropSet) :
58 		XMLIndexTableSourceContext(rImport, nPrfx, rLocalName, rPropSet)
59 {
60 }
61 
~XMLIndexIllustrationSourceContext()62 XMLIndexIllustrationSourceContext::~XMLIndexIllustrationSourceContext()
63 {
64 }
65 
CreateChildContext(sal_uInt16 nPrefix,const OUString & rLocalName,const Reference<XAttributeList> & xAttrList)66 SvXMLImportContext* XMLIndexIllustrationSourceContext::CreateChildContext(
67 	sal_uInt16 nPrefix,
68 	const OUString& rLocalName,
69 	const Reference<XAttributeList> & xAttrList )
70 {
71 	if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
72 		 ( IsXMLToken( rLocalName, XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE ) ) )
73 	{
74 		return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
75 										   nPrefix, rLocalName,
76 										   aLevelNameTableMap,
77 										   XML_TOKEN_INVALID, // no outline-level attr
78 										   aLevelStylePropNameTableMap,
79 										   aAllowedTokenTypesTable);
80 	}
81 	else
82 	{
83 		return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
84 															 rLocalName,
85 															 xAttrList);
86 	}
87 
88 }
89