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 <xmloff/XMLEmbeddedObjectExportFilter.hxx>
21 : #include <cppuhelper/supportsservice.hxx>
22 :
23 : using namespace ::com::sun::star::uno;
24 : using namespace ::com::sun::star::xml::sax;
25 :
26 :
27 0 : XMLEmbeddedObjectExportFilter::XMLEmbeddedObjectExportFilter(
28 : const Reference< XDocumentHandler > & rHandler ) throw() :
29 : xHandler( rHandler ),
30 0 : xExtHandler( rHandler, UNO_QUERY )
31 : {
32 0 : }
33 :
34 0 : XMLEmbeddedObjectExportFilter::~XMLEmbeddedObjectExportFilter () throw()
35 : {
36 0 : }
37 :
38 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::startDocument( void )
39 : throw( SAXException, RuntimeException, std::exception )
40 : {
41 : // do nothing, filter this
42 0 : }
43 :
44 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::endDocument( void )
45 : throw( SAXException, RuntimeException, std::exception)
46 : {
47 : // do nothing, filter this
48 0 : }
49 :
50 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::startElement(
51 : const OUString& rName,
52 : const Reference< XAttributeList >& xAttrList )
53 : throw(SAXException, RuntimeException, std::exception)
54 : {
55 0 : xHandler->startElement( rName, xAttrList );
56 0 : }
57 :
58 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::endElement( const OUString& rName )
59 : throw(SAXException, RuntimeException, std::exception)
60 : {
61 0 : xHandler->endElement( rName );
62 0 : }
63 :
64 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::characters( const OUString& rChars )
65 : throw(SAXException, RuntimeException, std::exception)
66 : {
67 0 : xHandler->characters( rChars );
68 0 : }
69 :
70 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::ignorableWhitespace(
71 : const OUString& rWhitespaces )
72 : throw(SAXException, RuntimeException, std::exception)
73 : {
74 0 : xHandler->ignorableWhitespace( rWhitespaces );
75 0 : }
76 :
77 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::processingInstruction(
78 : const OUString& rTarget,
79 : const OUString& rData )
80 : throw(SAXException, RuntimeException, std::exception)
81 : {
82 0 : xHandler->processingInstruction( rTarget, rData );
83 0 : }
84 :
85 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::setDocumentLocator(
86 : const Reference< XLocator >& rLocator )
87 : throw(SAXException, RuntimeException, std::exception)
88 : {
89 0 : xHandler->setDocumentLocator( rLocator );
90 0 : }
91 :
92 : // XExtendedDocumentHandler
93 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::startCDATA( void )
94 : throw(SAXException, RuntimeException, std::exception)
95 : {
96 0 : if( xExtHandler.is() )
97 0 : xExtHandler->startCDATA();
98 0 : }
99 :
100 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::endCDATA( void )
101 : throw(RuntimeException, std::exception)
102 : {
103 0 : if( xExtHandler.is() )
104 0 : xExtHandler->endCDATA();
105 0 : }
106 :
107 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::comment( const OUString& rComment )
108 : throw(SAXException, RuntimeException, std::exception)
109 : {
110 0 : if( xExtHandler.is() )
111 0 : xExtHandler->comment( rComment );
112 0 : }
113 :
114 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::allowLineBreak( void )
115 : throw(SAXException, RuntimeException, std::exception)
116 : {
117 0 : if( xExtHandler.is() )
118 0 : xExtHandler->allowLineBreak();
119 0 : }
120 :
121 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::unknown( const OUString& rString )
122 : throw(SAXException, RuntimeException, std::exception)
123 : {
124 0 : if( xExtHandler.is() )
125 0 : xExtHandler->unknown( rString );
126 0 : }
127 :
128 : // XInitialize
129 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::initialize(
130 : const Sequence< Any >& aArguments )
131 : throw(Exception, RuntimeException, std::exception)
132 : {
133 0 : const sal_Int32 nAnyCount = aArguments.getLength();
134 0 : const Any* pAny = aArguments.getConstArray();
135 :
136 0 : for( sal_Int32 nIndex = 0; nIndex < nAnyCount; nIndex++, pAny++ )
137 : {
138 0 : if( pAny->getValueType() ==
139 0 : cppu::UnoType<XDocumentHandler>::get())
140 : {
141 0 : *pAny >>= xHandler;
142 0 : *pAny >>= xExtHandler;
143 : }
144 : }
145 0 : }
146 :
147 : // XServiceInfo
148 0 : OUString SAL_CALL XMLEmbeddedObjectExportFilter::getImplementationName()
149 : throw(RuntimeException, std::exception)
150 : {
151 0 : OUString aStr;
152 0 : return aStr;
153 : }
154 :
155 0 : sal_Bool SAL_CALL XMLEmbeddedObjectExportFilter::supportsService( const OUString& ServiceName )
156 : throw(RuntimeException, std::exception)
157 : {
158 0 : return cppu::supportsService(this, ServiceName);
159 : }
160 :
161 0 : Sequence< OUString > SAL_CALL XMLEmbeddedObjectExportFilter::getSupportedServiceNames( )
162 : throw(RuntimeException, std::exception)
163 : {
164 0 : Sequence< OUString > aSeq;
165 0 : return aSeq;
166 : }
167 :
168 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|