1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_xmloff.hxx"
26 #include <com/sun/star/beans/XPropertySetInfo.hpp>
27 #include <rtl/uuid.h>
28 #include <rtl/ustrbuf.hxx>
29 #include <xmloff/nmspmap.hxx>
30 #include "xmloff/xmlnmspe.hxx"
31 #include <xmloff/xmltoken.hxx>
32 #include "DeepTContext.hxx"
33 #include "MetaTContext.hxx"
34 #include "DocumentTContext.hxx"
35 #ifndef _XMLOFF_NOTESCONTEXT_HXX
36 #include "NotesTContext.hxx"
37 #endif
38 #include "StyleOASISTContext.hxx"
39 #include "FrameOASISTContext.hxx"
40 #include "EventOASISTContext.hxx"
41 #include "DlgOASISTContext.hxx"
42 #ifndef _XMLOFF_CONTROLOASISTCONTEXT_HXX
43 #include "ControlOASISTContext.hxx"
44 #endif
45 #include "FormPropOASISTContext.hxx"
46 #include "ChartOASISTContext.hxx"
47 #include "ChartPlotAreaOASISTContext.hxx"
48 #include "MutableAttrList.hxx"
49 #include "ElemTransformerAction.hxx"
50 #include "AttrTransformerAction.hxx"
51 #include "TransformerActions.hxx"
52 #include "FamilyType.hxx"
53 #include <xmloff/xmluconv.hxx>
54 #include "Oasis2OOo.hxx"
55 
56 using ::rtl::OUString;
57 using ::rtl::OUStringBuffer;
58 using namespace ::osl;
59 using namespace ::xmloff::token;
60 using namespace ::com::sun::star::uno;
61 using namespace ::com::sun::star::lang;
62 using namespace ::com::sun::star::xml::sax;
63 using namespace ::com::sun::star::beans;
64 
65 OUString SAL_CALL Oasis2OOoTransformer_getImplementationName() throw();
66 
67 enum XMLUserDefinedTransformerAction
68 {
69 	XML_ETACTION_META=XML_ETACTION_USER_DEFINED,
70 	XML_ETACTION_DOCUMENT,
71     XML_ETACTION_BODY,
72 	XML_ETACTION_NOTES,
73 	XML_ETACTION_TABLE,
74 	XML_ETACTION_STYLE,
75 	XML_ETACTION_STYLE_RENAME,
76 	XML_ETACTION_FRAME,
77 	XML_ETACTION_EVENT,
78 	XML_ETACTION_DLG,
79 	XML_ETACTION_TAB_STOP,
80 	XML_ETACTION_FORM_CONTROL,
81 	XML_ETACTION_FORM_PROPERTY,
82 	XML_ETACTION_CONFIG_ITEM,
83 	XML_ETACTION_TRACKED_CHANGES,
84 	XML_ETACTION_CHART,
85 	XML_ETACTION_CHART_PLOT_AREA
86 };
87 
88 #define ENTRY3( n, l, a, p1, p2, p3 ) \
89 	{ XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 }
90 #define ENTRY3QNQ( n, l, a, n1, l1, p2, n3, l3 ) \
91 	ENTRY3( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
92 			p2, XMLTransformerActionInit::QNameParam( n3, l3 ) )
93 
94 #define ENTRY2( n, l, a, p1, p2 ) \
95 	ENTRY3( n, l, a, p1, p2, 0 )
96 #define ENTRY2QQ( n, l, a, n1, l1, n2, l2 ) \
97 	ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
98 			XMLTransformerActionInit::QNameParam( n2, l2 ) )
99 #define ENTRY2QN( n, l, a, n1, l1, p2 ) \
100 	ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), p2 )
101 
102 #define ENTRY1( n, l, a, p1 ) \
103 	ENTRY3( n, l, a, p1, 0, 0 )
104 #define ENTRY1Q( n, l, a, p1, t1 ) \
105 	ENTRY1( n, l, a, XMLTransformerActionInit::QNameParam( p1, t1 ) )
106 
107 #define ENTRY0( n, l, a ) \
108 	ENTRY3( n, l, a, 0, 0, 0 )
109 
110 // BM: a macro to put two tokens into one sal_Int32 for the action
111 // XML_ATACTION_RENAME_ATTRIBUTE
112 #define RENAME_ENTRY( f, s ) \
113     (static_cast< sal_Int32 >(f) | (static_cast< sal_Int32 >(s) << 16))
114 
115 static XMLTransformerActionInit aActionTable[] =
116 {
117 	// add office:class from <office:document> and <office:document-content>
118 	ENTRY0( OFFICE, DOCUMENT, XML_ETACTION_DOCUMENT ),
119 	ENTRY0( OFFICE, DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ),
120 	ENTRY1Q( OOO, AUTO_TEXT_EVENTS, XML_ETACTION_RENAME_ELEM,
121 						  XML_NAMESPACE_OFFICE, XML_AUTO_TEXT_EVENTS),
122 
123 	// add <meta:keywords>
124 	ENTRY0( OFFICE, META, XML_ETACTION_META ),
125 
126     // rename <office:scripts> to <office:script>
127     ENTRY1Q( OFFICE, SCRIPTS, XML_ETACTION_RENAME_ELEM,
128                         XML_NAMESPACE_OFFICE, XML_SCRIPT ),
129 
130 	// rename <office:script> to <office:script-data> and process attributes
131     ENTRY2QN( OFFICE, SCRIPT, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
132                         XML_NAMESPACE_OFFICE, XML_SCRIPT_DATA,
133                         OASIS_SCRIPT_ACTIONS ),
134 
135     // rename <ooo:libraries> to <script:libraries>
136     ENTRY1Q( OOO, LIBRARIES, XML_ETACTION_RENAME_ELEM,
137                         XML_NAMESPACE_SCRIPT, XML_LIBRARIES ),
138 
139     // rename <ooo:library-linked> to <script:library-linked> and process attributes
140     ENTRY2QN( OOO, LIBRARY_LINKED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
141                         XML_NAMESPACE_SCRIPT, XML_LIBRARY_LINKED,
142                         OASIS_SCRIPT_ACTIONS ),
143 
144     // rename <ooo:library-embedded> to <script:library-embedded> and process attributes
145     ENTRY2QN( OOO, LIBRARY_EMBEDDED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
146                         XML_NAMESPACE_SCRIPT, XML_LIBRARY_EMBEDDED,
147                         OASIS_SCRIPT_ACTIONS ),
148 
149     // rename <ooo:module> to <script:module> and process attributes
150     ENTRY2QN( OOO, MODULE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
151                         XML_NAMESPACE_SCRIPT, XML_MODULE,
152                         OASIS_SCRIPT_ACTIONS ),
153 
154     // rename <ooo:source-code> to <script:source-code>
155     ENTRY1Q( OOO, SOURCE_CODE, XML_ETACTION_RENAME_ELEM,
156                         XML_NAMESPACE_SCRIPT, XML_SOURCE_CODE ),
157 
158 	ENTRY0( OFFICE, BODY, XML_ETACTION_BODY ),
159 
160 	// rename <office:font-face-decls> to <office:font-decl>,
161 	// rename <style:font-face> to <style:font-decl>, process attrs
162 	ENTRY1Q( OFFICE, FONT_FACE_DECLS, XML_ETACTION_RENAME_ELEM,
163 						XML_NAMESPACE_OFFICE, XML_FONT_DECLS ),
164 	ENTRY2QN( STYLE, FONT_FACE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
165 						XML_NAMESPACE_STYLE, XML_FONT_DECL,
166 		   				OASIS_FONT_FACE_ACTIONS ),
167 
168 	// remove genre element
169 	ENTRY0( OFFICE, TEXT, XML_ETACTION_COPY_CONTENT ),
170 	ENTRY0( OFFICE, DRAWING, XML_ETACTION_COPY_CONTENT ),
171 	ENTRY0( OFFICE, PRESENTATION, XML_ETACTION_COPY_CONTENT ),
172 	ENTRY0( OFFICE, SPREADSHEET, XML_ETACTION_COPY_CONTENT ),
173 	ENTRY0( OFFICE, CHART, XML_ETACTION_COPY_CONTENT ),
174 	ENTRY0( OFFICE, IMAGE, XML_ETACTION_COPY_CONTENT ),
175 
176 	// rename <style:page-layout> to <style:page-master>
177 	// ENTRY1Q( STYLE, PAGE_LAYOUT, RENAME_ELEM,
178 	//						XML_NAMESPACE_STYLE, XML_PAGE_MASTER ),
179 	ENTRY1( STYLE, MASTER_PAGE, XML_ETACTION_PROC_ATTRS,
180 						OASIS_MASTER_PAGE_ACTIONS ),
181 
182 	// merge <style:*-properties> into <style:properties> and do other
183 	// styles processing
184 	ENTRY1( STYLE, STYLE, XML_ETACTION_STYLE,
185 		 		XML_FAMILY_TYPE_END ),
186 	ENTRY1( STYLE, DEFAULT_STYLE, XML_ETACTION_STYLE,
187 		 		XML_FAMILY_TYPE_END ),
188 	ENTRY2QN( STYLE, PAGE_LAYOUT, XML_ETACTION_STYLE_RENAME,
189 						XML_NAMESPACE_STYLE, XML_PAGE_MASTER,
190 		  				XML_FAMILY_TYPE_PAGE_LAYOUT ),
191 	ENTRY1( NUMBER, NUMBER_STYLE, XML_ETACTION_STYLE,
192 		 		XML_FAMILY_TYPE_DATA ),
193 	ENTRY1( NUMBER, CURRENCY_STYLE, XML_ETACTION_STYLE,
194 		 		XML_FAMILY_TYPE_DATA ),
195 	ENTRY1( NUMBER, PERCENTAGE_STYLE, XML_ETACTION_STYLE,
196 		 		XML_FAMILY_TYPE_DATA ),
197 	ENTRY1( NUMBER, DATE_STYLE, XML_ETACTION_STYLE,
198 		 		XML_FAMILY_TYPE_DATA ),
199 	ENTRY1( NUMBER, TIME_STYLE, XML_ETACTION_STYLE,
200 		 		XML_FAMILY_TYPE_DATA ),
201 	ENTRY1( NUMBER, BOOLEAN_STYLE, XML_ETACTION_STYLE,
202 		 		XML_FAMILY_TYPE_DATA ),
203 	ENTRY1( NUMBER, TEXT_STYLE, XML_ETACTION_STYLE,
204 		 		XML_FAMILY_TYPE_DATA ),
205 	ENTRY1( TEXT, LIST_STYLE, XML_ETACTION_STYLE,
206 		 		XML_FAMILY_TYPE_LIST ),
207 //	ENTRY0( TEXT, OUTLINE_STYLE, STYLE ),
208 
209 	ENTRY1( STYLE, HEADER_STYLE, XML_ETACTION_STYLE,
210 		 		XML_FAMILY_TYPE_HEADER_FOOTER ),
211 	ENTRY1( STYLE, FOOTER_STYLE, XML_ETACTION_STYLE,
212 		 		XML_FAMILY_TYPE_HEADER_FOOTER ),
213 	ENTRY1( TEXT, LIST_LEVEL_STYLE_NUMBER, XML_ETACTION_STYLE,
214 		 		XML_FAMILY_TYPE_LIST ),
215 	ENTRY1( TEXT, LIST_LEVEL_STYLE_BULLET, XML_ETACTION_STYLE,
216 		 		XML_FAMILY_TYPE_LIST ),
217 	ENTRY1( TEXT, LIST_LEVEL_STYLE_IMAGE, XML_ETACTION_STYLE,
218 		 		XML_FAMILY_TYPE_LIST ),
219 	ENTRY1( TEXT, OUTLINE_LEVEL_STYLE, XML_ETACTION_STYLE,
220 		 		XML_FAMILY_TYPE_LIST ),
221 	ENTRY1( DRAW, GRADIENT, XML_ETACTION_STYLE,
222 		 		XML_FAMILY_TYPE_GRADIENT ),
223 	ENTRY1( DRAW, FILL_IMAGE, XML_ETACTION_STYLE,
224 		 		XML_FAMILY_TYPE_FILL_IMAGE ),
225 	ENTRY2QN( DRAW, OPACITY, XML_ETACTION_STYLE_RENAME,
226 				XML_NAMESPACE_DRAW, XML_TRANSPARENCY,
227 		 		XML_FAMILY_TYPE_GRADIENT ),
228 	ENTRY1( DRAW, MARKER, XML_ETACTION_STYLE,
229 		 		XML_FAMILY_TYPE_MARKER ),
230 	ENTRY1( DRAW, HATCH, XML_ETACTION_STYLE,
231 		 		XML_FAMILY_TYPE_HATCH ),
232 	ENTRY1( DRAW, STROKE_DASH, XML_ETACTION_STYLE,
233 		 		XML_FAMILY_TYPE_STROKE_DASH ),
234 
235 	// process <text:h/p>: process style-name attributes,
236 	// rename <text:h>'s text:outline-level to text:level,
237 	ENTRY1( TEXT, H, XML_ETACTION_PROC_ATTRS, OASIS_PARA_ACTIONS ),
238 	ENTRY1( TEXT, P, XML_ETACTION_PROC_ATTRS, OASIS_PARA_ACTIONS ),
239 
240 	// process <test:list>'s text:style-name attributes
241 	// rename <text:list> to <text:ordered-list> or <text:unordered-list>
242 	// TODO: All list currenty are renamed to <text:ordered-list>
243 	ENTRY2QN( TEXT, LIST, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
244 			XML_NAMESPACE_TEXT, XML_ORDERED_LIST,
245 		    OASIS_LIST_STYLE_REF_ACTIONS ),
246 
247 	// rename <text:note*> to <text:footnote*> or <text:endnote*>
248 	ENTRY1( TEXT, NOTES_CONFIGURATION, XML_ETACTION_NOTES,
249 													XML_NOTES_CONFIGURATION),
250 	ENTRY1( TEXT, NOTE, XML_ETACTION_NOTES, XML_NOTE ),
251 
252 	// rename <text:footnote> and <text:endnote> to <text:note>
253 	ENTRY1( TEXT, NOTE_REF, XML_ETACTION_NOTES, XML_NOTE_REF ),
254 
255 	// rename <text:tab> to <text:tab-stop>
256 	ENTRY1Q( TEXT, TAB, XML_ETACTION_RENAME_ELEM,
257 						XML_NAMESPACE_TEXT, XML_TAB_STOP ),
258 
259 
260 	// replace <table:table tabke:is-sub-table> with <table:sub-table>
261 	ENTRY0( TABLE, TABLE, XML_ETACTION_TABLE ),
262 
263 	// merge frame element
264 	ENTRY0( DRAW, FRAME, XML_ETACTION_FRAME ),
265 
266 	// process events
267 	ENTRY1Q( OFFICE, EVENT_LISTENERS, XML_ETACTION_RENAME_ELEM,
268 		  			XML_NAMESPACE_OFFICE, XML_EVENTS ),
269 	ENTRY0( SCRIPT, EVENT_LISTENER, XML_ETACTION_EVENT ),
270 	ENTRY0( SCRIPT, EVENT, XML_ETACTION_EVENT ),
271 	ENTRY0( PRESENTATION, EVENT_LISTENER, XML_ETACTION_EVENT ),
272 
273 	// process Basic dialogs
274 	ENTRY0( DLG, STYLE, XML_ETACTION_DLG ),
275 
276 	// process length attributes
277 	ENTRY1( DRAW, RECT, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
278 	ENTRY1( DRAW, LINE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
279 	ENTRY1( DRAW, POLYLINE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
280 	ENTRY1( DRAW, POLYGON, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
281 	ENTRY1( DRAW, PATH, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
282 	ENTRY1( DRAW, CIRCLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
283 	ENTRY1( DRAW, ELLIPSE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
284 	ENTRY1( DRAW, CONNECTOR, XML_ETACTION_PROC_ATTRS, OASIS_CONNECTOR_ACTIONS ),
285 	ENTRY1( DRAW, CAPTION, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
286 	ENTRY1( DRAW, MEASURE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
287 	ENTRY1( DRAW, CONTROL, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
288 	ENTRY1( DRAW, PAGE_THUMBNAIL, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
289 	ENTRY1( DRAW, G, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
290 //	ENTRY1( DRAW, FRAME, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
291 	ENTRY1( DRAW, TEXT_BOX, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
292 	ENTRY1( PRESENTATION, PLACEHOLDER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
293 	ENTRY1( DRAW, CONTOUR_POLYGON, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
294 	ENTRY1( DRAW, CONTOUR_PATH, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
295 	ENTRY1( DRAW, AREA_RECTANGLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
296 	ENTRY1( DRAW, AREA_CIRCLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
297 	ENTRY1( DRAW, AREA_POLYGON, XML_ETACTION_PROC_ATTRS, OASIS_DRAW_AREA_POLYGON_ACTIONS ),
298 	ENTRY1( DRAW, GLUE_POINT, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
299 	ENTRY1( DR3D, SCENE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
300 	ENTRY1( DR3D, CUBE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
301 	ENTRY1( DR3D, SPHERE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
302 	ENTRY1( DR3D, EXTRUDE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
303 	ENTRY1( DR3D, ROTATE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
304 	ENTRY1( CHART, TITLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
305 	ENTRY1( CHART, SUBTITLE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
306 	ENTRY1( CHART, FOOTER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
307 	ENTRY1( CHART, LEGEND, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
308 	ENTRY1( CHART, WALL, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
309 	ENTRY1( CHART, FLOOR, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
310 	ENTRY1( CHART, AXIS, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
311 	ENTRY1( CHART, GRID, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
312 	ENTRY1( CHART, SERIES, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
313 	ENTRY1( CHART, DATA_POINT, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
314 	ENTRY1( CHART, MEAN_VALUE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
315 	ENTRY1( CHART, ERROR_INDICATOR, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
316 	ENTRY1( CHART, REGRESSION_CURVE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
317 	ENTRY1( CHART, STOCK_GAIN_MARKER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
318 	ENTRY1( CHART, STOCK_LOSS_MARKER, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
319 	ENTRY1( CHART, STOCK_RANGE_LINE, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
320 
321 	ENTRY0( CHART, CHART, XML_ETACTION_CHART ),
322     ENTRY0( CHART, PLOT_AREA, XML_ETACTION_CHART_PLOT_AREA ),
323 
324 	ENTRY0( CONFIG, CONFIG_ITEM, XML_ETACTION_CONFIG_ITEM ),
325 	ENTRY1Q( TEXT, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
326 						XML_NAMESPACE_TEXT, XML_PROTECTION_KEY ),
327 	ENTRY1Q( TABLE, TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
328 						XML_NAMESPACE_TABLE, XML_PROTECTION_KEY ),
329 
330 	ENTRY1( TEXT, INDEX_ENTRY_TAB_STOP, XML_ETACTION_PROC_ATTRS,
331 				  OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS ),
332 	ENTRY0( STYLE, TAB_STOP, XML_ETACTION_TAB_STOP ),
333 	ENTRY1( STYLE, BACKGROUND_IMAGE, XML_ETACTION_PROC_ATTRS,
334 		 			OASIS_BACKGROUND_IMAGE_ACTIONS  ),
335 	ENTRY1( TEXT, LINENUMBERING_CONFIGURATION, XML_ETACTION_PROC_ATTRS,
336 				  OASIS_LINENUMBERING_ACTIONS ),
337 	ENTRY1( STYLE, FOOTNOTE_SEP, XML_ETACTION_PROC_ATTRS,
338 				   OASIS_FOOTNOTE_SEP_ACTIONS ),
339 	ENTRY1( STYLE, DROP_CAP, XML_ETACTION_PROC_ATTRS, OASIS_DROP_CAP_ACTIONS ),
340 	ENTRY1( STYLE, COLUMNS, XML_ETACTION_PROC_ATTRS, OASIS_COLUMNS_ACTIONS ),
341 	ENTRY1( STYLE, COLUMN, XML_ETACTION_PROC_ATTRS, OASIS_COLUMNS_ACTIONS ),
342 
343 	// process *:style-name attributes
344 	ENTRY1( STYLE, MAP, XML_ETACTION_PROC_ATTRS, OASIS_MAP_STYLE_REF_ACTIONS ),
345 	ENTRY1( TEXT, SPAN, XML_ETACTION_PROC_ATTRS, OASIS_TEXT_STYLE_REF_ACTIONS ),
346 	ENTRY1( TEXT, A, XML_ETACTION_PROC_ATTRS, OASIS_TEXT_STYLE_REF_ACTIONS ),
347 	ENTRY1( TEXT, RUBY_TEXT, XML_ETACTION_PROC_ATTRS,
348 				OASIS_TEXT_STYLE_REF_ACTIONS ),
349 	ENTRY1( TEXT, TABLE_OF_CONTENT_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
350 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
351 	ENTRY1( TEXT, ILLUSTRATION_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
352 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
353 	ENTRY1( TEXT, TABLE_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
354 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
355 	ENTRY1( TEXT, OBJECT_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
356 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
357 	ENTRY1( TEXT, USER_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
358 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
359 	ENTRY1( TEXT, ALPHABETICAL_INDEX_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
360 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
361 	ENTRY1( TEXT, BIBLIOGRAPHY_ENTRY_TEMPLATE, XML_ETACTION_PROC_ATTRS,
362 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
363 	ENTRY1( TEXT, INDEX_SOURCE_STYLE, XML_ETACTION_PROC_ATTRS,
364 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
365 	ENTRY1( TEXT, INDEX_TITLE_TEMPLATE, XML_ETACTION_PROC_ATTRS,
366 				OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
367 	ENTRY3QNQ( TEXT, INDEX_ENTRY_CHAPTER,
368 			XML_ETACTION_RENAME_ELEM_PROC_ATTRS_COND,
369 			XML_NAMESPACE_TEXT, XML_INDEX_ENTRY_CHAPTER_NUMBER,
370 			OASIS_TEXT_STYLE_REF_ACTIONS ,
371 		   	XML_NAMESPACE_TEXT, XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE),
372 	ENTRY1( TEXT, INDEX_ENTRY_TEXT, XML_ETACTION_PROC_ATTRS,
373 				OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
374 	ENTRY1( TEXT, INDEX_ENTRY_PAGE_NUMBER, XML_ETACTION_PROC_ATTRS,
375 				OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
376 	ENTRY1( TEXT, INDEX_ENTRY_SPAN, XML_ETACTION_PROC_ATTRS,
377 				OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
378 	ENTRY1( TEXT, INDEX_ENTRY_BIBLIOGRAPHY, XML_ETACTION_PROC_ATTRS,
379 				OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
380 	ENTRY1( TEXT, INDEX_ENTRY_LINK_START, XML_ETACTION_PROC_ATTRS,
381 				OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
382 	ENTRY1( TEXT, INDEX_ENTRY_LINK_END, XML_ETACTION_PROC_ATTRS,
383 				OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
384 	ENTRY1( DRAW, PAGE, XML_ETACTION_PROC_ATTRS,
385 				OASIS_MASTER_PAGE_REF_ACTIONS ), /* generated entry */
386     // --> OD 2005-01-10 #i40011#, #i40015#
387     // - conversion of attribute <table:style-name> for <table:table-row> and
388     //   <table:table-column>
389     ENTRY1( TABLE, TABLE_ROW, XML_ETACTION_PROC_ATTRS,
390                 OASIS_TABLE_STYLE_REF_ACTIONS ),
391     ENTRY1( TABLE, TABLE_COLUMN, XML_ETACTION_PROC_ATTRS,
392                 OASIS_TABLE_STYLE_REF_ACTIONS ),
393     // <--
394 
395 	// rename office:value-* to *:value-*
396 	ENTRY1( TEXT, VARIABLE_DECL, XML_ETACTION_PROC_ATTRS,
397 			OASIS_TEXT_VALUE_TYPE_ACTIONS ), /* generated entry */
398 	ENTRY1( TEXT, VARIABLE_SET, XML_ETACTION_PROC_ATTRS,
399 			OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
400 	ENTRY1( TEXT, VARIABLE_INPUT, XML_ETACTION_PROC_ATTRS,
401 			OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
402 	ENTRY1( TEXT, USER_FIELD_DECL, XML_ETACTION_PROC_ATTRS,
403 			OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
404 	ENTRY1( TEXT, EXPRESSION, XML_ETACTION_PROC_ATTRS,
405 			OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
406     ENTRY1( TEXT, USER_DEFINED, XML_ETACTION_PROC_ATTRS,
407 			OASIS_DATETIME_ACTIONS ), // Add OASIS_TEXT_VALUE_TYPE_ACTIONS if attrs are added to text:user-defined
408 	ENTRY1( TABLE, TABLE_CELL, XML_ETACTION_PROC_ATTRS,
409 			OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
410 	ENTRY1( TABLE, COVERED_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
411 			OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
412 	ENTRY1( TABLE, CHANGE_TRACK_TABLE_CELL, XML_ETACTION_PROC_ATTRS,
413 			OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
414 //	ENTRY1( FORM, PROPERTY, XML_ETACTION_PROC_ATTRS,
415 //			OASIS_VALUE_TYPE_ACTIONS), /* TODO: generated entry */
416 //	ENTRY1( FORM, LIST_PROPERTY, XML_ETACTION_PROC_ATTRS,
417 //			OASIS_VALUE_TYPE_ACTIONS), /* generated entry */
418 
419 	ENTRY1( OFFICE, ANNOTATION, XML_ETACTION_MOVE_ELEMS_TO_ATTRS,
420 			OASIS_ANNOTATION_ACTIONS ), /* generated entry */
421 	ENTRY1( OFFICE, CHANGE_INFO, XML_ETACTION_MOVE_ELEMS_TO_ATTRS,
422 			OASIS_CHANGE_INFO_ACTIONS ), /* generated entry */
423 
424 	ENTRY1( TEXT, DDE_CONNECTION_DECL, XML_ETACTION_PROC_ATTRS,
425 		 			OASIS_DDE_CONNECTION_DECL_ACTIONS  ),
426 
427 	ENTRY0( FORM, TEXT, XML_ETACTION_FORM_CONTROL ),
428 	ENTRY0( FORM, TEXTAREA, XML_ETACTION_FORM_CONTROL ),
429 	ENTRY0( FORM, FIXED_TEXT, XML_ETACTION_FORM_CONTROL ),
430 	ENTRY0( FORM, FILE, XML_ETACTION_FORM_CONTROL ),
431 	ENTRY0( FORM, PASSWORD, XML_ETACTION_FORM_CONTROL ),
432 	ENTRY0( FORM, FORMATTED_TEXT, XML_ETACTION_FORM_CONTROL ),
433 	ENTRY0( FORM, BUTTON, XML_ETACTION_FORM_CONTROL ),
434 	ENTRY0( FORM, IMAGE, XML_ETACTION_FORM_CONTROL ),
435 	ENTRY0( FORM, CHECKBOX, XML_ETACTION_FORM_CONTROL ),
436 	ENTRY0( FORM, RADIO, XML_ETACTION_FORM_CONTROL ),
437 	ENTRY0( FORM, LISTBOX, XML_ETACTION_FORM_CONTROL ),
438 	ENTRY0( FORM, COMBOBOX, XML_ETACTION_FORM_CONTROL ),
439 	ENTRY0( FORM, FRAME, XML_ETACTION_FORM_CONTROL ),
440 	ENTRY0( FORM, HIDDEN, XML_ETACTION_FORM_CONTROL ),
441 	ENTRY0( FORM, IMAGE_FRAME, XML_ETACTION_FORM_CONTROL ),
442 	ENTRY0( FORM, GRID, XML_ETACTION_FORM_CONTROL ),
443 	ENTRY0( FORM, VALUE_RANGE, XML_ETACTION_FORM_CONTROL ),
444 	ENTRY0( FORM, GENERIC_CONTROL, XML_ETACTION_FORM_CONTROL ),
445 	ENTRY1( FORM, COLUMN, XML_ETACTION_PROC_ATTRS,
446 		 			OASIS_FORM_COLUMN_ACTIONS  ),
447 	ENTRY1( FORM, PROPERTY, XML_ETACTION_FORM_PROPERTY, XML_PROPERTY ),
448 	ENTRY1( FORM, LIST_PROPERTY, XML_ETACTION_FORM_PROPERTY,
449 					XML_LIST_PROPERTY ),
450 	ENTRY1( FORM, LIST_VALUE, XML_ETACTION_FORM_PROPERTY, XML_LIST_VALUE ),
451 
452 	// process xlink:href
453 	ENTRY1( META, TEMPLATE, XML_ETACTION_PROC_ATTRS,
454 		OASIS_XLINK_ACTIONS ), /* generated entry */
455 	ENTRY1( META, AUTO_RELOAD, XML_ETACTION_PROC_ATTRS,
456 		OASIS_XLINK_ACTIONS ), /* generated entry */
457 	ENTRY1( TEXT, SECTION_SOURCE, XML_ETACTION_PROC_ATTRS,
458 		OASIS_XLINK_ACTIONS ), /* generated entry */
459 	ENTRY1( TEXT, SCRIPT, XML_ETACTION_PROC_ATTRS,
460 		OASIS_XLINK_ACTIONS ), /* generated entry */
461 	ENTRY1( TEXT, ALPHABETICAL_INDEX_AUTO_MARK_FILE, XML_ETACTION_PROC_ATTRS,
462 		OASIS_XLINK_ACTIONS ), /* generated entry */
463 	ENTRY1( TABLE, TABLE_SOURCE, XML_ETACTION_PROC_ATTRS,
464 		OASIS_XLINK_ACTIONS ), /* generated entry */
465 	ENTRY1( TABLE, CELL_RANGE_SOURCE, XML_ETACTION_PROC_ATTRS,
466 		OASIS_XLINK_ACTIONS ), /* generated entry */
467 	ENTRY1( DRAW, A, XML_ETACTION_PROC_ATTRS,
468 		OASIS_XLINK_ACTIONS ), /* generated entry */
469 	ENTRY1( PRESENTATION, SOUND, XML_ETACTION_PROC_ATTRS,
470 		OASIS_XLINK_ACTIONS ), /* generated entry */
471 	ENTRY1( FORM, FORM, XML_ETACTION_PROC_ATTRS,
472 		OASIS_FORM_ACTIONS ), /* generated entry */
473 //	ENTRY1( SVG, FONT_FACE_URI, XML_ETACTION_PROC_ATTRS,
474 //		OASIS_XLINK_ACTIONS ), /* generated entry */
475 //	ENTRY1( SVG, DEFINITION_SRC, XML_ETACTION_PROC_ATTRS,
476 //		OASIS_XLINK_ACTIONS ), /* generated entry */
477 	ENTRY2QN( CHART, SYMBOL_IMAGE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
478               XML_NAMESPACE_STYLE, XML_SYMBOL_IMAGE,
479               OASIS_BACKGROUND_IMAGE_ACTIONS ),
480 //		OASIS_XLINK_ACTIONS ), /* generated entry */
481 //  events don't have real URIs
482 //	ENTRY1( PRESENTATION, EVENT_LISTENER, XML_ETACTION_PROC_ATTRS,
483 //		OASIS_XLINK_ACTIONS ), /* generated entry */
484 //	ENTRY1( SCRIPT, EVENT_LISTENER, XML_ETACTION_PROC_ATTRS,
485 //		OASIS_XLINK_ACTIONS ), /* generated entry */
486 
487 	// add namespace prefix to name
488 	ENTRY1( CONFIG, CONFIG_ITEM_SET, XML_ETACTION_PROC_ATTRS,
489 		OASIS_CONFIG_ITEM_SET_ACTIONS ),
490 
491 	// add namespace prefix to formula and condition
492 	//  text:condition
493 	ENTRY1( TEXT, SECTION, XML_ETACTION_PROC_ATTRS,
494 		OASIS_FORMULA_ACTIONS ), /* generated entry */
495 	//  text:formula
496 	ENTRY1( TEXT, SEQUENCE, XML_ETACTION_PROC_ATTRS,
497 		OASIS_FORMULA_ACTIONS ), /* generated entry */
498 	//  text:condition
499 	ENTRY1( TEXT, DATABASE_NEXT, XML_ETACTION_PROC_ATTRS,
500 		OASIS_FORMULA_ACTIONS ), /* generated entry */
501 	//  text:condition
502 	ENTRY2QN( TEXT, DATABASE_ROW_SELECT, XML_ETACTION_RENAME_ELEM_PROC_ATTRS,
503 		XML_NAMESPACE_TEXT, XML_DATABASE_SELECT,
504 		OASIS_FORMULA_ACTIONS ), /* generated entry */
505 	//  text:condition
506 	ENTRY1( TEXT, CONDITIONAL_TEXT, XML_ETACTION_PROC_ATTRS,
507 		OASIS_FORMULA_ACTIONS ), /* generated entry */
508 	//  text:condition
509 	ENTRY1( TEXT, HIDDEN_TEXT, XML_ETACTION_PROC_ATTRS,
510 		OASIS_FORMULA_ACTIONS ), /* generated entry */
511 	//  text:condition
512 	ENTRY1( TEXT, HIDDEN_PARAGRAPH, XML_ETACTION_PROC_ATTRS,
513 		OASIS_FORMULA_ACTIONS ), /* generated entry */
514 	//  text:formula
515 	ENTRY1( TEXT, TABLE_FORMULA, XML_ETACTION_PROC_ATTRS,
516 		OASIS_FORMULA_ACTIONS ), /* generated entry */
517 
518     //  process table::content-validation
519 	ENTRY1( TABLE, CONTENT_VALIDATION, XML_ETACTION_PROC_ATTRS,
520 		OASIS_CONTENT_VALIDATION_ACTIONS ),
521 
522 	// rename <table:dependencies> to <table:dependences>
523 	ENTRY1Q( TABLE, DEPENDENCIES, XML_ETACTION_RENAME_ELEM,
524 						XML_NAMESPACE_TABLE, XML_DEPENDENCES ),
525     ENTRY1Q( TABLE, DEPENDENCY, XML_ETACTION_RENAME_ELEM,
526                         XML_NAMESPACE_TABLE, XML_DEPENDENCE ),
527 
528     // process table::conversion-mode
529 	ENTRY1( TABLE, CONVERSION_MODE, XML_ETACTION_PROC_ATTRS,
530 			OASIS_DDE_CONV_MODE_ACTIONS ),
531 
532     // process table::data-pilot-member
533 	ENTRY1( TABLE, DATA_PILOT_MEMBER, XML_ETACTION_PROC_ATTRS,
534 			OASIS_DATAPILOT_MEMBER_ACTIONS ),
535 
536     // process table::data-pilot-level
537 	ENTRY1( TABLE, DATA_PILOT_LEVEL, XML_ETACTION_PROC_ATTRS,
538 			OASIS_DATAPILOT_LEVEL_ACTIONS ),
539 
540     // process table::source-service
541 	ENTRY1( TABLE, SOURCE_SERVICE, XML_ETACTION_PROC_ATTRS,
542 			OASIS_SOURCE_SERVICE_ACTIONS ),
543 
544     // entries for date time change (#i36576#)
545     ENTRY1( TEXT, DATE, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
546     ENTRY1( TEXT, CREATION_DATE, XML_ETACTION_PROC_ATTRS,
547 					OASIS_DATETIME_ACTIONS ),
548     ENTRY1( TEXT, TIME, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
549     ENTRY1( TEXT, CREATION_TIME, XML_ETACTION_PROC_ATTRS,
550 					OASIS_DATETIME_ACTIONS ),
551     ENTRY1( TEXT, PRINT_TIME, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
552     ENTRY1( TEXT, MODIFICATION_TIME, XML_ETACTION_PROC_ATTRS,
553 					OASIS_DATETIME_ACTIONS ),
554     ENTRY1( TEXT, EDITING_DURATION, XML_ETACTION_PROC_ATTRS,
555 					OASIS_DATETIME_ACTIONS ),
556     ENTRY1( FORM, TIME, XML_ETACTION_PROC_ATTRS, OASIS_DATETIME_ACTIONS ),
557     ENTRY1( PRESENTATION, SETTINGS, XML_ETACTION_PROC_ATTRS,
558 					OASIS_DATETIME_ACTIONS ),
559 
560     // fix <text:alphabatical-index-mark text:main-etry>
561 	ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK, XML_ETACTION_PROC_ATTRS,
562             OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS ),
563 	ENTRY1( TEXT, ALPHABETICAL_INDEX_MARK_START, XML_ETACTION_PROC_ATTRS,
564             OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS ),
565 
566 	// fix id strings in old animation elements
567 	ENTRY1( PRESENTATION, DIM, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
568 	ENTRY1( PRESENTATION, PLAY, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
569 	ENTRY1( PRESENTATION, SHOW_TEXT, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
570 	ENTRY1( PRESENTATION, SHOW_SHAPE, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
571 	ENTRY1( PRESENTATION, HIDE_TEXT, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
572 	ENTRY1( PRESENTATION, HIDE_SHAPE, XML_ETACTION_PROC_ATTRS, OASIS_ANIMATION_ACTIONS ),
573 
574 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
575 };
576 
577 // XML_ETACTION_STYLE
578 static XMLTransformerActionInit aStyleActionTable[] =
579 {
580 	ENTRY0( STYLE, FAMILY, XML_ATACTION_STYLE_FAMILY ),
581 	ENTRY1( STYLE, NAME, XML_ATACTION_DECODE_STYLE_NAME,
582 		 		XML_FAMILY_TYPE_END ),
583 	ENTRY1( STYLE, DISPLAY_NAME, XML_ATACTION_STYLE_DISPLAY_NAME,
584 		 		XML_FAMILY_TYPE_END ),
585 	ENTRY1( STYLE, PARENT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
586 		 		XML_FAMILY_TYPE_END ),
587 	ENTRY1( STYLE, NEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
588 		 		XML_FAMILY_TYPE_END ),
589 	ENTRY1( STYLE, LIST_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
590 		 		XML_FAMILY_TYPE_LIST ),
591 	ENTRY1( STYLE, MASTER_PAGE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
592 		 		XML_FAMILY_TYPE_MASTER_PAGE ),
593 	ENTRY0( STYLE, DEFAULT_OUTLINE_LEVEL, XML_ATACTION_REMOVE ),
594 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
595 		 		XML_FAMILY_TYPE_TEXT ),	// list level styles
596 	ENTRY1( DRAW, NAME, XML_ATACTION_DECODE_STYLE_NAME,
597 		 		XML_FAMILY_TYPE_END ),
598 	ENTRY1( DRAW, DISPLAY_NAME, XML_ATACTION_STYLE_DISPLAY_NAME,
599 		 		XML_FAMILY_TYPE_END ),
600 	ENTRY0( DRAW, DISTANCE, XML_ATACTION_IN2INCH ),
601 	ENTRY0( DRAW, DOTS1_LENGTH, XML_ATACTION_IN2INCH ),
602 	ENTRY0( DRAW, DOTS2_LENGTH, XML_ATACTION_IN2INCH ),
603 	ENTRY0( SVG, WIDTH, XML_ATACTION_IN2INCH ),
604 	ENTRY0( SVG, HEIGHT, XML_ATACTION_IN2INCH ),
605 	ENTRY0( DRAW, START, XML_ATACTION_NEG_PERCENT ),
606 	ENTRY0( DRAW, END, XML_ATACTION_NEG_PERCENT ),
607 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_True ),
608 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
609 };
610 
611 // OASIS_FRAME_ELEM_ACTIONS
612 static XMLTransformerActionInit aFrameActionTable[] =
613 {
614 	ENTRY0( DRAW, TEXT_BOX, XML_ETACTION_COPY ),
615 	ENTRY0( DRAW, IMAGE, XML_ETACTION_COPY ),
616 	ENTRY0( DRAW, OBJECT, XML_ETACTION_COPY ),
617 	ENTRY0( DRAW, OBJECT_OLE, XML_ETACTION_COPY ),
618 	ENTRY0( DRAW, APPLET, XML_ETACTION_COPY ),
619 	ENTRY0( DRAW, PLUGIN, XML_ETACTION_COPY ),
620 	ENTRY0( DRAW, FLOATING_FRAME, XML_ETACTION_COPY ),
621 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
622 };
623 
624 // OASIS_EVENT_ELEM_ACTIONS
625 static XMLTransformerActionInit aEventActionTable[] =
626 {
627 	ENTRY0( XLINK, HREF, XML_ATACTION_HREF ),
628 	ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_REMOVE_NAMESPACE_PREFIX,
629 					XML_NAMESPACE_OOO ),
630 	ENTRY0( SCRIPT, EVENT_NAME, XML_ATACTION_EVENT_NAME ),
631 	ENTRY0( SCRIPT, MACRO_NAME, XML_ATACTION_MACRO_NAME ),
632 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
633 };
634 
635 // OASIS_EVENT_ELEM_ACTIONS
636 static XMLTransformerActionInit aDlgActionTable[] =
637 {
638 	ENTRY0( DLG, BORDER, XML_ATACTION_DLG_BORDER )
639 };
640 
641 // action table for OASIS_MASTER_PAGE_ACTIONS
642 static XMLTransformerActionInit aMasterPageActionTable[] =
643 {
644 	ENTRY1( STYLE, NAME, XML_ATACTION_DECODE_STYLE_NAME,
645 		 		XML_FAMILY_TYPE_MASTER_PAGE ),
646 	ENTRY1( STYLE, DISPLAY_NAME, XML_ATACTION_STYLE_DISPLAY_NAME,
647 		 		XML_FAMILY_TYPE_MASTER_PAGE ),
648 	ENTRY1( STYLE, NEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
649 		 		XML_FAMILY_TYPE_MASTER_PAGE ),
650 	ENTRY1Q( STYLE, PAGE_LAYOUT_NAME, XML_ATACTION_RENAME,
651 						XML_NAMESPACE_STYLE, XML_PAGE_MASTER_NAME ),
652 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
653 };
654 
655 // action table for OASIS_TEXT_STYLE_REF_ACTIONS
656 static XMLTransformerActionInit aTextStyleRefActionTable[] =
657 {
658 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
659 				XML_FAMILY_TYPE_TEXT ),
660 	ENTRY1( TEXT, VISITED_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
661 		  		XML_FAMILY_TYPE_TEXT ),
662 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_False ),
663 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
664 };
665 
666 // action table for OASIS_PARA_STYLE_REF_ACTIONS
667 static XMLTransformerActionInit aParaStyleRefActionTable[] =
668 {
669 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
670 				XML_FAMILY_TYPE_PARAGRAPH ),
671 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
672 };
673 
674 
675 // action table for OASIS_LIST_STYLE_REF_ACTIONS
676 static XMLTransformerActionInit aListStyleRefActionTable[] =
677 {
678 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
679 				XML_FAMILY_TYPE_LIST ),
680 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
681 };
682 
683 // action table for OASIS_MASTER_PAGE_REF_ACTIONS
684 static XMLTransformerActionInit aMasterPageRefActionTable[] =
685 {
686 	ENTRY1( DRAW, MASTER_PAGE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
687 				XML_FAMILY_TYPE_MASTER_PAGE ),
688 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
689 };
690 
691 // action table for OASIS_MAP_STYLE_REF_ACTIONS
692 static XMLTransformerActionInit aMapStyleRefActionTable[] =
693 {
694 	ENTRY1( STYLE, APPLY_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
695 				XML_FAMILY_TYPE_END ),
696 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
697 };
698 
699 // --> OD 2005-01-10 #i40011#, #i40015#
700 // action table for OASIS_TABLE_STYLE_REF_ACTIONS
701 static XMLTransformerActionInit aTableStyleRefActionTable[] =
702 {
703     ENTRY1( TABLE, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
704                 XML_FAMILY_TYPE_END ),
705     ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
706 };
707 // <--
708 
709 
710 static XMLTransformerActionInit aFontFaceActionTable[] =
711 {
712 	ENTRY1Q( SVG, FONT_FAMILY, XML_ATACTION_RENAME,
713 						XML_NAMESPACE_FO, XML_FONT_FAMILY ),
714 	ENTRY1Q( STYLE, FONT_ADORNMENTS, XML_ATACTION_RENAME,
715 						XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME ),
716 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
717 };
718 
719 // action table for OASIS_PARA_ACTIONS
720 static XMLTransformerActionInit aParaActionTable[] =
721 {
722 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
723 				XML_FAMILY_TYPE_PARAGRAPH ),
724 	ENTRY1( TEXT, COND_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
725 				XML_FAMILY_TYPE_PARAGRAPH ),
726 	ENTRY1Q( TEXT, OUTLINE_LEVEL, XML_ATACTION_RENAME,
727 						XML_NAMESPACE_TEXT, XML_LEVEL ),
728 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
729 };
730 
731 // !!ATTENTION!! If you change something here, please also change
732 // aConnectorActionTable if apropriate
733 static XMLTransformerActionInit aShapeActionTable[] =
734 {
735 	ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
736 				XML_FAMILY_TYPE_GRAPHIC ),
737 	ENTRY1( DRAW, TEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
738 		 		XML_FAMILY_TYPE_PARAGRAPH ),
739 	ENTRY1( PRESENTATION, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
740 		 		XML_FAMILY_TYPE_PRESENTATION ),
741 	ENTRY0( SVG, X, XML_ATACTION_IN2INCH ),
742 	ENTRY0( SVG, Y, XML_ATACTION_IN2INCH ),
743 	ENTRY0( SVG, X1, XML_ATACTION_IN2INCH ),
744 	ENTRY0( SVG, Y1, XML_ATACTION_IN2INCH ),
745 	ENTRY0( SVG, X2, XML_ATACTION_IN2INCH ),
746 	ENTRY0( SVG, Y2, XML_ATACTION_IN2INCH ),
747 	ENTRY0( SVG, CX, XML_ATACTION_IN2INCH ),
748 	ENTRY0( SVG, CY, XML_ATACTION_IN2INCH ),
749 	ENTRY0( DRAW, END_X, XML_ATACTION_IN2INCH ),
750 	ENTRY0( DRAW, END_Y, XML_ATACTION_IN2INCH ),
751 	ENTRY0( SVG, R, XML_ATACTION_IN2INCH ),
752 	ENTRY0( SVG, RX, XML_ATACTION_IN2INCH ),
753 	ENTRY0( SVG, RY, XML_ATACTION_IN2INCH ),
754 	ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
755 	ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
756 	ENTRY0( FO, MIN_WIDTH, XML_ATACTION_IN2INCH ),
757 	ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_IN2INCH ),
758 	ENTRY0( FO, MAX_WIDTH, XML_ATACTION_IN2INCH ),
759 	ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_IN2INCH ),
760 	ENTRY0( DRAW, CORNER_RADIUS, XML_ATACTION_IN2INCH ),
761 	ENTRY0( DRAW, LINE_SKEW, XML_ATACTION_INS2INCHS ),
762 	ENTRY0( DRAW, CAPTION_POINT_X, XML_ATACTION_IN2INCH ),
763 	ENTRY0( DRAW, CAPTION_POINT_Y, XML_ATACTION_IN2INCH ),
764 	ENTRY0( DR3D, DISTANCE, XML_ATACTION_IN2INCH ),
765 	ENTRY0( DR3D, FOCAL_LENGTH, XML_ATACTION_IN2INCH ),
766 	ENTRY1Q( DRAW, CONTROL, XML_ATACTION_RENAME,
767 					XML_NAMESPACE_FORM, XML_ID ),
768 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_True ),
769 
770     // BM: needed by chart:legend.  The legend needs also the draw actions.  As
771     // there is no merge mechanism, all actions have to be in the same table
772     ENTRY2( CHART, LEGEND_POSITION, XML_ATACTION_RENAME_ATTRIBUTE,
773             RENAME_ENTRY( XML_START, XML_LEFT ),
774             RENAME_ENTRY( XML_END, XML_RIGHT )),
775 
776 	ENTRY0( DRAW, ID, XML_ATACTION_DECODE_ID ),
777 
778 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
779 };
780 
781 // OASIS_ANIMATION_ACTIONS
782 static XMLTransformerActionInit aAnimationActionTable[] =
783 {
784 	ENTRY0( DRAW, SHAPE_ID, XML_ATACTION_DECODE_ID ),
785     ENTRY0( PRESENTATION, DELAY,       XML_ATACTION_RNG2ISO_DATETIME ),
786     ENTRY0( PRESENTATION, PAUSE,       XML_ATACTION_RNG2ISO_DATETIME ),
787 
788 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
789 };
790 
791 // OOO_CONNECTOR_ACTIONS
792 static XMLTransformerActionInit aConnectorActionTable[] =
793 {
794 	ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
795 				XML_FAMILY_TYPE_GRAPHIC ),
796 	ENTRY1( DRAW, TEXT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
797 		 		XML_FAMILY_TYPE_PARAGRAPH ),
798 	ENTRY1( PRESENTATION, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
799 		 		XML_FAMILY_TYPE_PRESENTATION ),
800 	ENTRY0( SVG, X1, XML_ATACTION_IN2TWIPS ),
801 	ENTRY0( SVG, Y1, XML_ATACTION_IN2TWIPS ),
802 	ENTRY0( SVG, X2, XML_ATACTION_IN2TWIPS ),
803 	ENTRY0( SVG, Y2, XML_ATACTION_IN2TWIPS ),
804 	ENTRY0( DRAW, END_X, XML_ATACTION_IN2INCH ),
805 	ENTRY0( DRAW, END_Y, XML_ATACTION_IN2INCH ),
806 	ENTRY0( SVG, WIDTH, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
807 	ENTRY0( SVG, HEIGHT, XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS ),
808 	ENTRY0( FO, MIN_WIDTH, XML_ATACTION_IN2INCH ),
809 	ENTRY0( FO, MIN_HEIGHT, XML_ATACTION_IN2INCH ),
810 	ENTRY0( FO, MAX_WIDTH, XML_ATACTION_IN2INCH ),
811 	ENTRY0( FO, MAX_HEIGHT, XML_ATACTION_IN2INCH ),
812 	ENTRY0( DRAW, LINE_SKEW, XML_ATACTION_INS2INCHS ),
813 	ENTRY1Q( DRAW, CONTROL, XML_ATACTION_RENAME,
814 					XML_NAMESPACE_FORM, XML_ID ),
815 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_True ),
816 	ENTRY0( DRAW, START_SHAPE, XML_ATACTION_DECODE_ID ),
817 	ENTRY0( DRAW, END_SHAPE, XML_ATACTION_DECODE_ID ),
818 
819 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
820 };
821 
822 // OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS
823 static XMLTransformerActionInit aIndexEntryTabStopActionTable[] =
824 {
825 	ENTRY0( STYLE, POSITION, XML_ATACTION_IN2INCH ),
826 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
827 		  		XML_FAMILY_TYPE_TEXT ),
828 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
829 };
830 
831 // OASIS_TAB_STOP_ACTIONS
832 static XMLTransformerActionInit aTabStopActionTable[] =
833 {
834 	ENTRY0( STYLE, POSITION, XML_ATACTION_IN2INCH ),
835 	ENTRY1Q( STYLE, LEADER_TEXT, XML_ATACTION_RENAME,
836 		  		XML_NAMESPACE_STYLE, XML_LEADER_CHAR ),
837 	ENTRY0( STYLE, LEADER_STYLE, XML_ATACTION_REMOVE ),
838 	ENTRY0( STYLE, LEADER_TYPE, XML_ATACTION_REMOVE ),
839 	ENTRY0( STYLE, LEADER_WIDTH, XML_ATACTION_REMOVE ),
840 	ENTRY0( STYLE, LEADER_COLOR, XML_ATACTION_REMOVE ),
841 	ENTRY0( STYLE, LEADER_TEXT_STYLE, XML_ATACTION_REMOVE ),
842 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
843 };
844 
845 // OASIS_LINENUMBERING_ACTIONS
846 static XMLTransformerActionInit aLineNumberingActionTable[] =
847 {
848 	ENTRY0( TEXT, OFFSET, XML_ATACTION_IN2INCH ),
849 	ENTRY1( TEXT, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
850 				XML_FAMILY_TYPE_TEXT ),
851 	ENTRY1Q( TEXT, COUNT_IN_TEXT_BOXES , XML_ATACTION_RENAME,
852 					XML_NAMESPACE_TEXT, XML_COUNT_IN_FLOATING_FRAMES),
853 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
854 };
855 
856 static XMLTransformerActionInit aFootnoteSepActionTable[] =
857 {
858 	ENTRY0( STYLE, WIDTH, XML_ATACTION_IN2INCH ),
859 	ENTRY0( STYLE, DISTANCE_BEFORE_SEP, XML_ATACTION_IN2INCH ),
860 	ENTRY0( STYLE, DISTANCE_AFTER_SEP, XML_ATACTION_IN2INCH ),
861 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
862 };
863 
864 // OASIS_NOTES_ACTIONS (processed by special context)
865 static XMLTransformerActionInit aNotesActionTable[] =
866 {
867 	ENTRY0( TEXT, NOTE_CLASS, XML_ATACTION_STYLE_FAMILY ),
868 	ENTRY1( TEXT, CITATION_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
869 				XML_FAMILY_TYPE_TEXT ),
870 	ENTRY1( TEXT, CITATION_BODY_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
871 				XML_FAMILY_TYPE_TEXT ),
872 	ENTRY1( TEXT, DEFAULT_STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
873 				XML_FAMILY_TYPE_PARAGRAPH ),
874 	ENTRY1( TEXT, MASTER_PAGE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
875 				XML_FAMILY_TYPE_MASTER_PAGE ),
876 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
877 };
878 
879 // OASIS_DROP_CAP_ACTIONS
880 static XMLTransformerActionInit aDropCapActionTable[] =
881 {
882 	ENTRY0( STYLE, DISTANCE, XML_ATACTION_IN2INCH ),
883 	ENTRY1( STYLE, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
884 				XML_FAMILY_TYPE_TEXT ),
885 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
886 };
887 
888 static XMLTransformerActionInit aColumnsActionTable[] =
889 {
890 	ENTRY0( STYLE, COLUMN_GAP, XML_ATACTION_IN2INCH ),
891 	ENTRY0( STYLE, SPACE_BEFORE, XML_ATACTION_REMOVE ),
892 	ENTRY0( STYLE, SPACE_AFTER, XML_ATACTION_REMOVE ),
893 	ENTRY1Q( FO, START_INDENT, XML_ATACTION_RENAME_IN2INCH,
894 		   XML_NAMESPACE_FO, XML_MARGIN_LEFT ),
895 	ENTRY1Q( FO, END_INDENT, XML_ATACTION_RENAME_IN2INCH,
896 		   XML_NAMESPACE_FO, XML_MARGIN_RIGHT ),
897 	ENTRY0( STYLE, WIDTH, XML_ATACTION_IN2INCH ),
898 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
899 };
900 
901 // OASIS_TEXT_VALUE_TYPE_ACTIONS
902 static XMLTransformerActionInit aTextValueTypeActionTable[] =
903 {
904 	ENTRY1Q( OFFICE, VALUE_TYPE, XML_ATACTION_RENAME,
905 		   XML_NAMESPACE_TEXT, XML_VALUE_TYPE ),
906 	ENTRY1Q( OFFICE, VALUE, XML_ATACTION_RENAME,
907 		   XML_NAMESPACE_TEXT, XML_VALUE ),
908 	ENTRY1Q( OFFICE, CURRENCY, XML_ATACTION_RENAME,
909 		   XML_NAMESPACE_TEXT, XML_CURRENCY ),
910 	ENTRY1Q( OFFICE, DATE_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
911 		   XML_NAMESPACE_TEXT, XML_DATE_VALUE ),
912 	ENTRY1Q( OFFICE, TIME_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
913 		   XML_NAMESPACE_TEXT, XML_TIME_VALUE ),
914 	ENTRY1Q( OFFICE, BOOLEAN_VALUE, XML_ATACTION_RENAME,
915 		   XML_NAMESPACE_TEXT, XML_BOOLEAN_VALUE ),
916 	ENTRY1Q( OFFICE, STRING_VALUE, XML_ATACTION_RENAME,
917 		   XML_NAMESPACE_TEXT, XML_STRING_VALUE ),
918 	ENTRY0( TEXT, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
919 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
920 };
921 
922 // OASIS_TABLE_VALUE_TYPE_ACTIONS
923 static XMLTransformerActionInit aTableValueTypeActionTable[] =
924 {
925 	ENTRY1Q( OFFICE, VALUE_TYPE, XML_ATACTION_RENAME,
926 		   XML_NAMESPACE_TABLE, XML_VALUE_TYPE ),
927 	ENTRY1Q( OFFICE, VALUE, XML_ATACTION_RENAME,
928 		   XML_NAMESPACE_TABLE, XML_VALUE ),
929 	ENTRY1Q( OFFICE, CURRENCY, XML_ATACTION_RENAME,
930 		   XML_NAMESPACE_TABLE, XML_CURRENCY ),
931 	ENTRY1Q( OFFICE, DATE_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
932 		   XML_NAMESPACE_TABLE, XML_DATE_VALUE ),
933 	ENTRY1Q( OFFICE, TIME_VALUE, XML_ATACTION_RENAME_RNG2ISO_DATETIME,
934 		   XML_NAMESPACE_TABLE, XML_TIME_VALUE ),
935 	ENTRY1Q( OFFICE, BOOLEAN_VALUE, XML_ATACTION_RENAME,
936 		   XML_NAMESPACE_TABLE, XML_BOOLEAN_VALUE ),
937 	ENTRY1Q( OFFICE, STRING_VALUE, XML_ATACTION_RENAME,
938 		   XML_NAMESPACE_TABLE, XML_STRING_VALUE ),
939 	ENTRY1( TABLE, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
940 				XML_FAMILY_TYPE_TABLE_CELL ),
941 	ENTRY0( TABLE, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
942 	ENTRY1Q( TABLE, CONTENT_VALIDATION_NAME, XML_ATACTION_RENAME,
943 		   XML_NAMESPACE_TABLE, XML_VALIDATION_NAME ),
944 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
945 };
946 
947 // action table for OASIS_ANNOTATION_ACTIONS
948 static XMLTransformerActionInit aAnnotationActionTable[] =
949 {
950 	ENTRY1Q( DC, CREATOR, XML_ATACTION_MOVE_FROM_ELEM,
951 				XML_NAMESPACE_OFFICE, XML_AUTHOR ),
952 	ENTRY1Q( DC, DATE, XML_ATACTION_MOVE_FROM_ELEM_RNG2ISO_DATETIME,
953 				XML_NAMESPACE_OFFICE, XML_CREATE_DATE ),
954 	ENTRY1Q( META, DATE_STRING, XML_ATACTION_MOVE_FROM_ELEM,
955 				XML_NAMESPACE_OFFICE, XML_CREATE_DATE_STRING ),
956     ENTRY0( TEXT, P, XML_ETACTION_EXTRACT_CHARACTERS ),
957 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
958 };
959 
960 // action table for OASIS_CHANGE_INFO_ACTIONS
961 static XMLTransformerActionInit aChangeInfoActionTable[] =
962 {
963 	ENTRY1Q( DC, CREATOR, XML_ATACTION_MOVE_FROM_ELEM,
964 				XML_NAMESPACE_OFFICE, XML_CHG_AUTHOR ),
965 	ENTRY1Q( DC, DATE, XML_ATACTION_MOVE_FROM_ELEM_RNG2ISO_DATETIME,
966 				XML_NAMESPACE_OFFICE, XML_CHG_DATE_TIME ),
967 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
968 };
969 
970 // OASIS_BACKGROUND_IMAGE_ACTIONS
971 static XMLTransformerActionInit aBackgroundImageActionTable[] =
972 {
973 	ENTRY1Q( DRAW, OPACITY, XML_ATACTION_RENAME_NEG_PERCENT,
974 		 			XML_NAMESPACE_DRAW, XML_TRANSPARENCY ),
975 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_True ),
976 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
977 };
978 
979 // OASIS_DDE_CONNECTION_DECL
980 static XMLTransformerActionInit aDDEConnectionDeclActionTable[] =
981 {
982 	ENTRY1Q( OFFICE, NAME, XML_ATACTION_RENAME,
983 		 			XML_NAMESPACE_TEXT, XML_NAME ),
984 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
985 };
986 
987 
988 // OASIS_FORM_CONTROL_ACTIONS
989 static XMLTransformerActionInit aFormControlActionTable[] =
990 {
991 	ENTRY0( FORM, NAME, XML_ATACTION_MOVE_TO_ELEM ),
992 	ENTRY2QN( FORM, CONTROL_IMPLEMENTATION,
993 					XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,
994 		   			XML_NAMESPACE_FORM, XML_SERVICE_NAME,
995 					XML_NAMESPACE_OOO ),
996 	ENTRY0( FORM, ID, XML_ATACTION_MOVE_TO_ELEM ),
997 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_False ),
998 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
999 };
1000 
1001 // OASIS_FORM_COLUMN_ACTIONS
1002 static XMLTransformerActionInit aFormColumnActionTable[] =
1003 {
1004 	ENTRY1Q( FORM, TEXT_STYLE_NAME, XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF,
1005 						XML_NAMESPACE_FORM, XML_COLUMN_STYLE_NAME ),
1006 	ENTRY2QN( FORM, CONTROL_IMPLEMENTATION,
1007 					XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,
1008 		   			XML_NAMESPACE_FORM, XML_SERVICE_NAME,
1009 					XML_NAMESPACE_OOO ),
1010 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1011 };
1012 
1013 // OASIS_FORM_PROP_ACTIONS
1014 static XMLTransformerActionInit aFormPropActionTable[] =
1015 {
1016 	ENTRY1Q( OFFICE, VALUE_TYPE, XML_ATACTION_RENAME,
1017 		  				XML_NAMESPACE_FORM, XML_PROPERTY_TYPE ),
1018 	ENTRY0( OFFICE, VALUE, XML_ATACTION_REMOVE ),
1019 	ENTRY0( OFFICE, STRING_VALUE, XML_ATACTION_REMOVE ),
1020 	ENTRY0( OFFICE, BOOLEAN_VALUE, XML_ATACTION_REMOVE ),
1021 	ENTRY0( OFFICE, DATE_VALUE, XML_ATACTION_REMOVE ),
1022 	ENTRY0( OFFICE, TIME_VALUE, XML_ATACTION_REMOVE ),
1023 	ENTRY0( OFFICE, CURRENCY, XML_ATACTION_REMOVE ),
1024 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1025 };
1026 
1027 // OASIS_XLINK_ACTIONS
1028 static XMLTransformerActionInit aXLinkActionTable[] =
1029 {
1030 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_False ),
1031     ENTRY0( TABLE, REFRESH_DELAY, XML_ATACTION_RNG2ISO_DATETIME ),
1032 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1033 };
1034 
1035 // OASIS_CONFIG_ITEM_SET_ACTIONS
1036 static XMLTransformerActionInit aConfigItemSetActionTable[] =
1037 {
1038 	ENTRY1( CONFIG, NAME, XML_ATACTION_REMOVE_NAMESPACE_PREFIX,
1039 					XML_NAMESPACE_OOO ),
1040 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1041 };
1042 
1043 // OASIS_FORMULA_ACTIONS
1044 static XMLTransformerActionInit aFormulaActionTable[] =
1045 {
1046 	ENTRY0( TEXT, CONDITION, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1047 	ENTRY0( TEXT, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1048 	ENTRY0( TABLE, CONDITION, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1049 	ENTRY0( TABLE, FORMULA, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1050 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1051 };
1052 
1053 // OASIS_CONTENT_VALIDATION_ACTIONS
1054 static XMLTransformerActionInit aContentValidationActionTable[] =
1055 {
1056 	ENTRY0( TABLE, CONDITION, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1057     ENTRY0( TABLE, DISPLAY_LIST, XML_ATACTION_REMOVE ),
1058 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1059 };
1060 
1061 // OASIS_DDE_CONV_MODE_ACTIONS
1062 static XMLTransformerActionInit aDDEConvModeActionTable[] =
1063 {
1064 	ENTRY1Q( TABLE, KEEP_TEXT, XML_ATACTION_RENAME,
1065 						XML_NAMESPACE_TABLE, XML_LET_TEXT ),
1066 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1067 };
1068 
1069 // OASIS_DATAPILOT_MEMBER_ACTIONS
1070 static XMLTransformerActionInit aDataPilotMemberActionTable[] =
1071 {
1072 	ENTRY1Q( TABLE, SHOW_DETAILS, XML_ATACTION_RENAME,
1073 						XML_NAMESPACE_TABLE, XML_DISPLAY_DETAILS ),
1074 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1075 };
1076 
1077 // OASIS_DATAPILOT_LEVEL_ACTIONS
1078 static XMLTransformerActionInit aDataPilotLevelActionTable[] =
1079 {
1080 	ENTRY1Q( TABLE, SHOW_EMPTY, XML_ATACTION_RENAME,
1081 						XML_NAMESPACE_TABLE, XML_DISPLAY_EMPTY ),
1082 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1083 };
1084 
1085 // OASIS_SOURCE_SERVICE_ACTIONS
1086 static XMLTransformerActionInit aSourceServiceActionTable[] =
1087 {
1088 	ENTRY1Q( TABLE, USER_NAME, XML_ATACTION_RENAME,
1089 						XML_NAMESPACE_TABLE, XML_USERNAME ),
1090 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1091 };
1092 
1093 // OASIS_CHART_ACTIONS
1094 static XMLTransformerActionInit aChartActionTable[] =
1095 {
1096 	ENTRY0( CHART, CLASS, XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX ),
1097 	ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF,
1098 				XML_FAMILY_TYPE_GRAPHIC ),
1099 	ENTRY0( SVG, WIDTH, XML_ATACTION_IN2INCH ),
1100 	ENTRY0( SVG, HEIGHT, XML_ATACTION_IN2INCH ),
1101 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1102 };
1103 
1104 // OASIS_FORM_ACTIONS
1105 static XMLTransformerActionInit aFormActionTable[] =
1106 {
1107 	ENTRY2QN( FORM, CONTROL_IMPLEMENTATION,
1108 					XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX,
1109 		   			XML_NAMESPACE_FORM, XML_SERVICE_NAME,
1110 					XML_NAMESPACE_OOO ),
1111 	ENTRY1( XLINK, HREF, XML_ATACTION_URI_OASIS, sal_False ),
1112 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1113 };
1114 
1115 // OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS
1116 static XMLTransformerActionInit aAlphabeticalIndexMarkActionTable[] =
1117 {
1118 	ENTRY1Q( TEXT, MAIN_ENTRY, XML_ATACTION_RENAME,
1119 						XML_NAMESPACE_TEXT, XML_MAIN_ETRY ),
1120 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1121 };
1122 
1123 // OASIS_DRAW_AREA_POLYGON_ACTIONS (to be added to OASIS_SHAPE_ACTIONS)
1124 static XMLTransformerActionInit aDrawAreaPolygonActionTable[] =
1125 {
1126 	ENTRY1Q( DRAW, POINTS, XML_ATACTION_RENAME,
1127              XML_NAMESPACE_SVG, XML_POINTS ),
1128 	ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1129 };
1130 
1131 // OASIS_SCRIPT_ACTIONS
1132 static XMLTransformerActionInit aScriptActionTable[] =
1133 {
1134     ENTRY1( SCRIPT, LANGUAGE, XML_ATACTION_REMOVE_NAMESPACE_PREFIX, XML_NAMESPACE_OOO ),
1135     ENTRY1Q( OOO, NAME, XML_ATACTION_RENAME, XML_NAMESPACE_SCRIPT, XML_NAME ),
1136     ENTRY1Q( OOO, READONLY, XML_ATACTION_RENAME, XML_NAMESPACE_SCRIPT, XML_READONLY ),
1137     ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
1138 };
1139 
1140 // OASIS_DATETIME_ACTIONS
1141 static XMLTransformerActionInit aDateTimeActionTable[] =
1142 {
1143 	ENTRY0( TEXT,   DATE_VALUE,        XML_ATACTION_RNG2ISO_DATETIME ),
1144     ENTRY0( TEXT,   TIME_VALUE,        XML_ATACTION_RNG2ISO_DATETIME ),
1145 	ENTRY0( TEXT,   DATE_ADJUST,       XML_ATACTION_RNG2ISO_DATETIME ),
1146 	ENTRY0( TEXT,   TIME_ADJUST,       XML_ATACTION_RNG2ISO_DATETIME ),
1147 	ENTRY0( TEXT,   DURATION,          XML_ATACTION_RNG2ISO_DATETIME ),
1148 	ENTRY0( OFFICE, DATE_VALUE,        XML_ATACTION_RNG2ISO_DATETIME ),
1149 	ENTRY0( OFFICE, TIME_VALUE,        XML_ATACTION_RNG2ISO_DATETIME ),
1150     ENTRY0( FORM,   VALUE,             XML_ATACTION_RNG2ISO_DATETIME ),
1151     ENTRY0( FORM,   CURRENT_VALUE,     XML_ATACTION_RNG2ISO_DATETIME ),
1152     ENTRY0( TABLE,  DATE_START,        XML_ATACTION_RNG2ISO_DATETIME ),
1153     ENTRY0( TABLE,  DATE_END,          XML_ATACTION_RNG2ISO_DATETIME ),
1154     ENTRY0( TABLE,  REFRESH_DELAY,     XML_ATACTION_RNG2ISO_DATETIME ),
1155     ENTRY0( PRESENTATION, DELAY,       XML_ATACTION_RNG2ISO_DATETIME ),
1156     ENTRY0( PRESENTATION, PAUSE,       XML_ATACTION_RNG2ISO_DATETIME ),
1157 	ENTRY0( OFFICE, TOKEN_INVALID,     XML_ATACTION_EOT )
1158 };
1159 
1160 static XMLTokenEnum aTokenMap[] =
1161 {
1162 	XML_NONE, XML_SOLID, XML_DOTTED, XML_DASH, XML_LONG_DASH, XML_DOT_DASH,
1163 	XML_DOT_DOT_DASH, XML_WAVE, XML_SMALL_WAVE, XML_TOKEN_END
1164 };
1165 
1166 // -----------------------------------------------------------------------------
1167 
1168 class XMLTableTransformerContext_Impl : public XMLTransformerContext
1169 {
1170 	::rtl::OUString m_aElemQName;
1171 
1172 public:
1173 	TYPEINFO();
1174 
1175 	XMLTableTransformerContext_Impl( XMLTransformerBase& rTransformer,
1176 						   const ::rtl::OUString& rQName );
1177 
1178 	virtual ~XMLTableTransformerContext_Impl();
1179 
1180 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1181 	virtual void EndElement();
1182 };
1183 
1184 TYPEINIT1( XMLTableTransformerContext_Impl, XMLTransformerContext );
1185 
1186 XMLTableTransformerContext_Impl::XMLTableTransformerContext_Impl(
1187 		XMLTransformerBase& rImp,
1188 	    const OUString& rQName ) :
1189 	XMLTransformerContext( rImp, rQName ),
1190 	m_aElemQName( rQName )
1191 {
1192 }
1193 
1194 XMLTableTransformerContext_Impl::~XMLTableTransformerContext_Impl()
1195 {
1196 }
1197 
1198 void XMLTableTransformerContext_Impl::StartElement(
1199 		const Reference< XAttributeList >& rAttrList )
1200 {
1201 	Reference< XAttributeList > xAttrList( rAttrList );
1202 
1203     XMLMutableAttributeList *pMutableAttrList = 0;
1204     // <--
1205 
1206     sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1207 	for( sal_Int16 i=0; i < nAttrCount; i++ )
1208 	{
1209 		const OUString& rAttrName = xAttrList->getNameByIndex( i );
1210 		OUString aLocalName;
1211 		sal_uInt16 nPrefix =
1212 			GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1213 																 &aLocalName );
1214         if( XML_NAMESPACE_TABLE == nPrefix )
1215         {
1216             if ( IsXMLToken( aLocalName, XML_IS_SUB_TABLE ) )
1217             {
1218                 const OUString& rValue = xAttrList->getValueByIndex( i );
1219                 if( IsXMLToken( rValue, XML_TRUE ) )
1220                 {
1221                     m_aElemQName = GetTransformer().GetNamespaceMap().GetQNameByKey(
1222                                 XML_NAMESPACE_TABLE,
1223                                 ::xmloff::token::GetXMLToken( XML_SUB_TABLE ) );
1224                     if ( !pMutableAttrList )
1225                     {
1226                         pMutableAttrList =
1227                             new XMLMutableAttributeList( xAttrList );
1228                         xAttrList = pMutableAttrList;
1229                     }
1230                     pMutableAttrList->RemoveAttributeByIndex( i );
1231                 }
1232                 // OD 2005-07-05 #i50521# - no break here for savety reason.
1233             }
1234             // --> OD 2005-01-10 #i40011#, #i40015#
1235             // - convert attribute table:style-name for <table:table>
1236             else if ( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
1237             {
1238                 const OUString& rValue = xAttrList->getValueByIndex( i );
1239                 OUString aAttrValue( rValue );
1240                 if( GetTransformer().DecodeStyleName(aAttrValue) )
1241                 {
1242                     if ( !pMutableAttrList )
1243                     {
1244                         pMutableAttrList =
1245                             new XMLMutableAttributeList( xAttrList );
1246                         xAttrList = pMutableAttrList;
1247                     }
1248                     pMutableAttrList->SetValueByIndex( i, aAttrValue );
1249                 }
1250             }
1251             // <--
1252             else if( IsXMLToken( aLocalName, XML_PRINT ) )
1253             {
1254                 if ( !pMutableAttrList )
1255                 {
1256                     pMutableAttrList =
1257                         new XMLMutableAttributeList( xAttrList );
1258                     xAttrList = pMutableAttrList;
1259                 }
1260     			pMutableAttrList->RemoveAttributeByIndex( i );
1261             }
1262         }
1263 	}
1264 
1265 	GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1266 }
1267 
1268 void XMLTableTransformerContext_Impl::EndElement()
1269 {
1270 	GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1271 }
1272 
1273 // -----------------------------------------------------------------------------
1274 
1275 class XMLBodyOASISTransformerContext_Impl : public XMLTransformerContext
1276 {
1277 	sal_Bool m_bFirstChild;
1278 
1279 public:
1280 	TYPEINFO();
1281 
1282 	XMLBodyOASISTransformerContext_Impl( XMLTransformerBase& rTransformer,
1283 						   const ::rtl::OUString& rQName );
1284 
1285 	virtual ~XMLBodyOASISTransformerContext_Impl();
1286 
1287 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1288 
1289 	virtual XMLTransformerContext *CreateChildContext( sal_uInt16 nPrefix,
1290 								   const ::rtl::OUString& rLocalName,
1291 								   const ::rtl::OUString& rQName,
1292 								   const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1293 	virtual void EndElement();
1294 };
1295 
1296 TYPEINIT1( XMLBodyOASISTransformerContext_Impl, XMLTransformerContext );
1297 
1298 XMLBodyOASISTransformerContext_Impl::XMLBodyOASISTransformerContext_Impl(
1299 		XMLTransformerBase& rImp,
1300 	    const OUString& rQName ) :
1301 	XMLTransformerContext( rImp, rQName ),
1302 	m_bFirstChild( sal_False )
1303 {
1304 }
1305 
1306 XMLBodyOASISTransformerContext_Impl::~XMLBodyOASISTransformerContext_Impl()
1307 {
1308 }
1309 
1310 void XMLBodyOASISTransformerContext_Impl::StartElement(
1311 		const Reference< XAttributeList >& )
1312 {
1313 }
1314 
1315 XMLTransformerContext* XMLBodyOASISTransformerContext_Impl::CreateChildContext( sal_uInt16 nPrefix,
1316 								   const ::rtl::OUString& rLocalName,
1317 								   const ::rtl::OUString& rQName,
1318 								   const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList )
1319 {
1320     if (!m_bFirstChild)
1321     {
1322         m_bFirstChild = sal_True;
1323         XMLTransformerContext::StartElement(xAttrList);
1324     }
1325 
1326     return XMLTransformerContext::CreateChildContext(nPrefix, rLocalName, rQName, xAttrList);
1327 }
1328 
1329 void XMLBodyOASISTransformerContext_Impl::EndElement()
1330 {
1331     if (!m_bFirstChild)
1332         XMLTransformerContext::StartElement(Reference< XAttributeList >());
1333 
1334     XMLTransformerContext::EndElement();
1335 }
1336 
1337 //-----------------------------------------------------------------------------
1338 
1339 class XMLTabStopOASISTContext_Impl : public XMLPersElemContentTContext
1340 {
1341 public:
1342 	TYPEINFO();
1343 
1344 	XMLTabStopOASISTContext_Impl( XMLTransformerBase& rTransformer,
1345 						   const ::rtl::OUString& rQName );
1346 
1347 	virtual ~XMLTabStopOASISTContext_Impl();
1348 
1349 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1350 };
1351 
1352 TYPEINIT1( XMLTabStopOASISTContext_Impl, XMLPersElemContentTContext );
1353 
1354 XMLTabStopOASISTContext_Impl::XMLTabStopOASISTContext_Impl(
1355 		XMLTransformerBase& rImp,
1356 		const OUString& rQName ) :
1357 	XMLPersElemContentTContext( rImp, rQName )
1358 {
1359 }
1360 
1361 XMLTabStopOASISTContext_Impl::~XMLTabStopOASISTContext_Impl()
1362 {
1363 }
1364 
1365 void XMLTabStopOASISTContext_Impl::StartElement(
1366 		const Reference< XAttributeList >& rAttrList )
1367 {
1368 	XMLTransformerActions *pActions =
1369 		GetTransformer().GetUserDefinedActions( OASIS_TAB_STOP_ACTIONS  );
1370 	OSL_ENSURE( pActions, "go no actions" );
1371 
1372 	sal_Unicode cStyleLeaderChar = 0;
1373 	sal_Int16 nLeaderText = -1;
1374 	Reference< XAttributeList > xAttrList( rAttrList );
1375 	XMLMutableAttributeList *pMutableAttrList = 0;
1376 	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1377 	for( sal_Int16 i=0; i < nAttrCount; i++ )
1378 	{
1379 		const OUString& rAttrName = xAttrList->getNameByIndex( i );
1380 		OUString aLocalName;
1381 		sal_uInt16 nPrefix =
1382 			GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1383 																 &aLocalName );
1384 		XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1385 		XMLTransformerActions::const_iterator aIter =
1386 			pActions->find( aKey );
1387 		if( !(aIter == pActions->end() ) )
1388 		{
1389 			if( !pMutableAttrList )
1390 			{
1391 				pMutableAttrList =
1392 					new XMLMutableAttributeList( xAttrList );
1393 				xAttrList = pMutableAttrList;
1394 			}
1395 			const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1396 			switch( (*aIter).second.m_nActionType )
1397 			{
1398 			case XML_ATACTION_REMOVE:
1399 				if( IsXMLToken( aLocalName, XML_LEADER_STYLE ) )
1400 				{
1401 					if( IsXMLToken( rAttrValue, XML_NONE ) )
1402 						cStyleLeaderChar = ' ';
1403 					else if( IsXMLToken( rAttrValue, XML_DOTTED ) )
1404 						cStyleLeaderChar = '.';
1405 					else
1406 						cStyleLeaderChar = 0;
1407 					pMutableAttrList->RemoveAttributeByIndex( i );
1408 					--i;
1409 					--nAttrCount;
1410 				}
1411 				break;
1412 			case XML_ATACTION_RENAME:
1413 				{
1414 					OUString aNewAttrQName(
1415 						GetTransformer().GetNamespaceMap().GetQNameByKey(
1416 							(*aIter).second.GetQNamePrefixFromParam1(),
1417 							::xmloff::token::GetXMLToken(
1418 							(*aIter).second.GetQNameTokenFromParam1()) ) );
1419 					pMutableAttrList->RenameAttributeByIndex( i,
1420 															  aNewAttrQName );
1421 				}
1422 				if( IsXMLToken( aLocalName, XML_LEADER_TEXT ) )
1423 				{
1424 					if( rAttrValue.getLength() > 1 )
1425 					{
1426 						OUString aAttrValue( rAttrValue.copy( 0, 1 ) );
1427 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1428 						nLeaderText = i;
1429 					}
1430 				}
1431 				break;
1432 			case XML_ATACTION_IN2INCH:
1433 				{
1434 					OUString aAttrValue( rAttrValue );
1435 					if( XMLTransformerBase::ReplaceSingleInWithInch(
1436 								aAttrValue ) )
1437 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1438 				}
1439 				break;
1440 			default:
1441 				OSL_ENSURE( !this, "unknown action" );
1442 				break;
1443 			}
1444 		}
1445 	}
1446 
1447 	if( cStyleLeaderChar && ' ' != cStyleLeaderChar )
1448 	{
1449 		if( nLeaderText != -1 )
1450 		{
1451 			OUString aNewAttrQName(
1452 				GetTransformer().GetNamespaceMap().GetQNameByKey(
1453 							XML_NAMESPACE_STYLE,
1454 							::xmloff::token::GetXMLToken( XML_LEADER_CHAR ) ) );
1455 			pMutableAttrList->AddAttribute( aNewAttrQName,
1456 									OUString::valueOf( cStyleLeaderChar ) );
1457 		}
1458 	}
1459 	else
1460 	{
1461 		if( nLeaderText != -1 )
1462 			pMutableAttrList->RemoveAttributeByIndex( nLeaderText );
1463 	}
1464 
1465 	XMLPersElemContentTContext::StartElement( xAttrList );
1466 }
1467 
1468 // -----------------------------------------------------------------------------
1469 
1470 class XMLConfigItemTContext_Impl : public XMLTransformerContext
1471 {
1472 	::rtl::OUString m_aContent;
1473 	sal_Bool m_bIsRedlineProtectionKey;
1474     sal_Bool m_bIsCursorX;
1475     sal_Bool m_bIsCursorY;
1476 
1477 public:
1478 
1479 	TYPEINFO();
1480 
1481 	XMLConfigItemTContext_Impl( XMLTransformerBase& rTransformer,
1482 						   const ::rtl::OUString& rQName );
1483 
1484 	virtual ~XMLConfigItemTContext_Impl();
1485 
1486 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1487 	virtual void EndElement();
1488 
1489 	virtual void Characters( const ::rtl::OUString& rChars );
1490 };
1491 
1492 TYPEINIT1( XMLConfigItemTContext_Impl, XMLTransformerContext );
1493 
1494 XMLConfigItemTContext_Impl::XMLConfigItemTContext_Impl(
1495 		XMLTransformerBase& rImp,
1496 	    const OUString& rQName ) :
1497 	XMLTransformerContext( rImp, rQName ),
1498 	m_bIsRedlineProtectionKey( sal_False ),
1499     m_bIsCursorX( sal_False ),
1500     m_bIsCursorY( sal_False )
1501 {
1502 }
1503 
1504 XMLConfigItemTContext_Impl::~XMLConfigItemTContext_Impl()
1505 {
1506 }
1507 
1508 void XMLConfigItemTContext_Impl::StartElement(
1509 		const Reference< XAttributeList >& rAttrList )
1510 {
1511 	Reference< XAttributeList > xAttrList( rAttrList );
1512 
1513 	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1514 	for( sal_Int16 i=0; i < nAttrCount; i++ )
1515 	{
1516 		const OUString& rAttrName = xAttrList->getNameByIndex( i );
1517 		OUString aLocalName;
1518 		sal_uInt16 nPrefix =
1519 			GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1520 																 &aLocalName );
1521 		if( XML_NAMESPACE_CONFIG == nPrefix )
1522         {
1523 			if ( IsXMLToken( aLocalName, XML_NAME ) )
1524 		    {
1525 			    const OUString& rValue = xAttrList->getValueByIndex( i );
1526 			    const sal_Char sRedlineProtectionKey[] = "RedlineProtectionKey";
1527                 const sal_Char sCursorX[] = "CursorPositionX";
1528                 const sal_Char sCursorY[] = "CursorPositionY";
1529 			    if( rValue.equalsAsciiL( sRedlineProtectionKey, sizeof(sRedlineProtectionKey)-1 ) )
1530 				    m_bIsRedlineProtectionKey = sal_True;
1531                 else if( rValue.equalsAsciiL( sCursorX, sizeof(sCursorX)-1 ) )
1532                     m_bIsCursorX = sal_True;
1533                 else if( rValue.equalsAsciiL( sCursorY, sizeof(sCursorY)-1 ) )
1534                     m_bIsCursorY = sal_True;
1535 
1536 			    break;
1537 		    }
1538         }
1539 	}
1540 
1541 	XMLTransformerContext::StartElement( xAttrList );
1542 }
1543 
1544 void XMLConfigItemTContext_Impl::Characters( const ::rtl::OUString& rChars )
1545 {
1546     rtl::OUString sChars(rChars);
1547     if (m_bIsRedlineProtectionKey)
1548 	    m_aContent += rChars;
1549     else if (m_bIsCursorX || m_bIsCursorY)
1550     {
1551         sal_Int32 nPos = rChars.toInt32();
1552         if (m_bIsCursorX && nPos > 255)
1553             nPos = 255;
1554         else if (m_bIsCursorY && nPos > 31999)
1555             nPos = 31999;
1556 
1557         sChars = ::rtl::OUString::valueOf(nPos);
1558     }
1559 
1560 	XMLTransformerContext::Characters( sChars );
1561 }
1562 
1563 void XMLConfigItemTContext_Impl::EndElement()
1564 {
1565 
1566 	if( m_bIsRedlineProtectionKey )
1567 	{
1568 		const Reference< XPropertySet > rPropSet =
1569 			GetTransformer().GetPropertySet();
1570 		if( rPropSet.is() )
1571 		{
1572 			const sal_Char sRedlineProtectionKey[] = "RedlineProtectionKey";
1573 			OUString aPropName(RTL_CONSTASCII_USTRINGPARAM(sRedlineProtectionKey));
1574 			Reference< XPropertySetInfo > xPropSetInfo(
1575 						rPropSet->getPropertySetInfo() );
1576 			if( xPropSetInfo.is() &&
1577 				xPropSetInfo->hasPropertyByName( aPropName ) )
1578 			{
1579 				Sequence < sal_Int8 > aKey;
1580 				SvXMLUnitConverter::decodeBase64( aKey, m_aContent );
1581 				rPropSet->setPropertyValue( aPropName, makeAny( aKey ) );
1582 			}
1583 		}
1584 	}
1585 	XMLTransformerContext::EndElement();
1586 }
1587 
1588 // -----------------------------------------------------------------------------
1589 
1590 class XMLTrackedChangesOASISTContext_Impl : public XMLTransformerContext
1591 {
1592 	::rtl::OUString m_aAttrQName;
1593 
1594 public:
1595 
1596 	TYPEINFO();
1597 
1598 	XMLTrackedChangesOASISTContext_Impl( XMLTransformerBase& rTransformer,
1599 						   const ::rtl::OUString& rQName,
1600 		   					sal_uInt16 nPrefix,
1601 							XMLTokenEnum eToken	);
1602 
1603 	virtual ~XMLTrackedChangesOASISTContext_Impl();
1604 
1605 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
1606 };
1607 
1608 TYPEINIT1( XMLTrackedChangesOASISTContext_Impl, XMLTransformerContext );
1609 
1610 XMLTrackedChangesOASISTContext_Impl::XMLTrackedChangesOASISTContext_Impl(
1611 		XMLTransformerBase& rImp,
1612 	    const OUString& rQName,
1613 		sal_uInt16 nPrefix,
1614 		XMLTokenEnum eToken	) :
1615 	XMLTransformerContext( rImp, rQName ),
1616 	m_aAttrQName( rImp.GetNamespaceMap().GetQNameByKey( nPrefix,
1617 														GetXMLToken(eToken)) )
1618 {
1619 }
1620 
1621 XMLTrackedChangesOASISTContext_Impl::~XMLTrackedChangesOASISTContext_Impl()
1622 {
1623 }
1624 
1625 void XMLTrackedChangesOASISTContext_Impl::StartElement(
1626 		const Reference< XAttributeList >& rAttrList )
1627 {
1628 	Reference< XAttributeList > xAttrList( rAttrList );
1629 	const Reference< XPropertySet > rPropSet =
1630 		GetTransformer().GetPropertySet();
1631 	if( rPropSet.is() )
1632 	{
1633 		const sal_Char sRedlineProtectionKey[] = "RedlineProtectionKey";
1634 		OUString aPropName(RTL_CONSTASCII_USTRINGPARAM(sRedlineProtectionKey));
1635 		Reference< XPropertySetInfo > xPropSetInfo(
1636 					rPropSet->getPropertySetInfo() );
1637 		if( xPropSetInfo.is() &&
1638 			xPropSetInfo->hasPropertyByName( aPropName ) )
1639 		{
1640 			Any aAny = rPropSet->getPropertyValue( aPropName);
1641 			Sequence < sal_Int8 > aKey;
1642 			aAny >>= aKey;
1643 			if( aKey.getLength() )
1644 			{
1645 				OUStringBuffer aBuffer;
1646 				SvXMLUnitConverter::encodeBase64( aBuffer, aKey );
1647 				XMLMutableAttributeList *pMutableAttrList =
1648 					new XMLMutableAttributeList( xAttrList );
1649 				xAttrList = pMutableAttrList;
1650 				pMutableAttrList->AddAttribute( m_aAttrQName,
1651 												aBuffer.makeStringAndClear() );
1652 			}
1653 		}
1654 	}
1655 	XMLTransformerContext::StartElement( xAttrList );
1656 }
1657 
1658 // -----------------------------------------------------------------------------
1659 
1660 XMLTransformerContext *Oasis2OOoTransformer::CreateUserDefinedContext(
1661 							  const TransformerAction_Impl& rAction,
1662 							  const OUString& rQName,
1663 	   						  sal_Bool bPersistent )
1664 {
1665 	switch( rAction.m_nActionType )
1666 	{
1667 	case XML_ETACTION_META:
1668 		return new XMLMetaTransformerContext( *this, rQName );
1669 	case XML_ETACTION_DOCUMENT:
1670 		return new XMLDocumentTransformerContext( *this, rQName );
1671 	case XML_ETACTION_BODY:
1672 		return new XMLBodyOASISTransformerContext_Impl( *this, rQName );
1673 	case XML_ETACTION_NOTES:
1674 		return new XMLNotesTransformerContext( *this, rQName,
1675 				static_cast< XMLTokenEnum>( rAction.m_nParam1 ), bPersistent );
1676 	case XML_ETACTION_TABLE:
1677 		return new XMLTableTransformerContext_Impl( *this, rQName );
1678 	case XML_ETACTION_STYLE:
1679 		return new XMLStyleOASISTContext( *this, rQName, bPersistent );
1680 	case XML_ETACTION_STYLE_RENAME:
1681 		return new XMLStyleOASISTContext( *this, rQName,
1682 					rAction.GetQNamePrefixFromParam1(),
1683 					rAction.GetQNameTokenFromParam1(), bPersistent );
1684 	case XML_ETACTION_FRAME:
1685 		return new XMLFrameOASISTransformerContext( *this, rQName );
1686 	case XML_ETACTION_EVENT:
1687 		return new XMLEventOASISTransformerContext( *this, rQName );
1688 	case XML_ETACTION_DLG:
1689 		return new XMLDlgOASISTransformerContext( *this, rQName );
1690 	case XML_ETACTION_TAB_STOP:
1691 		return new XMLTabStopOASISTContext_Impl( *this, rQName );
1692 	case XML_ETACTION_FORM_CONTROL:
1693 		{
1694 			const XMLTransformerContext *pCurrent = GetCurrentContext();
1695 			return new XMLControlOASISTransformerContext( *this, rQName,
1696 						pCurrent ? pCurrent->HasQName( XML_NAMESPACE_FORM,
1697 										   XML_FORM ) : sal_False  );
1698 		}
1699 	case XML_ETACTION_FORM_PROPERTY:
1700 		return new XMLFormPropOASISTransformerContext( *this, rQName,
1701 				static_cast< XMLTokenEnum >( rAction.m_nParam1 ) );
1702 	case XML_ETACTION_CHART:
1703 		return new XMLChartOASISTransformerContext( *this, rQName );
1704 	case XML_ETACTION_CONFIG_ITEM:
1705 		return new XMLConfigItemTContext_Impl( *this, rQName );
1706 	case XML_ETACTION_TRACKED_CHANGES:
1707 		return new XMLTrackedChangesOASISTContext_Impl( *this, rQName,
1708 			   				rAction.GetQNamePrefixFromParam1(),
1709 							rAction.GetQNameTokenFromParam1() );
1710 	case XML_ETACTION_CHART_PLOT_AREA:
1711         return new XMLChartPlotAreaOASISTContext( *this, rQName );
1712 	default:
1713 		OSL_ENSURE( !this, "no user defined context found!" );
1714 		break;
1715 	}
1716 
1717 	// default is copying
1718 	return new XMLTransformerContext( *this, rQName );
1719 }
1720 
1721 XMLTransformerActions *Oasis2OOoTransformer::GetUserDefinedActions(
1722 		sal_uInt16 n )
1723 {
1724 	XMLTransformerActions *pActions = 0;
1725 	if( n < MAX_OASIS_ACTIONS )
1726 	{
1727 		if( !m_aActions[n] )
1728 		{
1729 			if( n<MAX_OASIS_PROP_ACTIONS )
1730 			{
1731 				m_aActions[n] =
1732 					XMLStyleOASISTContext::CreateTransformerActions( n );
1733 			}
1734 			else switch( n )
1735 			{
1736 			case OASIS_STYLE_ACTIONS:
1737 				m_aActions[OASIS_STYLE_ACTIONS] =
1738 					new XMLTransformerActions( aStyleActionTable );
1739 				break;
1740 			case OASIS_FONT_FACE_ACTIONS:
1741 				m_aActions[OASIS_FONT_FACE_ACTIONS] =
1742 					new XMLTransformerActions( aFontFaceActionTable );
1743 				break;
1744 			case OASIS_SHAPE_ACTIONS:
1745 				m_aActions[OASIS_SHAPE_ACTIONS] =
1746 					new XMLTransformerActions( aShapeActionTable );
1747 				break;
1748 			case OASIS_CONNECTOR_ACTIONS:
1749 				m_aActions[OASIS_CONNECTOR_ACTIONS] =
1750 					new XMLTransformerActions( aConnectorActionTable );
1751 				break;
1752 			case OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS:
1753 				m_aActions[OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS] =
1754 					new XMLTransformerActions( aIndexEntryTabStopActionTable );
1755 				break;
1756 			case OASIS_TAB_STOP_ACTIONS:
1757 				m_aActions[OASIS_TAB_STOP_ACTIONS] =
1758 					new XMLTransformerActions( aTabStopActionTable );
1759 				break;
1760 			case OASIS_LINENUMBERING_ACTIONS:
1761 				m_aActions[OASIS_LINENUMBERING_ACTIONS] =
1762 					new XMLTransformerActions( aLineNumberingActionTable );
1763 				break;
1764 			case OASIS_FOOTNOTE_SEP_ACTIONS:
1765 				m_aActions[OASIS_FOOTNOTE_SEP_ACTIONS] =
1766 					new XMLTransformerActions( aFootnoteSepActionTable );
1767 				break;
1768 			case OASIS_DROP_CAP_ACTIONS:
1769 				m_aActions[OASIS_DROP_CAP_ACTIONS] =
1770 					new XMLTransformerActions( aDropCapActionTable );
1771 				break;
1772 			case OASIS_COLUMNS_ACTIONS:
1773 				m_aActions[OASIS_COLUMNS_ACTIONS] =
1774 					new XMLTransformerActions( aColumnsActionTable );
1775 				break;
1776 			case OASIS_TEXT_VALUE_TYPE_ACTIONS:
1777 				m_aActions[OASIS_TEXT_VALUE_TYPE_ACTIONS] =
1778 					new XMLTransformerActions( aTextValueTypeActionTable );
1779 				break;
1780 			case OASIS_TABLE_VALUE_TYPE_ACTIONS:
1781 				m_aActions[OASIS_TABLE_VALUE_TYPE_ACTIONS] =
1782 					new XMLTransformerActions( aTableValueTypeActionTable );
1783 				break;
1784 			case OASIS_PARA_ACTIONS:
1785 				m_aActions[OASIS_PARA_ACTIONS] =
1786 					new XMLTransformerActions( aParaActionTable );
1787 				break;
1788 			case OASIS_LIST_STYLE_REF_ACTIONS:
1789 				m_aActions[OASIS_LIST_STYLE_REF_ACTIONS] =
1790 					new XMLTransformerActions( aListStyleRefActionTable );
1791 				break;
1792 			case OASIS_TEXT_STYLE_REF_ACTIONS:
1793 				m_aActions[OASIS_TEXT_STYLE_REF_ACTIONS] =
1794 					new XMLTransformerActions( aTextStyleRefActionTable );
1795 				break;
1796 			case OASIS_PARA_STYLE_REF_ACTIONS:
1797 				m_aActions[OASIS_PARA_STYLE_REF_ACTIONS] =
1798 					new XMLTransformerActions( aParaStyleRefActionTable );
1799 				break;
1800 			case OASIS_MASTER_PAGE_REF_ACTIONS:
1801 				m_aActions[OASIS_MASTER_PAGE_REF_ACTIONS] =
1802 					new XMLTransformerActions( aMasterPageRefActionTable );
1803 				break;
1804 			case OASIS_MAP_STYLE_REF_ACTIONS:
1805 				m_aActions[OASIS_MAP_STYLE_REF_ACTIONS] =
1806 					new XMLTransformerActions( aMapStyleRefActionTable );
1807 				break;
1808 			case OASIS_MASTER_PAGE_ACTIONS:
1809 				m_aActions[OASIS_MASTER_PAGE_ACTIONS] =
1810 					new XMLTransformerActions( aMasterPageActionTable );
1811 				break;
1812 			case OASIS_NOTES_ACTIONS:
1813 				m_aActions[OASIS_NOTES_ACTIONS] =
1814 					new XMLTransformerActions( aNotesActionTable );
1815 				break;
1816 			case OASIS_ANNOTATION_ACTIONS:
1817 				m_aActions[OASIS_ANNOTATION_ACTIONS] =
1818 					new XMLTransformerActions( aAnnotationActionTable );
1819 				break;
1820 			case OASIS_CHANGE_INFO_ACTIONS:
1821 				m_aActions[OASIS_CHANGE_INFO_ACTIONS] =
1822 					new XMLTransformerActions( aChangeInfoActionTable );
1823 				break;
1824 			case OASIS_FRAME_ELEM_ACTIONS:
1825 				m_aActions[OASIS_FRAME_ELEM_ACTIONS] =
1826 					new XMLTransformerActions( aFrameActionTable );
1827 				break;
1828 			case OASIS_BACKGROUND_IMAGE_ACTIONS:
1829 				m_aActions[OASIS_BACKGROUND_IMAGE_ACTIONS] =
1830 					new XMLTransformerActions( aBackgroundImageActionTable );
1831 				break;
1832 			case OASIS_DDE_CONNECTION_DECL_ACTIONS:
1833 				m_aActions[OASIS_DDE_CONNECTION_DECL_ACTIONS] =
1834 					new XMLTransformerActions( aDDEConnectionDeclActionTable );
1835 				break;
1836 			case OASIS_EVENT_ACTIONS:
1837 				m_aActions[OASIS_EVENT_ACTIONS] =
1838 					new XMLTransformerActions( aEventActionTable );
1839                 break;
1840 			case OASIS_DLG_ACTIONS:
1841 				m_aActions[OASIS_DLG_ACTIONS] =
1842 					new XMLTransformerActions( aDlgActionTable );
1843 				break;
1844 			case OASIS_FORM_CONTROL_ACTIONS:
1845 				m_aActions[OASIS_FORM_CONTROL_ACTIONS] =
1846 					new XMLTransformerActions( aFormControlActionTable );
1847 				break;
1848 			case OASIS_FORM_COLUMN_ACTIONS:
1849 				m_aActions[OASIS_FORM_COLUMN_ACTIONS] =
1850 					new XMLTransformerActions( aFormColumnActionTable );
1851 				break;
1852 			case OASIS_FORM_PROP_ACTIONS:
1853 				m_aActions[OASIS_FORM_PROP_ACTIONS] =
1854 					new XMLTransformerActions( aFormPropActionTable );
1855 				break;
1856 			case OASIS_XLINK_ACTIONS:
1857 				m_aActions[OASIS_XLINK_ACTIONS] =
1858 					new XMLTransformerActions( aXLinkActionTable );
1859 				break;
1860 			case OASIS_CONFIG_ITEM_SET_ACTIONS:
1861 				m_aActions[OASIS_CONFIG_ITEM_SET_ACTIONS] =
1862 					new XMLTransformerActions( aConfigItemSetActionTable );
1863 				break;
1864 			case OASIS_FORMULA_ACTIONS:
1865 				m_aActions[OASIS_FORMULA_ACTIONS] =
1866 					new XMLTransformerActions( aFormulaActionTable );
1867 				break;
1868 			case OASIS_CHART_ACTIONS:
1869 				m_aActions[OASIS_CHART_ACTIONS] =
1870 					new XMLTransformerActions( aChartActionTable );
1871 				break;
1872 			case OASIS_FORM_ACTIONS:
1873 				m_aActions[OASIS_FORM_ACTIONS] =
1874 					new XMLTransformerActions( aFormActionTable );
1875 				break;
1876             case OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS:
1877                 m_aActions[OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS] =
1878                     new XMLTransformerActions(
1879                         aAlphabeticalIndexMarkActionTable );
1880                 break;
1881             case OASIS_CONTENT_VALIDATION_ACTIONS:
1882                 m_aActions[OASIS_CONTENT_VALIDATION_ACTIONS] =
1883                     new XMLTransformerActions( aContentValidationActionTable );
1884 			case OASIS_DDE_CONV_MODE_ACTIONS:
1885 				m_aActions[OASIS_DDE_CONV_MODE_ACTIONS] =
1886 					new XMLTransformerActions( aDDEConvModeActionTable );
1887 				break;
1888 			case OASIS_DATAPILOT_MEMBER_ACTIONS:
1889 				m_aActions[OASIS_DATAPILOT_MEMBER_ACTIONS] =
1890 					new XMLTransformerActions( aDataPilotMemberActionTable );
1891 				break;
1892 			case OASIS_DATAPILOT_LEVEL_ACTIONS:
1893 				m_aActions[OASIS_DATAPILOT_LEVEL_ACTIONS] =
1894 					new XMLTransformerActions( aDataPilotLevelActionTable );
1895 				break;
1896 			case OASIS_SOURCE_SERVICE_ACTIONS:
1897 				m_aActions[OASIS_SOURCE_SERVICE_ACTIONS] =
1898 					new XMLTransformerActions( aSourceServiceActionTable );
1899 				break;
1900             case OASIS_DRAW_AREA_POLYGON_ACTIONS:
1901                 m_aActions[OASIS_DRAW_AREA_POLYGON_ACTIONS] =
1902                     new XMLTransformerActions( aShapeActionTable );
1903                 m_aActions[OASIS_DRAW_AREA_POLYGON_ACTIONS]
1904                     ->Add( aDrawAreaPolygonActionTable );
1905                 break;
1906             case OASIS_SCRIPT_ACTIONS:
1907 				m_aActions[OASIS_SCRIPT_ACTIONS] =
1908 					new XMLTransformerActions( aScriptActionTable );
1909 				break;
1910             case OASIS_DATETIME_ACTIONS:
1911                 m_aActions[OASIS_DATETIME_ACTIONS] =
1912                     new XMLTransformerActions( aDateTimeActionTable );
1913                 break;
1914             // --> OD 2005-01-10 #i40011#, #i40015#
1915             case OASIS_TABLE_STYLE_REF_ACTIONS:
1916                 m_aActions[OASIS_TABLE_STYLE_REF_ACTIONS] =
1917                     new XMLTransformerActions( aTableStyleRefActionTable );
1918                 break;
1919             // <--
1920 			case OASIS_ANIMATION_ACTIONS:
1921                 m_aActions[OASIS_ANIMATION_ACTIONS] =
1922                     new XMLTransformerActions( aAnimationActionTable );
1923                 break;
1924 			}
1925 		}
1926 		pActions = m_aActions[n];
1927 	}
1928 
1929 	return pActions;
1930 }
1931 
1932 OUString Oasis2OOoTransformer::GetEventName( const OUString& rName,
1933 											 sal_Bool bForm )
1934 {
1935 	if( bForm && !m_pFormEventMap )
1936 		m_pFormEventMap =
1937 			XMLEventOASISTransformerContext::CreateFormEventMap();
1938 	if( !m_pEventMap )
1939 		m_pEventMap = XMLEventOASISTransformerContext::CreateEventMap();
1940 
1941 	OUString aMacroName;
1942 	sal_uInt16 nPrefix =
1943 		GetNamespaceMap().GetKeyByAttrName( rName, &aMacroName );
1944 	return XMLEventOASISTransformerContext::GetEventName(
1945 				nPrefix, aMacroName, *m_pEventMap,
1946 		   		bForm ? m_pFormEventMap : 0	);
1947 }
1948 
1949 Oasis2OOoTransformer::Oasis2OOoTransformer() throw() :
1950 	XMLTransformerBase( aActionTable, aTokenMap ),
1951 	m_pEventMap( 0 ),
1952 	m_pFormEventMap( 0 )
1953 {
1954 	GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE );
1955 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE_OOO), XML_NAMESPACE_OFFICE );
1956 
1957 	GetNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META), XML_NAMESPACE_META );
1958 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META_OOO), XML_NAMESPACE_META );
1959 
1960 	GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE );
1961 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE_OOO), XML_NAMESPACE_STYLE );
1962 
1963 	GetNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER), XML_NAMESPACE_NUMBER );
1964 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER_OOO), XML_NAMESPACE_NUMBER );
1965 
1966 	GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG );
1967 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG_OOO), XML_NAMESPACE_CONFIG );
1968 
1969 	GetNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
1970 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT_OOO), XML_NAMESPACE_TEXT );
1971 
1972 	GetNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE );
1973 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE_OOO), XML_NAMESPACE_TABLE );
1974 
1975 	GetNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW );
1976 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW_OOO), XML_NAMESPACE_DRAW );
1977 
1978 	GetNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D), XML_NAMESPACE_DR3D );
1979 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DR3D), GetXMLToken(XML_N_DR3D_OOO), XML_NAMESPACE_DR3D );
1980 
1981 	GetNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION), XML_NAMESPACE_PRESENTATION );
1982 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_PRESENTATION), GetXMLToken(XML_N_PRESENTATION_OOO), XML_NAMESPACE_PRESENTATION );
1983 
1984 	GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART), XML_NAMESPACE_CHART );
1985 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_CHART), GetXMLToken(XML_N_CHART_OOO), XML_NAMESPACE_CHART );
1986 
1987 	GetNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM );
1988 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM_OOO), XML_NAMESPACE_FORM );
1989 
1990 	GetNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT), XML_NAMESPACE_SCRIPT );
1991 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT_OOO), XML_NAMESPACE_SCRIPT );
1992 
1993 	GetNamespaceMap().Add( GetXMLToken(XML_NP_DLG), GetXMLToken(XML_N_DLG), XML_NAMESPACE_DLG );
1994 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_DLG), GetXMLToken(XML_N_DLG), XML_NAMESPACE_DLG );
1995 
1996 	GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO );
1997 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO), XML_NAMESPACE_FO );
1998 
1999 	GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG_COMPAT), XML_NAMESPACE_SVG );
2000 	GetReplaceNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG),  XML_NAMESPACE_SVG );
2001 
2002 
2003 	for( sal_uInt16 i=0; i<MAX_OASIS_ACTIONS; ++i )
2004 		m_aActions[i] = 0;
2005 }
2006 
2007 Oasis2OOoTransformer::~Oasis2OOoTransformer() throw()
2008 {
2009 	for( sal_uInt16 i=0; i<MAX_OASIS_ACTIONS; ++i )
2010 		delete m_aActions[i];
2011 	XMLEventOASISTransformerContext::FlushEventMap( m_pEventMap );
2012 	XMLEventOASISTransformerContext::FlushEventMap( m_pFormEventMap );
2013 }
2014 
2015 ::com::sun::star::uno::Sequence< sal_Int8 >  static CreateUnoTunnelId()
2016 {
2017 	static osl::Mutex aCreateMutex;
2018 	Guard<osl::Mutex> aGuard( aCreateMutex );
2019 	Sequence< sal_Int8 > aSeq( 16 );
2020     rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0,	sal_True );
2021 	return aSeq;
2022 }
2023 
2024 const Sequence< sal_Int8 > & Oasis2OOoTransformer::getUnoTunnelId() throw()
2025 {
2026     static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
2027 	return aSeq;
2028 }
2029 
2030 // XUnoTunnel
2031 sal_Int64 SAL_CALL Oasis2OOoTransformer::getSomething( const Sequence< sal_Int8 >& rId )
2032 	throw(RuntimeException)
2033 {
2034     if( rId.getLength() == 16
2035         && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
2036 										rId.getConstArray(), 16 ) )
2037     {
2038 		return reinterpret_cast< sal_Int64 >( this );
2039     }
2040 	else
2041 	{
2042 		return (sal_Int64)0;
2043 	}
2044 }
2045 
2046 // XServiceInfo
2047 OUString SAL_CALL Oasis2OOoTransformer::getImplementationName()
2048     throw(RuntimeException)
2049 {
2050 	return Oasis2OOoTransformer_getImplementationName();
2051 }
2052 
2053 sal_Bool SAL_CALL Oasis2OOoTransformer::supportsService( const OUString& )
2054 	throw(RuntimeException)
2055 {
2056     return sal_False;
2057 }
2058 
2059 Sequence< OUString > SAL_CALL Oasis2OOoTransformer::getSupportedServiceNames(  )
2060 	throw(RuntimeException)
2061 {
2062     Sequence<OUString> aSeq(0);
2063     return aSeq;
2064 }
2065 
2066 // Service registration
2067 
2068 OUString SAL_CALL Oasis2OOoTransformer_getImplementationName() throw()
2069 {
2070 	return OUString( RTL_CONSTASCII_USTRINGPARAM(
2071 		"com.sun.star.comp.Oasis2OOoTransformer" ) );
2072 }
2073 
2074 Sequence< OUString > SAL_CALL Oasis2OOoTransformer_getSupportedServiceNames()
2075 	throw()
2076 {
2077 	const OUString aServiceName( Oasis2OOoTransformer_getImplementationName() );
2078 	const Sequence< OUString > aSeq( &aServiceName, 1 );
2079 	return aSeq;
2080 }
2081 
2082 Reference< XInterface > SAL_CALL Oasis2OOoTransformer_createInstance(
2083 		const Reference< XMultiServiceFactory > &)
2084 	throw( Exception )
2085 {
2086 	OSL_TRACE("Creating Oasis2OOoTransformer");
2087 	return (cppu::OWeakObject*)new Oasis2OOoTransformer;
2088 }
2089