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