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