Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "xmloff/XMLEmbeddedObjectExportFilter.hxx"
30 : :
31 : : using ::rtl::OUString;
32 : :
33 : : using namespace ::com::sun::star::uno;
34 : : using namespace ::com::sun::star::xml::sax;
35 : :
36 : :
37 : 0 : XMLEmbeddedObjectExportFilter::XMLEmbeddedObjectExportFilter(
38 : : const Reference< XDocumentHandler > & rHandler ) throw() :
39 : : xHandler( rHandler ),
40 [ # # ]: 0 : xExtHandler( rHandler, UNO_QUERY )
41 : : {
42 : 0 : }
43 : :
44 : 0 : XMLEmbeddedObjectExportFilter::~XMLEmbeddedObjectExportFilter () throw()
45 : : {
46 [ # # ]: 0 : }
47 : :
48 : :
49 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::startDocument( void )
50 : : throw( SAXException, RuntimeException )
51 : : {
52 : : // do nothing, filter this
53 : 0 : }
54 : :
55 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::endDocument( void )
56 : : throw( SAXException, RuntimeException)
57 : : {
58 : : // do nothing, filter this
59 : 0 : }
60 : :
61 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::startElement(
62 : : const OUString& rName,
63 : : const Reference< XAttributeList >& xAttrList )
64 : : throw(SAXException, RuntimeException)
65 : : {
66 : 0 : xHandler->startElement( rName, xAttrList );
67 : 0 : }
68 : :
69 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::endElement( const OUString& rName )
70 : : throw(SAXException, RuntimeException)
71 : : {
72 : 0 : xHandler->endElement( rName );
73 : 0 : }
74 : :
75 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::characters( const OUString& rChars )
76 : : throw(SAXException, RuntimeException)
77 : : {
78 : 0 : xHandler->characters( rChars );
79 : 0 : }
80 : :
81 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::ignorableWhitespace(
82 : : const OUString& rWhitespaces )
83 : : throw(SAXException, RuntimeException)
84 : : {
85 : 0 : xHandler->ignorableWhitespace( rWhitespaces );
86 : 0 : }
87 : :
88 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::processingInstruction(
89 : : const OUString& rTarget,
90 : : const OUString& rData )
91 : : throw(SAXException, RuntimeException)
92 : : {
93 : 0 : xHandler->processingInstruction( rTarget, rData );
94 : 0 : }
95 : :
96 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::setDocumentLocator(
97 : : const Reference< XLocator >& rLocator )
98 : : throw(SAXException, RuntimeException)
99 : : {
100 : 0 : xHandler->setDocumentLocator( rLocator );
101 : 0 : }
102 : :
103 : : // XExtendedDocumentHandler
104 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::startCDATA( void )
105 : : throw(SAXException, RuntimeException)
106 : : {
107 [ # # ]: 0 : if( xExtHandler.is() )
108 : 0 : xExtHandler->startCDATA();
109 : 0 : }
110 : :
111 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::endCDATA( void )
112 : : throw(RuntimeException)
113 : : {
114 [ # # ]: 0 : if( xExtHandler.is() )
115 : 0 : xExtHandler->endCDATA();
116 : 0 : }
117 : :
118 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::comment( const OUString& rComment )
119 : : throw(SAXException, RuntimeException)
120 : : {
121 [ # # ]: 0 : if( xExtHandler.is() )
122 : 0 : xExtHandler->comment( rComment );
123 : 0 : }
124 : :
125 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::allowLineBreak( void )
126 : : throw(SAXException, RuntimeException)
127 : : {
128 [ # # ]: 0 : if( xExtHandler.is() )
129 : 0 : xExtHandler->allowLineBreak();
130 : 0 : }
131 : :
132 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::unknown( const OUString& rString )
133 : : throw(SAXException, RuntimeException)
134 : : {
135 [ # # ]: 0 : if( xExtHandler.is() )
136 : 0 : xExtHandler->unknown( rString );
137 : 0 : }
138 : :
139 : : // XInitialize
140 : 0 : void SAL_CALL XMLEmbeddedObjectExportFilter::initialize(
141 : : const Sequence< Any >& aArguments )
142 : : throw(Exception, RuntimeException)
143 : : {
144 : 0 : const sal_Int32 nAnyCount = aArguments.getLength();
145 : 0 : const Any* pAny = aArguments.getConstArray();
146 : :
147 [ # # ]: 0 : for( sal_Int32 nIndex = 0; nIndex < nAnyCount; nIndex++, pAny++ )
148 : : {
149 [ # # ]: 0 : if( pAny->getValueType() ==
150 : 0 : ::getCppuType((const Reference< XDocumentHandler >*)0))
151 : : {
152 : 0 : *pAny >>= xHandler;
153 : 0 : *pAny >>= xExtHandler;
154 : : }
155 : : }
156 : 0 : }
157 : :
158 : : // XServiceInfo
159 : 0 : OUString SAL_CALL XMLEmbeddedObjectExportFilter::getImplementationName()
160 : : throw(RuntimeException)
161 : : {
162 : 0 : OUString aStr;
163 : 0 : return aStr;
164 : : }
165 : :
166 : 0 : sal_Bool SAL_CALL XMLEmbeddedObjectExportFilter::supportsService( const OUString& )
167 : : throw(RuntimeException)
168 : : {
169 : 0 : return sal_False;
170 : : }
171 : :
172 : 0 : Sequence< OUString > SAL_CALL XMLEmbeddedObjectExportFilter::getSupportedServiceNames( )
173 : : throw(RuntimeException)
174 : : {
175 : 0 : Sequence< OUString > aSeq;
176 : 0 : return aSeq;
177 : : }
178 : :
179 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|