Teach symstore more duplicated DLLs
[LibreOffice.git] / xmloff / source / transform / Oasis2OOo.cxx
blob4b85666a02cc1d8a82f37bad977e09afb9fecbac
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 <comphelper/base64.hxx>
21 #include <com/sun/star/beans/XPropertySetInfo.hpp>
22 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
23 #include <rtl/ustrbuf.hxx>
24 #include <sal/log.hxx>
25 #include <xmloff/nmspmap.hxx>
26 #include <xmloff/xmlnmspe.hxx>
27 #include <xmloff/xmltoken.hxx>
28 #include "DeepTContext.hxx"
29 #include "MetaTContext.hxx"
30 #include "DocumentTContext.hxx"
31 #include "NotesTContext.hxx"
32 #include "StyleOASISTContext.hxx"
33 #include "FrameOASISTContext.hxx"
34 #include "EventOASISTContext.hxx"
35 #include "DlgOASISTContext.hxx"
36 #include "ControlOASISTContext.hxx"
37 #include "FormPropOASISTContext.hxx"
38 #include "ChartOASISTContext.hxx"
39 #include "ChartPlotAreaOASISTContext.hxx"
40 #include "MutableAttrList.hxx"
41 #include "ElemTransformerAction.hxx"
42 #include "AttrTransformerAction.hxx"
43 #include "TransformerActions.hxx"
44 #include "FamilyType.hxx"
45 #include "XMLFilterRegistration.hxx"
46 #include <comphelper/servicehelper.hxx>
47 #include "Oasis2OOo.hxx"
48 #include <cppuhelper/supportsservice.hxx>
50 using namespace ::osl;
51 using namespace ::xmloff::token;
52 using namespace ::com::sun::star::uno;
53 using namespace ::com::sun::star::lang;
54 using namespace ::com::sun::star::xml::sax;
55 using namespace ::com::sun::star::beans;
57 enum XMLUserDefinedTransformerAction
59 XML_ETACTION_META=XML_ETACTION_USER_DEFINED,
60 XML_ETACTION_DOCUMENT,
61 XML_ETACTION_BODY,
62 XML_ETACTION_NOTES,
63 XML_ETACTION_TABLE,
64 XML_ETACTION_STYLE,
65 XML_ETACTION_STYLE_RENAME,
66 XML_ETACTION_FRAME,
67 XML_ETACTION_EVENT,
68 XML_ETACTION_DLG,
69 XML_ETACTION_TAB_STOP,
70 XML_ETACTION_FORM_CONTROL,
71 XML_ETACTION_FORM_PROPERTY,
72 XML_ETACTION_CONFIG_ITEM,
73 XML_ETACTION_TRACKED_CHANGES,
74 XML_ETACTION_CHART,
75 XML_ETACTION_CHART_PLOT_AREA
78 #define ENTRY3( n, l, a, p1, p2, p3 ) \
79 { XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 }
80 #define ENTRY3QNQ( n, l, a, n1, l1, p2, n3, l3 ) \
81 ENTRY3( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
82 p2, XMLTransformerActionInit::QNameParam( n3, l3 ) )
84 #define ENTRY2( n, l, a, p1, p2 ) \
85 ENTRY3( n, l, a, p1, p2, 0 )
86 #define ENTRY2QN( n, l, a, n1, l1, p2 ) \
87 ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), p2 )
89 #define ENTRY1( n, l, a, p1 ) \
90 ENTRY3( n, l, a, p1, 0, 0 )
91 #define ENTRY1Q( n, l, a, p1, t1 ) \
92 ENTRY1( n, l, a, XMLTransformerActionInit::QNameParam( p1, t1 ) )
94 #define ENTRY0( n, l, a ) \
95 ENTRY3( n, l, a, 0, 0, 0 )
97 // a macro to put two tokens into one sal_Int32 for the action
98 // XML_ATACTION_RENAME_ATTRIBUTE
99 static constexpr sal_Int32 RENAME_ENTRY( XMLTokenEnum f, XMLTokenEnum s )
101 return static_cast< sal_Int32 >(f) | (static_cast< sal_Int32 >(s) << 16);
104 static XMLTransformerActionInit const aActionTable[] =
106 // add office:class from <office:document> and <office:document-content>
107 ENTRY0( OFFICE, DOCUMENT, XML_ETACTION_DOCUMENT ),
108 ENTRY0( OFFICE, DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ),
109 ENTRY1Q( OOO, AUTO_TEXT_EVENTS, XML_ETACTION_RENAME_ELEM,
110 XML_NAMESPACE_OFFICE, XML_AUTO_TEXT_EVENTS),
112 // add <meta:keywords>
113 ENTRY0( OFFICE, META, XML_ETACTION_META ),
115 // rename <office:scripts> to <office:script>
116 ENTRY1Q( OFFICE, SCRIPTS, XML_ETACTION_RENAME_ELEM,
117 XML_NAMESPACE_OFFICE, XML_SCRIPT ),
119 // rename <office:script> to <office:script-data> and process attributes
120 ENTRY2QN( OFFICE, SCRIPT, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
121 XML_NAMESPACE_OFFICE, XML_SCRIPT_DATA,
122 OASIS_SCRIPT_ACTIONS ),
124 // rename <ooo:libraries> to <script:libraries>
125 ENTRY1Q( OOO, LIBRARIES, XML_ETACTION_RENAME_ELEM,
126 XML_NAMESPACE_SCRIPT, XML_LIBRARIES ),
128 // rename <ooo:library-linked> to <script:library-linked> and process attributes
129 ENTRY2QN( OOO, LIBRARY_LINKED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
130 XML_NAMESPACE_SCRIPT, XML_LIBRARY_LINKED,
131 OASIS_SCRIPT_ACTIONS ),
133 // rename <ooo:library-embedded> to <script:library-embedded> and process attributes
134 ENTRY2QN( OOO, LIBRARY_EMBEDDED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
135 XML_NAMESPACE_SCRIPT, XML_LIBRARY_EMBEDDED,
136 OASIS_SCRIPT_ACTIONS ),
138 // rename <ooo:module> to <script:module> and process attributes
139 ENTRY2QN( OOO, MODULE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
140 XML_NAMESPACE_SCRIPT, XML_MODULE,
141 OASIS_SCRIPT_ACTIONS ),
143 // rename <ooo:source-code> to <script:source-code>
144 ENTRY1Q( OOO, SOURCE_CODE, XML_ETACTION_RENAME_ELEM,
145 XML_NAMESPACE_SCRIPT, XML_SOURCE_CODE ),
147 ENTRY0( OFFICE, BODY, XML_ETACTION_BODY ),
149 // rename <office:font-face-decls> to <office:font-decl>,
150 // rename <style:font-face> to <style:font-decl>, process attrs
151 ENTRY1Q( OFFICE, FONT_FACE_DECLS, XML_ETACTION_RENAME_ELEM,
152 XML_NAMESPACE_OFFICE, XML_FONT_DECLS ),
153 ENTRY2QN( STYLE, FONT_FACE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
154 XML_NAMESPACE_STYLE, XML_FONT_DECL,
155 OASIS_FONT_FACE_ACTIONS ),
157 // remove genre element
158 ENTRY0( OFFICE, TEXT, XML_ETACTION_COPY_CONTENT ),
159 ENTRY0( OFFICE, DRAWING, XML_ETACTION_COPY_CONTENT ),
160 ENTRY0( OFFICE, PRESENTATION, XML_ETACTION_COPY_CONTENT ),
161 ENTRY0( OFFICE, SPREADSHEET, XML_ETACTION_COPY_CONTENT ),
162 ENTRY0( OFFICE, CHART, XML_ETACTION_COPY_CONTENT ),
163 ENTRY0( OFFICE, IMAGE, XML_ETACTION_COPY_CONTENT ),
165 // rename <style:page-layout> to <style:page-master>
166 // ENTRY1Q( STYLE, PAGE_LAYOUT, RENAME_ELEM,
167 // XML_NAMESPACE_STYLE, XML_PAGE_MASTER ),
168 ENTRY1( STYLE, MASTER_PAGE, XML_ETACTION_PROC_ATTRS,
169 OASIS_MASTER_PAGE_ACTIONS ),
171 // merge <style:*-properties> into <style:properties> and do other
172 // styles processing
173 ENTRY1( STYLE, STYLE, XML_ETACTION_STYLE,
174 XML_FAMILY_TYPE_END ),
175 ENTRY1( STYLE, DEFAULT_STYLE, XML_ETACTION_STYLE,
176 XML_FAMILY_TYPE_END ),
177 ENTRY2QN( STYLE, PAGE_LAYOUT, XML_ETACTION_STYLE_RENAME,
178 XML_NAMESPACE_STYLE, XML_PAGE_MASTER,
179 XML_FAMILY_TYPE_PAGE_LAYOUT ),
180 ENTRY1( NUMBER, NUMBER_STYLE, XML_ETACTION_STYLE,
181 XML_FAMILY_TYPE_DATA ),
182 ENTRY1( NUMBER, CURRENCY_STYLE, XML_ETACTION_STYLE,
183 XML_FAMILY_TYPE_DATA ),
184 ENTRY1( NUMBER, PERCENTAGE_STYLE, XML_ETACTION_STYLE,
185 XML_FAMILY_TYPE_DATA ),
186 ENTRY1( NUMBER, DATE_STYLE, XML_ETACTION_STYLE,
187 XML_FAMILY_TYPE_DATA ),
188 ENTRY1( NUMBER, TIME_STYLE, XML_ETACTION_STYLE,
189 XML_FAMILY_TYPE_DATA ),
190 ENTRY1( NUMBER, BOOLEAN_STYLE, XML_ETACTION_STYLE,
191 XML_FAMILY_TYPE_DATA ),
192 ENTRY1( NUMBER, TEXT_STYLE, XML_ETACTION_STYLE,
193 XML_FAMILY_TYPE_DATA ),
194 ENTRY1( TEXT, LIST_STYLE, XML_ETACTION_STYLE,
195 XML_FAMILY_TYPE_LIST ),
196 // ENTRY0( TEXT, OUTLINE_STYLE, STYLE ),
198 ENTRY1( STYLE, HEADER_STYLE, XML_ETACTION_STYLE,
199 XML_FAMILY_TYPE_HEADER_FOOTER ),
200 ENTRY1( STYLE, FOOTER_STYLE, XML_ETACTION_STYLE,
201 XML_FAMILY_TYPE_HEADER_FOOTER ),
202 ENTRY1( TEXT, LIST_LEVEL_STYLE_NUMBER, XML_ETACTION_STYLE,
203 XML_FAMILY_TYPE_LIST ),
204 ENTRY1( TEXT, LIST_LEVEL_STYLE_BULLET, XML_ETACTION_STYLE,
205 XML_FAMILY_TYPE_LIST ),
206 ENTRY1( TEXT, LIST_LEVEL_STYLE_IMAGE, XML_ETACTION_STYLE,
207 XML_FAMILY_TYPE_LIST ),
208 ENTRY1( TEXT, OUTLINE_LEVEL_STYLE, XML_ETACTION_STYLE,
209 XML_FAMILY_TYPE_LIST ),
210 ENTRY1( DRAW, GRADIENT, XML_ETACTION_STYLE,
211 XML_FAMILY_TYPE_GRADIENT ),
212 ENTRY1( DRAW, FILL_IMAGE, XML_ETACTION_STYLE,
213 XML_FAMILY_TYPE_FILL_IMAGE ),
214 ENTRY2QN( DRAW, OPACITY, XML_ETACTION_STYLE_RENAME,
215 XML_NAMESPACE_DRAW, XML_TRANSPARENCY,
216 XML_FAMILY_TYPE_GRADIENT ),
217 ENTRY1( DRAW, MARKER, XML_ETACTION_STYLE,
218 XML_FAMILY_TYPE_MARKER ),
219 ENTRY1( DRAW, HATCH, XML_ETACTION_STYLE,
220 XML_FAMILY_TYPE_HATCH ),
221 ENTRY1( DRAW, STROKE_DASH, XML_ETACTION_STYLE,
222 XML_FAMILY_TYPE_STROKE_DASH ),
224 // process <text:h/p>: process style-name attributes,
225 // rename <text:h>'s text:outline-level to text:level,
226 ENTRY1( TEXT, H, XML_ETACTION_PROC_ATTRS, OASIS_PARA_ACTIONS ),
227 ENTRY1( TEXT, P, XML_ETACTION_PROC_ATTRS, OASIS_PARA_ACTIONS ),
229 // process <test:list>'s text:style-name attributes
230 // rename <text:list> to <text:ordered-list> or <text:unordered-list>
231 // TODO: All list currently are renamed to <text:ordered-list>
232 ENTRY2QN( TEXT, LIST, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
233 XML_NAMESPACE_TEXT, XML_ORDERED_LIST,
234 OASIS_LIST_STYLE_REF_ACTIONS ),
236 // rename <text:note*> to <text:footnote*> or <text:endnote*>
237 ENTRY1( TEXT, NOTES_CONFIGURATION, XML_ETACTION_NOTES,
238 XML_NOTES_CONFIGURATION),
239 ENTRY1( TEXT, NOTE, XML_ETACTION_NOTES, XML_NOTE ),
241 // rename <text:footnote> and <text:endnote> to <text:note>
242 ENTRY1( TEXT, NOTE_REF, XML_ETACTION_NOTES, XML_NOTE_REF ),
244 // rename <text:tab> to <text:tab-stop>
245 ENTRY1Q( TEXT, TAB, XML_ETACTION_RENAME_ELEM,
246 XML_NAMESPACE_TEXT, XML_TAB_STOP ),
248 // replace <table:table table:is-sub-table> with <table:sub-table>
249 ENTRY0( TABLE, TABLE, XML_ETACTION_TABLE ),
251 // merge frame element
252 ENTRY0( DRAW, FRAME, XML_ETACTION_FRAME ),
254 // process events
255 ENTRY1Q( OFFICE, EVENT_LISTENERS, XML_ETACTION_RENAME_ELEM,
256 XML_NAMESPACE_OFFICE, XML_EVENTS ),
257 ENTRY0( SCRIPT, EVENT_LISTENER, XML_ETACTION_EVENT ),
258 ENTRY0( SCRIPT, EVENT, XML_ETACTION_EVENT ),
259 ENTRY0( PRESENTATION, EVENT_LISTENER, XML_ETACTION_EVENT ),
261 // process Basic dialogs
262 ENTRY0( DLG, STYLE, XML_ETACTION_DLG ),
264 // process length attributes
265 ENTRY1( DRAW, RECT, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
266 ENTRY1( DRAW, LINE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
267 ENTRY1( DRAW, POLYLINE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
268 ENTRY1( DRAW, POLYGON, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
269 ENTRY1( DRAW, PATH, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
270 ENTRY1( DRAW, CIRCLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
271 ENTRY1( DRAW, ELLIPSE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
272 ENTRY1( DRAW, CONNECTOR, XML_ETACTION_PROC_ATTRS, OASIS_CONNECTOR_ACTIONS ),
273 ENTRY1( DRAW, CAPTION, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
274 ENTRY1( DRAW, MEASURE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
275 ENTRY1( DRAW, CONTROL, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
276 ENTRY1( DRAW, PAGE_THUMBNAIL, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
277 ENTRY1( DRAW, G, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
278 // ENTRY1( DRAW, FRAME, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
279 ENTRY1( DRAW, TEXT_BOX, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
280 ENTRY1( PRESENTATION, PLACEHOLDER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
281 ENTRY1( DRAW, CONTOUR_POLYGON, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
282 ENTRY1( DRAW, CONTOUR_PATH, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
283 ENTRY1( DRAW, AREA_RECTANGLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
284 ENTRY1( DRAW, AREA_CIRCLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
285 ENTRY1( DRAW, AREA_POLYGON, XML_ETACTION_PROC_ATTRS, OASIS_DRAW_AREA_POLYGON_ACTIONS ),
286 ENTRY1( DRAW, GLUE_POINT, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
287 ENTRY1( DR3D, SCENE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
288 ENTRY1( DR3D, CUBE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
289 ENTRY1( DR3D, SPHERE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
290 ENTRY1( DR3D, EXTRUDE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
291 ENTRY1( DR3D, ROTATE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
292 ENTRY1( CHART, TITLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
293 ENTRY1( CHART, SUBTITLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
294 ENTRY1( CHART, FOOTER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
295 ENTRY1( CHART, LEGEND, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
296 ENTRY1( CHART, WALL, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
297 ENTRY1( CHART, FLOOR, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
298 ENTRY1( CHART, AXIS, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
299 ENTRY1( CHART, GRID, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
300 ENTRY1( CHART, SERIES, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
301 ENTRY1( CHART, DATA_POINT, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
302 ENTRY1( CHART, MEAN_VALUE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
303 ENTRY1( CHART, ERROR_INDICATOR, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
304 ENTRY1( CHART, REGRESSION_CURVE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
305 ENTRY1( CHART, STOCK_GAIN_MARKER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
306 ENTRY1( CHART, STOCK_LOSS_MARKER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
307 ENTRY1( CHART, STOCK_RANGE_LINE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
309 ENTRY0( CHART, CHART, XML_ETACTION_CHART ),
310 ENTRY0( CHART, PLOT_AREA, XML_ETACTION_CHART_PLOT_AREA ),
312 ENTRY0( CONFIG, CONFIG_ITEM, XML_ETACTION_CONFIG_ITEM ),
313 ENTRY1Q( TEXT, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
314 XML_NAMESPACE_TEXT, XML_PROTECTION_KEY ),
315 ENTRY1Q( TABLE, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
316 XML_NAMESPACE_TABLE, XML_PROTECTION_KEY ),
318 ENTRY1( TEXT, INDEX_ENTRY_TAB_STOP, XML_ETACTION_PROC_ATTRS,
319 OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS ),
320 ENTRY0( STYLE, TAB_STOP, XML_ETACTION_TAB_STOP ),
321 ENTRY1( STYLE, BACKGROUND_IMAGE, XML_ETACTION_PROC_ATTRS,
322 OASIS_BACKGROUND_IMAGE_ACTIONS ),
323 ENTRY1( TEXT, LINENUMBERING_CONFIGURATION, XML_ETACTION_PROC_ATTRS,
324 OASIS_LINENUMBERING_ACTIONS ),
325 ENTRY1( STYLE, FOOTNOTE_SEP, XML_ETACTION_PROC_ATTRS,
326 OASIS_FOOTNOTE_SEP_ACTIONS ),
327 ENTRY1( STYLE, DROP_CAP, XML_ETACTION_PROC_ATTRS, OASIS_DROP_CAP_ACTIONS ),
328 ENTRY1( STYLE, COLUMNS, XML_ETACTION_PROC_ATTRS, OASIS_COLUMNS_ACTIONS ),
329 ENTRY1( STYLE, COLUMN, XML_ETACTION_PROC_ATTRS, OASIS_COLUMNS_ACTIONS ),
331 // process *:style-name attributes
332 ENTRY1( STYLE, MAP, XML_ETACTION_PROC_ATTRS, OASIS_MAP_STYLE_REF_ACTIONS ),
333 ENTRY1( TEXT, SPAN, XML_ETACTION_PROC_ATTRS, OASIS_TEXT_STYLE_REF_ACTIONS ),
334 ENTRY1( TEXT, A, XML_ETACTION_PROC_ATTRS, OASIS_TEXT_STYLE_REF_ACTIONS ),
335 ENTRY1( TEXT, RUBY_TEXT, XML_ETACTION_PROC_ATTRS,
336 OASIS_TEXT_STYLE_REF_ACTIONS ),
337 ENTRY1( TEXT, TABLE_OF_CONTENT_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
338 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
339 ENTRY1( TEXT, ILLUSTRATION_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
340 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
341 ENTRY1( TEXT, TABLE_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
342 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
343 ENTRY1( TEXT, OBJECT_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
344 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
345 ENTRY1( TEXT, USER_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
346 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
347 ENTRY1( TEXT, ALPHABETICAL_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
348 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
349 ENTRY1( TEXT, BIBLIOGRAPHY_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
350 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
351 ENTRY1( TEXT, INDEX_SOURCE_STYLE, XML_ETACTION_PROC_ATTRS,
352 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
353 ENTRY1( TEXT, INDEX_TITLE_TEMPLATE, XML_ETACTION_PROC_ATTRS,
354 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
355 ENTRY3QNQ( TEXT, INDEX_ENTRY_CHAPTER,
356 XML_ETACTION_RENAME_ELEM_PROC_ATTRS_COND,
357 XML_NAMESPACE_TEXT, XML_INDEX_ENTRY_CHAPTER_NUMBER,
358 OASIS_TEXT_STYLE_REF_ACTIONS ,
359 XML_NAMESPACE_TEXT, XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE),
360 ENTRY1( TEXT, INDEX_ENTRY_TEXT, XML_ETACTION_PROC_ATTRS,
361 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
362 ENTRY1( TEXT, INDEX_ENTRY_PAGE_NUMBER, XML_ETACTION_PROC_ATTRS,
363 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
364 ENTRY1( TEXT, INDEX_ENTRY_SPAN, XML_ETACTION_PROC_ATTRS,
365 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
366 ENTRY1( TEXT, INDEX_ENTRY_BIBLIOGRAPHY, XML_ETACTION_PROC_ATTRS,
367 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
368 ENTRY1( TEXT, INDEX_ENTRY_LINK_START, XML_ETACTION_PROC_ATTRS,
369 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
370 ENTRY1( TEXT, INDEX_ENTRY_LINK_END, XML_ETACTION_PROC_ATTRS,
371 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
372 ENTRY1( DRAW, PAGE, XML_ETACTION_PROC_ATTRS,
373 OASIS_MASTER_PAGE_REF_ACTIONS ), /* generated entry */
374 // Conversion of attribute <table:style-name> for <table:table-row> and
375 // <table:table-column> (#i40011#, #i40015#)
376 ENTRY1( TABLE, TABLE_ROW, XML_ETACTION_PROC_ATTRS,
377 OASIS_TABLE_STYLE_REF_ACTIONS ),
378 ENTRY1( TABLE, TABLE_COLUMN, XML_ETACTION_PROC_ATTRS,
379 OASIS_TABLE_STYLE_REF_ACTIONS ),
381 // rename office:value-* to *:value-*
382 ENTRY1( TEXT, VARIABLE_DECL, XML_ETACTION_PROC_ATTRS,
383 OASIS_TEXT_VALUE_TYPE_ACTIONS ), /* generated entry */
384 ENTRY1( TEXT, VARIABLE_SET, XML_ETACTION_PROC_ATTRS,
385 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
386 ENTRY1( TEXT, VARIABLE_INPUT, XML_ETACTION_PROC_ATTRS,
387 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
388 ENTRY1( TEXT, USER_FIELD_DECL, XML_ETACTION_PROC_ATTRS,
389 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
390 ENTRY1( TEXT, EXPRESSION, XML_ETACTION_PROC_ATTRS,
391 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
392 ENTRY1( TEXT, USER_DEFINED, XML_ETACTION_PROC_ATTRS,
393 OASIS_DATETIME_ACTIONS ), // Add OASIS_TEXT_VALUE_TYPE_ACTIONS if attrs are added to text:user-defined
394 ENTRY1( TABLE, TABLE_CELL, XML_ETACTION_PROC_ATTRS,
395 OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
396 ENTRY1( TABLE, COVERED_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
397 OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
398 ENTRY1( TABLE, CHANGE_TRACK_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
399 OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
400 // ENTRY1( FORM, PROPERTY, XML_ETACTION_PROC_ATTRS,
401 // OASIS_VALUE_TYPE_ACTIONS), /* TODO: generated entry */
402 // ENTRY1( FORM, LIST_PROPERTY, XML_ETACTION_PROC_ATTRS,
403 // OASIS_VALUE_TYPE_ACTIONS), /* generated entry */
405 ENTRY1( OFFICE, ANNOTATION, XML_ETACTION_MOVE_ELEMS_TO_ATTRS,
406 OASIS_ANNOTATION_ACTIONS ), /* generated entry */
407 ENTRY1( OFFICE, CHANGE_INFO, XML_ETACTION_MOVE_ELEMS_TO_ATTRS,
408 OASIS_CHANGE_INFO_ACTIONS ), /* generated entry */
410 ENTRY1( TEXT, DDE_CONNECTION_DECL, XML_ETACTION_PROC_ATTRS,
411 OASIS_DDE_CONNECTION_DECL_ACTIONS ),
413 ENTRY0( FORM, TEXT, XML_ETACTION_FORM_CONTROL ),
414 ENTRY0( FORM, TEXTAREA, XML_ETACTION_FORM_CONTROL ),
415 ENTRY0( FORM, FIXED_TEXT, XML_ETACTION_FORM_CONTROL ),
416 ENTRY0( FORM, FILE, XML_ETACTION_FORM_CONTROL ),
417 ENTRY0( FORM, PASSWORD, XML_ETACTION_FORM_CONTROL ),
418 ENTRY0( FORM, FORMATTED_TEXT, XML_ETACTION_FORM_CONTROL ),
419 ENTRY0( FORM, BUTTON, XML_ETACTION_FORM_CONTROL ),
420 ENTRY0( FORM, IMAGE, XML_ETACTION_FORM_CONTROL ),
421 ENTRY0( FORM, CHECKBOX, XML_ETACTION_FORM_CONTROL ),
422 ENTRY0( FORM, RADIO, XML_ETACTION_FORM_CONTROL ),
423 ENTRY0( FORM, LISTBOX, XML_ETACTION_FORM_CONTROL ),
424 ENTRY0( FORM, COMBOBOX, XML_ETACTION_FORM_CONTROL ),
425 ENTRY0( FORM, FRAME, XML_ETACTION_FORM_CONTROL ),
426 ENTRY0( FORM, HIDDEN, XML_ETACTION_FORM_CONTROL ),
427 ENTRY0( FORM, IMAGE_FRAME, XML_ETACTION_FORM_CONTROL ),
428 ENTRY0( FORM, GRID, XML_ETACTION_FORM_CONTROL ),
429 ENTRY0( FORM, VALUE_RANGE, XML_ETACTION_FORM_CONTROL ),
430 ENTRY0( FORM, GENERIC_CONTROL, XML_ETACTION_FORM_CONTROL ),
431 ENTRY1( FORM, COLUMN, XML_ETACTION_PROC_ATTRS,
432 OASIS_FORM_COLUMN_ACTIONS ),
433 ENTRY1( FORM, PROPERTY, XML_ETACTION_FORM_PROPERTY, XML_PROPERTY ),
434 ENTRY1( FORM, LIST_PROPERTY, XML_ETACTION_FORM_PROPERTY,
435 XML_LIST_PROPERTY ),
436 ENTRY1( FORM, LIST_VALUE, XML_ETACTION_FORM_PROPERTY, XML_LIST_VALUE ),
438 // process xlink:href
439 ENTRY1( META, TEMPLATE, XML_ETACTION_PROC_ATTRS,
440 OASIS_XLINK_ACTIONS ), /* generated entry */
441 ENTRY1( META, AUTO_RELOAD, XML_ETACTION_PROC_ATTRS,
442 OASIS_XLINK_ACTIONS ), /* generated entry */
443 ENTRY1( TEXT, SECTION_SOURCE, XML_ETACTION_PROC_ATTRS,
444 OASIS_XLINK_ACTIONS ), /* generated entry */
445 ENTRY1( TEXT, SCRIPT, XML_ETACTION_PROC_ATTRS,
446 OASIS_XLINK_ACTIONS ), /* generated entry */
447 ENTRY1( TEXT, ALPHABETICAL_INDEX_AUTO_MARK_FILE, XML_ETACTION_PROC_ATTRS,
448 OASIS_XLINK_ACTIONS ), /* generated entry */
449 ENTRY1( TABLE, TABLE_SOURCE, XML_ETACTION_PROC_ATTRS,
450 OASIS_XLINK_ACTIONS ), /* generated entry */
451 ENTRY1( TABLE, CELL_RANGE_SOURCE, XML_ETACTION_PROC_ATTRS,
452 OASIS_XLINK_ACTIONS ), /* generated entry */
453 ENTRY1( DRAW, A, XML_ETACTION_PROC_ATTRS,
454 OASIS_XLINK_ACTIONS ), /* generated entry */
455 ENTRY1( PRESENTATION, SOUND, XML_ETACTION_PROC_ATTRS,
456 OASIS_XLINK_ACTIONS ), /* generated entry */
457 ENTRY1( FORM, FORM, XML_ETACTION_PROC_ATTRS,
458 OASIS_FORM_ACTIONS ), /* generated entry */
459 // ENTRY1( SVG, FONT_FACE_URI, XML_ETACTION_PROC_ATTRS,
460 // OASIS_XLINK_ACTIONS ), /* generated entry */
461 // ENTRY1( SVG, DEFINITION_SRC, XML_ETACTION_PROC_ATTRS,
462 // OASIS_XLINK_ACTIONS ), /* generated entry */
463 ENTRY2QN( CHART, SYMBOL_IMAGE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
464 XML_NAMESPACE_STYLE, XML_SYMBOL_IMAGE,
465 OASIS_BACKGROUND_IMAGE_ACTIONS ),
466 // OASIS_XLINK_ACTIONS ), /* generated entry */
467 // events don't have real URIs
468 // ENTRY1( PRESENTATION, EVENT_LISTENER, XML_ETACTION_PROC_ATTRS,
469 // OASIS_XLINK_ACTIONS ), /* generated entry */
470 // ENTRY1( SCRIPT, EVENT_LISTENER, XML_ETACTION_PROC_ATTRS,
471 // OASIS_XLINK_ACTIONS ), /* generated entry */
473 // add namespace prefix to name
474 ENTRY1( CONFIG, CONFIG_ITEM_SET, XML_ETACTION_PROC_ATTRS,
475 OASIS_CONFIG_ITEM_SET_ACTIONS ),
477 // add namespace prefix to formula and condition
478 // text:condition
479 ENTRY1( TEXT, SECTION, XML_ETACTION_PROC_ATTRS,
480 OASIS_FORMULA_ACTIONS ), /* generated entry */
481 // text:formula
482 ENTRY1( TEXT, SEQUENCE, XML_ETACTION_PROC_ATTRS,
483 OASIS_FORMULA_ACTIONS ), /* generated entry */
484 // text:condition
485 ENTRY1( TEXT, DATABASE_NEXT, XML_ETACTION_PROC_ATTRS,
486 OASIS_FORMULA_ACTIONS ), /* generated entry */
487 // text:condition
488 ENTRY2QN( TEXT, DATABASE_ROW_SELECT, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
489 XML_NAMESPACE_TEXT, XML_DATABASE_SELECT,
490 OASIS_FORMULA_ACTIONS ), /* generated entry */
491 // text:condition
492 ENTRY1( TEXT, CONDITIONAL_TEXT, XML_ETACTION_PROC_ATTRS,
493 OASIS_FORMULA_ACTIONS ), /* generated entry */
494 // text:condition
495 ENTRY1( TEXT, HIDDEN_TEXT, XML_ETACTION_PROC_ATTRS,
496 OASIS_FORMULA_ACTIONS ), /* generated entry */
497 // text:condition
498 ENTRY1( TEXT, HIDDEN_PARAGRAPH, XML_ETACTION_PROC_ATTRS,
499 OASIS_FORMULA_ACTIONS ), /* generated entry */
500 // text:formula
501 ENTRY1( TEXT, TABLE_FORMULA, XML_ETACTION_PROC_ATTRS,
502 OASIS_FORMULA_ACTIONS ), /* generated entry */
504 // process table::content-validation
505 ENTRY1( TABLE, CONTENT_VALIDATION, XML_ETACTION_PROC_ATTRS,
506 OASIS_CONTENT_VALIDATION_ACTIONS ),
508 // rename <table:dependencies> to <table:dependences>
509 ENTRY1Q( TABLE, DEPENDENCIES, XML_ETACTION_RENAME_ELEM,
510 XML_NAMESPACE_TABLE, XML_DEPENDENCES ),
511 ENTRY1Q( TABLE, DEPENDENCY, XML_ETACTION_RENAME_ELEM,
512 XML_NAMESPACE_TABLE, XML_DEPENDENCE ),
514 // process table::conversion-mode
515 ENTRY1( TABLE, CONVERSION_MODE, XML_ETACTION_PROC_ATTRS,
516 OASIS_DDE_CONV_MODE_ACTIONS ),
518 // process table::data-pilot-member
519 ENTRY1( TABLE, DATA_PILOT_MEMBER, XML_ETACTION_PROC_ATTRS,
520 OASIS_DATAPILOT_MEMBER_ACTIONS ),
522 // process table::data-pilot-level
523 ENTRY1( TABLE, DATA_PILOT_LEVEL, XML_ETACTION_PROC_ATTRS,
524 OASIS_DATAPILOT_LEVEL_ACTIONS ),
526 // process table::source-service
527 ENTRY1( TABLE, SOURCE_SERVICE, XML_ETACTION_PROC_ATTRS,
528 OASIS_SOURCE_SERVICE_ACTIONS ),
530 // entries for date time change (#i36576#)
531 ENTRY1( TEXT, DATE, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
532 ENTRY1( TEXT, CREATION_DATE, XML_ETACTION_PROC_ATTRS,
533 OASIS_DATETIME_ACTIONS ),
534 ENTRY1( TEXT, TIME, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
535 ENTRY1( TEXT, CREATION_TIME, XML_ETACTION_PROC_ATTRS,
536 OASIS_DATETIME_ACTIONS ),
537 ENTRY1( TEXT, PRINT_TIME, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
538 ENTRY1( TEXT, MODIFICATION_TIME, XML_ETACTION_PROC_ATTRS,
539 OASIS_DATETIME_ACTIONS ),
540 ENTRY1( TEXT, EDITING_DURATION, XML_ETACTION_PROC_ATTRS,
541 OASIS_DATETIME_ACTIONS ),
542 ENTRY1( FORM, TIME, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
543 ENTRY1( PRESENTATION, SETTINGS, XML_ETACTION_PROC_ATTRS,
544 OASIS_DATETIME_ACTIONS ),
546 // fix <text:alphabatical-index-mark text:main-etry>
547 ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK, XML_ETACTION_PROC_ATTRS,
548 OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS ),
549 ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK_START, XML_ETACTION_PROC_ATTRS,
550 OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS ),
552 // fix id strings in old animation elements
553 ENTRY1( PRESENTATION, DIM, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
554 ENTRY1( PRESENTATION, PLAY, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
555 ENTRY1( PRESENTATION, SHOW_TEXT, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
556 ENTRY1( PRESENTATION, SHOW_SHAPE, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
557 ENTRY1( PRESENTATION, HIDE_TEXT, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
558 ENTRY1( PRESENTATION, HIDE_SHAPE, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
560 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
563 // XML_ETACTION_STYLE
564 static XMLTransformerActionInit const aStyleActionTable[] =
566 ENTRY0( STYLE, FAMILY, XML_ATACTION_STYLE_FAMILY ),
567 ENTRY1( STYLE, NAME, XML_ATACTION_DECODE_STYLE_NAME,
568 XML_FAMILY_TYPE_END ),
569 ENTRY1( STYLE, DISPLAY_NAME, XML_ATACTION_STYLE_DISPLAY_NAME,
570 XML_FAMILY_TYPE_END ),
571 ENTRY1( STYLE, PARENT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
572 XML_FAMILY_TYPE_END ),
573 ENTRY1( STYLE, NEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
574 XML_FAMILY_TYPE_END ),
575 ENTRY1( STYLE, LIST_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
576 XML_FAMILY_TYPE_LIST ),
577 ENTRY1( STYLE, MASTER_PAGE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
578 XML_FAMILY_TYPE_MASTER_PAGE ),
579 ENTRY0( STYLE, DEFAULT_OUTLINE_LEVEL, XML_ATACTION_REMOVE ),
580 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
581 XML_FAMILY_TYPE_TEXT ), // list level styles
582 ENTRY1( DRAW, NAME, XML_ATACTION_DECODE_STYLE_NAME,
583 XML_FAMILY_TYPE_END ),
584 ENTRY1( DRAW, DISPLAY_NAME, XML_ATACTION_STYLE_DISPLAY_NAME,
585 XML_FAMILY_TYPE_END ),
586 ENTRY0( DRAW, DISTANCE, XML_ATACTION_IN2INCH ),
587 ENTRY0( DRAW, DOTS1_LENGTH, XML_ATACTION_IN2INCH ),
588 ENTRY0( DRAW, DOTS2_LENGTH, XML_ATACTION_IN2INCH ),
589 ENTRY0( SVG, WIDTH, XML_ATACTION_IN2INCH ),
590 ENTRY0( SVG, HEIGHT, XML_ATACTION_IN2INCH ),
591 ENTRY0( DRAW, START, XML_ATACTION_NEG_PERCENT ),
592 ENTRY0( DRAW, END, XML_ATACTION_NEG_PERCENT ),
593 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(true) ),
594 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
597 // OASIS_FRAME_ELEM_ACTIONS
598 static XMLTransformerActionInit const aFrameActionTable[] =
600 ENTRY0( DRAW, TEXT_BOX, XML_ETACTION_COPY ),
601 ENTRY0( DRAW, IMAGE, XML_ETACTION_COPY ),
602 ENTRY0( DRAW, OBJECT, XML_ETACTION_COPY ),
603 ENTRY0( DRAW, OBJECT_OLE, XML_ETACTION_COPY ),
604 ENTRY0( DRAW, APPLET, XML_ETACTION_COPY ),
605 ENTRY0( DRAW, PLUGIN, XML_ETACTION_COPY ),
606 ENTRY0( DRAW, FLOATING_FRAME, XML_ETACTION_COPY ),
607 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
610 // OASIS_EVENT_ELEM_ACTIONS
611 static XMLTransformerActionInit const aEventActionTable[] =
613 ENTRY0( XLINK, HREF, XML_ATACTION_HREF ),
614 ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_REMOVE_NAMESPACE_PREFIX,
615 XML_NAMESPACE_OOO ),
616 ENTRY0( SCRIPT, EVENT_NAME, XML_ATACTION_EVENT_NAME ),
617 ENTRY0( SCRIPT, MACRO_NAME, XML_ATACTION_MACRO_NAME ),
618 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
621 // OASIS_EVENT_ELEM_ACTIONS
622 static XMLTransformerActionInit const aDlgActionTable[] =
624 ENTRY0( DLG, BORDER, XML_ATACTION_DLG_BORDER )
627 // action table for OASIS_MASTER_PAGE_ACTIONS
628 static XMLTransformerActionInit const aMasterPageActionTable[] =
630 ENTRY1( STYLE, NAME, XML_ATACTION_DECODE_STYLE_NAME,
631 XML_FAMILY_TYPE_MASTER_PAGE ),
632 ENTRY1( STYLE, DISPLAY_NAME, XML_ATACTION_STYLE_DISPLAY_NAME,
633 XML_FAMILY_TYPE_MASTER_PAGE ),
634 ENTRY1( STYLE, NEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
635 XML_FAMILY_TYPE_MASTER_PAGE ),
636 ENTRY1Q( STYLE, PAGE_LAYOUT_NAME, XML_ATACTION_RENAME,
637 XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME ),
638 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
641 // action table for OASIS_TEXT_STYLE_REF_ACTIONS
642 static XMLTransformerActionInit const aTextStyleRefActionTable[] =
644 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
645 XML_FAMILY_TYPE_TEXT ),
646 ENTRY1( TEXT, VISITED_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
647 XML_FAMILY_TYPE_TEXT ),
648 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(false) ),
649 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
652 // action table for OASIS_PARA_STYLE_REF_ACTIONS
653 static XMLTransformerActionInit const aParaStyleRefActionTable[] =
655 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
656 XML_FAMILY_TYPE_PARAGRAPH ),
657 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
660 // action table for OASIS_LIST_STYLE_REF_ACTIONS
661 static XMLTransformerActionInit const aListStyleRefActionTable[] =
663 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
664 XML_FAMILY_TYPE_LIST ),
665 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
668 // action table for OASIS_MASTER_PAGE_REF_ACTIONS
669 static XMLTransformerActionInit const aMasterPageRefActionTable[] =
671 ENTRY1( DRAW, MASTER_PAGE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
672 XML_FAMILY_TYPE_MASTER_PAGE ),
673 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
676 // action table for OASIS_MAP_STYLE_REF_ACTIONS
677 static XMLTransformerActionInit const aMapStyleRefActionTable[] =
679 ENTRY1( STYLE, APPLY_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
680 XML_FAMILY_TYPE_END ),
681 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
684 // action table for OASIS_TABLE_STYLE_REF_ACTIONS (#i40011#, #i40015#)
685 static XMLTransformerActionInit const aTableStyleRefActionTable[] =
687 ENTRY1( TABLE, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
688 XML_FAMILY_TYPE_END ),
689 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
692 static XMLTransformerActionInit const aFontFaceActionTable[] =
694 ENTRY1Q( SVG, FONT_FAMILY, XML_ATACTION_RENAME,
695 XML_NAMESPACE_FO, XML_FONT_FAMILY ),
696 ENTRY1Q( STYLE, FONT_ADORNMENTS, XML_ATACTION_RENAME,
697 XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME ),
698 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
701 // action table for OASIS_PARA_ACTIONS
702 static XMLTransformerActionInit const aParaActionTable[] =
704 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
705 XML_FAMILY_TYPE_PARAGRAPH ),
706 ENTRY1( TEXT, COND_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
707 XML_FAMILY_TYPE_PARAGRAPH ),
708 ENTRY1Q( TEXT, OUTLINE_LEVEL, XML_ATACTION_RENAME,
709 XML_NAMESPACE_TEXT, XML_LEVEL ),
710 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
713 // !!ATTENTION!! If you change something here, please also change
714 // aConnectorActionTable if appropriate
715 static XMLTransformerActionInit const aShapeActionTable[] =
717 ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
718 XML_FAMILY_TYPE_GRAPHIC ),
719 ENTRY1( DRAW, TEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
720 XML_FAMILY_TYPE_PARAGRAPH ),
721 ENTRY1( PRESENTATION, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
722 XML_FAMILY_TYPE_PRESENTATION ),
723 ENTRY0( SVG, X, XML_ATACTION_IN2INCH ),
724 ENTRY0( SVG, Y, XML_ATACTION_IN2INCH ),
725 ENTRY0( SVG, X1, XML_ATACTION_IN2INCH ),
726 ENTRY0( SVG, Y1, XML_ATACTION_IN2INCH ),
727 ENTRY0( SVG, X2, XML_ATACTION_IN2INCH ),
728 ENTRY0( SVG, Y2, XML_ATACTION_IN2INCH ),
729 ENTRY0( SVG, CX, XML_ATACTION_IN2INCH ),
730 ENTRY0( SVG, CY, XML_ATACTION_IN2INCH ),
731 ENTRY0( DRAW, END_X, XML_ATACTION_IN2INCH ),
732 ENTRY0( DRAW, END_Y, XML_ATACTION_IN2INCH ),
733 ENTRY0( SVG, R, XML_ATACTION_IN2INCH ),
734 ENTRY0( SVG, RX, XML_ATACTION_IN2INCH ),
735 ENTRY0( SVG, RY, XML_ATACTION_IN2INCH ),
736 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
737 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
738 ENTRY0( FO, MIN_WIDTH, XML_ATACTION_IN2INCH ),
739 ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_IN2INCH ),
740 ENTRY0( FO, MAX_WIDTH, XML_ATACTION_IN2INCH ),
741 ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_IN2INCH ),
742 ENTRY0( DRAW, CORNER_RADIUS, XML_ATACTION_IN2INCH ),
743 ENTRY0( DRAW, LINE_SKEW, XML_ATACTION_INS2INCHS ),
744 ENTRY0( DRAW, CAPTION_POINT_X, XML_ATACTION_IN2INCH ),
745 ENTRY0( DRAW, CAPTION_POINT_Y, XML_ATACTION_IN2INCH ),
746 ENTRY0( DR3D, DISTANCE, XML_ATACTION_IN2INCH ),
747 ENTRY0( DR3D, FOCAL_LENGTH, XML_ATACTION_IN2INCH ),
748 ENTRY1Q( DRAW, CONTROL, XML_ATACTION_RENAME,
749 XML_NAMESPACE_FORM, XML_ID ),
750 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(true) ),
752 // needed by chart:legend. The legend needs also the draw actions. As
753 // there is no merge mechanism, all actions have to be in the same table
754 ENTRY2( CHART, LEGEND_POSITION, XML_ATACTION_RENAME_ATTRIBUTE,
755 RENAME_ENTRY( XML_START, XML_LEFT ),
756 RENAME_ENTRY( XML_END, XML_RIGHT )),
758 ENTRY0( DRAW, ID, XML_ATACTION_DECODE_ID ),
760 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
763 // OASIS_ANIMATION_ACTIONS
764 static XMLTransformerActionInit const aAnimationActionTable[] =
766 ENTRY0( DRAW, SHAPE_ID, XML_ATACTION_DECODE_ID ),
767 ENTRY0( PRESENTATION, DELAY, XML_ATACTION_RNG2ISO_DATETIME ),
768 ENTRY0( PRESENTATION, PAUSE, XML_ATACTION_RNG2ISO_DATETIME ),
770 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
773 // OOO_CONNECTOR_ACTIONS
774 static XMLTransformerActionInit const aConnectorActionTable[] =
776 ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
777 XML_FAMILY_TYPE_GRAPHIC ),
778 ENTRY1( DRAW, TEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
779 XML_FAMILY_TYPE_PARAGRAPH ),
780 ENTRY1( PRESENTATION, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
781 XML_FAMILY_TYPE_PRESENTATION ),
782 ENTRY0( SVG, X1, XML_ATACTION_IN2TWIPS ),
783 ENTRY0( SVG, Y1, XML_ATACTION_IN2TWIPS ),
784 ENTRY0( SVG, X2, XML_ATACTION_IN2TWIPS ),
785 ENTRY0( SVG, Y2, XML_ATACTION_IN2TWIPS ),
786 ENTRY0( DRAW, END_X, XML_ATACTION_IN2INCH ),
787 ENTRY0( DRAW, END_Y, XML_ATACTION_IN2INCH ),
788 ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
789 ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
790 ENTRY0( FO, MIN_WIDTH, XML_ATACTION_IN2INCH ),
791 ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_IN2INCH ),
792 ENTRY0( FO, MAX_WIDTH, XML_ATACTION_IN2INCH ),
793 ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_IN2INCH ),
794 ENTRY0( DRAW, LINE_SKEW, XML_ATACTION_INS2INCHS ),
795 ENTRY1Q( DRAW, CONTROL, XML_ATACTION_RENAME,
796 XML_NAMESPACE_FORM, XML_ID ),
797 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(true) ),
798 ENTRY0( DRAW, START_SHAPE, XML_ATACTION_DECODE_ID ),
799 ENTRY0( DRAW, END_SHAPE, XML_ATACTION_DECODE_ID ),
801 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
804 // OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS
805 static XMLTransformerActionInit const aIndexEntryTabStopActionTable[] =
807 ENTRY0( STYLE, POSITION, XML_ATACTION_IN2INCH ),
808 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
809 XML_FAMILY_TYPE_TEXT ),
810 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
813 // OASIS_TAB_STOP_ACTIONS
814 static XMLTransformerActionInit const aTabStopActionTable[] =
816 ENTRY0( STYLE, POSITION, XML_ATACTION_IN2INCH ),
817 ENTRY1Q( STYLE, LEADER_TEXT, XML_ATACTION_RENAME,
818 XML_NAMESPACE_STYLE, XML_LEADER_CHAR ),
819 ENTRY0( STYLE, LEADER_STYLE, XML_ATACTION_REMOVE ),
820 ENTRY0( STYLE, LEADER_TYPE, XML_ATACTION_REMOVE ),
821 ENTRY0( STYLE, LEADER_WIDTH, XML_ATACTION_REMOVE ),
822 ENTRY0( STYLE, LEADER_COLOR, XML_ATACTION_REMOVE ),
823 ENTRY0( STYLE, LEADER_TEXT_STYLE, XML_ATACTION_REMOVE ),
824 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
827 // OASIS_LINENUMBERING_ACTIONS
828 static XMLTransformerActionInit const aLineNumberingActionTable[] =
830 ENTRY0( TEXT, OFFSET, XML_ATACTION_IN2INCH ),
831 ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
832 XML_FAMILY_TYPE_TEXT ),
833 ENTRY1Q( TEXT, COUNT_IN_TEXT_BOXES , XML_ATACTION_RENAME,
834 XML_NAMESPACE_TEXT, XML_COUNT_IN_FLOATING_FRAMES),
835 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
838 static XMLTransformerActionInit const aFootnoteSepActionTable[] =
840 ENTRY0( STYLE, WIDTH, XML_ATACTION_IN2INCH ),
841 ENTRY0( STYLE, DISTANCE_BEFORE_SEP, XML_ATACTION_IN2INCH ),
842 ENTRY0( STYLE, DISTANCE_AFTER_SEP, XML_ATACTION_IN2INCH ),
843 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
846 // OASIS_NOTES_ACTIONS (processed by special context)
847 static XMLTransformerActionInit const aNotesActionTable[] =
849 ENTRY0( TEXT, NOTE_CLASS, XML_ATACTION_STYLE_FAMILY ),
850 ENTRY1( TEXT, CITATION_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
851 XML_FAMILY_TYPE_TEXT ),
852 ENTRY1( TEXT, CITATION_BODY_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
853 XML_FAMILY_TYPE_TEXT ),
854 ENTRY1( TEXT, DEFAULT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
855 XML_FAMILY_TYPE_PARAGRAPH ),
856 ENTRY1( TEXT, MASTER_PAGE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
857 XML_FAMILY_TYPE_MASTER_PAGE ),
858 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
861 // OASIS_DROP_CAP_ACTIONS
862 static XMLTransformerActionInit const aDropCapActionTable[] =
864 ENTRY0( STYLE, DISTANCE, XML_ATACTION_IN2INCH ),
865 ENTRY1( STYLE, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
866 XML_FAMILY_TYPE_TEXT ),
867 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
870 static XMLTransformerActionInit const aColumnsActionTable[] =
872 ENTRY0( STYLE, COLUMN_GAP, XML_ATACTION_IN2INCH ),
873 ENTRY0( STYLE, SPACE_BEFORE, XML_ATACTION_REMOVE ),
874 ENTRY0( STYLE, SPACE_AFTER, XML_ATACTION_REMOVE ),
875 ENTRY1Q( FO, START_INDENT, XML_ATACTION_RENAME_IN2INCH,
876 XML_NAMESPACE_FO, XML_MARGIN_LEFT ),
877 ENTRY1Q( FO, END_INDENT, XML_ATACTION_RENAME_IN2INCH,
878 XML_NAMESPACE_FO, XML_MARGIN_RIGHT ),
879 ENTRY0( STYLE, WIDTH, XML_ATACTION_IN2INCH ),
880 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
883 // OASIS_TEXT_VALUE_TYPE_ACTIONS
884 static XMLTransformerActionInit const aTextValueTypeActionTable[] =
886 ENTRY1Q( OFFICE, VALUE_TYPE, XML_ATACTION_RENAME,
887 XML_NAMESPACE_TEXT, XML_VALUE_TYPE ),
888 ENTRY1Q( OFFICE, VALUE, XML_ATACTION_RENAME,
889 XML_NAMESPACE_TEXT, XML_VALUE ),
890 ENTRY1Q( OFFICE, CURRENCY, XML_ATACTION_RENAME,
891 XML_NAMESPACE_TEXT, XML_CURRENCY ),
892 ENTRY1Q( OFFICE, DATE_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
893 XML_NAMESPACE_TEXT, XML_DATE_VALUE ),
894 ENTRY1Q( OFFICE, TIME_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
895 XML_NAMESPACE_TEXT, XML_TIME_VALUE ),
896 ENTRY1Q( OFFICE, BOOLEAN_VALUE, XML_ATACTION_RENAME,
897 XML_NAMESPACE_TEXT, XML_BOOLEAN_VALUE ),
898 ENTRY1Q( OFFICE, STRING_VALUE, XML_ATACTION_RENAME,
899 XML_NAMESPACE_TEXT, XML_STRING_VALUE ),
900 ENTRY0( TEXT, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
901 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
904 // OASIS_TABLE_VALUE_TYPE_ACTIONS
905 static XMLTransformerActionInit const aTableValueTypeActionTable[] =
907 ENTRY1Q( OFFICE, VALUE_TYPE, XML_ATACTION_RENAME,
908 XML_NAMESPACE_TABLE, XML_VALUE_TYPE ),
909 ENTRY1Q( OFFICE, VALUE, XML_ATACTION_RENAME,
910 XML_NAMESPACE_TABLE, XML_VALUE ),
911 ENTRY1Q( OFFICE, CURRENCY, XML_ATACTION_RENAME,
912 XML_NAMESPACE_TABLE, XML_CURRENCY ),
913 ENTRY1Q( OFFICE, DATE_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
914 XML_NAMESPACE_TABLE, XML_DATE_VALUE ),
915 ENTRY1Q( OFFICE, TIME_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
916 XML_NAMESPACE_TABLE, XML_TIME_VALUE ),
917 ENTRY1Q( OFFICE, BOOLEAN_VALUE, XML_ATACTION_RENAME,
918 XML_NAMESPACE_TABLE, XML_BOOLEAN_VALUE ),
919 ENTRY1Q( OFFICE, STRING_VALUE, XML_ATACTION_RENAME,
920 XML_NAMESPACE_TABLE, XML_STRING_VALUE ),
921 ENTRY1( TABLE, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
922 XML_FAMILY_TYPE_TABLE_CELL ),
923 ENTRY0( TABLE, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
924 ENTRY1Q( TABLE, CONTENT_VALIDATION_NAME, XML_ATACTION_RENAME,
925 XML_NAMESPACE_TABLE, XML_VALIDATION_NAME ),
926 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
929 // action table for OASIS_ANNOTATION_ACTIONS
930 static XMLTransformerActionInit const aAnnotationActionTable[] =
932 ENTRY1Q( DC, CREATOR, XML_ETACTION_MOVE_TO_ATTR,
933 XML_NAMESPACE_OFFICE, XML_AUTHOR ),
934 ENTRY1Q( DC, DATE, XML_ETACTION_MOVE_TO_ATTR_RNG2ISO_DATETIME,
935 XML_NAMESPACE_OFFICE, XML_CREATE_DATE ),
936 ENTRY1Q( META, DATE_STRING, XML_ETACTION_MOVE_TO_ATTR,
937 XML_NAMESPACE_OFFICE, XML_CREATE_DATE_STRING ),
938 ENTRY0( TEXT, P, XML_ETACTION_EXTRACT_CHARACTERS ),
939 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
942 // action table for OASIS_CHANGE_INFO_ACTIONS
943 static XMLTransformerActionInit const aChangeInfoActionTable[] =
945 ENTRY1Q( DC, CREATOR, XML_ETACTION_MOVE_TO_ATTR,
946 XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR ),
947 ENTRY1Q( DC, DATE, XML_ETACTION_MOVE_TO_ATTR_RNG2ISO_DATETIME,
948 XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME ),
949 ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
952 // OASIS_BACKGROUND_IMAGE_ACTIONS
953 static XMLTransformerActionInit const aBackgroundImageActionTable[] =
955 ENTRY1Q( DRAW, OPACITY, XML_ATACTION_RENAME_NEG_PERCENT,
956 XML_NAMESPACE_DRAW, XML_TRANSPARENCY ),
957 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(true) ),
958 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
961 // OASIS_DDE_CONNECTION_DECL
962 static XMLTransformerActionInit const aDDEConnectionDeclActionTable[] =
964 ENTRY1Q( OFFICE, NAME, XML_ATACTION_RENAME,
965 XML_NAMESPACE_TEXT, XML_NAME ),
966 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
969 // OASIS_FORM_CONTROL_ACTIONS
970 static XMLTransformerActionInit const aFormControlActionTable[] =
972 ENTRY0( FORM, NAME, XML_ATACTION_MOVE_TO_ELEM ),
973 ENTRY2QN( FORM, CONTROL_IMPLEMENTATION,
974 XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,
975 XML_NAMESPACE_FORM, XML_SERVICE_NAME,
976 XML_NAMESPACE_OOO ),
977 ENTRY0( FORM, ID, XML_ATACTION_MOVE_TO_ELEM ),
978 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(false) ),
979 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
982 // OASIS_FORM_COLUMN_ACTIONS
983 static XMLTransformerActionInit const aFormColumnActionTable[] =
985 ENTRY1Q( FORM, TEXT_STYLE_NAME, XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF,
986 XML_NAMESPACE_FORM, XML_COLUMN_STYLE_NAME ),
987 ENTRY2QN( FORM, CONTROL_IMPLEMENTATION,
988 XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,
989 XML_NAMESPACE_FORM, XML_SERVICE_NAME,
990 XML_NAMESPACE_OOO ),
991 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
994 // OASIS_FORM_PROP_ACTIONS
995 static XMLTransformerActionInit const aFormPropActionTable[] =
997 ENTRY1Q( OFFICE, VALUE_TYPE, XML_ATACTION_RENAME,
998 XML_NAMESPACE_FORM, XML_PROPERTY_TYPE ),
999 ENTRY0( OFFICE, VALUE, XML_ATACTION_REMOVE ),
1000 ENTRY0( OFFICE, STRING_VALUE, XML_ATACTION_REMOVE ),
1001 ENTRY0( OFFICE, BOOLEAN_VALUE, XML_ATACTION_REMOVE ),
1002 ENTRY0( OFFICE, DATE_VALUE, XML_ATACTION_REMOVE ),
1003 ENTRY0( OFFICE, TIME_VALUE, XML_ATACTION_REMOVE ),
1004 ENTRY0( OFFICE, CURRENCY, XML_ATACTION_REMOVE ),
1005 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1008 // OASIS_XLINK_ACTIONS
1009 static XMLTransformerActionInit const aXLinkActionTable[] =
1011 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(false) ),
1012 ENTRY0( TABLE, REFRESH_DELAY, XML_ATACTION_RNG2ISO_DATETIME ),
1013 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1016 // OASIS_CONFIG_ITEM_SET_ACTIONS
1017 static XMLTransformerActionInit const aConfigItemSetActionTable[] =
1019 ENTRY1( CONFIG, NAME, XML_ATACTION_REMOVE_NAMESPACE_PREFIX,
1020 XML_NAMESPACE_OOO ),
1021 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1024 // OASIS_FORMULA_ACTIONS
1025 static XMLTransformerActionInit const aFormulaActionTable[] =
1027 ENTRY0( TEXT, CONDITION, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1028 ENTRY0( TEXT, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1029 ENTRY0( TABLE, CONDITION, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1030 ENTRY0( TABLE, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1031 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1034 // OASIS_CONTENT_VALIDATION_ACTIONS
1035 static XMLTransformerActionInit const aContentValidationActionTable[] =
1037 ENTRY0( TABLE, CONDITION, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1038 ENTRY0( TABLE, DISPLAY_LIST, XML_ATACTION_REMOVE ),
1039 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1042 // OASIS_DDE_CONV_MODE_ACTIONS
1043 static XMLTransformerActionInit const aDDEConvModeActionTable[] =
1045 ENTRY1Q( TABLE, KEEP_TEXT, XML_ATACTION_RENAME,
1046 XML_NAMESPACE_TABLE, XML_LET_TEXT ),
1047 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1050 // OASIS_DATAPILOT_MEMBER_ACTIONS
1051 static XMLTransformerActionInit const aDataPilotMemberActionTable[] =
1053 ENTRY1Q( TABLE, SHOW_DETAILS, XML_ATACTION_RENAME,
1054 XML_NAMESPACE_TABLE, XML_DISPLAY_DETAILS ),
1055 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1058 // OASIS_DATAPILOT_LEVEL_ACTIONS
1059 static XMLTransformerActionInit const aDataPilotLevelActionTable[] =
1061 ENTRY1Q( TABLE, SHOW_EMPTY, XML_ATACTION_RENAME,
1062 XML_NAMESPACE_TABLE, XML_DISPLAY_EMPTY ),
1063 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1066 // OASIS_SOURCE_SERVICE_ACTIONS
1067 static XMLTransformerActionInit const aSourceServiceActionTable[] =
1069 ENTRY1Q( TABLE, USER_NAME, XML_ATACTION_RENAME,
1070 XML_NAMESPACE_TABLE, XML_USERNAME ),
1071 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1074 // OASIS_CHART_ACTIONS
1075 static XMLTransformerActionInit const aChartActionTable[] =
1077 ENTRY0( CHART, CLASS, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1078 ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
1079 XML_FAMILY_TYPE_GRAPHIC ),
1080 ENTRY0( SVG, WIDTH, XML_ATACTION_IN2INCH ),
1081 ENTRY0( SVG, HEIGHT, XML_ATACTION_IN2INCH ),
1082 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1085 // OASIS_FORM_ACTIONS
1086 static XMLTransformerActionInit const aFormActionTable[] =
1088 ENTRY2QN( FORM, CONTROL_IMPLEMENTATION,
1089 XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,
1090 XML_NAMESPACE_FORM, XML_SERVICE_NAME,
1091 XML_NAMESPACE_OOO ),
1092 ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_uInt32(false) ),
1093 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1096 // OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS
1097 static XMLTransformerActionInit const aAlphabeticalIndexMarkActionTable[] =
1099 ENTRY1Q( TEXT, MAIN_ENTRY, XML_ATACTION_RENAME,
1100 XML_NAMESPACE_TEXT, XML_MAIN_ETRY ),
1101 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1104 // OASIS_DRAW_AREA_POLYGON_ACTIONS (to be added to OASIS_SHAPE_ACTIONS)
1105 static XMLTransformerActionInit const aDrawAreaPolygonActionTable[] =
1107 ENTRY1Q( DRAW, POINTS, XML_ATACTION_RENAME,
1108 XML_NAMESPACE_SVG, XML_POINTS ),
1109 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1112 // OASIS_SCRIPT_ACTIONS
1113 static XMLTransformerActionInit const aScriptActionTable[] =
1115 ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_REMOVE_NAMESPACE_PREFIX, XML_NAMESPACE_OOO ),
1116 ENTRY1Q( OOO, NAME, XML_ATACTION_RENAME, XML_NAMESPACE_SCRIPT, XML_NAME ),
1117 ENTRY1Q( OOO, READONLY, XML_ATACTION_RENAME, XML_NAMESPACE_SCRIPT, XML_READONLY ),
1118 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1121 // OASIS_DATETIME_ACTIONS
1122 static XMLTransformerActionInit const aDateTimeActionTable[] =
1124 ENTRY0( TEXT, DATE_VALUE, XML_ATACTION_RNG2ISO_DATETIME ),
1125 ENTRY0( TEXT, TIME_VALUE, XML_ATACTION_RNG2ISO_DATETIME ),
1126 ENTRY0( TEXT, DATE_ADJUST, XML_ATACTION_RNG2ISO_DATETIME ),
1127 ENTRY0( TEXT, TIME_ADJUST, XML_ATACTION_RNG2ISO_DATETIME ),
1128 ENTRY0( TEXT, DURATION, XML_ATACTION_RNG2ISO_DATETIME ),
1129 ENTRY0( OFFICE, DATE_VALUE, XML_ATACTION_RNG2ISO_DATETIME ),
1130 ENTRY0( OFFICE, TIME_VALUE, XML_ATACTION_RNG2ISO_DATETIME ),
1131 ENTRY0( FORM, VALUE, XML_ATACTION_RNG2ISO_DATETIME ),
1132 ENTRY0( FORM, CURRENT_VALUE, XML_ATACTION_RNG2ISO_DATETIME ),
1133 ENTRY0( TABLE, DATE_START, XML_ATACTION_RNG2ISO_DATETIME ),
1134 ENTRY0( TABLE, DATE_END, XML_ATACTION_RNG2ISO_DATETIME ),
1135 ENTRY0( TABLE, REFRESH_DELAY, XML_ATACTION_RNG2ISO_DATETIME ),
1136 ENTRY0( PRESENTATION, DELAY, XML_ATACTION_RNG2ISO_DATETIME ),
1137 ENTRY0( PRESENTATION, PAUSE, XML_ATACTION_RNG2ISO_DATETIME ),
1138 ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1141 static XMLTokenEnum const aTokenMap[] =
1143 XML_NONE, XML_SOLID, XML_DOTTED, XML_DASH, XML_LONG_DASH, XML_DOT_DASH,
1144 XML_DOT_DOT_DASH, XML_WAVE, XML_SMALL_WAVE, XML_TOKEN_END
1147 class XMLTableTransformerContext_Impl : public XMLTransformerContext
1149 OUString m_aElemQName;
1151 public:
1152 XMLTableTransformerContext_Impl( XMLTransformerBase& rTransformer,
1153 const OUString& rQName );
1155 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1156 virtual void EndElement() override;
1159 XMLTableTransformerContext_Impl::XMLTableTransformerContext_Impl(
1160 XMLTransformerBase& rImp,
1161 const OUString& rQName ) :
1162 XMLTransformerContext( rImp, rQName ),
1163 m_aElemQName( rQName )
1167 void XMLTableTransformerContext_Impl::StartElement(
1168 const Reference< XAttributeList >& rAttrList )
1170 Reference< XAttributeList > xAttrList( rAttrList );
1172 XMLMutableAttributeList *pMutableAttrList = nullptr;
1174 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1175 for( sal_Int16 i=0; i < nAttrCount; i++ )
1177 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1178 OUString aLocalName;
1179 sal_uInt16 nPrefix =
1180 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1181 &aLocalName );
1182 if( XML_NAMESPACE_TABLE == nPrefix )
1184 if ( IsXMLToken( aLocalName, XML_IS_SUB_TABLE ) )
1186 const OUString& rValue = xAttrList->getValueByIndex( i );
1187 if( IsXMLToken( rValue, XML_TRUE ) )
1189 m_aElemQName = GetTransformer().GetNamespaceMap().GetQNameByKey(
1190 XML_NAMESPACE_TABLE,
1191 ::xmloff::token::GetXMLToken( XML_SUB_TABLE ) );
1192 if ( !pMutableAttrList )
1194 pMutableAttrList =
1195 new XMLMutableAttributeList( xAttrList );
1196 xAttrList = pMutableAttrList;
1198 pMutableAttrList->RemoveAttributeByIndex( i );
1200 // #i50521# - no break here for safety reason.
1202 // Convert attribute table:style-name for <table:table> (#i40011#, #i40015#)
1203 else if ( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
1205 const OUString& rValue = xAttrList->getValueByIndex( i );
1206 OUString aAttrValue( rValue );
1207 if( XMLTransformerBase::DecodeStyleName(aAttrValue) )
1209 if ( !pMutableAttrList )
1211 pMutableAttrList =
1212 new XMLMutableAttributeList( xAttrList );
1213 xAttrList = pMutableAttrList;
1215 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1218 else if( IsXMLToken( aLocalName, XML_PRINT ) )
1220 if ( !pMutableAttrList )
1222 pMutableAttrList =
1223 new XMLMutableAttributeList( xAttrList );
1224 xAttrList = pMutableAttrList;
1226 pMutableAttrList->RemoveAttributeByIndex( i );
1231 GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1234 void XMLTableTransformerContext_Impl::EndElement()
1236 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1239 class XMLBodyOASISTransformerContext_Impl : public XMLTransformerContext
1241 bool m_bFirstChild;
1243 public:
1244 XMLBodyOASISTransformerContext_Impl( XMLTransformerBase& rTransformer,
1245 const OUString& rQName );
1247 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1249 virtual rtl::Reference<XMLTransformerContext> CreateChildContext( sal_uInt16 nPrefix,
1250 const OUString& rLocalName,
1251 const OUString& rQName,
1252 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1253 virtual void EndElement() override;
1256 XMLBodyOASISTransformerContext_Impl::XMLBodyOASISTransformerContext_Impl(
1257 XMLTransformerBase& rImp,
1258 const OUString& rQName ) :
1259 XMLTransformerContext( rImp, rQName ),
1260 m_bFirstChild( false )
1264 void XMLBodyOASISTransformerContext_Impl::StartElement(
1265 const Reference< XAttributeList >& )
1269 rtl::Reference<XMLTransformerContext> XMLBodyOASISTransformerContext_Impl::CreateChildContext( sal_uInt16 nPrefix,
1270 const OUString& rLocalName,
1271 const OUString& rQName,
1272 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
1274 if (!m_bFirstChild)
1276 m_bFirstChild = true;
1277 XMLTransformerContext::StartElement(xAttrList);
1280 return XMLTransformerContext::CreateChildContext(nPrefix, rLocalName, rQName, xAttrList);
1283 void XMLBodyOASISTransformerContext_Impl::EndElement()
1285 if (!m_bFirstChild)
1286 XMLTransformerContext::StartElement(Reference< XAttributeList >());
1288 XMLTransformerContext::EndElement();
1291 class XMLTabStopOASISTContext_Impl : public XMLPersElemContentTContext
1293 public:
1294 XMLTabStopOASISTContext_Impl( XMLTransformerBase& rTransformer,
1295 const OUString& rQName );
1297 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1300 XMLTabStopOASISTContext_Impl::XMLTabStopOASISTContext_Impl(
1301 XMLTransformerBase& rImp,
1302 const OUString& rQName ) :
1303 XMLPersElemContentTContext( rImp, rQName )
1307 void XMLTabStopOASISTContext_Impl::StartElement(
1308 const Reference< XAttributeList >& rAttrList )
1310 XMLTransformerActions *pActions =
1311 GetTransformer().GetUserDefinedActions( OASIS_TAB_STOP_ACTIONS );
1312 SAL_WARN_IF( nullptr == pActions, "xmloff.transform", "got no actions" );
1314 sal_Unicode cStyleLeaderChar = 0;
1315 sal_Int16 nLeaderText = -1;
1316 Reference< XAttributeList > xAttrList( rAttrList );
1317 XMLMutableAttributeList *pMutableAttrList = nullptr;
1318 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1319 for( sal_Int16 i=0; i < nAttrCount; i++ )
1321 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1322 OUString aLocalName;
1323 sal_uInt16 nPrefix =
1324 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1325 &aLocalName );
1326 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1327 XMLTransformerActions::const_iterator aIter =
1328 pActions->find( aKey );
1329 if( aIter != pActions->end() )
1331 if( !pMutableAttrList )
1333 pMutableAttrList =
1334 new XMLMutableAttributeList( xAttrList );
1335 xAttrList = pMutableAttrList;
1337 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1338 switch( (*aIter).second.m_nActionType )
1340 case XML_ATACTION_REMOVE:
1341 if( IsXMLToken( aLocalName, XML_LEADER_STYLE ) )
1343 if( IsXMLToken( rAttrValue, XML_NONE ) )
1344 cStyleLeaderChar = ' ';
1345 else if( IsXMLToken( rAttrValue, XML_DOTTED ) )
1346 cStyleLeaderChar = '.';
1347 else
1348 cStyleLeaderChar = 0;
1349 pMutableAttrList->RemoveAttributeByIndex( i );
1350 --i;
1351 --nAttrCount;
1353 break;
1354 case XML_ATACTION_RENAME:
1356 OUString aNewAttrQName(
1357 GetTransformer().GetNamespaceMap().GetQNameByKey(
1358 (*aIter).second.GetQNamePrefixFromParam1(),
1359 ::xmloff::token::GetXMLToken(
1360 (*aIter).second.GetQNameTokenFromParam1()) ) );
1361 pMutableAttrList->RenameAttributeByIndex( i,
1362 aNewAttrQName );
1364 if( IsXMLToken( aLocalName, XML_LEADER_TEXT ) )
1366 if( rAttrValue.getLength() > 1 )
1368 OUString aAttrValue( rAttrValue.copy( 0, 1 ) );
1369 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1370 nLeaderText = i;
1373 break;
1374 case XML_ATACTION_IN2INCH:
1376 OUString aAttrValue( rAttrValue );
1377 if( XMLTransformerBase::ReplaceSingleInWithInch(
1378 aAttrValue ) )
1379 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1381 break;
1382 default:
1383 SAL_WARN( "xmloff.transform", "unknown action" );
1384 break;
1389 if( cStyleLeaderChar && ' ' != cStyleLeaderChar )
1391 if( nLeaderText != -1 )
1393 OUString aNewAttrQName(
1394 GetTransformer().GetNamespaceMap().GetQNameByKey(
1395 XML_NAMESPACE_STYLE,
1396 ::xmloff::token::GetXMLToken( XML_LEADER_CHAR ) ) );
1397 pMutableAttrList->AddAttribute( aNewAttrQName,
1398 OUString( cStyleLeaderChar ) );
1401 else
1403 if( nLeaderText != -1 )
1404 pMutableAttrList->RemoveAttributeByIndex( nLeaderText );
1407 XMLPersElemContentTContext::StartElement( xAttrList );
1410 class XMLConfigItemTContext_Impl : public XMLTransformerContext
1412 OUString m_aContent;
1413 bool m_bIsRedlineProtectionKey;
1414 bool m_bIsCursorX;
1415 bool m_bIsCursorY;
1417 public:
1418 XMLConfigItemTContext_Impl( XMLTransformerBase& rTransformer,
1419 const OUString& rQName );
1421 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1422 virtual void EndElement() override;
1424 virtual void Characters( const OUString& rChars ) override;
1427 XMLConfigItemTContext_Impl::XMLConfigItemTContext_Impl(
1428 XMLTransformerBase& rImp,
1429 const OUString& rQName ) :
1430 XMLTransformerContext( rImp, rQName ),
1431 m_bIsRedlineProtectionKey( false ),
1432 m_bIsCursorX( false ),
1433 m_bIsCursorY( false )
1437 void XMLConfigItemTContext_Impl::StartElement(
1438 const Reference< XAttributeList >& rAttrList )
1440 sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
1441 for( sal_Int16 i=0; i < nAttrCount; i++ )
1443 const OUString& rAttrName = rAttrList->getNameByIndex( i );
1444 OUString aLocalName;
1445 sal_uInt16 nPrefix =
1446 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1447 &aLocalName );
1448 if( XML_NAMESPACE_CONFIG == nPrefix )
1450 if ( IsXMLToken( aLocalName, XML_NAME ) )
1452 const OUString& rValue = rAttrList->getValueByIndex( i );
1453 if( rValue == "RedlineProtectionKey" )
1454 m_bIsRedlineProtectionKey = true;
1455 else if( rValue == "CursorPositionX" )
1456 m_bIsCursorX = true;
1457 else if( rValue == "CursorPositionY" )
1458 m_bIsCursorY = true;
1460 break;
1465 XMLTransformerContext::StartElement( rAttrList );
1468 void XMLConfigItemTContext_Impl::Characters( const OUString& rChars )
1470 OUString sChars(rChars);
1471 if (m_bIsRedlineProtectionKey)
1472 m_aContent += rChars;
1473 else if (m_bIsCursorX || m_bIsCursorY)
1475 sal_Int32 nPos = rChars.toInt32();
1476 if (m_bIsCursorX && nPos > 255)
1477 nPos = 255;
1478 else if (m_bIsCursorY && nPos > 31999)
1479 nPos = 31999;
1481 sChars = OUString::number(nPos);
1484 XMLTransformerContext::Characters( sChars );
1487 void XMLConfigItemTContext_Impl::EndElement()
1490 if( m_bIsRedlineProtectionKey )
1492 const Reference< XPropertySet > rPropSet =
1493 GetTransformer().GetPropertySet();
1494 if( rPropSet.is() )
1496 OUString aPropName("RedlineProtectionKey");
1497 Reference< XPropertySetInfo > xPropSetInfo(
1498 rPropSet->getPropertySetInfo() );
1499 if( xPropSetInfo.is() &&
1500 xPropSetInfo->hasPropertyByName( aPropName ) )
1502 Sequence < sal_Int8 > aKey;
1503 ::comphelper::Base64::decode( aKey, m_aContent );
1504 rPropSet->setPropertyValue( aPropName, makeAny( aKey ) );
1508 XMLTransformerContext::EndElement();
1511 class XMLTrackedChangesOASISTContext_Impl : public XMLTransformerContext
1513 OUString const m_aAttrQName;
1515 public:
1517 XMLTrackedChangesOASISTContext_Impl( XMLTransformerBase& rTransformer,
1518 const OUString& rQName,
1519 sal_uInt16 nPrefix,
1520 XMLTokenEnum eToken );
1522 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1525 XMLTrackedChangesOASISTContext_Impl::XMLTrackedChangesOASISTContext_Impl(
1526 XMLTransformerBase& rImp,
1527 const OUString& rQName,
1528 sal_uInt16 nPrefix,
1529 XMLTokenEnum eToken ) :
1530 XMLTransformerContext( rImp, rQName ),
1531 m_aAttrQName( rImp.GetNamespaceMap().GetQNameByKey( nPrefix,
1532 GetXMLToken(eToken)) )
1536 void XMLTrackedChangesOASISTContext_Impl::StartElement(
1537 const Reference< XAttributeList >& rAttrList )
1539 Reference< XAttributeList > xAttrList( rAttrList );
1540 const Reference< XPropertySet > rPropSet =
1541 GetTransformer().GetPropertySet();
1542 if( rPropSet.is() )
1544 OUString aPropName("RedlineProtectionKey");
1545 Reference< XPropertySetInfo > xPropSetInfo(
1546 rPropSet->getPropertySetInfo() );
1547 if( xPropSetInfo.is() &&
1548 xPropSetInfo->hasPropertyByName( aPropName ) )
1550 Any aAny = rPropSet->getPropertyValue( aPropName);
1551 Sequence < sal_Int8 > aKey;
1552 aAny >>= aKey;
1553 if( aKey.hasElements() )
1555 OUStringBuffer aBuffer;
1556 ::comphelper::Base64::encode( aBuffer, aKey );
1557 XMLMutableAttributeList *pMutableAttrList =
1558 new XMLMutableAttributeList( xAttrList );
1559 xAttrList = pMutableAttrList;
1560 pMutableAttrList->AddAttribute( m_aAttrQName,
1561 aBuffer.makeStringAndClear() );
1565 XMLTransformerContext::StartElement( xAttrList );
1568 XMLTransformerContext *Oasis2OOoTransformer::CreateUserDefinedContext(
1569 const TransformerAction_Impl& rAction,
1570 const OUString& rQName,
1571 bool bPersistent )
1573 switch( rAction.m_nActionType )
1575 case XML_ETACTION_META:
1576 return new XMLMetaTransformerContext( *this, rQName );
1577 case XML_ETACTION_DOCUMENT:
1578 return new XMLDocumentTransformerContext( *this, rQName );
1579 case XML_ETACTION_BODY:
1580 return new XMLBodyOASISTransformerContext_Impl( *this, rQName );
1581 case XML_ETACTION_NOTES:
1582 return new XMLNotesTransformerContext( *this, rQName,
1583 static_cast< XMLTokenEnum>( rAction.m_nParam1 ), bPersistent );
1584 case XML_ETACTION_TABLE:
1585 return new XMLTableTransformerContext_Impl( *this, rQName );
1586 case XML_ETACTION_STYLE:
1587 return new XMLStyleOASISTContext( *this, rQName, bPersistent );
1588 case XML_ETACTION_STYLE_RENAME:
1589 return new XMLStyleOASISTContext( *this, rQName,
1590 rAction.GetQNamePrefixFromParam1(),
1591 rAction.GetQNameTokenFromParam1(), bPersistent );
1592 case XML_ETACTION_FRAME:
1593 return new XMLFrameOASISTransformerContext( *this, rQName );
1594 case XML_ETACTION_EVENT:
1595 return new XMLEventOASISTransformerContext( *this, rQName );
1596 case XML_ETACTION_DLG:
1597 return new XMLDlgOASISTransformerContext( *this, rQName );
1598 case XML_ETACTION_TAB_STOP:
1599 return new XMLTabStopOASISTContext_Impl( *this, rQName );
1600 case XML_ETACTION_FORM_CONTROL:
1602 const XMLTransformerContext *pCurrent = GetCurrentContext();
1603 return new XMLControlOASISTransformerContext( *this, rQName,
1604 pCurrent && pCurrent->HasQName( XML_NAMESPACE_FORM,
1605 XML_FORM ) );
1607 case XML_ETACTION_FORM_PROPERTY:
1608 return new XMLFormPropOASISTransformerContext( *this, rQName,
1609 static_cast< XMLTokenEnum >( rAction.m_nParam1 ) );
1610 case XML_ETACTION_CHART:
1611 return new XMLChartOASISTransformerContext( *this, rQName );
1612 case XML_ETACTION_CONFIG_ITEM:
1613 return new XMLConfigItemTContext_Impl( *this, rQName );
1614 case XML_ETACTION_TRACKED_CHANGES:
1615 return new XMLTrackedChangesOASISTContext_Impl( *this, rQName,
1616 rAction.GetQNamePrefixFromParam1(),
1617 rAction.GetQNameTokenFromParam1() );
1618 case XML_ETACTION_CHART_PLOT_AREA:
1619 return new XMLChartPlotAreaOASISTContext( *this, rQName );
1620 default:
1621 SAL_WARN( "xmloff.transform", "no user defined context found!" );
1622 break;
1625 // default is copying
1626 return new XMLTransformerContext( *this, rQName );
1629 XMLTransformerActions *Oasis2OOoTransformer::GetUserDefinedActions(
1630 sal_uInt16 n )
1632 XMLTransformerActions *pActions = nullptr;
1633 if( n < MAX_OASIS_ACTIONS )
1635 if( !m_aActions[n] )
1637 if( n<MAX_OASIS_PROP_ACTIONS )
1639 m_aActions[n].reset(
1640 XMLStyleOASISTContext::CreateTransformerActions( n ) );
1642 else switch( n )
1644 case OASIS_STYLE_ACTIONS:
1645 m_aActions[OASIS_STYLE_ACTIONS].reset(
1646 new XMLTransformerActions( aStyleActionTable ) );
1647 break;
1648 case OASIS_FONT_FACE_ACTIONS:
1649 m_aActions[OASIS_FONT_FACE_ACTIONS].reset(
1650 new XMLTransformerActions( aFontFaceActionTable ) );
1651 break;
1652 case OASIS_SHAPE_ACTIONS:
1653 m_aActions[OASIS_SHAPE_ACTIONS].reset(
1654 new XMLTransformerActions( aShapeActionTable ) );
1655 break;
1656 case OASIS_CONNECTOR_ACTIONS:
1657 m_aActions[OASIS_CONNECTOR_ACTIONS].reset(
1658 new XMLTransformerActions( aConnectorActionTable ) );
1659 break;
1660 case OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS:
1661 m_aActions[OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS].reset(
1662 new XMLTransformerActions( aIndexEntryTabStopActionTable ) );
1663 break;
1664 case OASIS_TAB_STOP_ACTIONS:
1665 m_aActions[OASIS_TAB_STOP_ACTIONS].reset(
1666 new XMLTransformerActions( aTabStopActionTable ) );
1667 break;
1668 case OASIS_LINENUMBERING_ACTIONS:
1669 m_aActions[OASIS_LINENUMBERING_ACTIONS].reset(
1670 new XMLTransformerActions( aLineNumberingActionTable ) );
1671 break;
1672 case OASIS_FOOTNOTE_SEP_ACTIONS:
1673 m_aActions[OASIS_FOOTNOTE_SEP_ACTIONS].reset(
1674 new XMLTransformerActions( aFootnoteSepActionTable ) );
1675 break;
1676 case OASIS_DROP_CAP_ACTIONS:
1677 m_aActions[OASIS_DROP_CAP_ACTIONS].reset(
1678 new XMLTransformerActions( aDropCapActionTable ) );
1679 break;
1680 case OASIS_COLUMNS_ACTIONS:
1681 m_aActions[OASIS_COLUMNS_ACTIONS].reset(
1682 new XMLTransformerActions( aColumnsActionTable ) );
1683 break;
1684 case OASIS_TEXT_VALUE_TYPE_ACTIONS:
1685 m_aActions[OASIS_TEXT_VALUE_TYPE_ACTIONS].reset(
1686 new XMLTransformerActions( aTextValueTypeActionTable ) );
1687 break;
1688 case OASIS_TABLE_VALUE_TYPE_ACTIONS:
1689 m_aActions[OASIS_TABLE_VALUE_TYPE_ACTIONS].reset(
1690 new XMLTransformerActions( aTableValueTypeActionTable ) );
1691 break;
1692 case OASIS_PARA_ACTIONS:
1693 m_aActions[OASIS_PARA_ACTIONS].reset(
1694 new XMLTransformerActions( aParaActionTable ) );
1695 break;
1696 case OASIS_LIST_STYLE_REF_ACTIONS:
1697 m_aActions[OASIS_LIST_STYLE_REF_ACTIONS].reset(
1698 new XMLTransformerActions( aListStyleRefActionTable ) );
1699 break;
1700 case OASIS_TEXT_STYLE_REF_ACTIONS:
1701 m_aActions[OASIS_TEXT_STYLE_REF_ACTIONS].reset(
1702 new XMLTransformerActions( aTextStyleRefActionTable ) );
1703 break;
1704 case OASIS_PARA_STYLE_REF_ACTIONS:
1705 m_aActions[OASIS_PARA_STYLE_REF_ACTIONS].reset(
1706 new XMLTransformerActions( aParaStyleRefActionTable ) );
1707 break;
1708 case OASIS_MASTER_PAGE_REF_ACTIONS:
1709 m_aActions[OASIS_MASTER_PAGE_REF_ACTIONS].reset(
1710 new XMLTransformerActions( aMasterPageRefActionTable ) );
1711 break;
1712 case OASIS_MAP_STYLE_REF_ACTIONS:
1713 m_aActions[OASIS_MAP_STYLE_REF_ACTIONS].reset(
1714 new XMLTransformerActions( aMapStyleRefActionTable ) );
1715 break;
1716 case OASIS_MASTER_PAGE_ACTIONS:
1717 m_aActions[OASIS_MASTER_PAGE_ACTIONS].reset(
1718 new XMLTransformerActions( aMasterPageActionTable ) );
1719 break;
1720 case OASIS_NOTES_ACTIONS:
1721 m_aActions[OASIS_NOTES_ACTIONS].reset(
1722 new XMLTransformerActions( aNotesActionTable ) );
1723 break;
1724 case OASIS_ANNOTATION_ACTIONS:
1725 m_aActions[OASIS_ANNOTATION_ACTIONS].reset(
1726 new XMLTransformerActions( aAnnotationActionTable ) );
1727 break;
1728 case OASIS_CHANGE_INFO_ACTIONS:
1729 m_aActions[OASIS_CHANGE_INFO_ACTIONS].reset(
1730 new XMLTransformerActions( aChangeInfoActionTable ) );
1731 break;
1732 case OASIS_FRAME_ELEM_ACTIONS:
1733 m_aActions[OASIS_FRAME_ELEM_ACTIONS].reset(
1734 new XMLTransformerActions( aFrameActionTable ) );
1735 break;
1736 case OASIS_BACKGROUND_IMAGE_ACTIONS:
1737 m_aActions[OASIS_BACKGROUND_IMAGE_ACTIONS].reset(
1738 new XMLTransformerActions( aBackgroundImageActionTable ) );
1739 break;
1740 case OASIS_DDE_CONNECTION_DECL_ACTIONS:
1741 m_aActions[OASIS_DDE_CONNECTION_DECL_ACTIONS].reset(
1742 new XMLTransformerActions( aDDEConnectionDeclActionTable ) );
1743 break;
1744 case OASIS_EVENT_ACTIONS:
1745 m_aActions[OASIS_EVENT_ACTIONS].reset(
1746 new XMLTransformerActions( aEventActionTable ) );
1747 break;
1748 case OASIS_DLG_ACTIONS:
1749 m_aActions[OASIS_DLG_ACTIONS].reset(
1750 new XMLTransformerActions( aDlgActionTable ) );
1751 break;
1752 case OASIS_FORM_CONTROL_ACTIONS:
1753 m_aActions[OASIS_FORM_CONTROL_ACTIONS].reset(
1754 new XMLTransformerActions( aFormControlActionTable ) );
1755 break;
1756 case OASIS_FORM_COLUMN_ACTIONS:
1757 m_aActions[OASIS_FORM_COLUMN_ACTIONS].reset(
1758 new XMLTransformerActions( aFormColumnActionTable ) );
1759 break;
1760 case OASIS_FORM_PROP_ACTIONS:
1761 m_aActions[OASIS_FORM_PROP_ACTIONS].reset(
1762 new XMLTransformerActions( aFormPropActionTable ) );
1763 break;
1764 case OASIS_XLINK_ACTIONS:
1765 m_aActions[OASIS_XLINK_ACTIONS].reset(
1766 new XMLTransformerActions( aXLinkActionTable ) );
1767 break;
1768 case OASIS_CONFIG_ITEM_SET_ACTIONS:
1769 m_aActions[OASIS_CONFIG_ITEM_SET_ACTIONS].reset(
1770 new XMLTransformerActions( aConfigItemSetActionTable ) );
1771 break;
1772 case OASIS_FORMULA_ACTIONS:
1773 m_aActions[OASIS_FORMULA_ACTIONS].reset(
1774 new XMLTransformerActions( aFormulaActionTable ) );
1775 break;
1776 case OASIS_CHART_ACTIONS:
1777 m_aActions[OASIS_CHART_ACTIONS].reset(
1778 new XMLTransformerActions( aChartActionTable ) );
1779 break;
1780 case OASIS_FORM_ACTIONS:
1781 m_aActions[OASIS_FORM_ACTIONS].reset(
1782 new XMLTransformerActions( aFormActionTable ) );
1783 break;
1784 case OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS:
1785 m_aActions[OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS].reset(
1786 new XMLTransformerActions(
1787 aAlphabeticalIndexMarkActionTable ) );
1788 break;
1789 case OASIS_CONTENT_VALIDATION_ACTIONS:
1790 m_aActions[OASIS_CONTENT_VALIDATION_ACTIONS].reset(
1791 new XMLTransformerActions( aContentValidationActionTable ) );
1792 break;
1793 case OASIS_DDE_CONV_MODE_ACTIONS:
1794 m_aActions[OASIS_DDE_CONV_MODE_ACTIONS].reset(
1795 new XMLTransformerActions( aDDEConvModeActionTable ) );
1796 break;
1797 case OASIS_DATAPILOT_MEMBER_ACTIONS:
1798 m_aActions[OASIS_DATAPILOT_MEMBER_ACTIONS].reset(
1799 new XMLTransformerActions( aDataPilotMemberActionTable ) );
1800 break;
1801 case OASIS_DATAPILOT_LEVEL_ACTIONS:
1802 m_aActions[OASIS_DATAPILOT_LEVEL_ACTIONS].reset(
1803 new XMLTransformerActions( aDataPilotLevelActionTable ) );
1804 break;
1805 case OASIS_SOURCE_SERVICE_ACTIONS:
1806 m_aActions[OASIS_SOURCE_SERVICE_ACTIONS].reset(
1807 new XMLTransformerActions( aSourceServiceActionTable ) );
1808 break;
1809 case OASIS_DRAW_AREA_POLYGON_ACTIONS:
1810 m_aActions[OASIS_DRAW_AREA_POLYGON_ACTIONS].reset(
1811 new XMLTransformerActions( aShapeActionTable ) );
1812 m_aActions[OASIS_DRAW_AREA_POLYGON_ACTIONS]
1813 ->Add( aDrawAreaPolygonActionTable );
1814 break;
1815 case OASIS_SCRIPT_ACTIONS:
1816 m_aActions[OASIS_SCRIPT_ACTIONS].reset(
1817 new XMLTransformerActions( aScriptActionTable ) );
1818 break;
1819 case OASIS_DATETIME_ACTIONS:
1820 m_aActions[OASIS_DATETIME_ACTIONS].reset(
1821 new XMLTransformerActions( aDateTimeActionTable ) );
1822 break;
1823 // Bugdoc with table won't load correctly (#i40011#, #i40015#)
1824 case OASIS_TABLE_STYLE_REF_ACTIONS:
1825 m_aActions[OASIS_TABLE_STYLE_REF_ACTIONS].reset(
1826 new XMLTransformerActions( aTableStyleRefActionTable ) );
1827 break;
1828 case OASIS_ANIMATION_ACTIONS:
1829 m_aActions[OASIS_ANIMATION_ACTIONS].reset(
1830 new XMLTransformerActions( aAnimationActionTable ) );
1831 break;
1834 pActions = m_aActions[n].get();
1837 return pActions;
1840 OUString Oasis2OOoTransformer::GetEventName( const OUString& rName,
1841 bool bForm )
1843 if( bForm && !m_pFormEventMap )
1844 m_pFormEventMap =
1845 XMLEventOASISTransformerContext::CreateFormEventMap();
1846 if( !m_pEventMap )
1847 m_pEventMap = XMLEventOASISTransformerContext::CreateEventMap();
1849 OUString aMacroName;
1850 sal_uInt16 nPrefix =
1851 GetNamespaceMap().GetKeyByAttrName( rName, &aMacroName );
1852 return XMLEventOASISTransformerContext::GetEventName(
1853 nPrefix, aMacroName, *m_pEventMap,
1854 bForm ? m_pFormEventMap : nullptr );
1857 Oasis2OOoTransformer::Oasis2OOoTransformer() throw() :
1858 XMLTransformerBase( aActionTable, aTokenMap ),
1859 m_pEventMap( nullptr ),
1860 m_pFormEventMap( nullptr )
1862 GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE );
1863 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE_OOO), XML_NAMESPACE_OFFICE );
1865 GetNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META), XML_NAMESPACE_META );
1866 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META_OOO), XML_NAMESPACE_META );
1868 GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE );
1869 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE_OOO), XML_NAMESPACE_STYLE );
1871 GetNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER), XML_NAMESPACE_NUMBER );
1872 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER_OOO), XML_NAMESPACE_NUMBER );
1874 GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG );
1875 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG_OOO), XML_NAMESPACE_CONFIG );
1877 GetNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
1878 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT_OOO), XML_NAMESPACE_TEXT );
1880 GetNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE );
1881 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE_OOO), XML_NAMESPACE_TABLE );
1883 GetNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW );
1884 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW_OOO), XML_NAMESPACE_DRAW );
1886 GetNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D), XML_NAMESPACE_DR3D );
1887 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D_OOO), XML_NAMESPACE_DR3D );
1889 GetNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION), XML_NAMESPACE_PRESENTATION );
1890 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION_OOO), XML_NAMESPACE_PRESENTATION );
1892 GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART), XML_NAMESPACE_CHART );
1893 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART_OOO), XML_NAMESPACE_CHART );
1895 GetNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM );
1896 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM_OOO), XML_NAMESPACE_FORM );
1898 GetNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT), XML_NAMESPACE_SCRIPT );
1899 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT_OOO), XML_NAMESPACE_SCRIPT );
1901 GetNamespaceMap().Add( GetXMLToken(XML_NP_DLG), GetXMLToken(XML_N_DLG), XML_NAMESPACE_DLG );
1902 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DLG), GetXMLToken(XML_N_DLG), XML_NAMESPACE_DLG );
1904 GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO );
1905 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO), XML_NAMESPACE_FO );
1907 GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG_COMPAT), XML_NAMESPACE_SVG );
1908 GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG );
1910 for(auto & rp : m_aActions)
1911 rp.reset();
1914 Oasis2OOoTransformer::~Oasis2OOoTransformer() throw()
1916 for(auto & rp : m_aActions)
1917 rp.reset();
1918 XMLEventOASISTransformerContext::FlushEventMap( m_pEventMap );
1919 XMLEventOASISTransformerContext::FlushEventMap( m_pFormEventMap );
1922 namespace
1924 class theOasis2OOoTransformerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOasis2OOoTransformerUnoTunnelId> {};
1927 const css::uno::Sequence<sal_Int8>& Oasis2OOoTransformer::getUnoTunnelId() throw()
1929 return theOasis2OOoTransformerUnoTunnelId::get().getSeq();
1932 // XUnoTunnel
1933 sal_Int64 SAL_CALL Oasis2OOoTransformer::getSomething( const Sequence< sal_Int8 >& rId )
1935 if( isUnoTunnelId<Oasis2OOoTransformer>(rId) )
1937 return reinterpret_cast< sal_Int64 >( this );
1940 return sal_Int64(0);
1943 // XServiceInfo
1944 OUString SAL_CALL Oasis2OOoTransformer::getImplementationName()
1946 return Oasis2OOoTransformer_getImplementationName();
1949 sal_Bool SAL_CALL Oasis2OOoTransformer::supportsService( const OUString& ServiceName )
1951 return cppu::supportsService(this, ServiceName);
1954 Sequence< OUString > SAL_CALL Oasis2OOoTransformer::getSupportedServiceNames( )
1956 return { };
1959 // Service registration
1961 OUString Oasis2OOoTransformer_getImplementationName() throw()
1963 return "com.sun.star.comp.Oasis2OOoTransformer";
1966 Sequence< OUString > Oasis2OOoTransformer_getSupportedServiceNames()
1967 throw()
1969 return { Oasis2OOoTransformer_getImplementationName() };
1972 Reference< XInterface > Oasis2OOoTransformer_createInstance(
1973 const Reference< XMultiServiceFactory > &)
1975 SAL_INFO("xmloff.transform", "Creating Oasis2OOoTransformer");
1976 return static_cast<cppu::OWeakObject*>(new Oasis2OOoTransformer);
1979 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */