Update ooo320-m1
[ooovba.git] / xmloff / source / transform / OOo2Oasis.cxx
blob8d4cf844a1ffda41fbcbf5723f1c1cb5c26c63a4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OOo2Oasis.cxx,v $
10 * $Revision: 1.23.56.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include <rtl/uuid.h>
34 #include <rtl/ustrbuf.hxx>
35 #include <comphelper/processfactory.hxx>
36 #include <xmloff/nmspmap.hxx>
37 #include "xmlnmspe.hxx"
38 #include <xmloff/xmltoken.hxx>
39 #include "MutableAttrList.hxx"
40 #include "DeepTContext.hxx"
41 #include "StyleOOoTContext.hxx"
42 #include "FrameOOoTContext.hxx"
43 #include "EventOOoTContext.hxx"
44 #include "ControlOOoTContext.hxx"
45 #include "FormPropOOoTContext.hxx"
46 #include "ChartOOoTContext.hxx"
47 #include "ChartPlotAreaOOoTContext.hxx"
48 #include "ElemTransformerAction.hxx"
49 #include "AttrTransformerAction.hxx"
50 #include "PropertyActionsOOo.hxx"
51 #include "TransformerActions.hxx"
52 #include <xmloff/xmluconv.hxx>
53 #ifndef _XMLOFF_OOO2OOO_HXX
54 #include "OOo2Oasis.hxx"
55 #endif
57 using ::rtl::OUString;
58 using namespace ::xmloff::token;
59 using namespace ::com::sun::star::uno;
60 using namespace ::com::sun::star::lang;
61 using namespace ::com::sun::star::xml::sax;
62 using namespace ::com::sun::star::beans;
64 OUString SAL_CALL OOo2OasisTransformer_getImplementationName() throw();
66 enum XMLUserDefinedTransformerAction
68 XML_ETACTION_DOCUMENT=XML_ETACTION_USER_DEFINED,
69 XML_ETACTION_BODY,
70 XML_ETACTION_STYLE,
71 XML_ETACTION_STYLE_RENAME,
72 XML_ETACTION_FRAME,
73 XML_ETACTION_EVENT,
74 XML_ETACTION_TAB_STOP,
75 XML_ETACTION_FORM_CONTROL,
76 XML_ETACTION_FORM_PROPERTY,
77 XML_ETACTION_CHART,
78 XML_ETACTION_TRACKED_CHANGES,
79 XML_ETACTION_CHART_PLOT_AREA,
80 XML_ETACTION_DOCUMENT_RENAME,
81 XML_ETACTION_TABLE
84 #define ENTRY3( n, l, a, p1, p2, p3 ) \
85 { XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 }
86 #define ENTRY3QQN( n, l, a, n1, l1, n2, l2, p3 ) \
87 ENTRY3( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
88 XMLTransformerActionInit::QNameParam( n2, l2 ), p3 )
90 #define ENTRY2( n, l, a, p1, p2 ) \
91 ENTRY3( n, l, a, p1, p2, 0 )
92 #define ENTRY2QQ( n, l, a, n1, l1, n2, l2 ) \
93 ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
94 XMLTransformerActionInit::QNameParam( n2, l2 ) )
95 #define ENTRY2QN( n, l, a, n1, l1, p2 ) \
96 ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), p2 )
98 #define ENTRY1( n, l, a, p1 ) \
99 ENTRY3( n, l, a, p1, 0, 0 )
100 #define ENTRY1Q( n, l, a, n1, l1 ) \
101 ENTRY1( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ) )
103 #define ENTRY0( n, l, a ) \
104 ENTRY3( n, l, a, 0, 0, 0 )
106 // BM: a macro to put two tokens into one sal_Int32 for the action
107 // XML_ATACTION_RENAME_ATTRIBUTE
108 #define RENAME_ENTRY( f, s ) \
109 (static_cast< sal_Int32 >(f) | (static_cast< sal_Int32 >(s) << 16))
111 static XMLTransformerActionInit aActionTable[] =
113 // remove office:class from <office:document> and <office:document-content>
114 ENTRY0( OFFICE, DOCUMENT, XML_ETACTION_DOCUMENT ),
115 ENTRY0( OFFICE, DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ),
116 ENTRY0( OFFICE, DOCUMENT_STYLES, XML_ETACTION_DOCUMENT ),
117 ENTRY0( OFFICE, DOCUMENT_SETTINGS, XML_ETACTION_DOCUMENT ),
118 ENTRY1Q( OFFICE, AUTO_TEXT_EVENTS, XML_ETACTION_DOCUMENT_RENAME,
119 XML_NAMESPACE_OOO, XML_AUTO_TEXT_EVENTS),
121 // remove <meta:keywords>
122 ENTRY0( META, KEYWORDS, XML_ETACTION_COPY_CONTENT ),
124 // rename <office:script> to <office:scripts>
125 ENTRY1Q( OFFICE, SCRIPT, XML_ETACTION_RENAME_ELEM,
126 XML_NAMESPACE_OFFICE, XML_SCRIPTS ),
128 // rename <office:script-data> to <office:script> and process attributes
129 ENTRY2QN( OFFICE, SCRIPT_DATA, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
130 XML_NAMESPACE_OFFICE, XML_SCRIPT,
131 OOO_SCRIPT_ACTIONS ),
133 // rename <script:libraries> to <ooo:libraries>
134 ENTRY1Q( SCRIPT, LIBRARIES, XML_ETACTION_RENAME_ELEM,
135 XML_NAMESPACE_OOO, XML_LIBRARIES ),
137 // rename <script:library-linked> to <ooo:library-linked> and process attributes
138 ENTRY2QN( SCRIPT, LIBRARY_LINKED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
139 XML_NAMESPACE_OOO, XML_LIBRARY_LINKED,
140 OOO_SCRIPT_ACTIONS ),
142 // rename <script:library-embedded> to <ooo:library-embedded> and process attributes
143 ENTRY2QN( SCRIPT, LIBRARY_EMBEDDED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
144 XML_NAMESPACE_OOO, XML_LIBRARY_EMBEDDED,
145 OOO_SCRIPT_ACTIONS ),
147 // rename <script:module> to <ooo:module> and process attributes
148 ENTRY2QN( SCRIPT, MODULE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
149 XML_NAMESPACE_OOO, XML_MODULE,
150 OOO_SCRIPT_ACTIONS ),
152 // rename <script:source-code> to <ooo:source-code>
153 ENTRY1Q( SCRIPT, SOURCE_CODE, XML_ETACTION_RENAME_ELEM,
154 XML_NAMESPACE_OOO, XML_SOURCE_CODE ),
156 // rename <office:font-decls> to <office:font-face-decl>,
157 // rename <style:font-decl> to <style:font-face>, process attrs
158 ENTRY1Q( OFFICE, FONT_DECLS, XML_ETACTION_RENAME_ELEM,
159 XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS ),
160 ENTRY2QN( STYLE, FONT_DECL, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
161 XML_NAMESPACE_STYLE, XML_FONT_FACE,
162 OOO_FONT_DECL_ACTIONS ),
164 // add genre element
165 ENTRY0( OFFICE, BODY, XML_ETACTION_BODY ),
167 // rename <style:page-master> to <style:page-layout>
168 ENTRY2QN( STYLE, PAGE_MASTER, XML_ETACTION_STYLE_RENAME,
169 XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT,
170 XML_FAMILY_TYPE_PAGE_LAYOUT ),
171 ENTRY1( STYLE, MASTER_PAGE, XML_ETACTION_PROC_ATTRS,
172 OOO_MASTER_PAGE_ACTIONS ),
174 // split <style:properties> into <style:*-properties> and do other
175 // styles processing
176 ENTRY1( STYLE, STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_END ),
177 ENTRY1( STYLE, DEFAULT_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_END ),
178 ENTRY1( NUMBER, NUMBER_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
179 ENTRY1( NUMBER, CURRENCY_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
180 ENTRY1( NUMBER, PERCENTAGE_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
181 ENTRY1( NUMBER, DATE_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
182 ENTRY1( NUMBER, TIME_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
183 ENTRY1( NUMBER, BOOLEAN_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
184 ENTRY1( NUMBER, TEXT_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
185 ENTRY1( TEXT, LIST_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
186 // ENTRY0( TEXT, OUTLINE_STYLE, STYLE ),
187 ENTRY1( STYLE, HEADER_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_HEADER_FOOTER ),
188 ENTRY1( STYLE, FOOTER_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_HEADER_FOOTER ),
189 ENTRY1( TEXT, LIST_LEVEL_STYLE_NUMBER, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
190 ENTRY1( TEXT, LIST_LEVEL_STYLE_BULLET, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
191 ENTRY1( TEXT, LIST_LEVEL_STYLE_IMAGE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
192 ENTRY1( TEXT, OUTLINE_LEVEL_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
193 ENTRY1( DRAW, GRADIENT, XML_ETACTION_STYLE,
194 XML_FAMILY_TYPE_GRADIENT ),
195 ENTRY1( DRAW, FILL_IMAGE, XML_ETACTION_STYLE,
196 XML_FAMILY_TYPE_FILL_IMAGE ),
197 ENTRY2QN( DRAW, TRANSPARENCY, XML_ETACTION_STYLE_RENAME,
198 XML_NAMESPACE_DRAW, XML_OPACITY,
199 XML_FAMILY_TYPE_GRADIENT ),
200 ENTRY1( DRAW, MARKER, XML_ETACTION_STYLE,
201 XML_FAMILY_TYPE_MARKER ),
202 ENTRY1( DRAW, HATCH, XML_ETACTION_STYLE,
203 XML_FAMILY_TYPE_HATCH ),
204 ENTRY1( DRAW, STROKE_DASH, XML_ETACTION_STYLE,
205 XML_FAMILY_TYPE_STROKE_DASH ),
207 // rename <text:h>'s text:level to text:outline-level
208 // process <text:h/p>: process style-name attributes,
209 ENTRY1( TEXT, H, XML_ETACTION_PROC_ATTRS, OOO_PARA_ACTIONS ),
210 ENTRY1( TEXT, P, XML_ETACTION_PROC_ATTRS, OOO_PARA_ACTIONS ),
212 // rename <text:ordered-list> and <text:unordered-list> to <text:list>
213 ENTRY2QN( TEXT, UNORDERED_LIST, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
214 XML_NAMESPACE_TEXT, XML_LIST,
215 OOO_STYLE_REF_ACTIONS ),
216 ENTRY2QN( TEXT, ORDERED_LIST, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
217 XML_NAMESPACE_TEXT, XML_LIST,
218 OOO_STYLE_REF_ACTIONS ),
220 // rename <text:footnote*> to <text:note*>
221 ENTRY3QQN( TEXT, FOOTNOTE, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
222 XML_NAMESPACE_TEXT, XML_NOTE,
223 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_FOOTNOTE ),
224 ENTRY1Q( TEXT, FOOTNOTE_BODY, XML_ETACTION_RENAME_ELEM,
225 XML_NAMESPACE_TEXT, XML_NOTE_BODY ),
226 ENTRY1Q( TEXT, FOOTNOTE_CITATION, XML_ETACTION_RENAME_ELEM,
227 XML_NAMESPACE_TEXT, XML_NOTE_CITATION ),
228 ENTRY3QQN( TEXT, FOOTNOTES_CONFIGURATION,
229 XML_ETACTION_RENAME_ELEM_ADD_PROC_ATTR,
230 XML_NAMESPACE_TEXT, XML_NOTES_CONFIGURATION,
231 XML_NAMESPACE_TEXT, XML_NOTE_CLASS,
232 XML_FOOTNOTE | (OOO_STYLE_REF_ACTIONS << 16) ),
234 // rename <text:endnote*> to <text:endnote*>
235 ENTRY3QQN( TEXT, ENDNOTE, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
236 XML_NAMESPACE_TEXT, XML_NOTE,
237 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_ENDNOTE ),
238 ENTRY1Q( TEXT, ENDNOTE_BODY, XML_ETACTION_RENAME_ELEM,
239 XML_NAMESPACE_TEXT, XML_NOTE_BODY ),
240 ENTRY1Q( TEXT, ENDNOTE_CITATION, XML_ETACTION_RENAME_ELEM,
241 XML_NAMESPACE_TEXT, XML_NOTE_CITATION ),
242 ENTRY3QQN( TEXT, ENDNOTES_CONFIGURATION,
243 XML_ETACTION_RENAME_ELEM_ADD_PROC_ATTR,
244 XML_NAMESPACE_TEXT, XML_NOTES_CONFIGURATION,
245 XML_NAMESPACE_TEXT, XML_NOTE_CLASS,
246 XML_ENDNOTE | (OOO_STYLE_REF_ACTIONS << 16) ),
248 // rename <text:footnote> and <text:endnote> to <text:note>
249 ENTRY3QQN( TEXT, ENDNOTE_REF, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
250 XML_NAMESPACE_TEXT, XML_NOTE_REF,
251 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_ENDNOTE ),
252 ENTRY3QQN( TEXT, FOOTNOTE_REF, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
253 XML_NAMESPACE_TEXT, XML_NOTE_REF,
254 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_FOOTNOTE ),
256 // rename <text:tab-stop> to <text:tab>
257 ENTRY1Q( TEXT, TAB_STOP, XML_ETACTION_RENAME_ELEM,
258 XML_NAMESPACE_TEXT, XML_TAB ),
260 // replace <table:sub-table> with <table:table table:is-sub-table>
261 ENTRY3QQN( TABLE, SUB_TABLE, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
262 XML_NAMESPACE_TABLE, XML_TABLE,
263 XML_NAMESPACE_TABLE, XML_IS_SUB_TABLE, XML_TRUE ),
265 // process *:style-name attributes
266 ENTRY1( TEXT, SECTION, XML_ETACTION_PROC_ATTRS,
267 OOO_STYLE_REF_ACTIONS ), /* generated entry */
268 ENTRY1( TEXT, SPAN, XML_ETACTION_PROC_ATTRS,
269 OOO_STYLE_REF_ACTIONS ), /* generated entry */
270 ENTRY1( TEXT, A, XML_ETACTION_PROC_ATTRS,
271 OOO_STYLE_REF_ACTIONS ), /* generated entry */
272 ENTRY1( TEXT, RUBY, XML_ETACTION_PROC_ATTRS,
273 OOO_STYLE_REF_ACTIONS ), /* generated entry */
274 ENTRY1( TEXT, RUBY_TEXT, XML_ETACTION_PROC_ATTRS,
275 OOO_STYLE_REF_ACTIONS ), /* generated entry */
276 ENTRY1( TEXT, DATE, XML_ETACTION_PROC_ATTRS,
277 OOO_STYLE_REF_ACTIONS ), /* generated entry */
278 ENTRY1( TEXT, TIME, XML_ETACTION_PROC_ATTRS,
279 OOO_STYLE_REF_ACTIONS ), /* generated entry */
280 ENTRY1( TEXT, VARIABLE_GET, XML_ETACTION_PROC_ATTRS,
281 OOO_STYLE_REF_ACTIONS ), /* generated entry */
282 ENTRY1( TEXT, USER_FIELD_GET, XML_ETACTION_PROC_ATTRS,
283 OOO_STYLE_REF_ACTIONS ), /* generated entry */
284 ENTRY1( TEXT, USER_FIELD_INPUT, XML_ETACTION_PROC_ATTRS,
285 OOO_STYLE_REF_ACTIONS ), /* generated entry */
286 ENTRY1( TEXT, CREATION_DATE, XML_ETACTION_PROC_ATTRS,
287 OOO_STYLE_REF_ACTIONS ), /* generated entry */
288 ENTRY1( TEXT, CREATION_TIME, XML_ETACTION_PROC_ATTRS,
289 OOO_STYLE_REF_ACTIONS ), /* generated entry */
290 ENTRY1( TEXT, PRINT_TIME, XML_ETACTION_PROC_ATTRS,
291 OOO_STYLE_REF_ACTIONS ), /* generated entry */
292 ENTRY1( TEXT, PRINT_DATE, XML_ETACTION_PROC_ATTRS,
293 OOO_STYLE_REF_ACTIONS ), /* generated entry */
294 ENTRY1( TEXT, EDITING_DURATION, XML_ETACTION_PROC_ATTRS,
295 OOO_STYLE_REF_ACTIONS ), /* generated entry */
296 ENTRY1( TEXT, MODIFICATION_TIME, XML_ETACTION_PROC_ATTRS,
297 OOO_STYLE_REF_ACTIONS ), /* generated entry */
298 ENTRY1( TEXT, MODIFICATION_DATE, XML_ETACTION_PROC_ATTRS,
299 OOO_STYLE_REF_ACTIONS ), /* generated entry */
300 ENTRY1( TEXT, DATABASE_DISPLAY, XML_ETACTION_PROC_ATTRS,
301 OOO_STYLE_REF_ACTIONS ), /* generated entry */
302 ENTRY1( TEXT, TABLE_FORMULA, XML_ETACTION_PROC_ATTRS,
303 OOO_STYLE_REF_ACTIONS ), /* generated entry */
304 ENTRY1( TEXT, INDEX_TITLE, XML_ETACTION_PROC_ATTRS,
305 OOO_STYLE_REF_ACTIONS ), /* generated entry */
306 ENTRY1( TEXT, TABLE_OF_CONTENT, XML_ETACTION_PROC_ATTRS,
307 OOO_STYLE_REF_ACTIONS ), /* generated entry */
308 ENTRY1( TEXT, TABLE_OF_CONTENT_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
309 OOO_STYLE_REF_ACTIONS ), /* generated entry */
310 ENTRY1( TEXT, ILLUSTRATION_INDEX, XML_ETACTION_PROC_ATTRS,
311 OOO_STYLE_REF_ACTIONS ), /* generated entry */
312 ENTRY1( TEXT, ILLUSTRATION_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
313 OOO_STYLE_REF_ACTIONS ), /* generated entry */
314 ENTRY1( TEXT, TABLE_INDEX, XML_ETACTION_PROC_ATTRS,
315 OOO_STYLE_REF_ACTIONS ), /* generated entry */
316 ENTRY1( TEXT, TABLE_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
317 OOO_STYLE_REF_ACTIONS ), /* generated entry */
318 ENTRY1( TEXT, OBJECT_INDEX, XML_ETACTION_PROC_ATTRS,
319 OOO_STYLE_REF_ACTIONS ), /* generated entry */
320 ENTRY1( TEXT, OBJECT_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
321 OOO_STYLE_REF_ACTIONS ), /* generated entry */
322 ENTRY1( TEXT, USER_INDEX, XML_ETACTION_PROC_ATTRS,
323 OOO_STYLE_REF_ACTIONS ), /* generated entry */
324 ENTRY1( TEXT, USER_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
325 OOO_STYLE_REF_ACTIONS ), /* generated entry */
326 ENTRY1( TEXT, ALPHABETICAL_INDEX, XML_ETACTION_PROC_ATTRS,
327 OOO_STYLE_REF_ACTIONS ), /* generated entry */
328 ENTRY1( TEXT, ALPHABETICAL_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
329 OOO_STYLE_REF_ACTIONS ), /* generated entry */
330 ENTRY1( TEXT, BIBLIOGRAPHY, XML_ETACTION_PROC_ATTRS,
331 OOO_STYLE_REF_ACTIONS ), /* generated entry */
332 ENTRY1( TEXT, BIBLIOGRAPHY_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
333 OOO_STYLE_REF_ACTIONS ), /* generated entry */
334 ENTRY1( TEXT, INDEX_SOURCE_STYLE, XML_ETACTION_PROC_ATTRS,
335 OOO_STYLE_REF_ACTIONS ), /* generated entry */
336 ENTRY1( TEXT, INDEX_TITLE_TEMPLATE, XML_ETACTION_PROC_ATTRS,
337 OOO_STYLE_REF_ACTIONS ), /* generated entry */
338 ENTRY1( TEXT, INDEX_ENTRY_CHAPTER, XML_ETACTION_PROC_ATTRS,
339 OOO_STYLE_REF_ACTIONS ), /* generated entry */
340 ENTRY2QN( TEXT, INDEX_ENTRY_CHAPTER_NUMBER,
341 XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
342 XML_NAMESPACE_TEXT, XML_INDEX_ENTRY_CHAPTER,
343 OOO_STYLE_REF_ACTIONS ), /* generated entry */
344 ENTRY1( TEXT, INDEX_ENTRY_TEXT, XML_ETACTION_PROC_ATTRS,
345 OOO_STYLE_REF_ACTIONS ), /* generated entry */
346 ENTRY1( TEXT, INDEX_ENTRY_PAGE_NUMBER, XML_ETACTION_PROC_ATTRS,
347 OOO_STYLE_REF_ACTIONS ), /* generated entry */
348 ENTRY1( TEXT, INDEX_ENTRY_SPAN, XML_ETACTION_PROC_ATTRS,
349 OOO_STYLE_REF_ACTIONS ), /* generated entry */
350 ENTRY1( TEXT, INDEX_ENTRY_BIBLIOGRAPHY, XML_ETACTION_PROC_ATTRS,
351 OOO_STYLE_REF_ACTIONS ), /* generated entry */
352 ENTRY1( TEXT, INDEX_ENTRY_LINK_START, XML_ETACTION_PROC_ATTRS,
353 OOO_STYLE_REF_ACTIONS ), /* generated entry */
354 ENTRY1( TEXT, INDEX_ENTRY_LINK_END, XML_ETACTION_PROC_ATTRS,
355 OOO_STYLE_REF_ACTIONS ), /* generated entry */
356 ENTRY1( STYLE, HANDOUT_MASTER, XML_ETACTION_PROC_ATTRS,
357 OOO_STYLE_REF_ACTIONS ), /* generated entry */
358 ENTRY1( DRAW, PAGE, XML_ETACTION_PROC_ATTRS,
359 OOO_STYLE_REF_ACTIONS ), /* generated entry */
360 ENTRY1( STYLE, MAP, XML_ETACTION_PROC_ATTRS,
361 OOO_STYLE_REF_ACTIONS ), /* generated entry */
362 ENTRY1( PRESENTATION, NOTES, XML_ETACTION_PROC_ATTRS,
363 OOO_STYLE_REF_ACTIONS ), /* generated entry */
364 ENTRY1( STYLE, PRESENTATION_PAGE_LAYOUT, XML_ETACTION_PROC_ATTRS,
365 OOO_MASTER_PAGE_ACTIONS ),
366 // --> OD 2005-01-10 #i40011#, #i40015#
367 // - consider also attribute table:style-name for <table:table>,
368 // <table:table-row> and <table:table-column>.
369 // ENTRY1( TABLE, TABLE, XML_ETACTION_PROC_ATTRS, OOO_STYLE_REF_ACTIONS ),
370 ENTRY0( TABLE, TABLE, XML_ETACTION_TABLE ),
372 ENTRY1( TABLE, TABLE_ROW, XML_ETACTION_PROC_ATTRS, OOO_STYLE_REF_ACTIONS ),
373 ENTRY1( TABLE, TABLE_COLUMN, XML_ETACTION_PROC_ATTRS, OOO_STYLE_REF_ACTIONS ),
374 // <--
376 // split frame elements
377 ENTRY0( DRAW, TEXT_BOX, XML_ETACTION_FRAME ),
378 ENTRY0( DRAW, IMAGE, XML_ETACTION_FRAME ),
379 ENTRY0( DRAW, OBJECT, XML_ETACTION_FRAME ),
380 ENTRY0( DRAW, OBJECT_OLE, XML_ETACTION_FRAME ),
381 ENTRY0( DRAW, APPLET, XML_ETACTION_FRAME ),
382 ENTRY0( DRAW, PLUGIN, XML_ETACTION_FRAME ),
383 ENTRY0( DRAW, FLOATING_FRAME, XML_ETACTION_FRAME ),
384 ENTRY0( SVG, DESC, XML_ETACTION_COPY_TEXT ),
386 // process events
387 ENTRY1Q( OFFICE, EVENTS, XML_ETACTION_RENAME_ELEM,
388 XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS ),
389 ENTRY0( SCRIPT, EVENT, XML_ETACTION_EVENT ),
390 ENTRY0( PRESENTATION, EVENT, XML_ETACTION_EVENT ),
392 // process length attributes
393 ENTRY1( DRAW, RECT, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
394 ENTRY1( DRAW, LINE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
395 ENTRY1( DRAW, POLYLINE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
396 ENTRY1( DRAW, POLYGON, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
397 ENTRY1( DRAW, PATH, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
398 ENTRY1( DRAW, CIRCLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
399 ENTRY1( DRAW, ELLIPSE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
400 ENTRY1( DRAW, CONNECTOR, XML_ETACTION_PROC_ATTRS, OOO_CONNECTOR_ACTIONS ),
401 ENTRY1( DRAW, CAPTION, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
402 ENTRY1( DRAW, CONTROL, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
403 ENTRY1( DRAW, PAGE_THUMBNAIL, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
404 ENTRY1( DRAW, MEASURE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
405 ENTRY1( DRAW, G, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
406 // ENTRY1( DRAW, TEXT_BOX, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
407 ENTRY1( PRESENTATION, PLACEHOLDER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
408 ENTRY1( DRAW, CONTOUR_POLYGON, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
409 ENTRY1( DRAW, CONTOUR_PATH, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
410 ENTRY1( DRAW, AREA_RECTANGLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
411 ENTRY1( DRAW, AREA_CIRCLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
412 ENTRY1( DRAW, AREA_POLYGON, XML_ETACTION_PROC_ATTRS, OOO_DRAW_AREA_POLYGON_ACTIONS ),
413 ENTRY1( DRAW, GLUE_POINT, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
414 ENTRY1( DR3D, SCENE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
415 ENTRY1( DR3D, CUBE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
416 ENTRY1( DR3D, SPHERE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
417 ENTRY1( DR3D, EXTRUDE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
418 ENTRY1( DR3D, ROTATE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
419 ENTRY1( CHART, TITLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
420 ENTRY1( CHART, SUBTITLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
421 ENTRY1( CHART, FOOTER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
422 ENTRY1( CHART, LEGEND, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
423 ENTRY1( CHART, WALL, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
424 ENTRY1( CHART, FLOOR, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
425 ENTRY1( CHART, AXIS, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
426 ENTRY1( CHART, GRID, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
427 ENTRY1( CHART, SERIES, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
428 ENTRY1( CHART, DATA_POINT, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
429 ENTRY1( CHART, MEAN_VALUE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
430 ENTRY1( CHART, ERROR_INDICATOR, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
431 ENTRY1( CHART, REGRESSION_CURVE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
432 ENTRY1( CHART, STOCK_GAIN_MARKER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
433 ENTRY1( CHART, STOCK_LOSS_MARKER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
434 ENTRY1( CHART, STOCK_RANGE_LINE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
436 ENTRY0( CHART, CHART, XML_ETACTION_CHART ),
437 ENTRY0( CHART, PLOT_AREA, XML_ETACTION_CHART_PLOT_AREA ),
439 ENTRY1Q( TEXT, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
440 XML_NAMESPACE_TEXT, XML_PROTECTION_KEY ),
441 ENTRY1Q( TABLE, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
442 XML_NAMESPACE_TABLE, XML_PROTECTION_KEY ),
444 ENTRY1( TEXT, INDEX_ENTRY_TAB_STOP, XML_ETACTION_PROC_ATTRS,
445 OOO_INDEX_ENTRY_TAB_STOP_ACTIONS ),
446 ENTRY0( STYLE, TAB_STOP, XML_ETACTION_TAB_STOP ),
447 ENTRY1( STYLE, BACKGROUND_IMAGE, XML_ETACTION_PROC_ATTRS,
448 OOO_BACKGROUND_IMAGE_ACTIONS ),
449 ENTRY1( TEXT, LINENUMBERING_CONFIGURATION, XML_ETACTION_PROC_ATTRS,
450 OOO_LINENUMBERING_ACTIONS ),
451 ENTRY1( STYLE, FOOTNOTE_SEP, XML_ETACTION_PROC_ATTRS,
452 OOO_FOOTNOTE_SEP_ACTIONS ),
453 ENTRY1( STYLE, DROP_CAP, XML_ETACTION_PROC_ATTRS, OOO_DROP_CAP_ACTIONS ),
454 ENTRY1( STYLE, COLUMNS, XML_ETACTION_PROC_ATTRS, OOO_COLUMNS_ACTIONS ),
455 ENTRY1( STYLE, COLUMN, XML_ETACTION_PROC_ATTRS, OOO_COLUMNS_ACTIONS ),
457 // rename office:value-* to *:value-*
458 ENTRY1( TEXT, VARIABLE_DECL, XML_ETACTION_PROC_ATTRS,
459 OOO_TEXT_VALUE_TYPE_ACTIONS ), /* generated entry */
460 ENTRY1( TEXT, VARIABLE_SET, XML_ETACTION_PROC_ATTRS,
461 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
462 ENTRY1( TEXT, VARIABLE_INPUT, XML_ETACTION_PROC_ATTRS,
463 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
464 ENTRY1( TEXT, USER_FIELD_DECL, XML_ETACTION_PROC_ATTRS,
465 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
466 ENTRY1( TEXT, EXPRESSION, XML_ETACTION_PROC_ATTRS,
467 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
468 // ENTRY1( TEXT, USER_DEFINED, XML_ETACTION_PROC_ATTRS,
469 // OOO_TEXT_VALUE_TYPE_ACTIONS), /* text:user-defined has no attrs so far */
470 ENTRY1( TABLE, TABLE_CELL, XML_ETACTION_PROC_ATTRS,
471 OOO_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
472 ENTRY1( TABLE, COVERED_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
473 OOO_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
474 ENTRY1( TABLE, CHANGE_TRACK_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
475 OOO_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
476 // ENTRY1( FORM, PROPERTY, XML_ETACTION_PROC_ATTRS,
477 // OOO_VALUE_TYPE_ACTIONS), /* TODO: generated entry */
478 // ENTRY1( FORM, LIST_PROPERTY, XML_ETACTION_PROC_ATTRS,
479 // OOO_VALUE_TYPE_ACTIONS), /* generated entry */
481 ENTRY1( OFFICE, ANNOTATION, XML_ETACTION_MOVE_ATTRS_TO_ELEMS,
482 OOO_ANNOTATION_ACTIONS ), /* generated entry */
483 ENTRY1( OFFICE, CHANGE_INFO, XML_ETACTION_MOVE_ATTRS_TO_ELEMS,
484 OOO_CHANGE_INFO_ACTIONS ), /* generated entry */
486 ENTRY1( TEXT, DDE_CONNECTION_DECL, XML_ETACTION_PROC_ATTRS,
487 OOO_DDE_CONNECTION_DECL_ACTIONS ),
489 ENTRY0( FORM, CONTROL, XML_ETACTION_FORM_CONTROL ),
490 ENTRY1( FORM, COLUMN, XML_ETACTION_PROC_ATTRS,
491 OOO_FORM_COLUMN_ACTIONS ),
492 ENTRY0( FORM, PROPERTY, XML_ETACTION_FORM_PROPERTY ),
494 // process xlink:href
495 ENTRY1( META, TEMPLATE, XML_ETACTION_PROC_ATTRS,
496 OOO_XLINK_ACTIONS ), /* generated entry */
497 ENTRY1( META, AUTO_RELOAD, XML_ETACTION_PROC_ATTRS,
498 OOO_XLINK_ACTIONS ), /* generated entry */
499 ENTRY1( TEXT, SECTION_SOURCE, XML_ETACTION_PROC_ATTRS,
500 OOO_XLINK_ACTIONS ), /* generated entry */
501 ENTRY1( TEXT, SCRIPT, XML_ETACTION_PROC_ATTRS,
502 OOO_XLINK_ACTIONS ), /* generated entry */
503 ENTRY1( TEXT, ALPHABETICAL_INDEX_AUTO_MARK_FILE, XML_ETACTION_PROC_ATTRS,
504 OOO_XLINK_ACTIONS ), /* generated entry */
505 ENTRY1( TABLE, TABLE_SOURCE, XML_ETACTION_PROC_ATTRS,
506 OOO_XLINK_ACTIONS ), /* generated entry */
507 ENTRY1( TABLE, CELL_RANGE_SOURCE, XML_ETACTION_PROC_ATTRS,
508 OOO_XLINK_ACTIONS ), /* generated entry */
509 ENTRY1( DRAW, A, XML_ETACTION_PROC_ATTRS,
510 OOO_XLINK_ACTIONS ), /* generated entry */
511 ENTRY1( PRESENTATION, SOUND, XML_ETACTION_PROC_ATTRS,
512 OOO_XLINK_ACTIONS ), /* generated entry */
513 ENTRY1( FORM, FORM, XML_ETACTION_PROC_ATTRS,
514 OOO_FORM_CONTROL_ACTIONS ),
515 ENTRY2QN( STYLE, SYMBOL_IMAGE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
516 XML_NAMESPACE_CHART, XML_SYMBOL_IMAGE,
517 OOO_BACKGROUND_IMAGE_ACTIONS ),
519 ENTRY2QN( CONFIG, CONFIG_ITEM_SET, XML_ETACTION_PROC_ATTRS_COND,
520 XML_NAMESPACE_OFFICE, XML_SETTINGS,
521 OOO_CONFIG_ITEM_SET_ACTIONS ),
523 // add namespace prefix
524 // text:formula
525 ENTRY1( TEXT, SEQUENCE, XML_ETACTION_PROC_ATTRS,
526 OOO_FORMULA_ACTIONS ), /* generated entry */
527 // text:condition
528 ENTRY1( TEXT, DATABASE_NEXT, XML_ETACTION_PROC_ATTRS,
529 OOO_FORMULA_ACTIONS ), /* generated entry */
530 // text:condition
531 ENTRY2QN( TEXT, DATABASE_SELECT, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
532 XML_NAMESPACE_TEXT, XML_DATABASE_ROW_SELECT,
533 OOO_FORMULA_ACTIONS ),
534 // text:condition
535 ENTRY1( TEXT, CONDITIONAL_TEXT, XML_ETACTION_PROC_ATTRS,
536 OOO_FORMULA_ACTIONS ), /* generated entry */
537 // text:condition
538 ENTRY1( TEXT, HIDDEN_TEXT, XML_ETACTION_PROC_ATTRS,
539 OOO_FORMULA_ACTIONS ), /* generated entry */
540 // text:condition
541 ENTRY1( TEXT, HIDDEN_PARAGRAPH, XML_ETACTION_PROC_ATTRS,
542 OOO_FORMULA_ACTIONS ), /* generated entry */
543 // table:condition
544 ENTRY1( TABLE, CONTENT_VALIDATION, XML_ETACTION_PROC_ATTRS,
545 OOO_FORMULA_ACTIONS ), /* generated entry */
547 // rename <table:dependences> to <table:dependencies>
548 ENTRY1Q( TABLE, DEPENDENCES, XML_ETACTION_RENAME_ELEM,
549 XML_NAMESPACE_TABLE, XML_DEPENDENCIES ),
550 ENTRY1Q( TABLE, DEPENDENCE, XML_ETACTION_RENAME_ELEM,
551 XML_NAMESPACE_TABLE, XML_DEPENDENCY ),
553 // process table::error-macro
554 ENTRY1( TABLE, ERROR_MACRO, XML_ETACTION_PROC_ATTRS,
555 OOO_ERROR_MACRO_ACTIONS ),
557 // process table::conversion-mode
558 ENTRY1( TABLE, CONVERSION_MODE, XML_ETACTION_PROC_ATTRS,
559 OOO_DDE_CONV_MODE_ACTIONS ),
561 // fix <text:alphabatical-index-mark text:main-etry>
562 ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK, XML_ETACTION_PROC_ATTRS,
563 OOO_ALPHABETICAL_INDEX_MARK_ACTIONS ),
564 ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK_START, XML_ETACTION_PROC_ATTRS,
565 OOO_ALPHABETICAL_INDEX_MARK_ACTIONS ),
567 // process table::data-pilot-member
568 ENTRY1( TABLE, DATA_PILOT_MEMBER, XML_ETACTION_PROC_ATTRS,
569 OOO_DATAPILOT_MEMBER_ACTIONS ),
571 // process table::data-pilot-level
572 ENTRY1( TABLE, DATA_PILOT_LEVEL, XML_ETACTION_PROC_ATTRS,
573 OOO_DATAPILOT_LEVEL_ACTIONS ),
575 // process table::source-service
576 ENTRY1( TABLE, SOURCE_SERVICE, XML_ETACTION_PROC_ATTRS,
577 OOO_SOURCE_SERVICE_ACTIONS ),
579 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
582 // XML_ETACTION_STYLE
583 static XMLTransformerActionInit aStyleActionTable[] =
585 ENTRY0( STYLE, FAMILY, XML_ATACTION_STYLE_FAMILY ),
586 ENTRY0( STYLE, NAME, XML_ATACTION_ENCODE_STYLE_NAME ),
587 ENTRY0( STYLE, PARENT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
588 ENTRY0( STYLE, NEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
589 ENTRY0( STYLE, LIST_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
590 ENTRY0( STYLE, MASTER_PAGE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
591 ENTRY0( STYLE, DATA_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
592 ENTRY0( DRAW, NAME, XML_ATACTION_ENCODE_STYLE_NAME ),
593 ENTRY0( DRAW, DISTANCE, XML_ATACTION_INCH2IN ),
594 ENTRY0( DRAW, DOTS1_LENGTH, XML_ATACTION_INCH2IN ),
595 ENTRY0( DRAW, DOTS2_LENGTH, XML_ATACTION_INCH2IN ),
596 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
597 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
598 ENTRY0( DRAW, START, XML_ATACTION_NEG_PERCENT ),
599 ENTRY0( DRAW, END, XML_ATACTION_NEG_PERCENT ),
600 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ),
601 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
604 // OOO_FRAME_ELEM_ACTIONS
605 static XMLTransformerActionInit aFrameElemActionTable[] =
607 ENTRY1Q( OFFICE, EVENTS, XML_ETACTION_RENAME_ELEM,
608 XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS ),
609 ENTRY0( DRAW, GLUE_POINT, XML_ETACTION_COPY ),
610 ENTRY0( DRAW, IMAGE_MAP, XML_ETACTION_COPY ),
611 ENTRY0( SVG, DESC, XML_ETACTION_COPY_TEXT ),
612 ENTRY0( DRAW, CONTOUR_POLYGON, XML_ETACTION_COPY ),
613 ENTRY0( DRAW, CONTOUR_PATH, XML_ETACTION_COPY ),
614 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
617 // OOO_FRAME_ATTR_ACTIONS
618 static XMLTransformerActionInit aFrameAttrActionTable[] =
620 ENTRY0( DRAW, ZINDEX, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
621 ENTRY0( DRAW, ID, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
622 ENTRY0( DRAW, LAYER, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
623 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
624 ENTRY0( PRESENTATION, STYLE_NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
625 ENTRY0( DRAW, TRANSFORM, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
626 ENTRY0( DRAW, NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
627 ENTRY0( TABLE, END_CELL_ADDRESS, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
628 ENTRY0( TABLE, END_X, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
629 ENTRY0( TABLE, END_Y, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
630 ENTRY0( TABLE, TABLE_BACKGROUND, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
631 ENTRY0( TEXT, ANCHOR_TYPE, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
632 ENTRY0( TEXT, ANCHOR_PAGE_NUMBER, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
633 ENTRY0( DRAW, TEXT_STYLE_NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
634 ENTRY0( SVG, X, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
635 ENTRY0( SVG, Y, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
636 ENTRY0( SVG, WIDTH, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
637 ENTRY0( SVG, HEIGHT, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
638 ENTRY0( STYLE, REL_WIDTH, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
639 ENTRY0( STYLE, REL_HEIGHT, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
640 ENTRY0( PRESENTATION, CLASS, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
641 ENTRY0( PRESENTATION, PLACEHOLDER, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
642 ENTRY0( PRESENTATION, USER_TRANSFORMED, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
643 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
646 // OOO_EVENT_ELEM_ACTIONS
647 static XMLTransformerActionInit aEventActionTable[] =
649 ENTRY0( XLINK, HREF, XML_ATACTION_HREF ),
650 ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_ADD_NAMESPACE_PREFIX,
651 XML_NAMESPACE_OOO ),
652 ENTRY0( SCRIPT, EVENT_NAME, XML_ATACTION_EVENT_NAME ),
653 ENTRY0( SCRIPT, MACRO_NAME, XML_ATACTION_MACRO_NAME ),
654 ENTRY0( SCRIPT, LOCATION, XML_ATACTION_MACRO_LOCATION ),
655 ENTRY0( SCRIPT, LIBRARY, XML_ATACTION_MACRO_LOCATION ), // bug in draw
656 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
660 // action table for OOO_MASTER_PAGE_ACTIONS
661 static XMLTransformerActionInit aMasterPageActionTable[] =
663 ENTRY0( STYLE, NAME, XML_ATACTION_ENCODE_STYLE_NAME ),
664 ENTRY0( STYLE, NEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
665 ENTRY1Q( STYLE, PAGE_MASTER_NAME, XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF,
666 XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME ),
667 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
668 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
671 static XMLTransformerActionInit aFontDeclActionTable[] =
673 ENTRY1Q( FO, FONT_FAMILY, XML_ATACTION_RENAME,
674 XML_NAMESPACE_SVG, XML_FONT_FAMILY ),
675 ENTRY1Q( STYLE, FONT_STYLE_NAME, XML_ATACTION_RENAME,
676 XML_NAMESPACE_STYLE, XML_FONT_ADORNMENTS ),
677 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
680 // action table for OOO_PARA_ACTIONS
681 static XMLTransformerActionInit aParaActionTable[] =
683 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
684 ENTRY0( TEXT, COND_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
685 // ENTRY0( TEXT, CLASS_NAMES, XML_ATACTION_REMOVE ),
686 ENTRY1Q( TEXT, LEVEL, XML_ATACTION_RENAME,
687 XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL ),
688 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
691 // action table for OOO_STYLE_REF_ACTIONS
692 static XMLTransformerActionInit aStyleRefActionTable[] =
694 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
695 ENTRY0( TEXT, VISITED_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
696 ENTRY0( TEXT, MAIN_ENTRY_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
697 ENTRY0( TEXT, CITATION_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
698 ENTRY0( TEXT, CITATION_BODY_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
699 ENTRY0( TEXT, DEFAULT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
700 ENTRY0( TEXT, MASTER_PAGE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
701 ENTRY0( STYLE, DATA_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
702 ENTRY0( STYLE, APPLY_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
703 ENTRY0( STYLE, PAGE_LAYOUT_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
704 ENTRY0( TABLE, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
705 ENTRY0( TABLE, DEFAULT_CELL_STYLE_NAME,
706 XML_ATACTION_ENCODE_STYLE_NAME_REF ),
707 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
708 ENTRY0( DRAW, MASTER_PAGE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
709 ENTRY0( PRESENTATION, PRESENTATION_PAGE_LAYOUT_NAME,
710 XML_ATACTION_ENCODE_STYLE_NAME_REF ),
711 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_False ),
712 ENTRY1( TEXT, CONDITION, XML_ATACTION_ADD_NAMESPACE_PREFIX,
713 XML_NAMESPACE_OOOW ),
714 ENTRY1( TEXT, FORMULA, XML_ATACTION_ADD_NAMESPACE_PREFIX,
715 XML_NAMESPACE_OOOW ),
716 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
719 // OOO_SHAPE_ACTIONS
720 // !!ATTENTION!! If you change something here, please also change
721 // aConnectorActionTable if apropriate
722 static XMLTransformerActionInit aShapeActionTable[] =
724 ENTRY0( SVG, X, XML_ATACTION_INCH2IN ),
725 ENTRY0( SVG, Y, XML_ATACTION_INCH2IN ),
726 ENTRY0( SVG, X1, XML_ATACTION_INCH2IN ),
727 ENTRY0( SVG, Y1, XML_ATACTION_INCH2IN ),
728 ENTRY0( SVG, X2, XML_ATACTION_INCH2IN ),
729 ENTRY0( SVG, Y2, XML_ATACTION_INCH2IN ),
730 ENTRY0( SVG, CX, XML_ATACTION_INCH2IN ),
731 ENTRY0( SVG, CY, XML_ATACTION_INCH2IN ),
732 ENTRY0( SVG, R, XML_ATACTION_INCH2IN ),
733 ENTRY0( SVG, RX, XML_ATACTION_INCH2IN ),
734 ENTRY0( SVG, RY, XML_ATACTION_INCH2IN ),
735 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
736 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
737 ENTRY0( FO, MIN_WIDTH, XML_ATACTION_INCH2IN ),
738 ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_INCH2IN ),
739 ENTRY0( FO, MAX_WIDTH, XML_ATACTION_INCH2IN ),
740 ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_INCH2IN ),
741 ENTRY0( DRAW, CORNER_RADIUS, XML_ATACTION_INCH2IN ),
742 ENTRY0( DRAW, LINE_SKEW, XML_ATACTION_INCHS2INS ),
743 ENTRY0( DRAW, CAPTION_POINT_X, XML_ATACTION_INCH2IN ),
744 ENTRY0( DRAW, CAPTION_POINT_Y, XML_ATACTION_INCH2IN ),
745 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
746 ENTRY0( DRAW, TEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
747 ENTRY0( DRAW, END_X, XML_ATACTION_INCH2IN ),
748 ENTRY0( DRAW, END_Y, XML_ATACTION_INCH2IN ),
749 ENTRY0( PRESENTATION, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
750 ENTRY0( DR3D, DISTANCE, XML_ATACTION_INCH2IN ),
751 ENTRY0( DR3D, FOCAL_LENGTH, XML_ATACTION_INCH2IN ),
752 ENTRY1Q( FORM, ID, XML_ATACTION_RENAME,
753 XML_NAMESPACE_DRAW, XML_CONTROL ),
754 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ),
756 // BM: needed by chart:legend. The legend needs also the draw actions. As
757 // there is no merge mechanism, all actions have to be in the same table
758 ENTRY2( CHART, LEGEND_POSITION, XML_ATACTION_RENAME_ATTRIBUTE,
759 RENAME_ENTRY( XML_LEFT, XML_START ),
760 RENAME_ENTRY( XML_RIGHT, XML_END )),
761 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
764 static XMLTransformerActionInit aConnectorActionTable[] =
766 ENTRY0( SVG, X1, XML_ATACTION_TWIPS2IN ),
767 ENTRY0( SVG, Y1, XML_ATACTION_TWIPS2IN ),
768 ENTRY0( SVG, X2, XML_ATACTION_TWIPS2IN ),
769 ENTRY0( SVG, Y2, XML_ATACTION_TWIPS2IN ),
770 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
771 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
772 ENTRY0( FO, MIN_WIDTH, XML_ATACTION_INCH2IN ),
773 ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_INCH2IN ),
774 ENTRY0( FO, MAX_WIDTH, XML_ATACTION_INCH2IN ),
775 ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_INCH2IN ),
776 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
777 ENTRY0( DRAW, TEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
778 ENTRY0( DRAW, END_X, XML_ATACTION_INCH2IN ),
779 ENTRY0( DRAW, END_Y, XML_ATACTION_INCH2IN ),
780 ENTRY0( PRESENTATION, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
781 ENTRY1Q( FORM, ID, XML_ATACTION_RENAME,
782 XML_NAMESPACE_DRAW, XML_CONTROL ),
783 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ),
784 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
787 // OOO_INDEX_ENTRY_TAB_STOP_ACTIONS
788 static XMLTransformerActionInit aIndexEntryTabStopActionTable[] =
790 ENTRY0( STYLE, POSITION, XML_ATACTION_INCH2IN ),
791 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
792 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
795 // OOO_TAB_STOP_ACTIONS
796 static XMLTransformerActionInit aTabStopActionTable[] =
798 ENTRY0( STYLE, POSITION, XML_ATACTION_INCH2IN ),
799 ENTRY1Q( STYLE, LEADER_CHAR, XML_ATACTION_RENAME,
800 XML_NAMESPACE_STYLE, XML_LEADER_TEXT ),
801 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
804 // OOO_LINENUMBERING_ACTIONS
805 static XMLTransformerActionInit aLineNumberingActionTable[] =
807 ENTRY0( TEXT, OFFSET, XML_ATACTION_INCH2IN ),
808 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
809 ENTRY1Q( TEXT, COUNT_IN_FLOATING_FRAMES, XML_ATACTION_RENAME,
810 XML_NAMESPACE_TEXT, XML_COUNT_IN_TEXT_BOXES ),
811 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
814 static XMLTransformerActionInit aFootnoteSepActionTable[] =
816 ENTRY0( STYLE, WIDTH, XML_ATACTION_INCH2IN ),
817 ENTRY0( STYLE, DISTANCE_BEFORE_SEP, XML_ATACTION_INCH2IN ),
818 ENTRY0( STYLE, DISTANCE_AFTER_SEP, XML_ATACTION_INCH2IN ),
819 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
822 // OOO_DROP_CAP_ACTIONS
823 static XMLTransformerActionInit aDropCapActionTable[] =
825 ENTRY0( STYLE, DISTANCE, XML_ATACTION_INCH2IN ),
826 ENTRY0( STYLE, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
827 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
830 static XMLTransformerActionInit aColumnsActionTable[] =
832 ENTRY0( STYLE, COLUMN_GAP, XML_ATACTION_INCH2IN ),
833 // ENTRY0( STYLE, SPACE_BEFORE, XML_ATACTION_INCH2IN ),
834 // ENTRY0( STYLE, SPACE_AFTER, XML_ATACTION_INCH2IN ),
835 ENTRY1Q( FO, MARGIN_LEFT, XML_ATACTION_RENAME_INCH2IN,
836 XML_NAMESPACE_FO, XML_START_INDENT ),
837 ENTRY1Q( FO, MARGIN_RIGHT, XML_ATACTION_RENAME_INCH2IN,
838 XML_NAMESPACE_FO, XML_END_INDENT ),
839 ENTRY0( STYLE, WIDTH, XML_ATACTION_INCH2IN ),
840 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
843 // OOO_TEXT_VALUE_TYPE_ACTIONS
844 static XMLTransformerActionInit aTextValueTypeActionTable[] =
846 ENTRY1Q( TEXT, VALUE_TYPE, XML_ATACTION_RENAME,
847 XML_NAMESPACE_OFFICE, XML_VALUE_TYPE ),
848 ENTRY1Q( TEXT, VALUE, XML_ATACTION_RENAME,
849 XML_NAMESPACE_OFFICE, XML_VALUE ),
850 ENTRY1Q( TEXT, CURRENCY, XML_ATACTION_RENAME,
851 XML_NAMESPACE_OFFICE, XML_CURRENCY ),
852 ENTRY1Q( TEXT, DATE_VALUE, XML_ATACTION_RENAME,
853 XML_NAMESPACE_OFFICE, XML_DATE_VALUE ),
854 ENTRY1Q( TEXT, TIME_VALUE, XML_ATACTION_RENAME,
855 XML_NAMESPACE_OFFICE, XML_TIME_VALUE ),
856 ENTRY1Q( TEXT, BOOLEAN_VALUE, XML_ATACTION_RENAME,
857 XML_NAMESPACE_OFFICE, XML_BOOLEAN_VALUE ),
858 ENTRY1Q( TEXT, STRING_VALUE, XML_ATACTION_RENAME,
859 XML_NAMESPACE_OFFICE, XML_STRING_VALUE ),
860 ENTRY0( STYLE, DATA_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
861 ENTRY1( TEXT, FORMULA, XML_ATACTION_ADD_NAMESPACE_PREFIX,
862 XML_NAMESPACE_OOOW ),
863 ENTRY0( TEXT, TOKEN_INVALID, XML_ATACTION_EOT )
866 // OOO_TABLE_VALUE_TYPE_ACTIONS
867 static XMLTransformerActionInit aTableValueTypeActionTable[] =
869 ENTRY1Q( TABLE, VALUE_TYPE, XML_ATACTION_RENAME,
870 XML_NAMESPACE_OFFICE, XML_VALUE_TYPE ),
871 ENTRY1Q( TABLE, VALUE, XML_ATACTION_RENAME,
872 XML_NAMESPACE_OFFICE, XML_VALUE ),
873 ENTRY1Q( TABLE, CURRENCY, XML_ATACTION_RENAME,
874 XML_NAMESPACE_OFFICE, XML_CURRENCY ),
875 ENTRY1Q( TABLE, DATE_VALUE, XML_ATACTION_RENAME,
876 XML_NAMESPACE_OFFICE, XML_DATE_VALUE ),
877 ENTRY1Q( TABLE, TIME_VALUE, XML_ATACTION_RENAME,
878 XML_NAMESPACE_OFFICE, XML_TIME_VALUE ),
879 ENTRY1Q( TABLE, BOOLEAN_VALUE, XML_ATACTION_RENAME,
880 XML_NAMESPACE_OFFICE, XML_BOOLEAN_VALUE ),
881 ENTRY1Q( TABLE, STRING_VALUE, XML_ATACTION_RENAME,
882 XML_NAMESPACE_OFFICE, XML_STRING_VALUE ),
883 ENTRY0( TABLE, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
884 ENTRY1( TABLE, FORMULA, XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,
885 XML_NAMESPACE_OOOW ),
886 ENTRY1Q( TABLE, VALIDATION_NAME, XML_ATACTION_RENAME,
887 XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME ),
888 ENTRY0( TABLE, TOKEN_INVALID, XML_ATACTION_EOT )
891 // action table for OOO_ANNOTATION_ACTIONS
892 static XMLTransformerActionInit aAnnotationActionTable[] =
894 ENTRY1Q( OFFICE, AUTHOR, XML_ATACTION_MOVE_TO_ELEM,
895 XML_NAMESPACE_DC, XML_CREATOR ),
896 ENTRY1Q( OFFICE, CREATE_DATE, XML_ATACTION_MOVE_TO_ELEM,
897 XML_NAMESPACE_DC, XML_DATE ),
898 ENTRY1Q( OFFICE, CREATE_DATE_STRING, XML_ATACTION_MOVE_TO_ELEM,
899 XML_NAMESPACE_META, XML_DATE_STRING ),
900 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
903 // action table for OOO_CHANGE_INFO_ACTIONS
904 static XMLTransformerActionInit aChangeInfoActionTable[] =
906 ENTRY1Q( OFFICE, CHG_AUTHOR, XML_ATACTION_MOVE_TO_ELEM,
907 XML_NAMESPACE_DC, XML_CREATOR ),
908 ENTRY1Q( OFFICE, CHG_DATE_TIME, XML_ATACTION_MOVE_TO_ELEM,
909 XML_NAMESPACE_DC, XML_DATE ),
910 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
913 // OOO_BACKGROUND_IMAGE_ACTIONS
914 static XMLTransformerActionInit aBackgroundImageActionTable[] =
916 ENTRY1Q( DRAW, TRANSPARENCY, XML_ATACTION_RENAME_NEG_PERCENT,
917 XML_NAMESPACE_DRAW, XML_OPACITY ),
918 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ),
919 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
922 // --> OD 2005-06-10 #i50322#
923 // OOO_BACKGROUND_IMAGE_ACTIONS for OpenOffice.org text documents
924 // OpenOffice.org text documents, written by OpenOffice.org, contain
925 // wrong value for the transparency of the background graphic
926 static XMLTransformerActionInit aWriterBackgroundImageActionTable[] =
928 ENTRY1Q( DRAW, TRANSPARENCY, XML_ATACTION_WRITER_BACK_GRAPHIC_TRANSPARENCY, XML_NAMESPACE_DRAW, XML_OPACITY ),
929 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ),
930 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
932 // <--
934 // OOO_DDE_CONNECTION_DECL
935 static XMLTransformerActionInit aDDEConnectionDeclActionTable[] =
937 ENTRY1Q( TEXT, NAME, XML_ATACTION_RENAME,
938 XML_NAMESPACE_OFFICE, XML_NAME ),
939 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
942 // OOO_FORM_CONTROL_ACTIONS
943 static XMLTransformerActionInit aFormControlActionTable[] =
945 ENTRY2QN( FORM, SERVICE_NAME,
946 XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX,
947 XML_NAMESPACE_FORM, XML_CONTROL_IMPLEMENTATION,
948 XML_NAMESPACE_OOO ),
949 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_False ),
950 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
953 // OOO_FORM_COLUMN_ACTIONS
954 static XMLTransformerActionInit aFormColumnActionTable[] =
956 ENTRY1Q( FORM, COLUMN_STYLE_NAME, XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF,
957 XML_NAMESPACE_FORM, XML_TEXT_STYLE_NAME ),
958 ENTRY2QN( FORM, SERVICE_NAME,
959 XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX,
960 XML_NAMESPACE_FORM, XML_CONTROL_IMPLEMENTATION,
961 XML_NAMESPACE_OOO ),
962 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
965 // OOO_FORM_PROP_ACTIONS
966 static XMLTransformerActionInit aFormPropActionTable[] =
968 ENTRY1Q( FORM, PROPERTY_TYPE, XML_ATACTION_RENAME,
969 XML_NAMESPACE_OFFICE, XML_VALUE_TYPE ),
970 ENTRY0( FORM, PROPERTY_IS_LIST, XML_ATACTION_REMOVE ),
971 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
974 // OOO_XLINK_ACTIONS
975 static XMLTransformerActionInit aXLinkActionTable[] =
977 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_False ),
978 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
981 // OOO_CONFIG_ITEM_SET_ACTIONS
982 static XMLTransformerActionInit aConfigItemSetActionTable[] =
984 ENTRY1( CONFIG, NAME, XML_ATACTION_ADD_NAMESPACE_PREFIX,
985 XML_NAMESPACE_OOO ),
986 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
989 // OASIS_FORMULA_ACTIONS
990 static XMLTransformerActionInit aFormulaActionTable[] =
992 ENTRY1( TEXT, CONDITION, XML_ATACTION_ADD_NAMESPACE_PREFIX,
993 XML_NAMESPACE_OOOW ),
994 ENTRY1( TEXT, FORMULA, XML_ATACTION_ADD_NAMESPACE_PREFIX,
995 XML_NAMESPACE_OOOW ),
996 ENTRY1( TABLE, CONDITION, XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,
997 XML_NAMESPACE_OOOW ),
998 ENTRY1( TABLE, FORMULA, XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,
999 XML_NAMESPACE_OOOW ),
1000 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1003 // OOO_ERROR_MACRO_ACTIONS
1004 static XMLTransformerActionInit aErrorMacroActionTable[] =
1006 ENTRY0( TABLE, NAME, XML_ATACTION_REMOVE ),
1007 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1010 // OOO_DDE_CONV_MODE_ACTIONS
1011 static XMLTransformerActionInit aDDEConvModeActionTable[] =
1013 ENTRY1Q( TABLE, LET_TEXT, XML_ATACTION_RENAME,
1014 XML_NAMESPACE_TABLE, XML_KEEP_TEXT ),
1015 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1018 // OOO_DATAPILOT_MEMBER_ACTIONS
1019 static XMLTransformerActionInit aDataPilotMemberActionTable[] =
1021 ENTRY1Q( TABLE, DISPLAY_DETAILS, XML_ATACTION_RENAME,
1022 XML_NAMESPACE_TABLE, XML_SHOW_DETAILS ),
1023 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1026 // OOO_DATAPILOT_LEVEL_ACTIONS
1027 static XMLTransformerActionInit aDataPilotLevelActionTable[] =
1029 ENTRY1Q( TABLE, DISPLAY_EMPTY, XML_ATACTION_RENAME,
1030 XML_NAMESPACE_TABLE, XML_SHOW_EMPTY ),
1031 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1034 // OOO_SOURCE_SERVICE_ACTIONS
1035 static XMLTransformerActionInit aSourceServiceActionTable[] =
1037 ENTRY1Q( TABLE, USERNAME, XML_ATACTION_RENAME,
1038 XML_NAMESPACE_TABLE, XML_USER_NAME ),
1039 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1042 // OOO_DRAW_AREA_POLYGON_ACTIONS (to be added to OOO_SHAPE_ACTIONS)
1043 static XMLTransformerActionInit aDrawAreaPolygonActionTable[] =
1045 ENTRY1Q( SVG, POINTS, XML_ATACTION_RENAME,
1046 XML_NAMESPACE_DRAW, XML_POINTS ),
1047 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1050 // OOO_CHART_ACTIONS
1051 static XMLTransformerActionInit aChartActionTable[] =
1053 ENTRY1( CHART, CLASS, XML_ATACTION_ADD_NAMESPACE_PREFIX,
1054 XML_NAMESPACE_CHART ),
1055 ENTRY0( CHART, ADD_IN_NAME, XML_ATACTION_REMOVE ),
1056 ENTRY0( SVG, WIDTH, XML_ATACTION_INCH2IN ),
1057 ENTRY0( SVG, HEIGHT, XML_ATACTION_INCH2IN ),
1058 ENTRY0( CHART, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
1059 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1062 // OOO_ALPHABETICAL_INDEX_MARK_ACTIONS
1063 static XMLTransformerActionInit aAlphabeticalIndexMarkActionTable[] =
1065 ENTRY1Q( TEXT, MAIN_ETRY, XML_ATACTION_RENAME,
1066 XML_NAMESPACE_TEXT, XML_MAIN_ENTRY ),
1067 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1070 // OOO_SCRIPT_ACTIONS
1071 static XMLTransformerActionInit aScriptActionTable[] =
1073 ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_ADD_NAMESPACE_PREFIX, XML_NAMESPACE_OOO ),
1074 ENTRY1Q( SCRIPT, NAME, XML_ATACTION_RENAME, XML_NAMESPACE_OOO, XML_NAME ),
1075 ENTRY1Q( SCRIPT, READONLY, XML_ATACTION_RENAME, XML_NAMESPACE_OOO, XML_READONLY ),
1076 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1079 static XMLTokenEnum aTokenMap[] =
1081 XML_NONE, XML_SINGLE, XML_DOUBLE, XML_BOLD, XML_BOLD_DOTTED,
1082 XML_BOLD_DASH, XML_BOLD_LONG_DASH, XML_BOLD_DOT_DASH,
1083 XML_BOLD_DOT_DOT_DASH, XML_BOLD_WAVE, XML_DOUBLE_WAVE,
1084 XML_SINGLE_LINE, XML_DOUBLE_LINE, XML_THICK_LINE, XML_SLASH, XML_uX,
1085 XML_TOKEN_END
1088 //-----------------------------------------------------------------------------
1090 class XMLDocumentTransformerContext_Impl : public XMLTransformerContext
1092 ::rtl::OUString m_aElemQName;
1093 ::rtl::OUString m_aOldClass;
1095 public:
1096 TYPEINFO();
1098 XMLDocumentTransformerContext_Impl( XMLTransformerBase& rTransformer,
1099 const ::rtl::OUString& rQName );
1100 XMLDocumentTransformerContext_Impl( XMLTransformerBase& rTransformer,
1101 const ::rtl::OUString& rQName,
1102 sal_uInt16 nPrefix,
1103 ::xmloff::token::XMLTokenEnum eToken );
1105 virtual ~XMLDocumentTransformerContext_Impl();
1107 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1108 virtual void EndElement();
1111 TYPEINIT1( XMLDocumentTransformerContext_Impl, XMLTransformerContext );
1113 XMLDocumentTransformerContext_Impl::XMLDocumentTransformerContext_Impl(
1114 XMLTransformerBase& rImp,
1115 const OUString& rQName ) :
1116 XMLTransformerContext( rImp, rQName ),
1117 m_aElemQName( rQName )
1120 XMLDocumentTransformerContext_Impl::XMLDocumentTransformerContext_Impl(
1121 XMLTransformerBase& rImp,
1122 const OUString& rQName ,
1123 sal_uInt16 nPrefix,
1124 ::xmloff::token::XMLTokenEnum eToken) :
1125 XMLTransformerContext( rImp, rQName ),
1126 m_aElemQName( rImp.GetNamespaceMap().GetQNameByKey( nPrefix,
1127 ::xmloff::token::GetXMLToken( eToken ) ) )
1131 XMLDocumentTransformerContext_Impl::~XMLDocumentTransformerContext_Impl()
1135 void XMLDocumentTransformerContext_Impl::StartElement(
1136 const Reference< XAttributeList >& rAttrList )
1138 Reference< XAttributeList > xAttrList( rAttrList );
1140 m_aOldClass = GetTransformer().GetClass();
1142 XMLMutableAttributeList *pMutableAttrList = 0;
1143 sal_Bool bOOo = sal_False, bOOoW = sal_False, bOOoC = sal_False,
1144 bDOM=sal_False, bDC = sal_False, bSVG = sal_False;
1145 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1146 for( sal_Int16 i=0; i < nAttrCount; i++ )
1148 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1149 OUString aLocalName;
1150 sal_uInt16 nPrefix =
1151 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1152 &aLocalName );
1153 if( XML_NAMESPACE_OFFICE == nPrefix &&
1154 IsXMLToken( aLocalName, XML_CLASS ) )
1156 const OUString& rValue = xAttrList->getValueByIndex( i );
1157 GetTransformer().SetClass( rValue );
1159 pMutableAttrList = new XMLMutableAttributeList( xAttrList );
1160 xAttrList = pMutableAttrList;
1161 OUString sMime(RTL_CONSTASCII_USTRINGPARAM("application/vnd.oasis.opendocument.") );
1162 sMime += rValue;
1163 pMutableAttrList->SetValueByIndex( i, sMime );
1164 OUString aNewAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OFFICE, ::xmloff::token::GetXMLToken( XML_MIMETYPE ) ) );
1165 pMutableAttrList->RenameAttributeByIndex(i, aNewAttrQName );
1166 break;
1168 else if( XML_NAMESPACE_XMLNS == nPrefix )
1170 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1171 if( IsXMLToken( rAttrValue, XML_N_OOO ) )
1172 bOOo = sal_True;
1173 else if( IsXMLToken( rAttrValue, XML_N_OOOW ) )
1174 bOOoW = sal_True;
1175 else if( IsXMLToken( rAttrValue, XML_N_OOOC ) )
1176 bOOoC = sal_True;
1177 else if( IsXMLToken( rAttrValue, XML_N_DOM ) )
1178 bDOM = sal_True;
1179 else if( IsXMLToken( rAttrValue, XML_N_DC ) )
1180 bDC = sal_True;
1181 else if( IsXMLToken( rAttrValue, XML_N_SVG ) )
1182 bSVG = sal_True;
1185 if( !(bOOo && bOOoW && bOOoC && bDOM && bDC && bSVG) )
1187 if( !pMutableAttrList )
1189 pMutableAttrList = new XMLMutableAttributeList( xAttrList );
1190 xAttrList = pMutableAttrList;
1192 if( !bOOo )
1193 pMutableAttrList->AddAttribute(
1194 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1195 XML_NAMESPACE_OOO ),
1196 GetTransformer().GetNamespaceMap().GetNameByKey(
1197 XML_NAMESPACE_OOO ) );
1198 if( !bOOoW )
1199 pMutableAttrList->AddAttribute(
1200 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1201 XML_NAMESPACE_OOOW ),
1202 GetTransformer().GetNamespaceMap().GetNameByKey(
1203 XML_NAMESPACE_OOOW ) );
1204 if( !bOOoC )
1205 pMutableAttrList->AddAttribute(
1206 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1207 XML_NAMESPACE_OOOC ),
1208 GetTransformer().GetNamespaceMap().GetNameByKey(
1209 XML_NAMESPACE_OOOC ) );
1210 if( !bDOM )
1211 pMutableAttrList->AddAttribute(
1212 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1213 XML_NAMESPACE_DOM ),
1214 GetTransformer().GetNamespaceMap().GetNameByKey(
1215 XML_NAMESPACE_DOM ) );
1216 if( !bDC )
1217 pMutableAttrList->AddAttribute(
1218 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1219 XML_NAMESPACE_DC ),
1220 GetTransformer().GetNamespaceMap().GetNameByKey(
1221 XML_NAMESPACE_DC ) );
1222 if( !bSVG )
1223 pMutableAttrList->AddAttribute(
1224 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1225 XML_NAMESPACE_SVG ),
1226 GetTransformer().GetNamespaceMap().GetNameByKey(
1227 XML_NAMESPACE_SVG ) );
1230 GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1233 void XMLDocumentTransformerContext_Impl::EndElement()
1235 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1237 GetTransformer().SetClass( m_aOldClass );
1240 //-----------------------------------------------------------------------------
1242 class XMLBodyTransformerContext_Impl : public XMLTransformerContext
1244 OUString m_aClassQName;
1246 public:
1247 TYPEINFO();
1249 XMLBodyTransformerContext_Impl( XMLTransformerBase& rTransformer,
1250 const ::rtl::OUString& rQName );
1252 virtual ~XMLBodyTransformerContext_Impl();
1254 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1255 virtual void EndElement();
1258 TYPEINIT1( XMLBodyTransformerContext_Impl, XMLTransformerContext );
1260 XMLBodyTransformerContext_Impl::XMLBodyTransformerContext_Impl(
1261 XMLTransformerBase& rImp,
1262 const OUString& rQName ) :
1263 XMLTransformerContext( rImp, rQName )
1267 XMLBodyTransformerContext_Impl::~XMLBodyTransformerContext_Impl()
1271 void XMLBodyTransformerContext_Impl::StartElement(
1272 const Reference< XAttributeList >& rAttrList )
1274 XMLTransformerContext::StartElement( rAttrList );
1276 XMLMutableAttributeList *pMutableAttrList =
1277 new XMLMutableAttributeList( rAttrList );
1278 Reference< XAttributeList > xAttrList = pMutableAttrList;
1279 OUString aClass( GetTransformer().GetClass() );
1280 if( !aClass.getLength() )
1282 aClass = GetXMLToken( XML_TEXT );
1284 else if( IsXMLToken( aClass, XML_TEXT_GLOBAL ) )
1286 OUString aGlobalQName(
1287 GetTransformer().GetNamespaceMap().GetQNameByKey(
1288 XML_NAMESPACE_TEXT, GetXMLToken(XML_GLOBAL ) ) );
1289 pMutableAttrList->AddAttribute( aGlobalQName, GetXMLToken(XML_TRUE) );
1291 aClass = GetXMLToken( XML_TEXT );
1294 m_aClassQName = GetTransformer().GetNamespaceMap().GetQNameByKey(
1295 XML_NAMESPACE_OFFICE, aClass );
1296 GetTransformer().GetDocHandler()->startElement( m_aClassQName,
1297 xAttrList );
1300 void XMLBodyTransformerContext_Impl::EndElement()
1302 GetTransformer().GetDocHandler()->endElement( m_aClassQName );
1303 XMLTransformerContext::EndElement();
1306 //-----------------------------------------------------------------------------
1308 class XMLTabStopOOoTContext_Impl : public XMLPersElemContentTContext
1310 public:
1311 TYPEINFO();
1313 XMLTabStopOOoTContext_Impl( XMLTransformerBase& rTransformer,
1314 const ::rtl::OUString& rQName );
1316 virtual ~XMLTabStopOOoTContext_Impl();
1318 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1321 TYPEINIT1( XMLTabStopOOoTContext_Impl, XMLPersElemContentTContext );
1323 XMLTabStopOOoTContext_Impl::XMLTabStopOOoTContext_Impl(
1324 XMLTransformerBase& rImp,
1325 const OUString& rQName ) :
1326 XMLPersElemContentTContext( rImp, rQName )
1330 XMLTabStopOOoTContext_Impl::~XMLTabStopOOoTContext_Impl()
1334 void XMLTabStopOOoTContext_Impl::StartElement(
1335 const Reference< XAttributeList >& rAttrList )
1337 XMLTransformerActions *pActions =
1338 GetTransformer().GetUserDefinedActions( OOO_TAB_STOP_ACTIONS );
1339 OSL_ENSURE( pActions, "go no actions" );
1341 Reference< XAttributeList > xAttrList( rAttrList );
1342 XMLMutableAttributeList *pMutableAttrList = 0;
1343 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1344 for( sal_Int16 i=0; i < nAttrCount; i++ )
1346 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1347 OUString aLocalName;
1348 sal_uInt16 nPrefix =
1349 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1350 &aLocalName );
1351 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1352 XMLTransformerActions::const_iterator aIter =
1353 pActions->find( aKey );
1354 if( !(aIter == pActions->end() ) )
1356 if( !pMutableAttrList )
1358 pMutableAttrList =
1359 new XMLMutableAttributeList( xAttrList );
1360 xAttrList = pMutableAttrList;
1362 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1363 switch( (*aIter).second.m_nActionType )
1365 case XML_ATACTION_RENAME:
1367 OUString aNewAttrQName(
1368 GetTransformer().GetNamespaceMap().GetQNameByKey(
1369 (*aIter).second.GetQNamePrefixFromParam1(),
1370 ::xmloff::token::GetXMLToken(
1371 (*aIter).second.GetQNameTokenFromParam1()) ) );
1372 pMutableAttrList->RenameAttributeByIndex( i,
1373 aNewAttrQName );
1375 if( IsXMLToken( aLocalName, XML_LEADER_CHAR ) &&
1376 rAttrValue.getLength() > 0 &&
1377 rAttrValue[0] != ' ' )
1379 OUString aNewAttrQName(
1380 GetTransformer().GetNamespaceMap().GetQNameByKey(
1381 XML_NAMESPACE_STYLE,
1382 ::xmloff::token::GetXMLToken(XML_LEADER_STYLE) ) );
1383 pMutableAttrList->AddAttribute( aNewAttrQName,
1384 GetXMLToken( XML_SOLID ) );
1386 break;
1387 case XML_ATACTION_INCH2IN:
1389 OUString aAttrValue( rAttrValue );
1390 if( XMLTransformerBase::ReplaceSingleInchWithIn(
1391 aAttrValue ) )
1392 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1394 break;
1395 default:
1396 OSL_ENSURE( !this, "unknown action" );
1397 break;
1402 XMLPersElemContentTContext::StartElement( xAttrList );
1405 // -----------------------------------------------------------------------------
1407 class XMLTrackedChangesOOoTContext_Impl : public XMLTransformerContext
1409 sal_uInt16 m_nPrefix;
1410 XMLTokenEnum m_eToken;
1412 public:
1414 TYPEINFO();
1416 XMLTrackedChangesOOoTContext_Impl( XMLTransformerBase& rTransformer,
1417 const ::rtl::OUString& rQName,
1418 sal_uInt16 nPrefix,
1419 XMLTokenEnum eToken );
1421 virtual ~XMLTrackedChangesOOoTContext_Impl();
1423 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1426 TYPEINIT1( XMLTrackedChangesOOoTContext_Impl, XMLTransformerContext );
1428 XMLTrackedChangesOOoTContext_Impl::XMLTrackedChangesOOoTContext_Impl(
1429 XMLTransformerBase& rImp,
1430 const OUString& rQName,
1431 sal_uInt16 nPrefix,
1432 XMLTokenEnum eToken ) :
1433 XMLTransformerContext( rImp, rQName ),
1434 m_nPrefix( nPrefix ),
1435 m_eToken( eToken )
1439 XMLTrackedChangesOOoTContext_Impl::~XMLTrackedChangesOOoTContext_Impl()
1443 void XMLTrackedChangesOOoTContext_Impl::StartElement(
1444 const Reference< XAttributeList >& rAttrList )
1446 Reference< XAttributeList > xAttrList( rAttrList );
1447 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1448 for( sal_Int16 i=0; i < nAttrCount; i++ )
1450 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1451 OUString aLocalName;
1452 sal_uInt16 nPrefix =
1453 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1454 &aLocalName );
1455 if( m_nPrefix == nPrefix && IsXMLToken( aLocalName, m_eToken ) )
1457 const Reference< XPropertySet > rPropSet =
1458 GetTransformer().GetPropertySet();
1459 OSL_ENSURE( rPropSet.is(), "no info property set" );
1460 if( rPropSet.is() )
1462 const sal_Char sRedlineProtectionKey[] = "RedlineProtectionKey";
1463 OUString aPropName(RTL_CONSTASCII_USTRINGPARAM(sRedlineProtectionKey));
1464 Reference< XPropertySetInfo > xPropSetInfo(
1465 rPropSet->getPropertySetInfo() );
1466 if( xPropSetInfo.is() &&
1467 xPropSetInfo->hasPropertyByName( aPropName ) )
1469 Sequence < sal_Int8 > aKey;
1470 SvXMLUnitConverter::decodeBase64( aKey,
1471 xAttrList->getValueByIndex( i ) );
1472 rPropSet->setPropertyValue( aPropName, makeAny( aKey ) );
1474 else
1476 OSL_ENSURE( !this, "RedineProtectionKey is missing" );
1479 break;
1482 XMLTransformerContext::StartElement( xAttrList );
1485 // -----------------------------------------------------------------------------
1487 class XMLTableOOoTransformerContext_Impl : public XMLTransformerContext
1489 ::rtl::OUString m_aElemQName;
1491 public:
1492 TYPEINFO();
1494 XMLTableOOoTransformerContext_Impl( XMLTransformerBase& rTransformer,
1495 const ::rtl::OUString& rQName );
1497 virtual ~XMLTableOOoTransformerContext_Impl();
1499 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1500 virtual void EndElement();
1503 TYPEINIT1( XMLTableOOoTransformerContext_Impl, XMLTransformerContext );
1505 XMLTableOOoTransformerContext_Impl::XMLTableOOoTransformerContext_Impl(
1506 XMLTransformerBase& rImp,
1507 const OUString& rQName ) :
1508 XMLTransformerContext( rImp, rQName ),
1509 m_aElemQName( rQName )
1513 XMLTableOOoTransformerContext_Impl::~XMLTableOOoTransformerContext_Impl()
1517 void XMLTableOOoTransformerContext_Impl::StartElement(
1518 const Reference< XAttributeList >& rAttrList )
1520 // --> OD 2005-07-05 #i50521# - perform OOO_STYLE_REF_ACTIONS for all applications
1521 Reference< XAttributeList > xAttrList( rAttrList );
1522 XMLMutableAttributeList* pMutableAttrList =
1523 GetTransformer().ProcessAttrList( xAttrList, OOO_STYLE_REF_ACTIONS, sal_False );
1524 // <--
1525 if( rAttrList->getLength() && IsXMLToken( GetTransformer().GetClass(), XML_SPREADSHEET ) )
1527 sal_Bool bPrintRanges(sal_False);
1529 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1530 for( sal_Int16 i=0; i < nAttrCount; i++ )
1532 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1533 OUString aLocalName;
1534 sal_uInt16 nPrefix =
1535 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1536 &aLocalName );
1537 if( XML_NAMESPACE_TABLE == nPrefix &&
1538 IsXMLToken( aLocalName, XML_PRINT_RANGES ) )
1540 bPrintRanges = sal_True;
1543 if (!bPrintRanges && pMutableAttrList)
1545 xAttrList = pMutableAttrList;
1546 pMutableAttrList->AddAttribute(GetTransformer().GetNamespaceMap().GetQNameByKey(
1547 XML_NAMESPACE_TABLE,
1548 GetXMLToken( XML_PRINT ) ), GetXMLToken ( XML_FALSE ));
1552 GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1555 void XMLTableOOoTransformerContext_Impl::EndElement()
1557 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1561 //-----------------------------------------------------------------------------
1563 XMLTransformerContext *OOo2OasisTransformer::CreateUserDefinedContext(
1564 const TransformerAction_Impl& rAction,
1565 const OUString& rQName,
1566 sal_Bool bPersistent )
1568 switch( rAction.m_nActionType )
1570 case XML_ETACTION_DOCUMENT:
1571 return new XMLDocumentTransformerContext_Impl( *this, rQName );
1572 case XML_ETACTION_DOCUMENT_RENAME:
1573 return new XMLDocumentTransformerContext_Impl( *this, rQName,
1574 rAction.GetQNamePrefixFromParam1(),
1575 rAction.GetQNameTokenFromParam1() );
1576 case XML_ETACTION_BODY:
1577 return new XMLBodyTransformerContext_Impl( *this, rQName );
1578 case XML_ETACTION_STYLE:
1579 return new XMLStyleOOoTContext( *this, rQName,
1580 static_cast< XMLFamilyType >( rAction.m_nParam1 ),
1581 bPersistent );
1582 case XML_ETACTION_STYLE_RENAME:
1583 return new XMLStyleOOoTContext( *this, rQName,
1584 static_cast< XMLFamilyType >( rAction.m_nParam2 ),
1585 rAction.GetQNamePrefixFromParam1(),
1586 rAction.GetQNameTokenFromParam1(),
1587 bPersistent );
1588 case XML_ETACTION_FRAME:
1589 return new XMLFrameOOoTransformerContext( *this, rQName );
1590 case XML_ETACTION_EVENT:
1591 return new XMLEventOOoTransformerContext( *this, rQName, bPersistent );
1592 case XML_ETACTION_TAB_STOP:
1593 return new XMLTabStopOOoTContext_Impl( *this, rQName );
1594 case XML_ETACTION_FORM_CONTROL:
1595 return new XMLControlOOoTransformerContext( *this, rQName );
1596 case XML_ETACTION_FORM_PROPERTY:
1597 return new XMLFormPropOOoTransformerContext( *this, rQName );
1598 case XML_ETACTION_CHART:
1599 return new XMLChartOOoTransformerContext( *this, rQName );
1600 case XML_ETACTION_TRACKED_CHANGES:
1601 return new XMLTrackedChangesOOoTContext_Impl( *this, rQName,
1602 rAction.GetQNamePrefixFromParam1(),
1603 rAction.GetQNameTokenFromParam1() );
1604 case XML_ETACTION_CHART_PLOT_AREA:
1605 return new XMLChartPlotAreaOOoTContext( *this, rQName );
1606 case XML_ETACTION_TABLE:
1607 return new XMLTableOOoTransformerContext_Impl( *this, rQName );
1608 default:
1609 OSL_ENSURE( !this, "no user defined context found!" );
1612 // default is copying
1613 return new XMLTransformerContext( *this, rQName );
1616 XMLTransformerActions *OOo2OasisTransformer::GetUserDefinedActions(
1617 sal_uInt16 n )
1619 XMLTransformerActions *pActions = 0;
1620 if( n < MAX_OOO_ACTIONS )
1622 if( !m_aActions[n] )
1624 if( n<MAX_OOO_PROP_ACTIONS )
1626 m_aActions[n] =
1627 XMLStyleOOoTContext::CreateTransformerActions( n );
1629 else switch( n )
1631 case OOO_STYLE_ACTIONS:
1632 m_aActions[OOO_STYLE_ACTIONS] =
1633 new XMLTransformerActions( aStyleActionTable );
1634 break;
1635 case OOO_FONT_DECL_ACTIONS:
1636 m_aActions[OOO_FONT_DECL_ACTIONS] =
1637 new XMLTransformerActions( aFontDeclActionTable );
1638 break;
1639 case OOO_SHAPE_ACTIONS:
1640 m_aActions[OOO_SHAPE_ACTIONS] =
1641 new XMLTransformerActions( aShapeActionTable );
1642 break;
1643 case OOO_CONNECTOR_ACTIONS:
1644 m_aActions[OOO_CONNECTOR_ACTIONS] =
1645 new XMLTransformerActions( aConnectorActionTable );
1646 break;
1647 case OOO_TAB_STOP_ACTIONS:
1648 m_aActions[OOO_TAB_STOP_ACTIONS] =
1649 new XMLTransformerActions( aTabStopActionTable );
1650 break;
1651 case OOO_INDEX_ENTRY_TAB_STOP_ACTIONS:
1652 m_aActions[OOO_INDEX_ENTRY_TAB_STOP_ACTIONS] =
1653 new XMLTransformerActions( aIndexEntryTabStopActionTable );
1654 break;
1655 case OOO_LINENUMBERING_ACTIONS:
1656 m_aActions[OOO_LINENUMBERING_ACTIONS] =
1657 new XMLTransformerActions( aLineNumberingActionTable );
1658 break;
1659 case OOO_FOOTNOTE_SEP_ACTIONS:
1660 m_aActions[OOO_FOOTNOTE_SEP_ACTIONS] =
1661 new XMLTransformerActions( aFootnoteSepActionTable );
1662 break;
1663 case OOO_DROP_CAP_ACTIONS:
1664 m_aActions[OOO_DROP_CAP_ACTIONS] =
1665 new XMLTransformerActions( aDropCapActionTable );
1666 break;
1667 case OOO_COLUMNS_ACTIONS:
1668 m_aActions[OOO_COLUMNS_ACTIONS] =
1669 new XMLTransformerActions( aColumnsActionTable );
1670 break;
1671 case OOO_TEXT_VALUE_TYPE_ACTIONS:
1672 m_aActions[OOO_TEXT_VALUE_TYPE_ACTIONS] =
1673 new XMLTransformerActions( aTextValueTypeActionTable );
1674 break;
1675 case OOO_TABLE_VALUE_TYPE_ACTIONS:
1676 m_aActions[OOO_TABLE_VALUE_TYPE_ACTIONS] =
1677 new XMLTransformerActions( aTableValueTypeActionTable );
1678 break;
1679 case OOO_PARA_ACTIONS:
1680 m_aActions[OOO_PARA_ACTIONS] =
1681 new XMLTransformerActions( aParaActionTable );
1682 break;
1683 case OOO_STYLE_REF_ACTIONS:
1684 m_aActions[OOO_STYLE_REF_ACTIONS] =
1685 new XMLTransformerActions( aStyleRefActionTable );
1686 break;
1687 case OOO_MASTER_PAGE_ACTIONS:
1688 m_aActions[OOO_MASTER_PAGE_ACTIONS] =
1689 new XMLTransformerActions( aMasterPageActionTable );
1690 break;
1691 case OOO_ANNOTATION_ACTIONS:
1692 m_aActions[OOO_ANNOTATION_ACTIONS] =
1693 new XMLTransformerActions( aAnnotationActionTable );
1694 break;
1695 case OOO_CHANGE_INFO_ACTIONS:
1696 m_aActions[OOO_CHANGE_INFO_ACTIONS] =
1697 new XMLTransformerActions( aChangeInfoActionTable );
1698 break;
1699 case OOO_FRAME_ELEM_ACTIONS:
1700 m_aActions[OOO_FRAME_ELEM_ACTIONS] =
1701 new XMLTransformerActions( aFrameElemActionTable );
1702 break;
1703 case OOO_FRAME_ATTR_ACTIONS:
1704 m_aActions[OOO_FRAME_ATTR_ACTIONS] =
1705 new XMLTransformerActions( aFrameAttrActionTable );
1706 break;
1707 case OOO_BACKGROUND_IMAGE_ACTIONS:
1708 // --> OD 2005-06-10 #i50322#
1709 // use special actions for Writer documents.
1710 m_aActions[OOO_BACKGROUND_IMAGE_ACTIONS] =
1711 isWriter()
1712 ? new XMLTransformerActions( aWriterBackgroundImageActionTable )
1713 : new XMLTransformerActions( aBackgroundImageActionTable );
1714 // <--
1715 break;
1716 case OOO_DDE_CONNECTION_DECL_ACTIONS:
1717 m_aActions[OOO_DDE_CONNECTION_DECL_ACTIONS] =
1718 new XMLTransformerActions( aDDEConnectionDeclActionTable );
1719 break;
1720 case OOO_EVENT_ACTIONS:
1721 m_aActions[OOO_EVENT_ACTIONS] =
1722 new XMLTransformerActions( aEventActionTable );
1723 break;
1724 case OOO_FORM_CONTROL_ACTIONS:
1725 m_aActions[OOO_FORM_CONTROL_ACTIONS] =
1726 new XMLTransformerActions( aFormControlActionTable );
1727 break;
1728 case OOO_FORM_COLUMN_ACTIONS:
1729 m_aActions[OOO_FORM_COLUMN_ACTIONS] =
1730 new XMLTransformerActions( aFormColumnActionTable );
1731 break;
1732 case OOO_FORM_PROP_ACTIONS:
1733 m_aActions[OOO_FORM_PROP_ACTIONS] =
1734 new XMLTransformerActions( aFormPropActionTable );
1735 break;
1736 case OOO_XLINK_ACTIONS:
1737 m_aActions[OOO_XLINK_ACTIONS] =
1738 new XMLTransformerActions( aXLinkActionTable );
1739 break;
1740 case OOO_CONFIG_ITEM_SET_ACTIONS:
1741 m_aActions[OOO_CONFIG_ITEM_SET_ACTIONS] =
1742 new XMLTransformerActions( aConfigItemSetActionTable );
1743 break;
1744 case OOO_FORMULA_ACTIONS:
1745 m_aActions[OOO_FORMULA_ACTIONS] =
1746 new XMLTransformerActions( aFormulaActionTable );
1747 break;
1748 case OOO_CHART_ACTIONS:
1749 m_aActions[OOO_CHART_ACTIONS] =
1750 new XMLTransformerActions( aChartActionTable );
1751 break;
1752 case OOO_ERROR_MACRO_ACTIONS:
1753 m_aActions[OOO_ERROR_MACRO_ACTIONS] =
1754 new XMLTransformerActions( aErrorMacroActionTable );
1755 break;
1756 case OOO_DDE_CONV_MODE_ACTIONS:
1757 m_aActions[OOO_DDE_CONV_MODE_ACTIONS] =
1758 new XMLTransformerActions( aDDEConvModeActionTable );
1759 break;
1760 case OOO_ALPHABETICAL_INDEX_MARK_ACTIONS:
1761 m_aActions[OOO_ALPHABETICAL_INDEX_MARK_ACTIONS] =
1762 new XMLTransformerActions( aAlphabeticalIndexMarkActionTable );
1763 break;
1764 case OOO_DATAPILOT_MEMBER_ACTIONS:
1765 m_aActions[OOO_DATAPILOT_MEMBER_ACTIONS] =
1766 new XMLTransformerActions( aDataPilotMemberActionTable );
1767 case OOO_DATAPILOT_LEVEL_ACTIONS:
1768 m_aActions[OOO_DATAPILOT_LEVEL_ACTIONS] =
1769 new XMLTransformerActions( aDataPilotLevelActionTable );
1770 case OOO_SOURCE_SERVICE_ACTIONS:
1771 m_aActions[OOO_SOURCE_SERVICE_ACTIONS] =
1772 new XMLTransformerActions( aSourceServiceActionTable );
1773 case OOO_DRAW_AREA_POLYGON_ACTIONS:
1774 m_aActions[OOO_DRAW_AREA_POLYGON_ACTIONS] =
1775 new XMLTransformerActions( aShapeActionTable );
1776 m_aActions[OOO_DRAW_AREA_POLYGON_ACTIONS]
1777 ->Add( aDrawAreaPolygonActionTable );
1778 break;
1779 case OOO_SCRIPT_ACTIONS:
1780 m_aActions[OOO_SCRIPT_ACTIONS] =
1781 new XMLTransformerActions( aScriptActionTable );
1782 break;
1785 pActions = m_aActions[n];
1788 return pActions;
1791 OUString OOo2OasisTransformer::GetEventName( const OUString& rName, sal_Bool )
1793 if( !m_pEventMap )
1794 m_pEventMap = XMLEventOOoTransformerContext::CreateEventMap();
1796 OUString aNewName;
1797 sal_uInt16 nPrefix = XMLEventOOoTransformerContext::GetEventName( rName,
1798 aNewName, *m_pEventMap );
1799 if( XML_NAMESPACE_UNKNOWN != nPrefix )
1800 aNewName = GetNamespaceMap().GetQNameByKey( nPrefix, aNewName );
1801 else
1802 aNewName = rName;
1804 return aNewName;
1808 OOo2OasisTransformer::OOo2OasisTransformer( const sal_Char *pImplName,
1809 const sal_Char *pSubServiceName )
1810 throw() :
1811 XMLTransformerBase( aActionTable, aTokenMap ),
1812 m_pEventMap( 0 )
1814 if( pImplName )
1815 m_aImplName = OUString::createFromAscii( pImplName );
1816 else
1817 m_aImplName = OOo2OasisTransformer_getImplementationName();
1818 if( pSubServiceName )
1819 m_aSubServiceName = OUString::createFromAscii( pSubServiceName );
1821 GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE_OOO), XML_NAMESPACE_OFFICE );
1822 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE );
1824 GetNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META_OOO), XML_NAMESPACE_META );
1825 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META), XML_NAMESPACE_META );
1827 GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE_OOO), XML_NAMESPACE_STYLE );
1828 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE );
1830 GetNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER_OOO), XML_NAMESPACE_NUMBER );
1831 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER), XML_NAMESPACE_NUMBER );
1833 GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG_OOO), XML_NAMESPACE_CONFIG );
1834 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG );
1836 GetNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT_OOO), XML_NAMESPACE_TEXT );
1837 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
1839 GetNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE_OOO), XML_NAMESPACE_TABLE );
1840 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE );
1842 GetNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW_OOO), XML_NAMESPACE_DRAW );
1843 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW );
1845 GetNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D_OOO), XML_NAMESPACE_DR3D );
1846 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D), XML_NAMESPACE_DR3D );
1848 GetNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION_OOO), XML_NAMESPACE_PRESENTATION );
1849 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION), XML_NAMESPACE_PRESENTATION );
1851 GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART_OOO), XML_NAMESPACE_CHART );
1852 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART), XML_NAMESPACE_CHART );
1854 GetNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM_OOO), XML_NAMESPACE_FORM );
1855 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM );
1857 GetNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT_OOO), XML_NAMESPACE_SCRIPT );
1858 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT), XML_NAMESPACE_SCRIPT );
1860 GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO), XML_NAMESPACE_FO );
1861 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO );
1863 GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG );
1864 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG_COMPAT), XML_NAMESPACE_SVG );
1866 for( sal_uInt16 i=0; i<MAX_OOO_ACTIONS; ++i )
1867 m_aActions[i] = 0;
1870 OOo2OasisTransformer::~OOo2OasisTransformer() throw()
1872 for( sal_uInt16 i=0; i<MAX_OOO_ACTIONS; ++i )
1873 delete m_aActions[i];
1874 XMLEventOOoTransformerContext::FlushEventMap( m_pEventMap );
1877 Any OOo2OasisTransformer::queryInterface( const Type& rType )
1878 throw (RuntimeException)
1880 Any aRet;
1881 if ( rType == ::getCppuType((Reference<XImporter> *)0) )
1883 Reference<XImporter> xThis( this );
1884 aRet <<= xThis;
1886 else if ( rType == ::getCppuType((Reference<XFilter> *)0) )
1888 Reference<XFilter> xThis( this );
1889 aRet <<= xThis;
1891 else
1893 aRet = XMLTransformerBase::queryInterface(rType);
1896 return aRet;
1899 // XImporter
1900 void SAL_CALL OOo2OasisTransformer::setTargetDocument(
1901 const Reference< XComponent >& xDoc )
1902 throw( IllegalArgumentException, RuntimeException)
1904 if( !GetDocHandler().is() )
1906 // if initialize hasn't been called, then we have to call it now
1907 // to get the sub component initialized.
1908 Sequence<Any> aArgs( 0 );
1909 Initialize( aArgs );
1912 mxModel.set( xDoc, UNO_QUERY );
1914 Reference< XImporter > xImp( GetDocHandler(), UNO_QUERY );
1915 OSL_ENSURE( xImp.is(), "doc handler is not an importer" );
1916 if( xImp.is() )
1917 xImp->setTargetDocument( xDoc );
1920 // XFilter
1921 sal_Bool SAL_CALL OOo2OasisTransformer::filter(
1922 const Sequence< PropertyValue >& aDescriptor )
1923 throw ( RuntimeException)
1925 Reference< XFilter> xFilter( GetDocHandler(), UNO_QUERY );
1926 OSL_ENSURE( xFilter.is(), "doc handler is not a filter" );
1927 if( xFilter.is() )
1928 return xFilter->filter( aDescriptor );
1930 return sal_False;
1933 void SAL_CALL OOo2OasisTransformer::cancel( )
1934 throw ( RuntimeException)
1936 Reference< XFilter> xFilter( GetDocHandler(), UNO_QUERY );
1937 OSL_ENSURE( xFilter.is(), "doc handler is not a filter" );
1938 if( xFilter.is() )
1939 xFilter->cancel();
1942 // XInitialize
1943 void SAL_CALL OOo2OasisTransformer::initialize(
1944 const Sequence< Any >& rArguments )
1945 throw( Exception, RuntimeException )
1947 Initialize( rArguments );
1950 void SAL_CALL OOo2OasisTransformer::startDocument( void )
1951 throw( SAXException, RuntimeException )
1953 if( !GetDocHandler().is() )
1955 // if initialize hasn't been called, then we have to call it now
1956 // to get the sub component initialized.
1957 Sequence<Any> aArgs( 0 );
1958 Initialize( aArgs );
1961 XMLTransformerBase::startDocument();
1965 void SAL_CALL OOo2OasisTransformer::Initialize(
1966 const Sequence< Any >& rArguments )
1967 throw( Exception, RuntimeException )
1969 OSL_ENSURE( !GetDocHandler().is(), "duplication initialization" );
1971 Reference< XDocumentHandler > xDocHandler;
1972 if( m_aSubServiceName.getLength() )
1974 Reference< XMultiServiceFactory > xFactory =
1975 comphelper::getProcessServiceFactory();
1976 if( xFactory.is() )
1980 // get filter component
1981 xDocHandler = Reference< XDocumentHandler >(
1982 xFactory->createInstanceWithArguments( m_aSubServiceName,
1983 rArguments ),
1984 UNO_QUERY);
1986 catch( Exception& )
1992 OSL_ENSURE( xDocHandler.is(), "can't instantiate filter component" );
1993 if( xDocHandler.is() )
1995 Sequence<Any> aArgs( 1 + rArguments.getLength() );
1996 aArgs[0] <<= xDocHandler;
1997 for(sal_Int32 i = 0; i < rArguments.getLength(); i++)
1998 aArgs[i+1] = rArguments[i];
1999 XMLTransformerBase::initialize( aArgs );
2001 OSL_ENSURE( GetDocHandler() == xDocHandler,
2002 "duplicate doc handler" );
2004 else
2006 XMLTransformerBase::initialize( rArguments );
2011 Sequence< sal_Int8 > static CreateUnoTunnelId()
2013 static osl::Mutex aCreateMutex;
2014 ::osl::Guard<osl::Mutex> aGuard( aCreateMutex );
2015 Sequence< sal_Int8 > aSeq( 16 );
2016 rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
2017 return aSeq;
2020 const Sequence< sal_Int8 > & OOo2OasisTransformer::getUnoTunnelId() throw()
2022 static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
2023 return aSeq;
2026 // XUnoTunnel
2027 sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 >& rId )
2028 throw(RuntimeException)
2030 if( rId.getLength() == 16
2031 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
2032 rId.getConstArray(), 16 ) )
2034 return reinterpret_cast< sal_Int64 >( this );
2036 else
2038 return (sal_Int64)0;
2042 // XServiceInfo
2043 OUString SAL_CALL OOo2OasisTransformer::getImplementationName()
2044 throw(RuntimeException)
2046 return m_aImplName;
2049 sal_Bool SAL_CALL OOo2OasisTransformer::supportsService( const OUString& )
2050 throw(RuntimeException)
2052 return sal_False;
2055 Sequence< OUString > SAL_CALL OOo2OasisTransformer::getSupportedServiceNames( )
2056 throw(RuntimeException)
2058 Sequence<OUString> aSeq(0);
2059 return aSeq;
2062 // XTypeProvider
2063 Sequence< ::com::sun::star::uno::Type > SAL_CALL
2064 OOo2OasisTransformer::getTypes() throw(RuntimeException)
2066 Sequence< ::com::sun::star::uno::Type > aTypes(
2067 XMLTransformerBase::getTypes() );
2069 sal_Int32 nIndex = aTypes.getLength();
2070 aTypes.realloc( nIndex + 2 );
2072 ::com::sun::star::uno::Type* pTypes = aTypes.getArray();
2073 pTypes[nIndex++] = ::getCppuType( static_cast< Reference< XImporter > * >( 0 ) );
2074 pTypes[nIndex++] = ::getCppuType( static_cast< Reference< XFilter > * >( 0 ) );
2076 return aTypes;
2079 // Service registration
2081 OUString SAL_CALL OOo2OasisTransformer_getImplementationName() throw()
2083 return OUString( RTL_CONSTASCII_USTRINGPARAM(
2084 "com.sun.star.comp.OOo2OasisTransformer" ) );
2087 Sequence< OUString > SAL_CALL OOo2OasisTransformer_getSupportedServiceNames() throw()
2089 const OUString aServiceName( OOo2OasisTransformer_getImplementationName() );
2090 const Sequence< OUString > aSeq( &aServiceName, 1 );
2091 return aSeq;
2094 Reference< XInterface > SAL_CALL OOo2OasisTransformer_createInstance(
2095 const Reference< XMultiServiceFactory > & )
2096 throw( Exception )
2098 return (cppu::OWeakObject*)new OOo2OasisTransformer();
2101 #define OOO_IMPORTER( className, implName, subServiceName ) \
2102 OUString SAL_CALL className##_getImplementationName() throw() \
2104 return OUString( RTL_CONSTASCII_USTRINGPARAM( implName ) ); \
2107 Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw()\
2109 const OUString aServiceName( className##_getImplementationName() ); \
2110 const Sequence< OUString > aSeq( &aServiceName, 1 ); \
2111 return aSeq; \
2114 Reference< XInterface > SAL_CALL className##_createInstance( \
2115 const Reference< XMultiServiceFactory > & ) \
2116 throw( Exception ) \
2118 return (cppu::OWeakObject*)new OOo2OasisTransformer( implName, \
2119 subServiceName ); \
2122 OOO_IMPORTER( XMLWriterImportOOO,
2123 "com.sun.star.comp.Writer.XMLImporter",
2124 "com.sun.star.comp.Writer.XMLOasisImporter" )
2125 OOO_IMPORTER( XMLWriterStylesImportOOO,
2126 "com.sun.star.comp.Writer.XMLStylesImporter",
2127 "com.sun.star.comp.Writer.XMLOasisStylesImporter" )
2128 OOO_IMPORTER( XMLWriterContentImportOOO,
2129 "com.sun.star.comp.Writer.XMLContentImporter",
2130 "com.sun.star.comp.Writer.XMLOasisContentImporter" )
2131 OOO_IMPORTER( XMLWriterMetaImportOOO,
2132 "com.sun.star.comp.Writer.XMLMetaImporter",
2133 "com.sun.star.comp.Writer.XMLOasisMetaImporter" )
2134 OOO_IMPORTER( XMLWriterSettingsImportOOO,
2135 "com.sun.star.comp.Writer.XMLSettingsImporter",
2136 "com.sun.star.comp.Writer.XMLOasisSettingsImporter" )
2138 OOO_IMPORTER( XMLImpressImportOOO,
2139 "com.sun.star.comp.Impress.XMLImporter",
2140 "com.sun.star.comp.Impress.XMLOasisImporter" )
2141 OOO_IMPORTER( XMLImpressStylesImportOOO,
2142 "com.sun.star.comp.Impress.XMLStylesImporter",
2143 "com.sun.star.comp.Impress.XMLOasisStylesImporter" )
2144 OOO_IMPORTER( XMLImpressContentImportOOO,
2145 "com.sun.star.comp.Impress.XMLContentImporter",
2146 "com.sun.star.comp.Impress.XMLOasisContentImporter" )
2147 OOO_IMPORTER( XMLImpressMetaImportOOO,
2148 "com.sun.star.comp.Impress.XMLMetaImporter",
2149 "com.sun.star.comp.Impress.XMLOasisMetaImporter" )
2150 OOO_IMPORTER( XMLImpressSettingsImportOOO,
2151 "com.sun.star.comp.Impress.XMLSettingsImporter",
2152 "com.sun.star.comp.Impress.XMLOasisSettingsImporter" )
2154 OOO_IMPORTER( XMLDrawImportOOO,
2155 "com.sun.star.comp.Draw.XMLImporter",
2156 "com.sun.star.comp.Draw.XMLOasisImporter" )
2157 OOO_IMPORTER( XMLDrawStylesImportOOO,
2158 "com.sun.star.comp.Draw.XMLStylesImporter",
2159 "com.sun.star.comp.Draw.XMLOasisStylesImporter" )
2160 OOO_IMPORTER( XMLDrawContentImportOOO,
2161 "com.sun.star.comp.Draw.XMLContentImporter",
2162 "com.sun.star.comp.Draw.XMLOasisContentImporter" )
2163 OOO_IMPORTER( XMLDrawMetaImportOOO,
2164 "com.sun.star.comp.Draw.XMLMetaImporter",
2165 "com.sun.star.comp.Draw.XMLOasisMetaImporter" )
2166 OOO_IMPORTER( XMLDrawSettingsImportOOO,
2167 "com.sun.star.comp.Draw.XMLSettingsImporter",
2168 "com.sun.star.comp.Draw.XMLOasisSettingsImporter" )
2170 OOO_IMPORTER( XMLCalcImportOOO,
2171 "com.sun.star.comp.Calc.XMLImporter",
2172 "com.sun.star.comp.Calc.XMLOasisImporter" )
2173 OOO_IMPORTER( XMLCalcStylesImportOOO,
2174 "com.sun.star.comp.Calc.XMLStylesImporter",
2175 "com.sun.star.comp.Calc.XMLOasisStylesImporter" )
2176 OOO_IMPORTER( XMLCalcContentImportOOO,
2177 "com.sun.star.comp.Calc.XMLContentImporter",
2178 "com.sun.star.comp.Calc.XMLOasisContentImporter" )
2179 OOO_IMPORTER( XMLCalcMetaImportOOO,
2180 "com.sun.star.comp.Calc.XMLMetaImporter",
2181 "com.sun.star.comp.Calc.XMLOasisMetaImporter" )
2182 OOO_IMPORTER( XMLCalcSettingsImportOOO,
2183 "com.sun.star.comp.Calc.XMLSettingsImporter",
2184 "com.sun.star.comp.Calc.XMLOasisSettingsImporter" )
2186 OOO_IMPORTER( XMLChartImportOOO,
2187 "com.sun.star.comp.Chart.XMLImporter",
2188 "com.sun.star.comp.Chart.XMLOasisImporter" )
2189 OOO_IMPORTER( XMLChartStylesImportOOO,
2190 "com.sun.star.comp.Chart.XMLStylesImporter",
2191 "com.sun.star.comp.Chart.XMLOasisStylesImporter" )
2192 OOO_IMPORTER( XMLChartContentImportOOO,
2193 "com.sun.star.comp.Chart.XMLContentImporter",
2194 "com.sun.star.comp.Chart.XMLOasisContentImporter" )
2196 OOO_IMPORTER( XMLMathMetaImportOOO,
2197 "com.sun.star.comp.Math.XMLMetaImporter",
2198 "com.sun.star.comp.Math.XMLOasisMetaImporter" )
2199 OOO_IMPORTER( XMLMathSettingsImportOOO,
2200 "com.sun.star.comp.Math.XMLSettingsImporter",
2201 "com.sun.star.comp.Math.XMLOasisSettingsImporter" )
2203 OOO_IMPORTER( XMLMetaImportOOO,
2204 "com.sun.star.document.XMLMetaImporter",
2205 "com.sun.star.document.XMLOasisMetaImporter" )
2207 OOO_IMPORTER( XMLAutoTextEventImportOOO,
2208 "com.sun.star.comp.Writer.XMLAutotextEventsImporter",
2209 "com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter" )