xref: /trunk/main/xmloff/source/text/XMLIndexBibliographySourceContext.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_xmloff.hxx"
30 
31 
32 #include "XMLIndexBibliographySourceContext.hxx"
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <com/sun/star/container/XIndexReplace.hpp>
35 #include "XMLIndexTemplateContext.hxx"
36 #include "XMLIndexTitleTemplateContext.hxx"
37 #include "XMLIndexTOCStylesContext.hxx"
38 #include <xmloff/xmlictxt.hxx>
39 #include <xmloff/xmlimp.hxx>
40 #include <xmloff/txtimp.hxx>
41 #include "xmloff/xmlnmspe.hxx"
42 #include <xmloff/nmspmap.hxx>
43 #include <xmloff/xmltoken.hxx>
44 #include <xmloff/xmluconv.hxx>
45 #include <tools/debug.hxx>
46 #include <rtl/ustring.hxx>
47 
48 
49 using namespace ::xmloff::token;
50 
51 using ::rtl::OUString;
52 using ::com::sun::star::beans::XPropertySet;
53 using ::com::sun::star::uno::Reference;
54 using ::com::sun::star::uno::Any;
55 using ::com::sun::star::xml::sax::XAttributeList;
56 
57 
58 TYPEINIT1(XMLIndexBibliographySourceContext, XMLIndexSourceBaseContext);
59 
60 
61 XMLIndexBibliographySourceContext::XMLIndexBibliographySourceContext(
62     SvXMLImport& rImport,
63     sal_uInt16 nPrfx,
64     const OUString& rLocalName,
65     Reference<XPropertySet> & rPropSet) :
66         XMLIndexSourceBaseContext(rImport, nPrfx, rLocalName,
67                                   rPropSet, sal_False)
68 {
69 }
70 
71 XMLIndexBibliographySourceContext::~XMLIndexBibliographySourceContext()
72 {
73 }
74 
75 void XMLIndexBibliographySourceContext::ProcessAttribute(
76     enum IndexSourceParamEnum,
77     const OUString&)
78 {
79     // We have no attributes. Who wants attributes, anyway?
80 }
81 
82 
83 void XMLIndexBibliographySourceContext::EndElement()
84 {
85     // No attributes, no properties.
86 }
87 
88 
89 SvXMLImportContext* XMLIndexBibliographySourceContext::CreateChildContext(
90     sal_uInt16 nPrefix,
91     const OUString& rLocalName,
92     const Reference<XAttributeList> & xAttrList )
93 {
94     if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
95          ( IsXMLToken( rLocalName, XML_BIBLIOGRAPHY_ENTRY_TEMPLATE ) ) )
96     {
97         return new XMLIndexTemplateContext(GetImport(), rIndexPropertySet,
98                                            nPrefix, rLocalName,
99                                            aLevelNameBibliographyMap,
100                                            XML_BIBLIOGRAPHY_TYPE,
101                                            aLevelStylePropNameBibliographyMap,
102                                            aAllowedTokenTypesBibliography);
103     }
104     else
105     {
106         return XMLIndexSourceBaseContext::CreateChildContext(nPrefix,
107                                                              rLocalName,
108                                                              xAttrList);
109     }
110 
111 }
112