bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / transform / OOo2Oasis.cxx
blob07382bcf4124a9890a8e2507a188aa646eb01487
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <rtl/ustrbuf.hxx>
21 #include <osl/diagnose.h>
22 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
23 #include <comphelper/processfactory.hxx>
24 #include <comphelper/servicehelper.hxx>
25 #include <sax/tools/converter.hxx>
26 #include <xmloff/nmspmap.hxx>
27 #include <xmloff/xmlnmspe.hxx>
28 #include <xmloff/xmltoken.hxx>
29 #include "MutableAttrList.hxx"
30 #include "DeepTContext.hxx"
31 #include "StyleOOoTContext.hxx"
32 #include "FrameOOoTContext.hxx"
33 #include "EventOOoTContext.hxx"
34 #include "ControlOOoTContext.hxx"
35 #include "FormPropOOoTContext.hxx"
36 #include "ChartOOoTContext.hxx"
37 #include "ChartPlotAreaOOoTContext.hxx"
38 #include "ElemTransformerAction.hxx"
39 #include "AttrTransformerAction.hxx"
40 #include "PropertyActionsOOo.hxx"
41 #include "TransformerActions.hxx"
42 #include "OOo2Oasis.hxx"
43 #include "XMLFilterRegistration.hxx"
44 #include <cppuhelper/supportsservice.hxx>
46 using namespace ::xmloff::token;
47 using namespace ::com::sun::star::uno;
48 using namespace ::com::sun::star::lang;
49 using namespace ::com::sun::star::xml::sax;
50 using namespace ::com::sun::star::beans;
52 enum XMLUserDefinedTransformerAction
54 XML_ETACTION_DOCUMENT=XML_ETACTION_USER_DEFINED,
55 XML_ETACTION_BODY,
56 XML_ETACTION_STYLE,
57 XML_ETACTION_STYLE_RENAME,
58 XML_ETACTION_FRAME,
59 XML_ETACTION_EVENT,
60 XML_ETACTION_TAB_STOP,
61 XML_ETACTION_FORM_CONTROL,
62 XML_ETACTION_FORM_PROPERTY,
63 XML_ETACTION_CHART,
64 XML_ETACTION_TRACKED_CHANGES,
65 XML_ETACTION_CHART_PLOT_AREA,
66 XML_ETACTION_DOCUMENT_RENAME,
67 XML_ETACTION_TABLE
70 #define ENTRY3( n, l, a, p1, p2, p3 ) \
71 { XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 }
72 #define ENTRY3QQN( n, l, a, n1, l1, n2, l2, p3 ) \
73 ENTRY3( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
74 XMLTransformerActionInit::QNameParam( n2, l2 ), p3 )
76 #define ENTRY2( n, l, a, p1, p2 ) \
77 ENTRY3( n, l, a, p1, p2, 0 )
78 #define ENTRY2QN( n, l, a, n1, l1, p2 ) \
79 ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), p2 )
81 #define ENTRY1( n, l, a, p1 ) \
82 ENTRY3( n, l, a, p1, 0, 0 )
83 #define ENTRY1Q( n, l, a, n1, l1 ) \
84 ENTRY1( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ) )
86 #define ENTRY0( n, l, a ) \
87 ENTRY3( n, l, a, 0, 0, 0 )
89 // BM: a macro to put two tokens into one sal_Int32 for the action
90 // XML_ATACTION_RENAME_ATTRIBUTE
91 #define RENAME_ENTRY( f, s ) \
92 (static_cast< sal_Int32 >(f) | (static_cast< sal_Int32 >(s) << 16))
94 static XMLTransformerActionInit aActionTable[] =
96 // remove office:class from <office:document> and <office:document-content>
97 ENTRY0( OFFICE, DOCUMENT, XML_ETACTION_DOCUMENT ),
98 ENTRY0( OFFICE, DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ),
99 ENTRY0( OFFICE, DOCUMENT_STYLES, XML_ETACTION_DOCUMENT ),
100 ENTRY0( OFFICE, DOCUMENT_SETTINGS, XML_ETACTION_DOCUMENT ),
101 ENTRY1Q( OFFICE, AUTO_TEXT_EVENTS, XML_ETACTION_DOCUMENT_RENAME,
102 XML_NAMESPACE_OOO, XML_AUTO_TEXT_EVENTS),
104 // remove <meta:keywords>
105 ENTRY0( META, KEYWORDS, XML_ETACTION_COPY_CONTENT ),
107 // rename <office:script> to <office:scripts>
108 ENTRY1Q( OFFICE, SCRIPT, XML_ETACTION_RENAME_ELEM,
109 XML_NAMESPACE_OFFICE, XML_SCRIPTS ),
111 // rename <office:script-data> to <office:script> and process attributes
112 ENTRY2QN( OFFICE, SCRIPT_DATA, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
113 XML_NAMESPACE_OFFICE, XML_SCRIPT,
114 OOO_SCRIPT_ACTIONS ),
116 // rename <script:libraries> to <ooo:libraries>
117 ENTRY1Q( SCRIPT, LIBRARIES, XML_ETACTION_RENAME_ELEM,
118 XML_NAMESPACE_OOO, XML_LIBRARIES ),
120 // rename <script:library-linked> to <ooo:library-linked> and process attributes
121 ENTRY2QN( SCRIPT, LIBRARY_LINKED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
122 XML_NAMESPACE_OOO, XML_LIBRARY_LINKED,
123 OOO_SCRIPT_ACTIONS ),
125 // rename <script:library-embedded> to <ooo:library-embedded> and process attributes
126 ENTRY2QN( SCRIPT, LIBRARY_EMBEDDED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
127 XML_NAMESPACE_OOO, XML_LIBRARY_EMBEDDED,
128 OOO_SCRIPT_ACTIONS ),
130 // rename <script:module> to <ooo:module> and process attributes
131 ENTRY2QN( SCRIPT, MODULE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
132 XML_NAMESPACE_OOO, XML_MODULE,
133 OOO_SCRIPT_ACTIONS ),
135 // rename <script:source-code> to <ooo:source-code>
136 ENTRY1Q( SCRIPT, SOURCE_CODE, XML_ETACTION_RENAME_ELEM,
137 XML_NAMESPACE_OOO, XML_SOURCE_CODE ),
139 // rename <office:font-decls> to <office:font-face-decl>,
140 // rename <style:font-decl> to <style:font-face>, process attrs
141 ENTRY1Q( OFFICE, FONT_DECLS, XML_ETACTION_RENAME_ELEM,
142 XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS ),
143 ENTRY2QN( STYLE, FONT_DECL, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
144 XML_NAMESPACE_STYLE, XML_FONT_FACE,
145 OOO_FONT_DECL_ACTIONS ),
147 // add genre element
148 ENTRY0( OFFICE, BODY, XML_ETACTION_BODY ),
150 // rename <style:page-master> to <style:page-layout>
151 ENTRY2QN( STYLE, PAGE_MASTER, XML_ETACTION_STYLE_RENAME,
152 XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT,
153 XML_FAMILY_TYPE_PAGE_LAYOUT ),
154 ENTRY1( STYLE, MASTER_PAGE, XML_ETACTION_PROC_ATTRS,
155 OOO_MASTER_PAGE_ACTIONS ),
157 // split <style:properties> into <style:*-properties> and do other
158 // styles processing
159 ENTRY1( STYLE, STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_END ),
160 ENTRY1( STYLE, DEFAULT_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_END ),
161 ENTRY1( NUMBER, NUMBER_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
162 ENTRY1( NUMBER, CURRENCY_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
163 ENTRY1( NUMBER, PERCENTAGE_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
164 ENTRY1( NUMBER, DATE_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
165 ENTRY1( NUMBER, TIME_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
166 ENTRY1( NUMBER, BOOLEAN_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
167 ENTRY1( NUMBER, TEXT_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_DATA ),
168 ENTRY1( TEXT, LIST_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
169 // ENTRY0( TEXT, OUTLINE_STYLE, STYLE ),
170 ENTRY1( STYLE, HEADER_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_HEADER_FOOTER ),
171 ENTRY1( STYLE, FOOTER_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_HEADER_FOOTER ),
172 ENTRY1( TEXT, LIST_LEVEL_STYLE_NUMBER, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
173 ENTRY1( TEXT, LIST_LEVEL_STYLE_BULLET, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
174 ENTRY1( TEXT, LIST_LEVEL_STYLE_IMAGE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
175 ENTRY1( TEXT, OUTLINE_LEVEL_STYLE, XML_ETACTION_STYLE, XML_FAMILY_TYPE_LIST ),
176 ENTRY1( DRAW, GRADIENT, XML_ETACTION_STYLE,
177 XML_FAMILY_TYPE_GRADIENT ),
178 ENTRY1( DRAW, FILL_IMAGE, XML_ETACTION_STYLE,
179 XML_FAMILY_TYPE_FILL_IMAGE ),
180 ENTRY2QN( DRAW, TRANSPARENCY, XML_ETACTION_STYLE_RENAME,
181 XML_NAMESPACE_DRAW, XML_OPACITY,
182 XML_FAMILY_TYPE_GRADIENT ),
183 ENTRY1( DRAW, MARKER, XML_ETACTION_STYLE,
184 XML_FAMILY_TYPE_MARKER ),
185 ENTRY1( DRAW, HATCH, XML_ETACTION_STYLE,
186 XML_FAMILY_TYPE_HATCH ),
187 ENTRY1( DRAW, STROKE_DASH, XML_ETACTION_STYLE,
188 XML_FAMILY_TYPE_STROKE_DASH ),
190 // rename <text:h>'s text:level to text:outline-level
191 // process <text:h/p>: process style-name attributes,
192 ENTRY1( TEXT, H, XML_ETACTION_PROC_ATTRS, OOO_PARA_ACTIONS ),
193 ENTRY1( TEXT, P, XML_ETACTION_PROC_ATTRS, OOO_PARA_ACTIONS ),
195 // rename <text:ordered-list> and <text:unordered-list> to <text:list>
196 ENTRY2QN( TEXT, UNORDERED_LIST, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
197 XML_NAMESPACE_TEXT, XML_LIST,
198 OOO_STYLE_REF_ACTIONS ),
199 ENTRY2QN( TEXT, ORDERED_LIST, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
200 XML_NAMESPACE_TEXT, XML_LIST,
201 OOO_STYLE_REF_ACTIONS ),
203 // rename <text:footnote*> to <text:note*>
204 ENTRY3QQN( TEXT, FOOTNOTE, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
205 XML_NAMESPACE_TEXT, XML_NOTE,
206 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_FOOTNOTE ),
207 ENTRY1Q( TEXT, FOOTNOTE_BODY, XML_ETACTION_RENAME_ELEM,
208 XML_NAMESPACE_TEXT, XML_NOTE_BODY ),
209 ENTRY1Q( TEXT, FOOTNOTE_CITATION, XML_ETACTION_RENAME_ELEM,
210 XML_NAMESPACE_TEXT, XML_NOTE_CITATION ),
211 ENTRY3QQN( TEXT, FOOTNOTES_CONFIGURATION,
212 XML_ETACTION_RENAME_ELEM_ADD_PROC_ATTR,
213 XML_NAMESPACE_TEXT, XML_NOTES_CONFIGURATION,
214 XML_NAMESPACE_TEXT, XML_NOTE_CLASS,
215 XML_FOOTNOTE | (OOO_STYLE_REF_ACTIONS << 16) ),
217 // rename <text:endnote*> to <text:endnote*>
218 ENTRY3QQN( TEXT, ENDNOTE, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
219 XML_NAMESPACE_TEXT, XML_NOTE,
220 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_ENDNOTE ),
221 ENTRY1Q( TEXT, ENDNOTE_BODY, XML_ETACTION_RENAME_ELEM,
222 XML_NAMESPACE_TEXT, XML_NOTE_BODY ),
223 ENTRY1Q( TEXT, ENDNOTE_CITATION, XML_ETACTION_RENAME_ELEM,
224 XML_NAMESPACE_TEXT, XML_NOTE_CITATION ),
225 ENTRY3QQN( TEXT, ENDNOTES_CONFIGURATION,
226 XML_ETACTION_RENAME_ELEM_ADD_PROC_ATTR,
227 XML_NAMESPACE_TEXT, XML_NOTES_CONFIGURATION,
228 XML_NAMESPACE_TEXT, XML_NOTE_CLASS,
229 XML_ENDNOTE | (OOO_STYLE_REF_ACTIONS << 16) ),
231 // rename <text:footnote> and <text:endnote> to <text:note>
232 ENTRY3QQN( TEXT, ENDNOTE_REF, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
233 XML_NAMESPACE_TEXT, XML_NOTE_REF,
234 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_ENDNOTE ),
235 ENTRY3QQN( TEXT, FOOTNOTE_REF, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
236 XML_NAMESPACE_TEXT, XML_NOTE_REF,
237 XML_NAMESPACE_TEXT, XML_NOTE_CLASS, XML_FOOTNOTE ),
239 // rename <text:tab-stop> to <text:tab>
240 ENTRY1Q( TEXT, TAB_STOP, XML_ETACTION_RENAME_ELEM,
241 XML_NAMESPACE_TEXT, XML_TAB ),
243 // replace <table:sub-table> with <table:table table:is-sub-table>
244 ENTRY3QQN( TABLE, SUB_TABLE, XML_ETACTION_RENAME_ELEM_ADD_ATTR,
245 XML_NAMESPACE_TABLE, XML_TABLE,
246 XML_NAMESPACE_TABLE, XML_IS_SUB_TABLE, XML_TRUE ),
248 // process *:style-name attributes
249 ENTRY1( TEXT, SECTION, XML_ETACTION_PROC_ATTRS,
250 OOO_STYLE_REF_ACTIONS ), /* generated entry */
251 ENTRY1( TEXT, SPAN, XML_ETACTION_PROC_ATTRS,
252 OOO_STYLE_REF_ACTIONS ), /* generated entry */
253 ENTRY1( TEXT, A, XML_ETACTION_PROC_ATTRS,
254 OOO_STYLE_REF_ACTIONS ), /* generated entry */
255 ENTRY1( TEXT, RUBY, XML_ETACTION_PROC_ATTRS,
256 OOO_STYLE_REF_ACTIONS ), /* generated entry */
257 ENTRY1( TEXT, RUBY_TEXT, XML_ETACTION_PROC_ATTRS,
258 OOO_STYLE_REF_ACTIONS ), /* generated entry */
259 ENTRY1( TEXT, DATE, XML_ETACTION_PROC_ATTRS,
260 OOO_STYLE_REF_ACTIONS ), /* generated entry */
261 ENTRY1( TEXT, TIME, XML_ETACTION_PROC_ATTRS,
262 OOO_STYLE_REF_ACTIONS ), /* generated entry */
263 ENTRY1( TEXT, VARIABLE_GET, XML_ETACTION_PROC_ATTRS,
264 OOO_STYLE_REF_ACTIONS ), /* generated entry */
265 ENTRY1( TEXT, USER_FIELD_GET, XML_ETACTION_PROC_ATTRS,
266 OOO_STYLE_REF_ACTIONS ), /* generated entry */
267 ENTRY1( TEXT, USER_FIELD_INPUT, XML_ETACTION_PROC_ATTRS,
268 OOO_STYLE_REF_ACTIONS ), /* generated entry */
269 ENTRY1( TEXT, CREATION_DATE, XML_ETACTION_PROC_ATTRS,
270 OOO_STYLE_REF_ACTIONS ), /* generated entry */
271 ENTRY1( TEXT, CREATION_TIME, XML_ETACTION_PROC_ATTRS,
272 OOO_STYLE_REF_ACTIONS ), /* generated entry */
273 ENTRY1( TEXT, PRINT_TIME, XML_ETACTION_PROC_ATTRS,
274 OOO_STYLE_REF_ACTIONS ), /* generated entry */
275 ENTRY1( TEXT, PRINT_DATE, XML_ETACTION_PROC_ATTRS,
276 OOO_STYLE_REF_ACTIONS ), /* generated entry */
277 ENTRY1( TEXT, EDITING_DURATION, XML_ETACTION_PROC_ATTRS,
278 OOO_STYLE_REF_ACTIONS ), /* generated entry */
279 ENTRY1( TEXT, MODIFICATION_TIME, XML_ETACTION_PROC_ATTRS,
280 OOO_STYLE_REF_ACTIONS ), /* generated entry */
281 ENTRY1( TEXT, MODIFICATION_DATE, XML_ETACTION_PROC_ATTRS,
282 OOO_STYLE_REF_ACTIONS ), /* generated entry */
283 ENTRY1( TEXT, DATABASE_DISPLAY, XML_ETACTION_PROC_ATTRS,
284 OOO_STYLE_REF_ACTIONS ), /* generated entry */
285 ENTRY1( TEXT, TABLE_FORMULA, XML_ETACTION_PROC_ATTRS,
286 OOO_STYLE_REF_ACTIONS ), /* generated entry */
287 ENTRY1( TEXT, INDEX_TITLE, XML_ETACTION_PROC_ATTRS,
288 OOO_STYLE_REF_ACTIONS ), /* generated entry */
289 ENTRY1( TEXT, TABLE_OF_CONTENT, XML_ETACTION_PROC_ATTRS,
290 OOO_STYLE_REF_ACTIONS ), /* generated entry */
291 ENTRY1( TEXT, TABLE_OF_CONTENT_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
292 OOO_STYLE_REF_ACTIONS ), /* generated entry */
293 ENTRY1( TEXT, ILLUSTRATION_INDEX, XML_ETACTION_PROC_ATTRS,
294 OOO_STYLE_REF_ACTIONS ), /* generated entry */
295 ENTRY1( TEXT, ILLUSTRATION_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
296 OOO_STYLE_REF_ACTIONS ), /* generated entry */
297 ENTRY1( TEXT, TABLE_INDEX, XML_ETACTION_PROC_ATTRS,
298 OOO_STYLE_REF_ACTIONS ), /* generated entry */
299 ENTRY1( TEXT, TABLE_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
300 OOO_STYLE_REF_ACTIONS ), /* generated entry */
301 ENTRY1( TEXT, OBJECT_INDEX, XML_ETACTION_PROC_ATTRS,
302 OOO_STYLE_REF_ACTIONS ), /* generated entry */
303 ENTRY1( TEXT, OBJECT_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
304 OOO_STYLE_REF_ACTIONS ), /* generated entry */
305 ENTRY1( TEXT, USER_INDEX, XML_ETACTION_PROC_ATTRS,
306 OOO_STYLE_REF_ACTIONS ), /* generated entry */
307 ENTRY1( TEXT, USER_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
308 OOO_STYLE_REF_ACTIONS ), /* generated entry */
309 ENTRY1( TEXT, ALPHABETICAL_INDEX, XML_ETACTION_PROC_ATTRS,
310 OOO_STYLE_REF_ACTIONS ), /* generated entry */
311 ENTRY1( TEXT, ALPHABETICAL_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
312 OOO_STYLE_REF_ACTIONS ), /* generated entry */
313 ENTRY1( TEXT, BIBLIOGRAPHY, XML_ETACTION_PROC_ATTRS,
314 OOO_STYLE_REF_ACTIONS ), /* generated entry */
315 ENTRY1( TEXT, BIBLIOGRAPHY_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
316 OOO_STYLE_REF_ACTIONS ), /* generated entry */
317 ENTRY1( TEXT, INDEX_SOURCE_STYLE, XML_ETACTION_PROC_ATTRS,
318 OOO_STYLE_REF_ACTIONS ), /* generated entry */
319 ENTRY1( TEXT, INDEX_TITLE_TEMPLATE, XML_ETACTION_PROC_ATTRS,
320 OOO_STYLE_REF_ACTIONS ), /* generated entry */
321 ENTRY1( TEXT, INDEX_ENTRY_CHAPTER, XML_ETACTION_PROC_ATTRS,
322 OOO_STYLE_REF_ACTIONS ), /* generated entry */
323 ENTRY2QN( TEXT, INDEX_ENTRY_CHAPTER_NUMBER,
324 XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
325 XML_NAMESPACE_TEXT, XML_INDEX_ENTRY_CHAPTER,
326 OOO_STYLE_REF_ACTIONS ), /* generated entry */
327 ENTRY1( TEXT, INDEX_ENTRY_TEXT, XML_ETACTION_PROC_ATTRS,
328 OOO_STYLE_REF_ACTIONS ), /* generated entry */
329 ENTRY1( TEXT, INDEX_ENTRY_PAGE_NUMBER, XML_ETACTION_PROC_ATTRS,
330 OOO_STYLE_REF_ACTIONS ), /* generated entry */
331 ENTRY1( TEXT, INDEX_ENTRY_SPAN, XML_ETACTION_PROC_ATTRS,
332 OOO_STYLE_REF_ACTIONS ), /* generated entry */
333 ENTRY1( TEXT, INDEX_ENTRY_BIBLIOGRAPHY, XML_ETACTION_PROC_ATTRS,
334 OOO_STYLE_REF_ACTIONS ), /* generated entry */
335 ENTRY1( TEXT, INDEX_ENTRY_LINK_START, XML_ETACTION_PROC_ATTRS,
336 OOO_STYLE_REF_ACTIONS ), /* generated entry */
337 ENTRY1( TEXT, INDEX_ENTRY_LINK_END, XML_ETACTION_PROC_ATTRS,
338 OOO_STYLE_REF_ACTIONS ), /* generated entry */
339 ENTRY1( STYLE, HANDOUT_MASTER, XML_ETACTION_PROC_ATTRS,
340 OOO_STYLE_REF_ACTIONS ), /* generated entry */
341 ENTRY1( DRAW, PAGE, XML_ETACTION_PROC_ATTRS,
342 OOO_STYLE_REF_ACTIONS ), /* generated entry */
343 ENTRY1( STYLE, MAP, XML_ETACTION_PROC_ATTRS,
344 OOO_STYLE_REF_ACTIONS ), /* generated entry */
345 ENTRY1( PRESENTATION, NOTES, XML_ETACTION_PROC_ATTRS,
346 OOO_STYLE_REF_ACTIONS ), /* generated entry */
347 ENTRY1( STYLE, PRESENTATION_PAGE_LAYOUT, XML_ETACTION_PROC_ATTRS,
348 OOO_MASTER_PAGE_ACTIONS ),
349 /* Consider also attribute table:style-name for <table:table>,
350 <table:table-row> and <table:table-column>. (#i40011#, #i40015#)
352 ENTRY0( TABLE, TABLE, XML_ETACTION_TABLE ),
353 ENTRY1( TABLE, TABLE_ROW, XML_ETACTION_PROC_ATTRS, OOO_STYLE_REF_ACTIONS ),
354 ENTRY1( TABLE, TABLE_COLUMN, XML_ETACTION_PROC_ATTRS, OOO_STYLE_REF_ACTIONS ),
356 // split frame elements
357 ENTRY0( DRAW, TEXT_BOX, XML_ETACTION_FRAME ),
358 ENTRY0( DRAW, IMAGE, XML_ETACTION_FRAME ),
359 ENTRY0( DRAW, OBJECT, XML_ETACTION_FRAME ),
360 ENTRY0( DRAW, OBJECT_OLE, XML_ETACTION_FRAME ),
361 ENTRY0( DRAW, APPLET, XML_ETACTION_FRAME ),
362 ENTRY0( DRAW, PLUGIN, XML_ETACTION_FRAME ),
363 ENTRY0( DRAW, FLOATING_FRAME, XML_ETACTION_FRAME ),
364 ENTRY0( SVG, DESC, XML_ETACTION_COPY_TEXT ),
366 // process events
367 ENTRY1Q( OFFICE, EVENTS, XML_ETACTION_RENAME_ELEM,
368 XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS ),
369 ENTRY0( SCRIPT, EVENT, XML_ETACTION_EVENT ),
370 ENTRY0( PRESENTATION, EVENT, XML_ETACTION_EVENT ),
372 // process length attributes
373 ENTRY1( DRAW, RECT, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
374 ENTRY1( DRAW, LINE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
375 ENTRY1( DRAW, POLYLINE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
376 ENTRY1( DRAW, POLYGON, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
377 ENTRY1( DRAW, PATH, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
378 ENTRY1( DRAW, CIRCLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
379 ENTRY1( DRAW, ELLIPSE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
380 ENTRY1( DRAW, CONNECTOR, XML_ETACTION_PROC_ATTRS, OOO_CONNECTOR_ACTIONS ),
381 ENTRY1( DRAW, CAPTION, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
382 ENTRY1( DRAW, CONTROL, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
383 ENTRY1( DRAW, PAGE_THUMBNAIL, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
384 ENTRY1( DRAW, MEASURE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
385 ENTRY1( DRAW, G, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
386 // ENTRY1( DRAW, TEXT_BOX, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
387 ENTRY1( PRESENTATION, PLACEHOLDER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
388 ENTRY1( DRAW, CONTOUR_POLYGON, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
389 ENTRY1( DRAW, CONTOUR_PATH, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
390 ENTRY1( DRAW, AREA_RECTANGLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
391 ENTRY1( DRAW, AREA_CIRCLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
392 ENTRY1( DRAW, AREA_POLYGON, XML_ETACTION_PROC_ATTRS, OOO_DRAW_AREA_POLYGON_ACTIONS ),
393 ENTRY1( DRAW, GLUE_POINT, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
394 ENTRY1( DR3D, SCENE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
395 ENTRY1( DR3D, CUBE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
396 ENTRY1( DR3D, SPHERE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
397 ENTRY1( DR3D, EXTRUDE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
398 ENTRY1( DR3D, ROTATE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
399 ENTRY1( CHART, TITLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
400 ENTRY1( CHART, SUBTITLE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
401 ENTRY1( CHART, FOOTER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
402 ENTRY1( CHART, LEGEND, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
403 ENTRY1( CHART, WALL, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
404 ENTRY1( CHART, FLOOR, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
405 ENTRY1( CHART, AXIS, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
406 ENTRY1( CHART, GRID, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
407 ENTRY1( CHART, SERIES, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
408 ENTRY1( CHART, DATA_POINT, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
409 ENTRY1( CHART, MEAN_VALUE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
410 ENTRY1( CHART, ERROR_INDICATOR, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
411 ENTRY1( CHART, REGRESSION_CURVE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
412 ENTRY1( CHART, STOCK_GAIN_MARKER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
413 ENTRY1( CHART, STOCK_LOSS_MARKER, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
414 ENTRY1( CHART, STOCK_RANGE_LINE, XML_ETACTION_PROC_ATTRS, OOO_SHAPE_ACTIONS ),
416 ENTRY0( CHART, CHART, XML_ETACTION_CHART ),
417 ENTRY0( CHART, PLOT_AREA, XML_ETACTION_CHART_PLOT_AREA ),
419 ENTRY1Q( TEXT, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
420 XML_NAMESPACE_TEXT, XML_PROTECTION_KEY ),
421 ENTRY1Q( TABLE, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
422 XML_NAMESPACE_TABLE, XML_PROTECTION_KEY ),
424 ENTRY1( TEXT, INDEX_ENTRY_TAB_STOP, XML_ETACTION_PROC_ATTRS,
425 OOO_INDEX_ENTRY_TAB_STOP_ACTIONS ),
426 ENTRY0( STYLE, TAB_STOP, XML_ETACTION_TAB_STOP ),
427 ENTRY1( STYLE, BACKGROUND_IMAGE, XML_ETACTION_PROC_ATTRS,
428 OOO_BACKGROUND_IMAGE_ACTIONS ),
429 ENTRY1( TEXT, LINENUMBERING_CONFIGURATION, XML_ETACTION_PROC_ATTRS,
430 OOO_LINENUMBERING_ACTIONS ),
431 ENTRY1( STYLE, FOOTNOTE_SEP, XML_ETACTION_PROC_ATTRS,
432 OOO_FOOTNOTE_SEP_ACTIONS ),
433 ENTRY1( STYLE, DROP_CAP, XML_ETACTION_PROC_ATTRS, OOO_DROP_CAP_ACTIONS ),
434 ENTRY1( STYLE, COLUMNS, XML_ETACTION_PROC_ATTRS, OOO_COLUMNS_ACTIONS ),
435 ENTRY1( STYLE, COLUMN, XML_ETACTION_PROC_ATTRS, OOO_COLUMNS_ACTIONS ),
437 // rename office:value-* to *:value-*
438 ENTRY1( TEXT, VARIABLE_DECL, XML_ETACTION_PROC_ATTRS,
439 OOO_TEXT_VALUE_TYPE_ACTIONS ), /* generated entry */
440 ENTRY1( TEXT, VARIABLE_SET, XML_ETACTION_PROC_ATTRS,
441 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
442 ENTRY1( TEXT, VARIABLE_INPUT, XML_ETACTION_PROC_ATTRS,
443 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
444 ENTRY1( TEXT, USER_FIELD_DECL, XML_ETACTION_PROC_ATTRS,
445 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
446 ENTRY1( TEXT, EXPRESSION, XML_ETACTION_PROC_ATTRS,
447 OOO_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
448 // ENTRY1( TEXT, USER_DEFINED, XML_ETACTION_PROC_ATTRS,
449 // OOO_TEXT_VALUE_TYPE_ACTIONS), /* text:user-defined has no attrs so far */
450 ENTRY1( TABLE, TABLE_CELL, XML_ETACTION_PROC_ATTRS,
451 OOO_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
452 ENTRY1( TABLE, COVERED_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
453 OOO_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
454 ENTRY1( TABLE, CHANGE_TRACK_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
455 OOO_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
456 // ENTRY1( FORM, PROPERTY, XML_ETACTION_PROC_ATTRS,
457 // OOO_VALUE_TYPE_ACTIONS), /* TODO: generated entry */
458 // ENTRY1( FORM, LIST_PROPERTY, XML_ETACTION_PROC_ATTRS,
459 // OOO_VALUE_TYPE_ACTIONS), /* generated entry */
461 ENTRY1( OFFICE, ANNOTATION, XML_ETACTION_MOVE_ATTRS_TO_ELEMS,
462 OOO_ANNOTATION_ACTIONS ), /* generated entry */
463 ENTRY1( OFFICE, CHANGE_INFO, XML_ETACTION_MOVE_ATTRS_TO_ELEMS,
464 OOO_CHANGE_INFO_ACTIONS ), /* generated entry */
466 ENTRY1( TEXT, DDE_CONNECTION_DECL, XML_ETACTION_PROC_ATTRS,
467 OOO_DDE_CONNECTION_DECL_ACTIONS ),
469 ENTRY0( FORM, CONTROL, XML_ETACTION_FORM_CONTROL ),
470 ENTRY1( FORM, COLUMN, XML_ETACTION_PROC_ATTRS,
471 OOO_FORM_COLUMN_ACTIONS ),
472 ENTRY0( FORM, PROPERTY, XML_ETACTION_FORM_PROPERTY ),
474 // process xlink:href
475 ENTRY1( META, TEMPLATE, XML_ETACTION_PROC_ATTRS,
476 OOO_XLINK_ACTIONS ), /* generated entry */
477 ENTRY1( META, AUTO_RELOAD, XML_ETACTION_PROC_ATTRS,
478 OOO_XLINK_ACTIONS ), /* generated entry */
479 ENTRY1( TEXT, SECTION_SOURCE, XML_ETACTION_PROC_ATTRS,
480 OOO_XLINK_ACTIONS ), /* generated entry */
481 ENTRY1( TEXT, SCRIPT, XML_ETACTION_PROC_ATTRS,
482 OOO_XLINK_ACTIONS ), /* generated entry */
483 ENTRY1( TEXT, ALPHABETICAL_INDEX_AUTO_MARK_FILE, XML_ETACTION_PROC_ATTRS,
484 OOO_XLINK_ACTIONS ), /* generated entry */
485 ENTRY1( TABLE, TABLE_SOURCE, XML_ETACTION_PROC_ATTRS,
486 OOO_XLINK_ACTIONS ), /* generated entry */
487 ENTRY1( TABLE, CELL_RANGE_SOURCE, XML_ETACTION_PROC_ATTRS,
488 OOO_XLINK_ACTIONS ), /* generated entry */
489 ENTRY1( DRAW, A, XML_ETACTION_PROC_ATTRS,
490 OOO_XLINK_ACTIONS ), /* generated entry */
491 ENTRY1( PRESENTATION, SOUND, XML_ETACTION_PROC_ATTRS,
492 OOO_XLINK_ACTIONS ), /* generated entry */
493 ENTRY1( FORM, FORM, XML_ETACTION_PROC_ATTRS,
494 OOO_FORM_CONTROL_ACTIONS ),
495 ENTRY2QN( STYLE, SYMBOL_IMAGE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
496 XML_NAMESPACE_CHART, XML_SYMBOL_IMAGE,
497 OOO_BACKGROUND_IMAGE_ACTIONS ),
499 ENTRY2QN( CONFIG, CONFIG_ITEM_SET, XML_ETACTION_PROC_ATTRS_COND,
500 XML_NAMESPACE_OFFICE, XML_SETTINGS,
501 OOO_CONFIG_ITEM_SET_ACTIONS ),
503 // add namespace prefix
504 // text:formula
505 ENTRY1( TEXT, SEQUENCE, XML_ETACTION_PROC_ATTRS,
506 OOO_FORMULA_ACTIONS ), /* generated entry */
507 // text:condition
508 ENTRY1( TEXT, DATABASE_NEXT, XML_ETACTION_PROC_ATTRS,
509 OOO_FORMULA_ACTIONS ), /* generated entry */
510 // text:condition
511 ENTRY2QN( TEXT, DATABASE_SELECT, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
512 XML_NAMESPACE_TEXT, XML_DATABASE_ROW_SELECT,
513 OOO_FORMULA_ACTIONS ),
514 // text:condition
515 ENTRY1( TEXT, CONDITIONAL_TEXT, XML_ETACTION_PROC_ATTRS,
516 OOO_FORMULA_ACTIONS ), /* generated entry */
517 // text:condition
518 ENTRY1( TEXT, HIDDEN_TEXT, XML_ETACTION_PROC_ATTRS,
519 OOO_FORMULA_ACTIONS ), /* generated entry */
520 // text:condition
521 ENTRY1( TEXT, HIDDEN_PARAGRAPH, XML_ETACTION_PROC_ATTRS,
522 OOO_FORMULA_ACTIONS ), /* generated entry */
523 // table:condition
524 ENTRY1( TABLE, CONTENT_VALIDATION, XML_ETACTION_PROC_ATTRS,
525 OOO_FORMULA_ACTIONS ), /* generated entry */
527 // rename <table:dependences> to <table:dependencies>
528 ENTRY1Q( TABLE, DEPENDENCES, XML_ETACTION_RENAME_ELEM,
529 XML_NAMESPACE_TABLE, XML_DEPENDENCIES ),
530 ENTRY1Q( TABLE, DEPENDENCE, XML_ETACTION_RENAME_ELEM,
531 XML_NAMESPACE_TABLE, XML_DEPENDENCY ),
533 // process table::error-macro
534 ENTRY1( TABLE, ERROR_MACRO, XML_ETACTION_PROC_ATTRS,
535 OOO_ERROR_MACRO_ACTIONS ),
537 // process table::conversion-mode
538 ENTRY1( TABLE, CONVERSION_MODE, XML_ETACTION_PROC_ATTRS,
539 OOO_DDE_CONV_MODE_ACTIONS ),
541 // fix <text:alphabatical-index-mark text:main-etry>
542 ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK, XML_ETACTION_PROC_ATTRS,
543 OOO_ALPHABETICAL_INDEX_MARK_ACTIONS ),
544 ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK_START, XML_ETACTION_PROC_ATTRS,
545 OOO_ALPHABETICAL_INDEX_MARK_ACTIONS ),
547 // process table::data-pilot-member
548 ENTRY1( TABLE, DATA_PILOT_MEMBER, XML_ETACTION_PROC_ATTRS,
549 OOO_DATAPILOT_MEMBER_ACTIONS ),
551 // process table::data-pilot-level
552 ENTRY1( TABLE, DATA_PILOT_LEVEL, XML_ETACTION_PROC_ATTRS,
553 OOO_DATAPILOT_LEVEL_ACTIONS ),
555 // process table::source-service
556 ENTRY1( TABLE, SOURCE_SERVICE, XML_ETACTION_PROC_ATTRS,
557 OOO_SOURCE_SERVICE_ACTIONS ),
559 // fix id strings in old animation elements
560 ENTRY1( PRESENTATION, DIM, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
561 ENTRY1( PRESENTATION, PLAY, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
562 ENTRY1( PRESENTATION, SHOW_TEXT, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
563 ENTRY1( PRESENTATION, SHOW_SHAPE, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
564 ENTRY1( PRESENTATION, HIDE_TEXT, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
565 ENTRY1( PRESENTATION, HIDE_SHAPE, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
567 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
570 // XML_ETACTION_STYLE
571 static XMLTransformerActionInit aStyleActionTable[] =
573 ENTRY0( STYLE, FAMILY, XML_ATACTION_STYLE_FAMILY ),
574 ENTRY0( STYLE, NAME, XML_ATACTION_ENCODE_STYLE_NAME ),
575 ENTRY0( STYLE, PARENT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
576 ENTRY0( STYLE, NEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
577 ENTRY0( STYLE, LIST_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
578 ENTRY0( STYLE, MASTER_PAGE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
579 ENTRY0( STYLE, DATA_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
580 ENTRY0( DRAW, NAME, XML_ATACTION_ENCODE_STYLE_NAME ),
581 ENTRY0( DRAW, DISTANCE, XML_ATACTION_INCH2IN ),
582 ENTRY0( DRAW, DOTS1_LENGTH, XML_ATACTION_INCH2IN ),
583 ENTRY0( DRAW, DOTS2_LENGTH, XML_ATACTION_INCH2IN ),
584 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
585 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
586 ENTRY0( DRAW, START, XML_ATACTION_NEG_PERCENT ),
587 ENTRY0( DRAW, END, XML_ATACTION_NEG_PERCENT ),
588 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(true) ),
589 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
592 // OOO_FRAME_ELEM_ACTIONS
593 static XMLTransformerActionInit aFrameElemActionTable[] =
595 ENTRY1Q( OFFICE, EVENTS, XML_ETACTION_RENAME_ELEM,
596 XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS ),
597 ENTRY0( DRAW, GLUE_POINT, XML_ETACTION_COPY ),
598 ENTRY0( DRAW, IMAGE_MAP, XML_ETACTION_COPY ),
599 ENTRY0( SVG, DESC, XML_ETACTION_COPY_TEXT ),
600 ENTRY0( DRAW, CONTOUR_POLYGON, XML_ETACTION_COPY ),
601 ENTRY0( DRAW, CONTOUR_PATH, XML_ETACTION_COPY ),
602 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
605 // OOO_FRAME_ATTR_ACTIONS
606 static XMLTransformerActionInit aFrameAttrActionTable[] =
608 ENTRY0( DRAW, ZINDEX, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
609 ENTRY0( DRAW, ID, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
610 ENTRY0( DRAW, LAYER, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
611 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
612 ENTRY0( PRESENTATION, STYLE_NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
613 ENTRY0( DRAW, TRANSFORM, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
614 ENTRY0( DRAW, NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
615 ENTRY0( TABLE, END_CELL_ADDRESS, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
616 ENTRY0( TABLE, END_X, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
617 ENTRY0( TABLE, END_Y, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
618 ENTRY0( TABLE, TABLE_BACKGROUND, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
619 ENTRY0( TEXT, ANCHOR_TYPE, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
620 ENTRY0( TEXT, ANCHOR_PAGE_NUMBER, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
621 ENTRY0( DRAW, TEXT_STYLE_NAME, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
622 ENTRY0( SVG, X, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
623 ENTRY0( SVG, Y, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
624 ENTRY0( SVG, WIDTH, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
625 ENTRY0( SVG, HEIGHT, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
626 ENTRY0( STYLE, REL_WIDTH, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
627 ENTRY0( STYLE, REL_HEIGHT, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
628 ENTRY0( PRESENTATION, CLASS, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
629 ENTRY0( PRESENTATION, PLACEHOLDER, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
630 ENTRY0( PRESENTATION, USER_TRANSFORMED, XML_ATACTION_MOVE_TO_ELEM ), /* generated entry */
631 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
634 // OOO_EVENT_ELEM_ACTIONS
635 static XMLTransformerActionInit aEventActionTable[] =
637 ENTRY0( XLINK, HREF, XML_ATACTION_HREF ),
638 ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_ADD_NAMESPACE_PREFIX,
639 XML_NAMESPACE_OOO ),
640 ENTRY0( SCRIPT, EVENT_NAME, XML_ATACTION_EVENT_NAME ),
641 ENTRY0( SCRIPT, MACRO_NAME, XML_ATACTION_MACRO_NAME ),
642 ENTRY0( SCRIPT, LOCATION, XML_ATACTION_MACRO_LOCATION ),
643 ENTRY0( SCRIPT, LIBRARY, XML_ATACTION_MACRO_LOCATION ), // bug in draw
644 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
647 // action table for OOO_MASTER_PAGE_ACTIONS
648 static XMLTransformerActionInit aMasterPageActionTable[] =
650 ENTRY0( STYLE, NAME, XML_ATACTION_ENCODE_STYLE_NAME ),
651 ENTRY0( STYLE, NEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
652 ENTRY1Q( STYLE, PAGE_MASTER_NAME, XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF,
653 XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME ),
654 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
655 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
658 static XMLTransformerActionInit aFontDeclActionTable[] =
660 ENTRY1Q( FO, FONT_FAMILY, XML_ATACTION_RENAME,
661 XML_NAMESPACE_SVG, XML_FONT_FAMILY ),
662 ENTRY1Q( STYLE, FONT_STYLE_NAME, XML_ATACTION_RENAME,
663 XML_NAMESPACE_STYLE, XML_FONT_ADORNMENTS ),
664 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
667 // action table for OOO_PARA_ACTIONS
668 static XMLTransformerActionInit aParaActionTable[] =
670 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
671 ENTRY0( TEXT, COND_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
672 // ENTRY0( TEXT, CLASS_NAMES, XML_ATACTION_REMOVE ),
673 ENTRY1Q( TEXT, LEVEL, XML_ATACTION_RENAME,
674 XML_NAMESPACE_TEXT, XML_OUTLINE_LEVEL ),
675 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
678 // action table for OOO_STYLE_REF_ACTIONS
679 static XMLTransformerActionInit aStyleRefActionTable[] =
681 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
682 ENTRY0( TEXT, VISITED_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
683 ENTRY0( TEXT, MAIN_ENTRY_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
684 ENTRY0( TEXT, CITATION_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
685 ENTRY0( TEXT, CITATION_BODY_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
686 ENTRY0( TEXT, DEFAULT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
687 ENTRY0( TEXT, MASTER_PAGE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
688 ENTRY0( STYLE, DATA_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
689 ENTRY0( STYLE, APPLY_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
690 ENTRY0( STYLE, PAGE_LAYOUT_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
691 ENTRY0( TABLE, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
692 ENTRY0( TABLE, DEFAULT_CELL_STYLE_NAME,
693 XML_ATACTION_ENCODE_STYLE_NAME_REF ),
694 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
695 ENTRY0( DRAW, MASTER_PAGE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
696 ENTRY0( PRESENTATION, PRESENTATION_PAGE_LAYOUT_NAME,
697 XML_ATACTION_ENCODE_STYLE_NAME_REF ),
698 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(false) ),
699 ENTRY1( TEXT, CONDITION, XML_ATACTION_ADD_NAMESPACE_PREFIX,
700 XML_NAMESPACE_OOOW ),
701 ENTRY1( TEXT, FORMULA, XML_ATACTION_ADD_NAMESPACE_PREFIX,
702 XML_NAMESPACE_OOOW ),
703 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
706 // OOO_SHAPE_ACTIONS
707 // !!ATTENTION!! If you change something here, please also change
708 // aConnectorActionTable if appropriate
709 static XMLTransformerActionInit aShapeActionTable[] =
711 ENTRY0( SVG, X, XML_ATACTION_INCH2IN ),
712 ENTRY0( SVG, Y, XML_ATACTION_INCH2IN ),
713 ENTRY0( SVG, X1, XML_ATACTION_INCH2IN ),
714 ENTRY0( SVG, Y1, XML_ATACTION_INCH2IN ),
715 ENTRY0( SVG, X2, XML_ATACTION_INCH2IN ),
716 ENTRY0( SVG, Y2, XML_ATACTION_INCH2IN ),
717 ENTRY0( SVG, CX, XML_ATACTION_INCH2IN ),
718 ENTRY0( SVG, CY, XML_ATACTION_INCH2IN ),
719 ENTRY0( SVG, R, XML_ATACTION_INCH2IN ),
720 ENTRY0( SVG, RX, XML_ATACTION_INCH2IN ),
721 ENTRY0( SVG, RY, XML_ATACTION_INCH2IN ),
722 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
723 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
724 ENTRY0( FO, MIN_WIDTH, XML_ATACTION_INCH2IN ),
725 ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_INCH2IN ),
726 ENTRY0( FO, MAX_WIDTH, XML_ATACTION_INCH2IN ),
727 ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_INCH2IN ),
728 ENTRY0( DRAW, CORNER_RADIUS, XML_ATACTION_INCH2IN ),
729 ENTRY0( DRAW, LINE_SKEW, XML_ATACTION_INCHS2INS ),
730 ENTRY0( DRAW, CAPTION_POINT_X, XML_ATACTION_INCH2IN ),
731 ENTRY0( DRAW, CAPTION_POINT_Y, XML_ATACTION_INCH2IN ),
732 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
733 ENTRY0( DRAW, TEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
734 ENTRY0( DRAW, END_X, XML_ATACTION_INCH2IN ),
735 ENTRY0( DRAW, END_Y, XML_ATACTION_INCH2IN ),
736 ENTRY0( PRESENTATION, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
737 ENTRY0( DR3D, DISTANCE, XML_ATACTION_INCH2IN ),
738 ENTRY0( DR3D, FOCAL_LENGTH, XML_ATACTION_INCH2IN ),
739 ENTRY1Q( FORM, ID, XML_ATACTION_RENAME,
740 XML_NAMESPACE_DRAW, XML_CONTROL ),
741 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(true) ),
743 // BM: needed by chart:legend. The legend needs also the draw actions. As
744 // there is no merge mechanism, all actions have to be in the same table
745 ENTRY2( CHART, LEGEND_POSITION, XML_ATACTION_RENAME_ATTRIBUTE,
746 RENAME_ENTRY( XML_LEFT, XML_START ),
747 RENAME_ENTRY( XML_RIGHT, XML_END )),
748 ENTRY0( DRAW, ID, XML_ATACTION_SHAPEID ),
749 ENTRY0( DRAW, START_SHAPE, XML_ATACTION_SHAPEID ),
750 ENTRY0( DRAW, END_SHAPE, XML_ATACTION_SHAPEID ),
751 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
754 static XMLTransformerActionInit aConnectorActionTable[] =
756 ENTRY0( SVG, X1, XML_ATACTION_TWIPS2IN ),
757 ENTRY0( SVG, Y1, XML_ATACTION_TWIPS2IN ),
758 ENTRY0( SVG, X2, XML_ATACTION_TWIPS2IN ),
759 ENTRY0( SVG, Y2, XML_ATACTION_TWIPS2IN ),
760 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
761 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OOO ),
762 ENTRY0( FO, MIN_WIDTH, XML_ATACTION_INCH2IN ),
763 ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_INCH2IN ),
764 ENTRY0( FO, MAX_WIDTH, XML_ATACTION_INCH2IN ),
765 ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_INCH2IN ),
766 ENTRY0( DRAW, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
767 ENTRY0( DRAW, TEXT_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
768 ENTRY0( DRAW, END_X, XML_ATACTION_INCH2IN ),
769 ENTRY0( DRAW, END_Y, XML_ATACTION_INCH2IN ),
770 ENTRY0( PRESENTATION, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
771 ENTRY1Q( FORM, ID, XML_ATACTION_RENAME,
772 XML_NAMESPACE_DRAW, XML_CONTROL ),
773 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(true) ),
774 ENTRY0( DRAW, ID, XML_ATACTION_SHAPEID ),
775 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
778 // OOO_INDEX_ENTRY_TAB_STOP_ACTIONS
779 static XMLTransformerActionInit aIndexEntryTabStopActionTable[] =
781 ENTRY0( STYLE, POSITION, XML_ATACTION_INCH2IN ),
782 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
783 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
786 // OOO_TAB_STOP_ACTIONS
787 static XMLTransformerActionInit aTabStopActionTable[] =
789 ENTRY0( STYLE, POSITION, XML_ATACTION_INCH2IN ),
790 ENTRY1Q( STYLE, LEADER_CHAR, XML_ATACTION_RENAME,
791 XML_NAMESPACE_STYLE, XML_LEADER_TEXT ),
792 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
795 // OOO_LINENUMBERING_ACTIONS
796 static XMLTransformerActionInit aLineNumberingActionTable[] =
798 ENTRY0( TEXT, OFFSET, XML_ATACTION_INCH2IN ),
799 ENTRY0( TEXT, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
800 ENTRY1Q( TEXT, COUNT_IN_FLOATING_FRAMES, XML_ATACTION_RENAME,
801 XML_NAMESPACE_TEXT, XML_COUNT_IN_TEXT_BOXES ),
802 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
805 static XMLTransformerActionInit aFootnoteSepActionTable[] =
807 ENTRY0( STYLE, WIDTH, XML_ATACTION_INCH2IN ),
808 ENTRY0( STYLE, DISTANCE_BEFORE_SEP, XML_ATACTION_INCH2IN ),
809 ENTRY0( STYLE, DISTANCE_AFTER_SEP, XML_ATACTION_INCH2IN ),
810 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
813 // OOO_DROP_CAP_ACTIONS
814 static XMLTransformerActionInit aDropCapActionTable[] =
816 ENTRY0( STYLE, DISTANCE, XML_ATACTION_INCH2IN ),
817 ENTRY0( STYLE, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
818 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
821 static XMLTransformerActionInit aColumnsActionTable[] =
823 ENTRY0( STYLE, COLUMN_GAP, XML_ATACTION_INCH2IN ),
824 // ENTRY0( STYLE, SPACE_BEFORE, XML_ATACTION_INCH2IN ),
825 // ENTRY0( STYLE, SPACE_AFTER, XML_ATACTION_INCH2IN ),
826 ENTRY1Q( FO, MARGIN_LEFT, XML_ATACTION_RENAME_INCH2IN,
827 XML_NAMESPACE_FO, XML_START_INDENT ),
828 ENTRY1Q( FO, MARGIN_RIGHT, XML_ATACTION_RENAME_INCH2IN,
829 XML_NAMESPACE_FO, XML_END_INDENT ),
830 ENTRY0( STYLE, WIDTH, XML_ATACTION_INCH2IN ),
831 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
834 // OOO_TEXT_VALUE_TYPE_ACTIONS
835 static XMLTransformerActionInit aTextValueTypeActionTable[] =
837 ENTRY1Q( TEXT, VALUE_TYPE, XML_ATACTION_RENAME,
838 XML_NAMESPACE_OFFICE, XML_VALUE_TYPE ),
839 ENTRY1Q( TEXT, VALUE, XML_ATACTION_RENAME,
840 XML_NAMESPACE_OFFICE, XML_VALUE ),
841 ENTRY1Q( TEXT, CURRENCY, XML_ATACTION_RENAME,
842 XML_NAMESPACE_OFFICE, XML_CURRENCY ),
843 ENTRY1Q( TEXT, DATE_VALUE, XML_ATACTION_RENAME,
844 XML_NAMESPACE_OFFICE, XML_DATE_VALUE ),
845 ENTRY1Q( TEXT, TIME_VALUE, XML_ATACTION_RENAME,
846 XML_NAMESPACE_OFFICE, XML_TIME_VALUE ),
847 ENTRY1Q( TEXT, BOOLEAN_VALUE, XML_ATACTION_RENAME,
848 XML_NAMESPACE_OFFICE, XML_BOOLEAN_VALUE ),
849 ENTRY1Q( TEXT, STRING_VALUE, XML_ATACTION_RENAME,
850 XML_NAMESPACE_OFFICE, XML_STRING_VALUE ),
851 ENTRY0( STYLE, DATA_STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
852 ENTRY1( TEXT, FORMULA, XML_ATACTION_ADD_NAMESPACE_PREFIX,
853 XML_NAMESPACE_OOOW ),
854 ENTRY0( TEXT, TOKEN_INVALID, XML_ATACTION_EOT )
857 // OOO_TABLE_VALUE_TYPE_ACTIONS
858 static XMLTransformerActionInit aTableValueTypeActionTable[] =
860 ENTRY1Q( TABLE, VALUE_TYPE, XML_ATACTION_RENAME,
861 XML_NAMESPACE_OFFICE, XML_VALUE_TYPE ),
862 ENTRY1Q( TABLE, VALUE, XML_ATACTION_RENAME,
863 XML_NAMESPACE_OFFICE, XML_VALUE ),
864 ENTRY1Q( TABLE, CURRENCY, XML_ATACTION_RENAME,
865 XML_NAMESPACE_OFFICE, XML_CURRENCY ),
866 ENTRY1Q( TABLE, DATE_VALUE, XML_ATACTION_RENAME,
867 XML_NAMESPACE_OFFICE, XML_DATE_VALUE ),
868 ENTRY1Q( TABLE, TIME_VALUE, XML_ATACTION_RENAME,
869 XML_NAMESPACE_OFFICE, XML_TIME_VALUE ),
870 ENTRY1Q( TABLE, BOOLEAN_VALUE, XML_ATACTION_RENAME,
871 XML_NAMESPACE_OFFICE, XML_BOOLEAN_VALUE ),
872 ENTRY1Q( TABLE, STRING_VALUE, XML_ATACTION_RENAME,
873 XML_NAMESPACE_OFFICE, XML_STRING_VALUE ),
874 ENTRY0( TABLE, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
875 ENTRY1( TABLE, FORMULA, XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,
876 XML_NAMESPACE_OOOW ),
877 ENTRY1Q( TABLE, VALIDATION_NAME, XML_ATACTION_RENAME,
878 XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION_NAME ),
879 ENTRY0( TABLE, TOKEN_INVALID, XML_ATACTION_EOT )
882 // action table for OOO_ANNOTATION_ACTIONS
883 static XMLTransformerActionInit aAnnotationActionTable[] =
885 ENTRY1Q( OFFICE, AUTHOR, XML_ATACTION_MOVE_TO_ELEM,
886 XML_NAMESPACE_DC, XML_CREATOR ),
887 ENTRY1Q( OFFICE, CREATE_DATE, XML_ATACTION_MOVE_TO_ELEM,
888 XML_NAMESPACE_DC, XML_DATE ),
889 ENTRY1Q( OFFICE, CREATE_DATE_STRING, XML_ATACTION_MOVE_TO_ELEM,
890 XML_NAMESPACE_META, XML_DATE_STRING ),
891 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
894 // action table for OOO_CHANGE_INFO_ACTIONS
895 static XMLTransformerActionInit aChangeInfoActionTable[] =
897 ENTRY1Q( OFFICE, CHG_AUTHOR, XML_ATACTION_MOVE_TO_ELEM,
898 XML_NAMESPACE_DC, XML_CREATOR ),
899 ENTRY1Q( OFFICE, CHG_DATE_TIME, XML_ATACTION_MOVE_TO_ELEM,
900 XML_NAMESPACE_DC, XML_DATE ),
901 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
904 // OOO_BACKGROUND_IMAGE_ACTIONS
905 static XMLTransformerActionInit aBackgroundImageActionTable[] =
907 ENTRY1Q( DRAW, TRANSPARENCY, XML_ATACTION_RENAME_NEG_PERCENT,
908 XML_NAMESPACE_DRAW, XML_OPACITY ),
909 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(true) ),
910 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
913 /* OOO_BACKGROUND_IMAGE_ACTIONS for OpenOffice.org text documents
914 OpenOffice.org text documents, written by OpenOffice.org, contain
915 wrong value for the transparency of the background graphic (#i50322#)
917 static XMLTransformerActionInit aWriterBackgroundImageActionTable[] =
919 ENTRY1Q( DRAW, TRANSPARENCY, XML_ATACTION_WRITER_BACK_GRAPHIC_TRANSPARENCY, XML_NAMESPACE_DRAW, XML_OPACITY ),
920 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(true) ),
921 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
924 // OOO_DDE_CONNECTION_DECL
925 static XMLTransformerActionInit aDDEConnectionDeclActionTable[] =
927 ENTRY1Q( TEXT, NAME, XML_ATACTION_RENAME,
928 XML_NAMESPACE_OFFICE, XML_NAME ),
929 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
932 // OOO_FORM_CONTROL_ACTIONS
933 static XMLTransformerActionInit aFormControlActionTable[] =
935 ENTRY2QN( FORM, SERVICE_NAME,
936 XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX,
937 XML_NAMESPACE_FORM, XML_CONTROL_IMPLEMENTATION,
938 XML_NAMESPACE_OOO ),
939 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(false) ),
940 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
943 // OOO_FORM_COLUMN_ACTIONS
944 static XMLTransformerActionInit aFormColumnActionTable[] =
946 ENTRY1Q( FORM, COLUMN_STYLE_NAME, XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF,
947 XML_NAMESPACE_FORM, XML_TEXT_STYLE_NAME ),
948 ENTRY2QN( FORM, SERVICE_NAME,
949 XML_ATACTION_RENAME_ADD_NAMESPACE_PREFIX,
950 XML_NAMESPACE_FORM, XML_CONTROL_IMPLEMENTATION,
951 XML_NAMESPACE_OOO ),
952 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
955 // OOO_FORM_PROP_ACTIONS
956 static XMLTransformerActionInit aFormPropActionTable[] =
958 ENTRY1Q( FORM, PROPERTY_TYPE, XML_ATACTION_RENAME,
959 XML_NAMESPACE_OFFICE, XML_VALUE_TYPE ),
960 ENTRY0( FORM, PROPERTY_IS_LIST, XML_ATACTION_REMOVE ),
961 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
964 // OOO_XLINK_ACTIONS
965 static XMLTransformerActionInit aXLinkActionTable[] =
967 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_uInt32(false) ),
968 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
971 // OOO_CONFIG_ITEM_SET_ACTIONS
972 static XMLTransformerActionInit aConfigItemSetActionTable[] =
974 ENTRY1( CONFIG, NAME, XML_ATACTION_ADD_NAMESPACE_PREFIX,
975 XML_NAMESPACE_OOO ),
976 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
979 // OASIS_FORMULA_ACTIONS
980 static XMLTransformerActionInit aFormulaActionTable[] =
982 ENTRY1( TEXT, CONDITION, XML_ATACTION_ADD_NAMESPACE_PREFIX,
983 XML_NAMESPACE_OOOW ),
984 ENTRY1( TEXT, FORMULA, XML_ATACTION_ADD_NAMESPACE_PREFIX,
985 XML_NAMESPACE_OOOW ),
986 ENTRY1( TABLE, CONDITION, XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,
987 XML_NAMESPACE_OOOW ),
988 ENTRY1( TABLE, FORMULA, XML_ATACTION_ADD_APP_NAMESPACE_PREFIX,
989 XML_NAMESPACE_OOOW ),
990 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
993 // OOO_ERROR_MACRO_ACTIONS
994 static XMLTransformerActionInit aErrorMacroActionTable[] =
996 ENTRY0( TABLE, NAME, XML_ATACTION_REMOVE ),
997 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1000 // OOO_DDE_CONV_MODE_ACTIONS
1001 static XMLTransformerActionInit aDDEConvModeActionTable[] =
1003 ENTRY1Q( TABLE, LET_TEXT, XML_ATACTION_RENAME,
1004 XML_NAMESPACE_TABLE, XML_KEEP_TEXT ),
1005 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1008 // OOO_DATAPILOT_MEMBER_ACTIONS
1009 static XMLTransformerActionInit aDataPilotMemberActionTable[] =
1011 ENTRY1Q( TABLE, DISPLAY_DETAILS, XML_ATACTION_RENAME,
1012 XML_NAMESPACE_TABLE, XML_SHOW_DETAILS ),
1013 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1016 // OOO_DATAPILOT_LEVEL_ACTIONS
1017 static XMLTransformerActionInit aDataPilotLevelActionTable[] =
1019 ENTRY1Q( TABLE, DISPLAY_EMPTY, XML_ATACTION_RENAME,
1020 XML_NAMESPACE_TABLE, XML_SHOW_EMPTY ),
1021 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1024 // OOO_SOURCE_SERVICE_ACTIONS
1025 static XMLTransformerActionInit aSourceServiceActionTable[] =
1027 ENTRY1Q( TABLE, USERNAME, XML_ATACTION_RENAME,
1028 XML_NAMESPACE_TABLE, XML_USER_NAME ),
1029 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1032 // OOO_ANIMATION_ACTIONS
1033 static XMLTransformerActionInit aAnimationsActionTable[] =
1035 ENTRY0( DRAW, SHAPE_ID, XML_ATACTION_SHAPEID ),
1036 ENTRY0( PRESENTATION, PATH_ID, XML_ATACTION_SHAPEID ),
1037 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1040 // OOO_DRAW_AREA_POLYGON_ACTIONS (to be added to OOO_SHAPE_ACTIONS)
1041 static XMLTransformerActionInit aDrawAreaPolygonActionTable[] =
1043 ENTRY1Q( SVG, POINTS, XML_ATACTION_RENAME,
1044 XML_NAMESPACE_DRAW, XML_POINTS ),
1045 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1048 // OOO_CHART_ACTIONS
1049 static XMLTransformerActionInit aChartActionTable[] =
1051 ENTRY1( CHART, CLASS, XML_ATACTION_ADD_NAMESPACE_PREFIX,
1052 XML_NAMESPACE_CHART ),
1053 ENTRY0( CHART, ADD_IN_NAME, XML_ATACTION_REMOVE ),
1054 ENTRY0( SVG, WIDTH, XML_ATACTION_INCH2IN ),
1055 ENTRY0( SVG, HEIGHT, XML_ATACTION_INCH2IN ),
1056 ENTRY0( CHART, STYLE_NAME, XML_ATACTION_ENCODE_STYLE_NAME_REF ),
1057 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1060 // OOO_ALPHABETICAL_INDEX_MARK_ACTIONS
1061 static XMLTransformerActionInit aAlphabeticalIndexMarkActionTable[] =
1063 ENTRY1Q( TEXT, MAIN_ETRY, XML_ATACTION_RENAME,
1064 XML_NAMESPACE_TEXT, XML_MAIN_ENTRY ),
1065 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1068 // OOO_SCRIPT_ACTIONS
1069 static XMLTransformerActionInit aScriptActionTable[] =
1071 ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_ADD_NAMESPACE_PREFIX, XML_NAMESPACE_OOO ),
1072 ENTRY1Q( SCRIPT, NAME, XML_ATACTION_RENAME, XML_NAMESPACE_OOO, XML_NAME ),
1073 ENTRY1Q( SCRIPT, READONLY, XML_ATACTION_RENAME, XML_NAMESPACE_OOO, XML_READONLY ),
1074 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1077 static XMLTokenEnum aTokenMap[] =
1079 XML_NONE, XML_SINGLE, XML_DOUBLE, XML_BOLD, XML_BOLD_DOTTED,
1080 XML_BOLD_DASH, XML_BOLD_LONG_DASH, XML_BOLD_DOT_DASH,
1081 XML_BOLD_DOT_DOT_DASH, XML_BOLD_WAVE, XML_DOUBLE_WAVE,
1082 XML_SINGLE_LINE, XML_DOUBLE_LINE, XML_THICK_LINE, XML_SLASH, XML_uX,
1083 XML_TOKEN_END
1086 class XMLDocumentTransformerContext_Impl : public XMLTransformerContext
1088 OUString m_aElemQName;
1089 OUString m_aOldClass;
1091 public:
1092 TYPEINFO_OVERRIDE();
1094 XMLDocumentTransformerContext_Impl( XMLTransformerBase& rTransformer,
1095 const OUString& rQName );
1096 XMLDocumentTransformerContext_Impl( XMLTransformerBase& rTransformer,
1097 const OUString& rQName,
1098 sal_uInt16 nPrefix,
1099 ::xmloff::token::XMLTokenEnum eToken );
1101 virtual ~XMLDocumentTransformerContext_Impl();
1103 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
1104 virtual void EndElement() SAL_OVERRIDE;
1107 TYPEINIT1( XMLDocumentTransformerContext_Impl, XMLTransformerContext );
1109 XMLDocumentTransformerContext_Impl::XMLDocumentTransformerContext_Impl(
1110 XMLTransformerBase& rImp,
1111 const OUString& rQName ) :
1112 XMLTransformerContext( rImp, rQName ),
1113 m_aElemQName( rQName )
1116 XMLDocumentTransformerContext_Impl::XMLDocumentTransformerContext_Impl(
1117 XMLTransformerBase& rImp,
1118 const OUString& rQName ,
1119 sal_uInt16 nPrefix,
1120 ::xmloff::token::XMLTokenEnum eToken) :
1121 XMLTransformerContext( rImp, rQName ),
1122 m_aElemQName( rImp.GetNamespaceMap().GetQNameByKey( nPrefix,
1123 ::xmloff::token::GetXMLToken( eToken ) ) )
1127 XMLDocumentTransformerContext_Impl::~XMLDocumentTransformerContext_Impl()
1131 void XMLDocumentTransformerContext_Impl::StartElement(
1132 const Reference< XAttributeList >& rAttrList )
1134 Reference< XAttributeList > xAttrList( rAttrList );
1136 m_aOldClass = GetTransformer().GetClass();
1138 XMLMutableAttributeList *pMutableAttrList = 0;
1139 bool bOOo = false, bOOoW = false, bOOoC = false,
1140 bDOM=false, bDC = false, bSVG = false;
1141 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1142 for( sal_Int16 i=0; i < nAttrCount; i++ )
1144 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1145 OUString aLocalName;
1146 sal_uInt16 nPrefix =
1147 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1148 &aLocalName );
1149 if( XML_NAMESPACE_OFFICE == nPrefix &&
1150 IsXMLToken( aLocalName, XML_CLASS ) )
1152 const OUString& rValue = xAttrList->getValueByIndex( i );
1153 GetTransformer().SetClass( rValue );
1155 pMutableAttrList = new XMLMutableAttributeList( xAttrList );
1156 xAttrList = pMutableAttrList;
1157 OUString sMime("application/vnd.oasis.opendocument.");
1158 sMime += rValue;
1159 pMutableAttrList->SetValueByIndex( i, sMime );
1160 OUString aNewAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OFFICE, ::xmloff::token::GetXMLToken( XML_MIMETYPE ) ) );
1161 pMutableAttrList->RenameAttributeByIndex(i, aNewAttrQName );
1162 break;
1164 else if( XML_NAMESPACE_XMLNS == nPrefix )
1166 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1167 if( IsXMLToken( rAttrValue, XML_N_OOO ) )
1168 bOOo = true;
1169 else if( IsXMLToken( rAttrValue, XML_N_OOOW ) )
1170 bOOoW = true;
1171 else if( IsXMLToken( rAttrValue, XML_N_OOOC ) )
1172 bOOoC = true;
1173 else if( IsXMLToken( rAttrValue, XML_N_DOM ) )
1174 bDOM = true;
1175 else if( IsXMLToken( rAttrValue, XML_N_DC ) )
1176 bDC = true;
1177 else if( IsXMLToken( rAttrValue, XML_N_SVG ) )
1178 bSVG = true;
1181 if( !(bOOo && bOOoW && bOOoC && bDOM && bDC && bSVG) )
1183 if( !pMutableAttrList )
1185 pMutableAttrList = new XMLMutableAttributeList( xAttrList );
1186 xAttrList = pMutableAttrList;
1188 if( !bOOo )
1189 pMutableAttrList->AddAttribute(
1190 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1191 XML_NAMESPACE_OOO ),
1192 GetTransformer().GetNamespaceMap().GetNameByKey(
1193 XML_NAMESPACE_OOO ) );
1194 if( !bOOoW )
1195 pMutableAttrList->AddAttribute(
1196 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1197 XML_NAMESPACE_OOOW ),
1198 GetTransformer().GetNamespaceMap().GetNameByKey(
1199 XML_NAMESPACE_OOOW ) );
1200 if( !bOOoC )
1201 pMutableAttrList->AddAttribute(
1202 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1203 XML_NAMESPACE_OOOC ),
1204 GetTransformer().GetNamespaceMap().GetNameByKey(
1205 XML_NAMESPACE_OOOC ) );
1206 if( !bDOM )
1207 pMutableAttrList->AddAttribute(
1208 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1209 XML_NAMESPACE_DOM ),
1210 GetTransformer().GetNamespaceMap().GetNameByKey(
1211 XML_NAMESPACE_DOM ) );
1212 if( !bDC )
1213 pMutableAttrList->AddAttribute(
1214 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1215 XML_NAMESPACE_DC ),
1216 GetTransformer().GetNamespaceMap().GetNameByKey(
1217 XML_NAMESPACE_DC ) );
1218 if( !bSVG )
1219 pMutableAttrList->AddAttribute(
1220 GetTransformer().GetNamespaceMap().GetAttrNameByKey(
1221 XML_NAMESPACE_SVG ),
1222 GetTransformer().GetNamespaceMap().GetNameByKey(
1223 XML_NAMESPACE_SVG ) );
1226 GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1229 void XMLDocumentTransformerContext_Impl::EndElement()
1231 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1233 GetTransformer().SetClass( m_aOldClass );
1236 class XMLBodyTransformerContext_Impl : public XMLTransformerContext
1238 OUString m_aClassQName;
1240 public:
1241 TYPEINFO_OVERRIDE();
1243 XMLBodyTransformerContext_Impl( XMLTransformerBase& rTransformer,
1244 const OUString& rQName );
1246 virtual ~XMLBodyTransformerContext_Impl();
1248 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
1249 virtual void EndElement() SAL_OVERRIDE;
1252 TYPEINIT1( XMLBodyTransformerContext_Impl, XMLTransformerContext );
1254 XMLBodyTransformerContext_Impl::XMLBodyTransformerContext_Impl(
1255 XMLTransformerBase& rImp,
1256 const OUString& rQName ) :
1257 XMLTransformerContext( rImp, rQName )
1261 XMLBodyTransformerContext_Impl::~XMLBodyTransformerContext_Impl()
1265 void XMLBodyTransformerContext_Impl::StartElement(
1266 const Reference< XAttributeList >& rAttrList )
1268 XMLTransformerContext::StartElement( rAttrList );
1270 XMLMutableAttributeList *pMutableAttrList =
1271 new XMLMutableAttributeList( rAttrList );
1272 Reference< XAttributeList > xAttrList = pMutableAttrList;
1273 OUString aClass( GetTransformer().GetClass() );
1274 if( aClass.isEmpty() )
1276 aClass = GetXMLToken( XML_TEXT );
1278 else if( IsXMLToken( aClass, XML_TEXT_GLOBAL ) )
1280 OUString aGlobalQName(
1281 GetTransformer().GetNamespaceMap().GetQNameByKey(
1282 XML_NAMESPACE_TEXT, GetXMLToken(XML_GLOBAL ) ) );
1283 pMutableAttrList->AddAttribute( aGlobalQName, GetXMLToken(XML_TRUE) );
1285 aClass = GetXMLToken( XML_TEXT );
1288 m_aClassQName = GetTransformer().GetNamespaceMap().GetQNameByKey(
1289 XML_NAMESPACE_OFFICE, aClass );
1290 GetTransformer().GetDocHandler()->startElement( m_aClassQName,
1291 xAttrList );
1294 void XMLBodyTransformerContext_Impl::EndElement()
1296 GetTransformer().GetDocHandler()->endElement( m_aClassQName );
1297 XMLTransformerContext::EndElement();
1300 class XMLTabStopOOoTContext_Impl : public XMLPersElemContentTContext
1302 public:
1303 TYPEINFO_OVERRIDE();
1305 XMLTabStopOOoTContext_Impl( XMLTransformerBase& rTransformer,
1306 const OUString& rQName );
1308 virtual ~XMLTabStopOOoTContext_Impl();
1310 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
1313 TYPEINIT1( XMLTabStopOOoTContext_Impl, XMLPersElemContentTContext );
1315 XMLTabStopOOoTContext_Impl::XMLTabStopOOoTContext_Impl(
1316 XMLTransformerBase& rImp,
1317 const OUString& rQName ) :
1318 XMLPersElemContentTContext( rImp, rQName )
1322 XMLTabStopOOoTContext_Impl::~XMLTabStopOOoTContext_Impl()
1326 void XMLTabStopOOoTContext_Impl::StartElement(
1327 const Reference< XAttributeList >& rAttrList )
1329 XMLTransformerActions *pActions =
1330 GetTransformer().GetUserDefinedActions( OOO_TAB_STOP_ACTIONS );
1331 OSL_ENSURE( pActions, "go no actions" );
1333 Reference< XAttributeList > xAttrList( rAttrList );
1334 XMLMutableAttributeList *pMutableAttrList = 0;
1335 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1336 for( sal_Int16 i=0; i < nAttrCount; i++ )
1338 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1339 OUString aLocalName;
1340 sal_uInt16 nPrefix =
1341 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1342 &aLocalName );
1343 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1344 XMLTransformerActions::const_iterator aIter =
1345 pActions->find( aKey );
1346 if( !(aIter == pActions->end() ) )
1348 if( !pMutableAttrList )
1350 pMutableAttrList =
1351 new XMLMutableAttributeList( xAttrList );
1352 xAttrList = pMutableAttrList;
1354 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1355 switch( (*aIter).second.m_nActionType )
1357 case XML_ATACTION_RENAME:
1359 OUString aNewAttrQName(
1360 GetTransformer().GetNamespaceMap().GetQNameByKey(
1361 (*aIter).second.GetQNamePrefixFromParam1(),
1362 ::xmloff::token::GetXMLToken(
1363 (*aIter).second.GetQNameTokenFromParam1()) ) );
1364 pMutableAttrList->RenameAttributeByIndex( i,
1365 aNewAttrQName );
1367 if( IsXMLToken( aLocalName, XML_LEADER_CHAR ) &&
1368 !rAttrValue.isEmpty() &&
1369 rAttrValue[0] != ' ' )
1371 OUString aNewAttrQName(
1372 GetTransformer().GetNamespaceMap().GetQNameByKey(
1373 XML_NAMESPACE_STYLE,
1374 ::xmloff::token::GetXMLToken(XML_LEADER_STYLE) ) );
1375 pMutableAttrList->AddAttribute( aNewAttrQName,
1376 GetXMLToken( XML_SOLID ) );
1378 break;
1379 case XML_ATACTION_INCH2IN:
1381 OUString aAttrValue( rAttrValue );
1382 if( XMLTransformerBase::ReplaceSingleInchWithIn(
1383 aAttrValue ) )
1384 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1386 break;
1387 default:
1388 OSL_ENSURE( false, "unknown action" );
1389 break;
1394 XMLPersElemContentTContext::StartElement( xAttrList );
1397 class XMLTrackedChangesOOoTContext_Impl : public XMLTransformerContext
1399 sal_uInt16 m_nPrefix;
1400 XMLTokenEnum m_eToken;
1402 public:
1404 TYPEINFO_OVERRIDE();
1406 XMLTrackedChangesOOoTContext_Impl( XMLTransformerBase& rTransformer,
1407 const OUString& rQName,
1408 sal_uInt16 nPrefix,
1409 XMLTokenEnum eToken );
1411 virtual ~XMLTrackedChangesOOoTContext_Impl();
1413 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
1416 TYPEINIT1( XMLTrackedChangesOOoTContext_Impl, XMLTransformerContext );
1418 XMLTrackedChangesOOoTContext_Impl::XMLTrackedChangesOOoTContext_Impl(
1419 XMLTransformerBase& rImp,
1420 const OUString& rQName,
1421 sal_uInt16 nPrefix,
1422 XMLTokenEnum eToken ) :
1423 XMLTransformerContext( rImp, rQName ),
1424 m_nPrefix( nPrefix ),
1425 m_eToken( eToken )
1429 XMLTrackedChangesOOoTContext_Impl::~XMLTrackedChangesOOoTContext_Impl()
1433 void XMLTrackedChangesOOoTContext_Impl::StartElement(
1434 const Reference< XAttributeList >& rAttrList )
1436 Reference< XAttributeList > xAttrList( rAttrList );
1437 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1438 for( sal_Int16 i=0; i < nAttrCount; i++ )
1440 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1441 OUString aLocalName;
1442 sal_uInt16 nPrefix =
1443 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1444 &aLocalName );
1445 if( m_nPrefix == nPrefix && IsXMLToken( aLocalName, m_eToken ) )
1447 const Reference< XPropertySet > rPropSet =
1448 GetTransformer().GetPropertySet();
1449 OSL_ENSURE( rPropSet.is(), "no info property set" );
1450 if( rPropSet.is() )
1452 const sal_Char sRedlineProtectionKey[] = "RedlineProtectionKey";
1453 OUString aPropName(sRedlineProtectionKey);
1454 Reference< XPropertySetInfo > xPropSetInfo(
1455 rPropSet->getPropertySetInfo() );
1456 if( xPropSetInfo.is() &&
1457 xPropSetInfo->hasPropertyByName( aPropName ) )
1459 Sequence < sal_Int8 > aKey;
1460 ::sax::Converter::decodeBase64( aKey,
1461 xAttrList->getValueByIndex( i ) );
1462 rPropSet->setPropertyValue( aPropName, makeAny( aKey ) );
1464 else
1466 OSL_ENSURE( false, "RedineProtectionKey is missing" );
1469 break;
1472 XMLTransformerContext::StartElement( xAttrList );
1475 class XMLTableOOoTransformerContext_Impl : public XMLTransformerContext
1477 OUString m_aElemQName;
1479 public:
1480 TYPEINFO_OVERRIDE();
1482 XMLTableOOoTransformerContext_Impl( XMLTransformerBase& rTransformer,
1483 const OUString& rQName );
1485 virtual ~XMLTableOOoTransformerContext_Impl();
1487 virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
1488 virtual void EndElement() SAL_OVERRIDE;
1491 TYPEINIT1( XMLTableOOoTransformerContext_Impl, XMLTransformerContext );
1493 XMLTableOOoTransformerContext_Impl::XMLTableOOoTransformerContext_Impl(
1494 XMLTransformerBase& rImp,
1495 const OUString& rQName ) :
1496 XMLTransformerContext( rImp, rQName ),
1497 m_aElemQName( rQName )
1501 XMLTableOOoTransformerContext_Impl::~XMLTableOOoTransformerContext_Impl()
1505 void XMLTableOOoTransformerContext_Impl::StartElement(
1506 const Reference< XAttributeList >& rAttrList )
1508 // Perform OOO_STYLE_REF_ACTIONS for all applications (#i50521#)
1509 Reference< XAttributeList > xAttrList( rAttrList );
1510 XMLMutableAttributeList* pMutableAttrList =
1511 GetTransformer().ProcessAttrList( xAttrList, OOO_STYLE_REF_ACTIONS, false );
1512 if( rAttrList->getLength() && IsXMLToken( GetTransformer().GetClass(), XML_SPREADSHEET ) )
1514 bool bPrintRanges(false);
1516 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1517 for( sal_Int16 i=0; i < nAttrCount; i++ )
1519 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1520 OUString aLocalName;
1521 sal_uInt16 nPrefix =
1522 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1523 &aLocalName );
1524 if( XML_NAMESPACE_TABLE == nPrefix &&
1525 IsXMLToken( aLocalName, XML_PRINT_RANGES ) )
1527 bPrintRanges = true;
1530 if (!bPrintRanges && pMutableAttrList)
1532 xAttrList = pMutableAttrList;
1533 pMutableAttrList->AddAttribute(GetTransformer().GetNamespaceMap().GetQNameByKey(
1534 XML_NAMESPACE_TABLE,
1535 GetXMLToken( XML_PRINT ) ), GetXMLToken ( XML_FALSE ));
1539 GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1542 void XMLTableOOoTransformerContext_Impl::EndElement()
1544 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1547 XMLTransformerContext *OOo2OasisTransformer::CreateUserDefinedContext(
1548 const TransformerAction_Impl& rAction,
1549 const OUString& rQName,
1550 bool bPersistent )
1552 switch( rAction.m_nActionType )
1554 case XML_ETACTION_DOCUMENT:
1555 return new XMLDocumentTransformerContext_Impl( *this, rQName );
1556 case XML_ETACTION_DOCUMENT_RENAME:
1557 return new XMLDocumentTransformerContext_Impl( *this, rQName,
1558 rAction.GetQNamePrefixFromParam1(),
1559 rAction.GetQNameTokenFromParam1() );
1560 case XML_ETACTION_BODY:
1561 return new XMLBodyTransformerContext_Impl( *this, rQName );
1562 case XML_ETACTION_STYLE:
1563 return new XMLStyleOOoTContext( *this, rQName,
1564 static_cast< XMLFamilyType >( rAction.m_nParam1 ),
1565 bPersistent );
1566 case XML_ETACTION_STYLE_RENAME:
1567 return new XMLStyleOOoTContext( *this, rQName,
1568 static_cast< XMLFamilyType >( rAction.m_nParam2 ),
1569 rAction.GetQNamePrefixFromParam1(),
1570 rAction.GetQNameTokenFromParam1(),
1571 bPersistent );
1572 case XML_ETACTION_FRAME:
1573 return new XMLFrameOOoTransformerContext( *this, rQName );
1574 case XML_ETACTION_EVENT:
1575 return new XMLEventOOoTransformerContext( *this, rQName, bPersistent );
1576 case XML_ETACTION_TAB_STOP:
1577 return new XMLTabStopOOoTContext_Impl( *this, rQName );
1578 case XML_ETACTION_FORM_CONTROL:
1579 return new XMLControlOOoTransformerContext( *this, rQName );
1580 case XML_ETACTION_FORM_PROPERTY:
1581 return new XMLFormPropOOoTransformerContext( *this, rQName );
1582 case XML_ETACTION_CHART:
1583 return new XMLChartOOoTransformerContext( *this, rQName );
1584 case XML_ETACTION_TRACKED_CHANGES:
1585 return new XMLTrackedChangesOOoTContext_Impl( *this, rQName,
1586 rAction.GetQNamePrefixFromParam1(),
1587 rAction.GetQNameTokenFromParam1() );
1588 case XML_ETACTION_CHART_PLOT_AREA:
1589 return new XMLChartPlotAreaOOoTContext( *this, rQName );
1590 case XML_ETACTION_TABLE:
1591 return new XMLTableOOoTransformerContext_Impl( *this, rQName );
1592 default:
1593 OSL_ENSURE( false, "no user defined context found!" );
1596 // default is copying
1597 return new XMLTransformerContext( *this, rQName );
1600 XMLTransformerActions *OOo2OasisTransformer::GetUserDefinedActions(
1601 sal_uInt16 n )
1603 XMLTransformerActions *pActions = 0;
1604 if( n < MAX_OOO_ACTIONS )
1606 if( !m_aActions[n] )
1608 if( n<MAX_OOO_PROP_ACTIONS )
1610 m_aActions[n] =
1611 XMLStyleOOoTContext::CreateTransformerActions( n );
1613 else switch( n )
1615 case OOO_STYLE_ACTIONS:
1616 m_aActions[OOO_STYLE_ACTIONS] =
1617 new XMLTransformerActions( aStyleActionTable );
1618 break;
1619 case OOO_FONT_DECL_ACTIONS:
1620 m_aActions[OOO_FONT_DECL_ACTIONS] =
1621 new XMLTransformerActions( aFontDeclActionTable );
1622 break;
1623 case OOO_SHAPE_ACTIONS:
1624 m_aActions[OOO_SHAPE_ACTIONS] =
1625 new XMLTransformerActions( aShapeActionTable );
1626 break;
1627 case OOO_CONNECTOR_ACTIONS:
1628 m_aActions[OOO_CONNECTOR_ACTIONS] =
1629 new XMLTransformerActions( aConnectorActionTable );
1630 break;
1631 case OOO_TAB_STOP_ACTIONS:
1632 m_aActions[OOO_TAB_STOP_ACTIONS] =
1633 new XMLTransformerActions( aTabStopActionTable );
1634 break;
1635 case OOO_INDEX_ENTRY_TAB_STOP_ACTIONS:
1636 m_aActions[OOO_INDEX_ENTRY_TAB_STOP_ACTIONS] =
1637 new XMLTransformerActions( aIndexEntryTabStopActionTable );
1638 break;
1639 case OOO_LINENUMBERING_ACTIONS:
1640 m_aActions[OOO_LINENUMBERING_ACTIONS] =
1641 new XMLTransformerActions( aLineNumberingActionTable );
1642 break;
1643 case OOO_FOOTNOTE_SEP_ACTIONS:
1644 m_aActions[OOO_FOOTNOTE_SEP_ACTIONS] =
1645 new XMLTransformerActions( aFootnoteSepActionTable );
1646 break;
1647 case OOO_DROP_CAP_ACTIONS:
1648 m_aActions[OOO_DROP_CAP_ACTIONS] =
1649 new XMLTransformerActions( aDropCapActionTable );
1650 break;
1651 case OOO_COLUMNS_ACTIONS:
1652 m_aActions[OOO_COLUMNS_ACTIONS] =
1653 new XMLTransformerActions( aColumnsActionTable );
1654 break;
1655 case OOO_TEXT_VALUE_TYPE_ACTIONS:
1656 m_aActions[OOO_TEXT_VALUE_TYPE_ACTIONS] =
1657 new XMLTransformerActions( aTextValueTypeActionTable );
1658 break;
1659 case OOO_TABLE_VALUE_TYPE_ACTIONS:
1660 m_aActions[OOO_TABLE_VALUE_TYPE_ACTIONS] =
1661 new XMLTransformerActions( aTableValueTypeActionTable );
1662 break;
1663 case OOO_PARA_ACTIONS:
1664 m_aActions[OOO_PARA_ACTIONS] =
1665 new XMLTransformerActions( aParaActionTable );
1666 break;
1667 case OOO_STYLE_REF_ACTIONS:
1668 m_aActions[OOO_STYLE_REF_ACTIONS] =
1669 new XMLTransformerActions( aStyleRefActionTable );
1670 break;
1671 case OOO_MASTER_PAGE_ACTIONS:
1672 m_aActions[OOO_MASTER_PAGE_ACTIONS] =
1673 new XMLTransformerActions( aMasterPageActionTable );
1674 break;
1675 case OOO_ANNOTATION_ACTIONS:
1676 m_aActions[OOO_ANNOTATION_ACTIONS] =
1677 new XMLTransformerActions( aAnnotationActionTable );
1678 break;
1679 case OOO_CHANGE_INFO_ACTIONS:
1680 m_aActions[OOO_CHANGE_INFO_ACTIONS] =
1681 new XMLTransformerActions( aChangeInfoActionTable );
1682 break;
1683 case OOO_FRAME_ELEM_ACTIONS:
1684 m_aActions[OOO_FRAME_ELEM_ACTIONS] =
1685 new XMLTransformerActions( aFrameElemActionTable );
1686 break;
1687 case OOO_FRAME_ATTR_ACTIONS:
1688 m_aActions[OOO_FRAME_ATTR_ACTIONS] =
1689 new XMLTransformerActions( aFrameAttrActionTable );
1690 break;
1691 case OOO_BACKGROUND_IMAGE_ACTIONS:
1692 // Use special actions for Writer documents. (#i50322#)
1693 m_aActions[OOO_BACKGROUND_IMAGE_ACTIONS] =
1694 isWriter()
1695 ? new XMLTransformerActions( aWriterBackgroundImageActionTable )
1696 : new XMLTransformerActions( aBackgroundImageActionTable );
1697 break;
1698 case OOO_DDE_CONNECTION_DECL_ACTIONS:
1699 m_aActions[OOO_DDE_CONNECTION_DECL_ACTIONS] =
1700 new XMLTransformerActions( aDDEConnectionDeclActionTable );
1701 break;
1702 case OOO_EVENT_ACTIONS:
1703 m_aActions[OOO_EVENT_ACTIONS] =
1704 new XMLTransformerActions( aEventActionTable );
1705 break;
1706 case OOO_FORM_CONTROL_ACTIONS:
1707 m_aActions[OOO_FORM_CONTROL_ACTIONS] =
1708 new XMLTransformerActions( aFormControlActionTable );
1709 break;
1710 case OOO_FORM_COLUMN_ACTIONS:
1711 m_aActions[OOO_FORM_COLUMN_ACTIONS] =
1712 new XMLTransformerActions( aFormColumnActionTable );
1713 break;
1714 case OOO_FORM_PROP_ACTIONS:
1715 m_aActions[OOO_FORM_PROP_ACTIONS] =
1716 new XMLTransformerActions( aFormPropActionTable );
1717 break;
1718 case OOO_XLINK_ACTIONS:
1719 m_aActions[OOO_XLINK_ACTIONS] =
1720 new XMLTransformerActions( aXLinkActionTable );
1721 break;
1722 case OOO_CONFIG_ITEM_SET_ACTIONS:
1723 m_aActions[OOO_CONFIG_ITEM_SET_ACTIONS] =
1724 new XMLTransformerActions( aConfigItemSetActionTable );
1725 break;
1726 case OOO_FORMULA_ACTIONS:
1727 m_aActions[OOO_FORMULA_ACTIONS] =
1728 new XMLTransformerActions( aFormulaActionTable );
1729 break;
1730 case OOO_CHART_ACTIONS:
1731 m_aActions[OOO_CHART_ACTIONS] =
1732 new XMLTransformerActions( aChartActionTable );
1733 break;
1734 case OOO_ERROR_MACRO_ACTIONS:
1735 m_aActions[OOO_ERROR_MACRO_ACTIONS] =
1736 new XMLTransformerActions( aErrorMacroActionTable );
1737 break;
1738 case OOO_DDE_CONV_MODE_ACTIONS:
1739 m_aActions[OOO_DDE_CONV_MODE_ACTIONS] =
1740 new XMLTransformerActions( aDDEConvModeActionTable );
1741 break;
1742 case OOO_ALPHABETICAL_INDEX_MARK_ACTIONS:
1743 m_aActions[OOO_ALPHABETICAL_INDEX_MARK_ACTIONS] =
1744 new XMLTransformerActions( aAlphabeticalIndexMarkActionTable );
1745 break;
1746 case OOO_DATAPILOT_MEMBER_ACTIONS:
1747 m_aActions[OOO_DATAPILOT_MEMBER_ACTIONS] =
1748 new XMLTransformerActions( aDataPilotMemberActionTable );
1749 break;
1750 case OOO_DATAPILOT_LEVEL_ACTIONS:
1751 m_aActions[OOO_DATAPILOT_LEVEL_ACTIONS] =
1752 new XMLTransformerActions( aDataPilotLevelActionTable );
1753 break;
1754 case OOO_SOURCE_SERVICE_ACTIONS:
1755 m_aActions[OOO_SOURCE_SERVICE_ACTIONS] =
1756 new XMLTransformerActions( aSourceServiceActionTable );
1757 break;
1758 case OOO_DRAW_AREA_POLYGON_ACTIONS:
1759 m_aActions[OOO_DRAW_AREA_POLYGON_ACTIONS] =
1760 new XMLTransformerActions( aShapeActionTable );
1761 m_aActions[OOO_DRAW_AREA_POLYGON_ACTIONS]
1762 ->Add( aDrawAreaPolygonActionTable );
1763 break;
1764 case OOO_SCRIPT_ACTIONS:
1765 m_aActions[OOO_SCRIPT_ACTIONS] =
1766 new XMLTransformerActions( aScriptActionTable );
1767 break;
1768 case OOO_ANIMATION_ACTIONS:
1769 m_aActions[OOO_ANIMATION_ACTIONS] =
1770 new XMLTransformerActions( aAnimationsActionTable );
1771 break;
1774 pActions = m_aActions[n];
1777 return pActions;
1780 OUString OOo2OasisTransformer::GetEventName( const OUString& rName, bool )
1782 if( !m_pEventMap )
1783 m_pEventMap = XMLEventOOoTransformerContext::CreateEventMap();
1785 OUString aNewName;
1786 sal_uInt16 nPrefix = XMLEventOOoTransformerContext::GetEventName( rName,
1787 aNewName, *m_pEventMap );
1788 if( XML_NAMESPACE_UNKNOWN != nPrefix )
1789 aNewName = GetNamespaceMap().GetQNameByKey( nPrefix, aNewName );
1790 else
1791 aNewName = rName;
1793 return aNewName;
1796 OOo2OasisTransformer::OOo2OasisTransformer( const sal_Char *pImplName,
1797 const sal_Char *pSubServiceName )
1798 throw() :
1799 XMLTransformerBase( aActionTable, aTokenMap ),
1800 m_pEventMap( 0 )
1802 if( pImplName )
1803 m_aImplName = OUString::createFromAscii( pImplName );
1804 else
1805 m_aImplName = OOo2OasisTransformer_getImplementationName();
1806 if( pSubServiceName )
1807 m_aSubServiceName = OUString::createFromAscii( pSubServiceName );
1809 GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE_OOO), XML_NAMESPACE_OFFICE );
1810 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE );
1812 GetNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META_OOO), XML_NAMESPACE_META );
1813 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META), XML_NAMESPACE_META );
1815 GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE_OOO), XML_NAMESPACE_STYLE );
1816 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE );
1818 GetNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER_OOO), XML_NAMESPACE_NUMBER );
1819 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER), XML_NAMESPACE_NUMBER );
1821 GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG_OOO), XML_NAMESPACE_CONFIG );
1822 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG );
1824 GetNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT_OOO), XML_NAMESPACE_TEXT );
1825 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
1827 GetNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE_OOO), XML_NAMESPACE_TABLE );
1828 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE );
1830 GetNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW_OOO), XML_NAMESPACE_DRAW );
1831 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW );
1833 GetNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D_OOO), XML_NAMESPACE_DR3D );
1834 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D), XML_NAMESPACE_DR3D );
1836 GetNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION_OOO), XML_NAMESPACE_PRESENTATION );
1837 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION), XML_NAMESPACE_PRESENTATION );
1839 GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART_OOO), XML_NAMESPACE_CHART );
1840 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART), XML_NAMESPACE_CHART );
1842 GetNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM_OOO), XML_NAMESPACE_FORM );
1843 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM );
1845 GetNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT_OOO), XML_NAMESPACE_SCRIPT );
1846 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT), XML_NAMESPACE_SCRIPT );
1848 GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO), XML_NAMESPACE_FO );
1849 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO );
1851 GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG );
1852 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG_COMPAT), XML_NAMESPACE_SVG );
1854 for( sal_uInt16 i=0; i<MAX_OOO_ACTIONS; ++i )
1855 m_aActions[i] = 0;
1858 OOo2OasisTransformer::~OOo2OasisTransformer() throw()
1860 for( sal_uInt16 i=0; i<MAX_OOO_ACTIONS; ++i )
1861 delete m_aActions[i];
1862 XMLEventOOoTransformerContext::FlushEventMap( m_pEventMap );
1865 Any OOo2OasisTransformer::queryInterface( const Type& rType )
1866 throw (RuntimeException, std::exception)
1868 Any aRet;
1869 if ( rType == cppu::UnoType<XImporter>::get())
1871 Reference<XImporter> xThis( this );
1872 aRet <<= xThis;
1874 else if ( rType == cppu::UnoType<XFilter>::get())
1876 Reference<XFilter> xThis( this );
1877 aRet <<= xThis;
1879 else
1881 aRet = XMLTransformerBase::queryInterface(rType);
1884 return aRet;
1887 // XImporter
1888 void SAL_CALL OOo2OasisTransformer::setTargetDocument(
1889 const Reference< XComponent >& xDoc )
1890 throw( IllegalArgumentException, RuntimeException, std::exception)
1892 if( !GetDocHandler().is() )
1894 // if initialize hasn't been called, then we have to call it now
1895 // to get the sub component initialized.
1896 Sequence<Any> aArgs( 0 );
1897 Initialize( aArgs );
1900 mxModel.set( xDoc, UNO_QUERY );
1902 Reference< XImporter > xImp( GetDocHandler(), UNO_QUERY );
1903 OSL_ENSURE( xImp.is(), "doc handler is not an importer" );
1904 if( xImp.is() )
1905 xImp->setTargetDocument( xDoc );
1908 // XFilter
1909 sal_Bool SAL_CALL OOo2OasisTransformer::filter(
1910 const Sequence< PropertyValue >& aDescriptor )
1911 throw ( RuntimeException, std::exception)
1913 Reference< XFilter> xFilter( GetDocHandler(), UNO_QUERY );
1914 OSL_ENSURE( xFilter.is(), "doc handler is not a filter" );
1915 if( xFilter.is() )
1916 return xFilter->filter( aDescriptor );
1918 return sal_False;
1921 void SAL_CALL OOo2OasisTransformer::cancel( )
1922 throw ( RuntimeException, std::exception)
1924 Reference< XFilter> xFilter( GetDocHandler(), UNO_QUERY );
1925 OSL_ENSURE( xFilter.is(), "doc handler is not a filter" );
1926 if( xFilter.is() )
1927 xFilter->cancel();
1930 // XInitialize
1931 void SAL_CALL OOo2OasisTransformer::initialize(
1932 const Sequence< Any >& rArguments )
1933 throw( Exception, RuntimeException, std::exception )
1935 Initialize( rArguments );
1938 void SAL_CALL OOo2OasisTransformer::startDocument()
1939 throw( SAXException, RuntimeException, std::exception )
1941 if( !GetDocHandler().is() )
1943 // if initialize hasn't been called, then we have to call it now
1944 // to get the sub component initialized.
1945 Sequence<Any> aArgs( 0 );
1946 Initialize( aArgs );
1949 XMLTransformerBase::startDocument();
1952 void SAL_CALL OOo2OasisTransformer::Initialize(
1953 const Sequence< Any >& rArguments )
1954 throw( Exception, RuntimeException )
1956 OSL_ENSURE( !GetDocHandler().is(), "duplication initialization" );
1958 Reference< XDocumentHandler > xDocHandler;
1959 if( !m_aSubServiceName.isEmpty() )
1961 Reference< XComponentContext > xContext =
1962 comphelper::getProcessComponentContext();
1965 // get filter component
1966 xDocHandler = Reference< XDocumentHandler >(
1967 xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext),
1968 UNO_QUERY);
1970 catch( Exception& )
1975 OSL_ENSURE( xDocHandler.is(), "can't instantiate filter component" );
1976 if( xDocHandler.is() )
1978 Sequence<Any> aArgs( 1 + rArguments.getLength() );
1979 aArgs[0] <<= xDocHandler;
1980 for(sal_Int32 i = 0; i < rArguments.getLength(); i++)
1981 aArgs[i+1] = rArguments[i];
1982 XMLTransformerBase::initialize( aArgs );
1984 OSL_ENSURE( GetDocHandler() == xDocHandler,
1985 "duplicate doc handler" );
1987 else
1989 XMLTransformerBase::initialize( rArguments );
1993 namespace
1995 class theOOo2OasisTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOOo2OasisTransformerUnoTunnelId> {};
1998 const Sequence< sal_Int8 > & OOo2OasisTransformer::getUnoTunnelId() throw()
2000 return theOOo2OasisTransformerUnoTunnelId::get().getSeq();
2003 // XUnoTunnel
2004 sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 >& rId )
2005 throw(RuntimeException, std::exception)
2007 if( rId.getLength() == 16
2008 && 0 == memcmp( getUnoTunnelId().getConstArray(),
2009 rId.getConstArray(), 16 ) )
2011 return reinterpret_cast< sal_Int64 >( this );
2013 else
2015 return (sal_Int64)0;
2019 // XServiceInfo
2020 OUString SAL_CALL OOo2OasisTransformer::getImplementationName()
2021 throw(RuntimeException, std::exception)
2023 return m_aImplName;
2026 sal_Bool SAL_CALL OOo2OasisTransformer::supportsService( const OUString& ServiceName )
2027 throw(RuntimeException, std::exception)
2029 return cppu::supportsService(this, ServiceName);
2032 Sequence< OUString > SAL_CALL OOo2OasisTransformer::getSupportedServiceNames( )
2033 throw(RuntimeException, std::exception)
2035 Sequence<OUString> aSeq(0);
2036 return aSeq;
2039 // XTypeProvider
2040 Sequence< ::com::sun::star::uno::Type > SAL_CALL
2041 OOo2OasisTransformer::getTypes() throw(RuntimeException, std::exception)
2043 Sequence< ::com::sun::star::uno::Type > aTypes(
2044 XMLTransformerBase::getTypes() );
2046 sal_Int32 nIndex = aTypes.getLength();
2047 aTypes.realloc( nIndex + 2 );
2049 ::com::sun::star::uno::Type* pTypes = aTypes.getArray();
2050 pTypes[nIndex++] = cppu::UnoType<XImporter>::get();
2051 pTypes[nIndex++] = cppu::UnoType<XFilter>::get();
2053 return aTypes;
2056 // Service registration
2058 OUString SAL_CALL OOo2OasisTransformer_getImplementationName() throw()
2060 return OUString( "com.sun.star.comp.OOo2OasisTransformer" );
2063 Sequence< OUString > SAL_CALL OOo2OasisTransformer_getSupportedServiceNames() throw()
2065 const OUString aServiceName( OOo2OasisTransformer_getImplementationName() );
2066 const Sequence< OUString > aSeq( &aServiceName, 1 );
2067 return aSeq;
2070 Reference< XInterface > SAL_CALL OOo2OasisTransformer_createInstance(
2071 const Reference< XMultiServiceFactory > & )
2072 throw( Exception )
2074 return (cppu::OWeakObject*)new OOo2OasisTransformer();
2077 #define OOO_IMPORTER( className, implName, subServiceName ) \
2078 OUString SAL_CALL className##_getImplementationName() throw() \
2080 return OUString( implName ); \
2083 Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw()\
2085 const OUString aServiceName( className##_getImplementationName() ); \
2086 const Sequence< OUString > aSeq( &aServiceName, 1 ); \
2087 return aSeq; \
2090 Reference< XInterface > SAL_CALL className##_createInstance( \
2091 const Reference< XMultiServiceFactory > & ) \
2092 throw( Exception ) \
2094 return (cppu::OWeakObject*)new OOo2OasisTransformer( implName, \
2095 subServiceName ); \
2098 OOO_IMPORTER( XMLWriterImportOOO,
2099 "com.sun.star.comp.Writer.XMLImporter",
2100 "com.sun.star.comp.Writer.XMLOasisImporter" )
2101 OOO_IMPORTER( XMLWriterStylesImportOOO,
2102 "com.sun.star.comp.Writer.XMLStylesImporter",
2103 "com.sun.star.comp.Writer.XMLOasisStylesImporter" )
2104 OOO_IMPORTER( XMLWriterContentImportOOO,
2105 "com.sun.star.comp.Writer.XMLContentImporter",
2106 "com.sun.star.comp.Writer.XMLOasisContentImporter" )
2107 OOO_IMPORTER( XMLWriterMetaImportOOO,
2108 "com.sun.star.comp.Writer.XMLMetaImporter",
2109 "com.sun.star.comp.Writer.XMLOasisMetaImporter" )
2110 OOO_IMPORTER( XMLWriterSettingsImportOOO,
2111 "com.sun.star.comp.Writer.XMLSettingsImporter",
2112 "com.sun.star.comp.Writer.XMLOasisSettingsImporter" )
2114 OOO_IMPORTER( XMLImpressImportOOO,
2115 "com.sun.star.comp.Impress.XMLImporter",
2116 "com.sun.star.comp.Impress.XMLOasisImporter" )
2117 OOO_IMPORTER( XMLImpressStylesImportOOO,
2118 "com.sun.star.comp.Impress.XMLStylesImporter",
2119 "com.sun.star.comp.Impress.XMLOasisStylesImporter" )
2120 OOO_IMPORTER( XMLImpressContentImportOOO,
2121 "com.sun.star.comp.Impress.XMLContentImporter",
2122 "com.sun.star.comp.Impress.XMLOasisContentImporter" )
2123 OOO_IMPORTER( XMLImpressMetaImportOOO,
2124 "com.sun.star.comp.Impress.XMLMetaImporter",
2125 "com.sun.star.comp.Impress.XMLOasisMetaImporter" )
2126 OOO_IMPORTER( XMLImpressSettingsImportOOO,
2127 "com.sun.star.comp.Impress.XMLSettingsImporter",
2128 "com.sun.star.comp.Impress.XMLOasisSettingsImporter" )
2130 OOO_IMPORTER( XMLDrawImportOOO,
2131 "com.sun.star.comp.Draw.XMLImporter",
2132 "com.sun.star.comp.Draw.XMLOasisImporter" )
2133 OOO_IMPORTER( XMLDrawStylesImportOOO,
2134 "com.sun.star.comp.Draw.XMLStylesImporter",
2135 "com.sun.star.comp.Draw.XMLOasisStylesImporter" )
2136 OOO_IMPORTER( XMLDrawContentImportOOO,
2137 "com.sun.star.comp.Draw.XMLContentImporter",
2138 "com.sun.star.comp.Draw.XMLOasisContentImporter" )
2139 OOO_IMPORTER( XMLDrawMetaImportOOO,
2140 "com.sun.star.comp.Draw.XMLMetaImporter",
2141 "com.sun.star.comp.Draw.XMLOasisMetaImporter" )
2142 OOO_IMPORTER( XMLDrawSettingsImportOOO,
2143 "com.sun.star.comp.Draw.XMLSettingsImporter",
2144 "com.sun.star.comp.Draw.XMLOasisSettingsImporter" )
2146 OOO_IMPORTER( XMLCalcImportOOO,
2147 "com.sun.star.comp.Calc.XMLImporter",
2148 "com.sun.star.comp.Calc.XMLOasisImporter" )
2149 OOO_IMPORTER( XMLCalcStylesImportOOO,
2150 "com.sun.star.comp.Calc.XMLStylesImporter",
2151 "com.sun.star.comp.Calc.XMLOasisStylesImporter" )
2152 OOO_IMPORTER( XMLCalcContentImportOOO,
2153 "com.sun.star.comp.Calc.XMLContentImporter",
2154 "com.sun.star.comp.Calc.XMLOasisContentImporter" )
2155 OOO_IMPORTER( XMLCalcMetaImportOOO,
2156 "com.sun.star.comp.Calc.XMLMetaImporter",
2157 "com.sun.star.comp.Calc.XMLOasisMetaImporter" )
2158 OOO_IMPORTER( XMLCalcSettingsImportOOO,
2159 "com.sun.star.comp.Calc.XMLSettingsImporter",
2160 "com.sun.star.comp.Calc.XMLOasisSettingsImporter" )
2162 OOO_IMPORTER( XMLChartImportOOO,
2163 "com.sun.star.comp.Chart.XMLImporter",
2164 "com.sun.star.comp.Chart.XMLOasisImporter" )
2165 OOO_IMPORTER( XMLChartStylesImportOOO,
2166 "com.sun.star.comp.Chart.XMLStylesImporter",
2167 "com.sun.star.comp.Chart.XMLOasisStylesImporter" )
2168 OOO_IMPORTER( XMLChartContentImportOOO,
2169 "com.sun.star.comp.Chart.XMLContentImporter",
2170 "com.sun.star.comp.Chart.XMLOasisContentImporter" )
2172 OOO_IMPORTER( XMLMathMetaImportOOO,
2173 "com.sun.star.comp.Math.XMLMetaImporter",
2174 "com.sun.star.comp.Math.XMLOasisMetaImporter" )
2175 OOO_IMPORTER( XMLMathSettingsImportOOO,
2176 "com.sun.star.comp.Math.XMLSettingsImporter",
2177 "com.sun.star.comp.Math.XMLOasisSettingsImporter" )
2179 OOO_IMPORTER( XMLMetaImportOOO,
2180 "com.sun.star.document.XMLMetaImporter",
2181 "com.sun.star.document.XMLOasisMetaImporter" )
2183 OOO_IMPORTER( XMLAutoTextEventImportOOO,
2184 "com.sun.star.comp.Writer.XMLAutotextEventsImporter",
2185 "com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter" )
2187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */