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 #include "XMLBasicExportFilter.hxx"
27
28 using namespace ::com::sun::star;
29 using namespace ::com::sun::star::uno;
30
31
32 // =============================================================================
33 // XMLBasicExportFilter
34 // =============================================================================
35
XMLBasicExportFilter(const Reference<xml::sax::XDocumentHandler> & rxHandler)36 XMLBasicExportFilter::XMLBasicExportFilter( const Reference< xml::sax::XDocumentHandler >& rxHandler )
37 :m_xHandler( rxHandler )
38 {
39 }
40
41 // -----------------------------------------------------------------------------
42
~XMLBasicExportFilter()43 XMLBasicExportFilter::~XMLBasicExportFilter()
44 {
45 }
46
47 // -----------------------------------------------------------------------------
48 // XDocumentHandler
49 // -----------------------------------------------------------------------------
50
startDocument()51 void XMLBasicExportFilter::startDocument()
52 throw (xml::sax::SAXException, RuntimeException)
53 {
54 // do nothing, filter this
55 }
56
57 // -----------------------------------------------------------------------------
58
endDocument()59 void XMLBasicExportFilter::endDocument()
60 throw (xml::sax::SAXException, RuntimeException)
61 {
62 // do nothing, filter this
63 }
64
65 // -----------------------------------------------------------------------------
66
startElement(const::rtl::OUString & aName,const Reference<xml::sax::XAttributeList> & xAttribs)67 void XMLBasicExportFilter::startElement( const ::rtl::OUString& aName,
68 const Reference< xml::sax::XAttributeList >& xAttribs )
69 throw (xml::sax::SAXException, RuntimeException)
70 {
71 if ( m_xHandler.is() )
72 m_xHandler->startElement( aName, xAttribs );
73 }
74
75 // -----------------------------------------------------------------------------
76
endElement(const::rtl::OUString & aName)77 void XMLBasicExportFilter::endElement( const ::rtl::OUString& aName )
78 throw (xml::sax::SAXException, RuntimeException)
79 {
80 if ( m_xHandler.is() )
81 m_xHandler->endElement( aName );
82 }
83
84 // -----------------------------------------------------------------------------
85
characters(const::rtl::OUString & aChars)86 void XMLBasicExportFilter::characters( const ::rtl::OUString& aChars )
87 throw (xml::sax::SAXException, RuntimeException)
88 {
89 if ( m_xHandler.is() )
90 m_xHandler->characters( aChars );
91 }
92
93 // -----------------------------------------------------------------------------
94
ignorableWhitespace(const::rtl::OUString & aWhitespaces)95 void XMLBasicExportFilter::ignorableWhitespace( const ::rtl::OUString& aWhitespaces )
96 throw (xml::sax::SAXException, RuntimeException)
97 {
98 if ( m_xHandler.is() )
99 m_xHandler->ignorableWhitespace( aWhitespaces );
100 }
101
102 // -----------------------------------------------------------------------------
103
processingInstruction(const::rtl::OUString & aTarget,const::rtl::OUString & aData)104 void XMLBasicExportFilter::processingInstruction( const ::rtl::OUString& aTarget,
105 const ::rtl::OUString& aData )
106 throw (xml::sax::SAXException, RuntimeException)
107 {
108 if ( m_xHandler.is() )
109 m_xHandler->processingInstruction( aTarget, aData );
110 }
111
112 // -----------------------------------------------------------------------------
113
setDocumentLocator(const Reference<xml::sax::XLocator> & xLocator)114 void XMLBasicExportFilter::setDocumentLocator( const Reference< xml::sax::XLocator >& xLocator )
115 throw (xml::sax::SAXException, RuntimeException)
116 {
117 if ( m_xHandler.is() )
118 m_xHandler->setDocumentLocator( xLocator );
119 }
120
121 // -----------------------------------------------------------------------------
122