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