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