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 "XMLIndexBibliographySourceContext.hxx"
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/container/XIndexReplace.hpp>
31 #include "XMLIndexTemplateContext.hxx"
32 #include "XMLIndexTitleTemplateContext.hxx"
33 #include "XMLIndexTOCStylesContext.hxx"
34 #include <xmloff/xmlictxt.hxx>
35 #include <xmloff/xmlimp.hxx>
36 #include <xmloff/txtimp.hxx>
37 #include "xmloff/xmlnmspe.hxx"
38 #include <xmloff/nmspmap.hxx>
39 #include <xmloff/xmltoken.hxx>
40 #include <xmloff/xmluconv.hxx>
41 #include <tools/debug.hxx>
42 #include <rtl/ustring.hxx>
43 
44 
45 using namespace ::xmloff::token;
46 
47 using ::rtl::OUString;
48 using ::com::sun::star::beans::XPropertySet;
49 using ::com::sun::star::uno::Reference;
50 using ::com::sun::star::uno::Any;
51 using ::com::sun::star::xml::sax::XAttributeList;
52 
53 
54 TYPEINIT1(XMLIndexBibliographySourceContext, XMLIndexSourceBaseContext);
55 
56 
XMLIndexBibliographySourceContext(SvXMLImport & rImport,sal_uInt16 nPrfx,const OUString & rLocalName,Reference<XPropertySet> & rPropSet)57 XMLIndexBibliographySourceContext::XMLIndexBibliographySourceContext(
58 	SvXMLImport& rImport,
59 	sal_uInt16 nPrfx,
60 	const OUString& rLocalName,
61 	Reference<XPropertySet> & rPropSet) :
62 		XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
63 								  rPropSet, sal_False)
64 {
65 }
66 
~XMLIndexBibliographySourceContext()67 XMLIndexBibliographySourceContext::~XMLIndexBibliographySourceContext()
68 {
69 }
70 
ProcessAttribute(enum IndexSourceParamEnum,const OUString &)71 void XMLIndexBibliographySourceContext::ProcessAttribute(
72 	enum IndexSourceParamEnum,
73 	const OUString&)
74 {
75 	// We have no attributes. Who wants attributes, anyway?
76 }
77 
78 
EndElement()79 void XMLIndexBibliographySourceContext::EndElement()
80 {
81 	// No attributes, no properties.
82 }
83 
84 
CreateChildContext(sal_uInt16 nPrefix,const OUString & rLocalName,const Reference<XAttributeList> & xAttrList)85 SvXMLImportContext* XMLIndexBibliographySourceContext::CreateChildContext(
86 	sal_uInt16 nPrefix,
87 	const OUString& rLocalName,
88 	const Reference<XAttributeList> & xAttrList )
89 {
90 	if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
91 		 ( IsXMLToken( rLocalName, XML_BIBLIOGRAPHY_ENTRY_TEMPLATE ) ) )
92 	{
93 		return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
94 										   nPrefix, rLocalName,
95 										   aLevelNameBibliographyMap,
96 										   XML_BIBLIOGRAPHY_TYPE,
97 										   aLevelStylePropNameBibliographyMap,
98 										   aAllowedTokenTypesBibliography);
99 	}
100 	else
101 	{
102 		return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
103 															 rLocalName,
104 															 xAttrList);
105 	}
106 
107 }
108