LibreOffice Module xmloff (master) 1
Oasis2OOo.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <comphelper/base64.hxx>
21#include <com/sun/star/beans/XPropertySetInfo.hpp>
22#include <com/sun/star/lang/XMultiServiceFactory.hpp>
23#include <com/sun/star/uno/XComponentContext.hpp>
24#include <rtl/ustrbuf.hxx>
25#include <sal/log.hxx>
28#include <xmloff/xmltoken.hxx>
29#include "DeepTContext.hxx"
30#include "MetaTContext.hxx"
31#include "DocumentTContext.hxx"
32#include "NotesTContext.hxx"
36#include "DlgOASISTContext.hxx"
41#include "MutableAttrList.hxx"
45#include "FamilyType.hxx"
47#include "Oasis2OOo.hxx"
49
50using namespace ::osl;
51using namespace ::xmloff::token;
52using namespace ::com::sun::star::uno;
53using namespace ::com::sun::star::lang;
54using namespace ::com::sun::star::xml::sax;
55using namespace ::com::sun::star::beans;
56
57namespace {
58
59enum XMLUserDefinedTransformerAction
60{
61 XML_ETACTION_META=XML_ETACTION_USER_DEFINED,
62 XML_ETACTION_DOCUMENT,
63 XML_ETACTION_BODY,
64 XML_ETACTION_NOTES,
65 XML_ETACTION_TABLE,
66 XML_ETACTION_STYLE,
67 XML_ETACTION_STYLE_RENAME,
68 XML_ETACTION_FRAME,
69 XML_ETACTION_EVENT,
70 XML_ETACTION_DLG,
71 XML_ETACTION_TAB_STOP,
72 XML_ETACTION_FORM_CONTROL,
73 XML_ETACTION_FORM_PROPERTY,
74 XML_ETACTION_CONFIG_ITEM,
75 XML_ETACTION_TRACKED_CHANGES,
76 XML_ETACTION_CHART,
77 XML_ETACTION_CHART_PLOT_AREA
78};
79
80}
81
82#define ENTRY3( n, l, a, p1, p2, p3 ) \
83 { n, l, a, p1, p2, p3 }
84#define ENTRY3QNQ( n, l, a, n1, l1, p2, n3, l3 ) \
85 ENTRY3( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \
86 p2, XMLTransformerActionInit::QNameParam( n3, l3 ) )
87
88#define ENTRY2( n, l, a, p1, p2 ) \
89 ENTRY3( n, l, a, p1, p2, 0 )
90#define ENTRY2QN( n, l, a, n1, l1, p2 ) \
91 ENTRY2( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), p2 )
92
93#define ENTRY1( n, l, a, p1 ) \
94 ENTRY3( n, l, a, p1, 0, 0 )
95#define ENTRY1Q( n, l, a, p1, t1 ) \
96 ENTRY1( n, l, a, XMLTransformerActionInit::QNameParam( p1, t1 ) )
97
98#define ENTRY0( n, l, a ) \
99 ENTRY3( n, l, a, 0, 0, 0 )
100
101// a macro to put two tokens into one sal_Int32 for the action
102// XML_ATACTION_RENAME_ATTRIBUTE
103static constexpr sal_Int32 RENAME_ENTRY( XMLTokenEnum f, XMLTokenEnum s )
104{
105 return static_cast< sal_Int32 >(f) | (static_cast< sal_Int32 >(s) << 16);
106}
107
109{
110 // add office:class from <office:document> and <office:document-content>
111 ENTRY0( XML_NAMESPACE_OFFICE, XML_DOCUMENT, XML_ETACTION_DOCUMENT ),
112 ENTRY0( XML_NAMESPACE_OFFICE, XML_DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ),
115
116 // add <meta:keywords>
117 ENTRY0( XML_NAMESPACE_OFFICE, XML_META, XML_ETACTION_META ),
118
119 // rename <office:scripts> to <office:script>
122
123 // rename <office:script> to <office:script-data> and process attributes
127
128 // rename <ooo:libraries> to <script:libraries>
131
132 // rename <ooo:library-linked> to <script:library-linked> and process attributes
136
137 // rename <ooo:library-embedded> to <script:library-embedded> and process attributes
141
142 // rename <ooo:module> to <script:module> and process attributes
146
147 // rename <ooo:source-code> to <script:source-code>
150
151 ENTRY0( XML_NAMESPACE_OFFICE, XML_BODY, XML_ETACTION_BODY ),
152
153 // rename <office:font-face-decls> to <office:font-decl>,
154 // rename <style:font-face> to <style:font-decl>, process attrs
160
161 // remove genre element
168
169 // rename <style:page-layout> to <style:page-master>
170 // ENTRY1Q( STYLE, PAGE_LAYOUT, RENAME_ELEM,
171 // XML_NAMESPACE_STYLE, XML_PAGE_MASTER ),
174
175 // merge <style:*-properties> into <style:properties> and do other
176 // styles processing
177 ENTRY1( XML_NAMESPACE_STYLE, XML_STYLE, XML_ETACTION_STYLE,
179 ENTRY1( XML_NAMESPACE_STYLE, XML_DEFAULT_STYLE, XML_ETACTION_STYLE,
181 ENTRY2QN( XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, XML_ETACTION_STYLE_RENAME,
184 ENTRY1( XML_NAMESPACE_NUMBER, XML_NUMBER_STYLE, XML_ETACTION_STYLE,
186 ENTRY1( XML_NAMESPACE_NUMBER, XML_CURRENCY_STYLE, XML_ETACTION_STYLE,
190 ENTRY1( XML_NAMESPACE_NUMBER, XML_DATE_STYLE, XML_ETACTION_STYLE,
192 ENTRY1( XML_NAMESPACE_NUMBER, XML_TIME_STYLE, XML_ETACTION_STYLE,
194 ENTRY1( XML_NAMESPACE_NUMBER, XML_BOOLEAN_STYLE, XML_ETACTION_STYLE,
196 ENTRY1( XML_NAMESPACE_NUMBER, XML_TEXT_STYLE, XML_ETACTION_STYLE,
198 ENTRY1( XML_NAMESPACE_TEXT, XML_LIST_STYLE, XML_ETACTION_STYLE,
200// ENTRY0( XML_NAMESPACE_TEXT, XML_OUTLINE_STYLE, STYLE ),
201
202 ENTRY1( XML_NAMESPACE_STYLE, XML_HEADER_STYLE, XML_ETACTION_STYLE,
204 ENTRY1( XML_NAMESPACE_STYLE, XML_FOOTER_STYLE, XML_ETACTION_STYLE,
214 ENTRY1( XML_NAMESPACE_DRAW, XML_GRADIENT, XML_ETACTION_STYLE,
216 ENTRY1( XML_NAMESPACE_DRAW, XML_FILL_IMAGE, XML_ETACTION_STYLE,
218 ENTRY2QN( XML_NAMESPACE_DRAW, XML_OPACITY, XML_ETACTION_STYLE_RENAME,
221 ENTRY1( XML_NAMESPACE_DRAW, XML_MARKER, XML_ETACTION_STYLE,
223 ENTRY1( XML_NAMESPACE_DRAW, XML_HATCH, XML_ETACTION_STYLE,
225 ENTRY1( XML_NAMESPACE_DRAW, XML_STROKE_DASH, XML_ETACTION_STYLE,
227
228 // process <text:h/p>: process style-name attributes,
229 // rename <text:h>'s text:outline-level to text:level,
232
233 // process <test:list>'s text:style-name attributes
234 // rename <text:list> to <text:ordered-list> or <text:unordered-list>
235 // TODO: All list currently are renamed to <text:ordered-list>
239
240 // rename <text:note*> to <text:footnote*> or <text:endnote*>
243 ENTRY1( XML_NAMESPACE_TEXT, XML_NOTE, XML_ETACTION_NOTES, XML_NOTE ),
244
245 // rename <text:footnote> and <text:endnote> to <text:note>
246 ENTRY1( XML_NAMESPACE_TEXT, XML_NOTE_REF, XML_ETACTION_NOTES, XML_NOTE_REF ),
247
248 // rename <text:tab> to <text:tab-stop>
251
252 // replace <table:table table:is-sub-table> with <table:sub-table>
253 ENTRY0( XML_NAMESPACE_TABLE, XML_TABLE, XML_ETACTION_TABLE ),
254
255 // merge frame element
256 ENTRY0( XML_NAMESPACE_DRAW, XML_FRAME, XML_ETACTION_FRAME ),
257
258 // process events
261 ENTRY0( XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, XML_ETACTION_EVENT ),
262 ENTRY0( XML_NAMESPACE_SCRIPT, XML_EVENT, XML_ETACTION_EVENT ),
264
265 // process Basic dialogs
266 ENTRY0( XML_NAMESPACE_DLG, XML_STYLE, XML_ETACTION_DLG ),
267
268 // process length attributes
282// ENTRY1( XML_NAMESPACE_DRAW, XML_FRAME, XML_ETACTION_PROC_ATTRS, OASIS_SHAPE_ACTIONS ),
312
313 ENTRY0( XML_NAMESPACE_CHART, XML_CHART, XML_ETACTION_CHART ),
314 ENTRY0( XML_NAMESPACE_CHART, XML_PLOT_AREA, XML_ETACTION_CHART_PLOT_AREA ),
315
316 ENTRY0( XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, XML_ETACTION_CONFIG_ITEM ),
317 ENTRY1Q( XML_NAMESPACE_TEXT, XML_TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
319 ENTRY1Q( XML_NAMESPACE_TABLE, XML_TRACKED_CHANGES, XML_ETACTION_TRACKED_CHANGES,
321
324 ENTRY0( XML_NAMESPACE_STYLE, XML_TAB_STOP, XML_ETACTION_TAB_STOP ),
334
335 // process *:style-name attributes
342 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
344 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
346 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
348 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
350 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
352 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
354 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
356 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
358 OASIS_PARA_STYLE_REF_ACTIONS ), /* generated entry */
365 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
367 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
369 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
371 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
373 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
375 OASIS_TEXT_STYLE_REF_ACTIONS ), /* generated entry */
377 OASIS_MASTER_PAGE_REF_ACTIONS ), /* generated entry */
378 // Conversion of attribute <table:style-name> for <table:table-row> and
379 // <table:table-column> (#i40011#, #i40015#)
384
385 // rename office:value-* to *:value-*
387 OASIS_TEXT_VALUE_TYPE_ACTIONS ), /* generated entry */
389 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
391 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
393 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
395 OASIS_TEXT_VALUE_TYPE_ACTIONS), /* generated entry */
397 OASIS_DATETIME_ACTIONS ), // Add OASIS_TEXT_VALUE_TYPE_ACTIONS if attrs are added to text:user-defined
399 OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
401 OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
403 OASIS_TABLE_VALUE_TYPE_ACTIONS), /* generated entry */
404// ENTRY1( XML_NAMESPACE_FORM, XML_PROPERTY, XML_ETACTION_PROC_ATTRS,
405// OASIS_VALUE_TYPE_ACTIONS), /* TODO: generated entry */
406// ENTRY1( XML_NAMESPACE_FORM, XML_LIST_PROPERTY, XML_ETACTION_PROC_ATTRS,
407// OASIS_VALUE_TYPE_ACTIONS), /* generated entry */
408
410 OASIS_ANNOTATION_ACTIONS ), /* generated entry */
412 OASIS_CHANGE_INFO_ACTIONS ), /* generated entry */
413
416
417 ENTRY0( XML_NAMESPACE_FORM, XML_TEXT, XML_ETACTION_FORM_CONTROL ),
418 ENTRY0( XML_NAMESPACE_FORM, XML_TEXTAREA, XML_ETACTION_FORM_CONTROL ),
419 ENTRY0( XML_NAMESPACE_FORM, XML_FIXED_TEXT, XML_ETACTION_FORM_CONTROL ),
420 ENTRY0( XML_NAMESPACE_FORM, XML_FILE, XML_ETACTION_FORM_CONTROL ),
421 ENTRY0( XML_NAMESPACE_FORM, XML_PASSWORD, XML_ETACTION_FORM_CONTROL ),
422 ENTRY0( XML_NAMESPACE_FORM, XML_FORMATTED_TEXT, XML_ETACTION_FORM_CONTROL ),
423 ENTRY0( XML_NAMESPACE_FORM, XML_BUTTON, XML_ETACTION_FORM_CONTROL ),
424 ENTRY0( XML_NAMESPACE_FORM, XML_IMAGE, XML_ETACTION_FORM_CONTROL ),
425 ENTRY0( XML_NAMESPACE_FORM, XML_CHECKBOX, XML_ETACTION_FORM_CONTROL ),
426 ENTRY0( XML_NAMESPACE_FORM, XML_RADIO, XML_ETACTION_FORM_CONTROL ),
427 ENTRY0( XML_NAMESPACE_FORM, XML_LISTBOX, XML_ETACTION_FORM_CONTROL ),
428 ENTRY0( XML_NAMESPACE_FORM, XML_COMBOBOX, XML_ETACTION_FORM_CONTROL ),
429 ENTRY0( XML_NAMESPACE_FORM, XML_FRAME, XML_ETACTION_FORM_CONTROL ),
430 ENTRY0( XML_NAMESPACE_FORM, XML_HIDDEN, XML_ETACTION_FORM_CONTROL ),
431 ENTRY0( XML_NAMESPACE_FORM, XML_IMAGE_FRAME, XML_ETACTION_FORM_CONTROL ),
432 ENTRY0( XML_NAMESPACE_FORM, XML_GRID, XML_ETACTION_FORM_CONTROL ),
433 ENTRY0( XML_NAMESPACE_FORM, XML_VALUE_RANGE, XML_ETACTION_FORM_CONTROL ),
434 ENTRY0( XML_NAMESPACE_FORM, XML_GENERIC_CONTROL, XML_ETACTION_FORM_CONTROL ),
437 ENTRY1( XML_NAMESPACE_FORM, XML_PROPERTY, XML_ETACTION_FORM_PROPERTY, XML_PROPERTY ),
438 ENTRY1( XML_NAMESPACE_FORM, XML_LIST_PROPERTY, XML_ETACTION_FORM_PROPERTY,
440 ENTRY1( XML_NAMESPACE_FORM, XML_LIST_VALUE, XML_ETACTION_FORM_PROPERTY, XML_LIST_VALUE ),
441
442 // process xlink:href
444 OASIS_XLINK_ACTIONS ), /* generated entry */
446 OASIS_XLINK_ACTIONS ), /* generated entry */
448 OASIS_XLINK_ACTIONS ), /* generated entry */
450 OASIS_XLINK_ACTIONS ), /* generated entry */
452 OASIS_XLINK_ACTIONS ), /* generated entry */
454 OASIS_XLINK_ACTIONS ), /* generated entry */
456 OASIS_XLINK_ACTIONS ), /* generated entry */
458 OASIS_XLINK_ACTIONS ), /* generated entry */
460 OASIS_XLINK_ACTIONS ), /* generated entry */
462 OASIS_FORM_ACTIONS ), /* generated entry */
463// ENTRY1( XML_NAMESPACE_SVG, XML_FONT_FACE_URI, XML_ETACTION_PROC_ATTRS,
464// OASIS_XLINK_ACTIONS ), /* generated entry */
465// ENTRY1( XML_NAMESPACE_SVG, XML_DEFINITION_SRC, XML_ETACTION_PROC_ATTRS,
466// OASIS_XLINK_ACTIONS ), /* generated entry */
470// OASIS_XLINK_ACTIONS ), /* generated entry */
471// events don't have real URIs
472// ENTRY1( XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, XML_ETACTION_PROC_ATTRS,
473// OASIS_XLINK_ACTIONS ), /* generated entry */
474// ENTRY1( XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, XML_ETACTION_PROC_ATTRS,
475// OASIS_XLINK_ACTIONS ), /* generated entry */
476
477 // add namespace prefix to name
480
481 // add namespace prefix to formula and condition
482 // text:condition
484 OASIS_FORMULA_ACTIONS ), /* generated entry */
485 // text:formula
487 OASIS_FORMULA_ACTIONS ), /* generated entry */
488 // text:condition
490 OASIS_FORMULA_ACTIONS ), /* generated entry */
491 // text:condition
494 OASIS_FORMULA_ACTIONS ), /* generated entry */
495 // text:condition
497 OASIS_FORMULA_ACTIONS ), /* generated entry */
498 // text:condition
500 OASIS_FORMULA_ACTIONS ), /* generated entry */
501 // text:condition
503 OASIS_FORMULA_ACTIONS ), /* generated entry */
504 // text:formula
506 OASIS_FORMULA_ACTIONS ), /* generated entry */
507
508 // process table::content-validation
511
512 // rename <table:dependencies> to <table:dependences>
517
518 // process table::conversion-mode
521
522 // process table::data-pilot-member
525
526 // process table::data-pilot-level
529
530 // process table::source-service
533
534 // entries for date time change (#i36576#)
549
550 // fix <text:alphabatical-index-mark text:main-etry>
555
556 // fix id strings in old animation elements
563
565};
566
567// XML_ETACTION_STYLE
569{
585 XML_FAMILY_TYPE_TEXT ), // list level styles
599};
600
601// OASIS_FRAME_ELEM_ACTIONS
603{
612};
613
614// OASIS_EVENT_ELEM_ACTIONS
616{
622};
623
624// OASIS_EVENT_ELEM_ACTIONS
626{
628};
629
630// action table for OASIS_MASTER_PAGE_ACTIONS
632{
638};
639
640// action table for OASIS_TEXT_STYLE_REF_ACTIONS
642{
647};
648
649// action table for OASIS_PARA_STYLE_REF_ACTIONS
651{
654};
655
656// action table for OASIS_LIST_STYLE_REF_ACTIONS
658{
661};
662
663// action table for OASIS_MASTER_PAGE_REF_ACTIONS
665{
668};
669
670// action table for OASIS_MAP_STYLE_REF_ACTIONS
672{
675};
676
677// action table for OASIS_TABLE_STYLE_REF_ACTIONS (#i40011#, #i40015#)
679{
682};
683
685{
689};
690
691// action table for OASIS_PARA_ACTIONS
693{
698};
699
700// !!ATTENTION!! If you change something here, please also change
701// aConnectorActionTable if appropriate
703{
734
735 // needed by chart:legend. The legend needs also the draw actions. As
736 // there is no merge mechanism, all actions have to be in the same table
740
742
744};
745
746// OASIS_ANIMATION_ACTIONS
748{
752
754};
755
756// OOO_CONNECTOR_ACTIONS
758{
779
781};
782
783// OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS
785{
789};
790
791// OASIS_TAB_STOP_ACTIONS
793{
802};
803
804// OASIS_LINENUMBERING_ACTIONS
806{
811};
812
814{
819};
820
821// OASIS_NOTES_ACTIONS (processed by special context)
823{
830};
831
832// OASIS_DROP_CAP_ACTIONS
834{
838};
839
841{
849};
850
851// OASIS_TEXT_VALUE_TYPE_ACTIONS
853{
863};
864
865// OASIS_TABLE_VALUE_TYPE_ACTIONS
867{
879};
880
881// action table for OASIS_ANNOTATION_ACTIONS
883{
889};
890
891// action table for OASIS_CHANGE_INFO_ACTIONS
893{
897};
898
899// OASIS_BACKGROUND_IMAGE_ACTIONS
901{
905};
906
907// OASIS_DDE_CONNECTION_DECL
909{
912};
913
914// OASIS_FORM_CONTROL_ACTIONS
916{
923};
924
925// OASIS_FORM_COLUMN_ACTIONS
927{
932};
933
934// OASIS_FORM_PROP_ACTIONS
936{
945};
946
947// OASIS_XLINK_ACTIONS
949{
953};
954
955// OASIS_CONFIG_ITEM_SET_ACTIONS
957{
960};
961
962// OASIS_FORMULA_ACTIONS
964{
970};
971
972// OASIS_CONTENT_VALIDATION_ACTIONS
974{
978};
979
980// OASIS_DDE_CONV_MODE_ACTIONS
982{
985};
986
987// OASIS_DATAPILOT_MEMBER_ACTIONS
989{
992};
993
994// OASIS_DATAPILOT_LEVEL_ACTIONS
996{
999};
1000
1001// OASIS_SOURCE_SERVICE_ACTIONS
1003{
1006};
1007
1008// OASIS_CHART_ACTIONS
1010{
1016};
1017
1018// OASIS_FORM_ACTIONS
1020{
1025};
1026
1027// OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS
1029{
1032};
1033
1034// OASIS_DRAW_AREA_POLYGON_ACTIONS (to be added to OASIS_SHAPE_ACTIONS)
1036{
1039};
1040
1041// OASIS_SCRIPT_ACTIONS
1043{
1048};
1049
1050// OASIS_DATETIME_ACTIONS
1052{
1068};
1069
1071{
1074};
1075
1076namespace {
1077
1078class XMLTableTransformerContext_Impl : public XMLTransformerContext
1079{
1080 OUString m_aElemQName;
1081
1082public:
1083 XMLTableTransformerContext_Impl( XMLTransformerBase& rTransformer,
1084 const OUString& rQName );
1085
1086 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1087 virtual void EndElement() override;
1088};
1089
1090}
1091
1092XMLTableTransformerContext_Impl::XMLTableTransformerContext_Impl(
1093 XMLTransformerBase& rImp,
1094 const OUString& rQName ) :
1095 XMLTransformerContext( rImp, rQName ),
1096 m_aElemQName( rQName )
1097{
1098}
1099
1100void XMLTableTransformerContext_Impl::StartElement(
1101 const Reference< XAttributeList >& rAttrList )
1102{
1103 Reference< XAttributeList > xAttrList( rAttrList );
1104
1106
1107 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1108 for( sal_Int16 i=0; i < nAttrCount; i++ )
1109 {
1110 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1111 OUString aLocalName;
1112 sal_uInt16 nPrefix =
1113 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1114 &aLocalName );
1115 if( XML_NAMESPACE_TABLE == nPrefix )
1116 {
1117 if ( IsXMLToken( aLocalName, XML_IS_SUB_TABLE ) )
1118 {
1119 const OUString& rValue = xAttrList->getValueByIndex( i );
1120 if( IsXMLToken( rValue, XML_TRUE ) )
1121 {
1122 m_aElemQName = GetTransformer().GetNamespaceMap().GetQNameByKey(
1125 if ( !pMutableAttrList )
1126 {
1127 pMutableAttrList =
1128 new XMLMutableAttributeList( xAttrList );
1129 xAttrList = pMutableAttrList;
1130 }
1131 pMutableAttrList->RemoveAttributeByIndex( i );
1132 }
1133 // #i50521# - no break here for safety reason.
1134 }
1135 // Convert attribute table:style-name for <table:table> (#i40011#, #i40015#)
1136 else if ( IsXMLToken( aLocalName, XML_STYLE_NAME ) )
1137 {
1138 const OUString& rValue = xAttrList->getValueByIndex( i );
1139 OUString aAttrValue( rValue );
1140 if( XMLTransformerBase::DecodeStyleName(aAttrValue) )
1141 {
1142 if ( !pMutableAttrList )
1143 {
1144 pMutableAttrList =
1145 new XMLMutableAttributeList( xAttrList );
1146 xAttrList = pMutableAttrList;
1147 }
1148 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1149 }
1150 }
1151 else if( IsXMLToken( aLocalName, XML_PRINT ) )
1152 {
1153 if ( !pMutableAttrList )
1154 {
1155 pMutableAttrList =
1156 new XMLMutableAttributeList( xAttrList );
1157 xAttrList = pMutableAttrList;
1158 }
1159 pMutableAttrList->RemoveAttributeByIndex( i );
1160 }
1161 }
1162 }
1163
1164 GetTransformer().GetDocHandler()->startElement( m_aElemQName, xAttrList );
1165}
1166
1167void XMLTableTransformerContext_Impl::EndElement()
1168{
1169 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
1170}
1171
1172namespace {
1173
1174class XMLBodyOASISTransformerContext_Impl : public XMLTransformerContext
1175{
1176 bool m_bFirstChild;
1177
1178public:
1179 XMLBodyOASISTransformerContext_Impl( XMLTransformerBase& rTransformer,
1180 const OUString& rQName );
1181
1182 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1183
1185 const OUString& rLocalName,
1186 const OUString& rQName,
1187 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1188 virtual void EndElement() override;
1189};
1190
1191}
1192
1193XMLBodyOASISTransformerContext_Impl::XMLBodyOASISTransformerContext_Impl(
1194 XMLTransformerBase& rImp,
1195 const OUString& rQName ) :
1196 XMLTransformerContext( rImp, rQName ),
1197 m_bFirstChild( false )
1198{
1199}
1200
1201void XMLBodyOASISTransformerContext_Impl::StartElement(
1202 const Reference< XAttributeList >& )
1203{
1204}
1205
1206rtl::Reference<XMLTransformerContext> XMLBodyOASISTransformerContext_Impl::CreateChildContext( sal_uInt16 nPrefix,
1207 const OUString& rLocalName,
1208 const OUString& rQName,
1209 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList )
1210{
1211 if (!m_bFirstChild)
1212 {
1213 m_bFirstChild = true;
1215 }
1216
1217 return XMLTransformerContext::CreateChildContext(nPrefix, rLocalName, rQName, xAttrList);
1218}
1219
1220void XMLBodyOASISTransformerContext_Impl::EndElement()
1221{
1222 if (!m_bFirstChild)
1223 XMLTransformerContext::StartElement(Reference< XAttributeList >());
1224
1226}
1227
1228namespace {
1229
1230class XMLTabStopOASISTContext_Impl : public XMLPersElemContentTContext
1231{
1232public:
1233 XMLTabStopOASISTContext_Impl( XMLTransformerBase& rTransformer,
1234 const OUString& rQName );
1235
1236 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1237};
1238
1239}
1240
1241XMLTabStopOASISTContext_Impl::XMLTabStopOASISTContext_Impl(
1242 XMLTransformerBase& rImp,
1243 const OUString& rQName ) :
1244 XMLPersElemContentTContext( rImp, rQName )
1245{
1246}
1247
1248void XMLTabStopOASISTContext_Impl::StartElement(
1249 const Reference< XAttributeList >& rAttrList )
1250{
1251 XMLTransformerActions *pActions =
1252 GetTransformer().GetUserDefinedActions( OASIS_TAB_STOP_ACTIONS );
1253 SAL_WARN_IF( nullptr == pActions, "xmloff.transform", "got no actions" );
1254
1255 sal_Unicode cStyleLeaderChar = 0;
1256 sal_Int16 nLeaderText = -1;
1257 Reference< XAttributeList > xAttrList( rAttrList );
1259 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1260 for( sal_Int16 i=0; i < nAttrCount; i++ )
1261 {
1262 const OUString& rAttrName = xAttrList->getNameByIndex( i );
1263 OUString aLocalName;
1264 sal_uInt16 nPrefix =
1265 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1266 &aLocalName );
1267 XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1268 XMLTransformerActions::const_iterator aIter =
1269 pActions->find( aKey );
1270 if( aIter != pActions->end() )
1271 {
1272 if( !pMutableAttrList )
1273 {
1274 pMutableAttrList =
1275 new XMLMutableAttributeList( xAttrList );
1276 xAttrList = pMutableAttrList;
1277 }
1278 const OUString& rAttrValue = xAttrList->getValueByIndex( i );
1279 switch( (*aIter).second.m_nActionType )
1280 {
1282 if( IsXMLToken( aLocalName, XML_LEADER_STYLE ) )
1283 {
1284 if( IsXMLToken( rAttrValue, XML_NONE ) )
1285 cStyleLeaderChar = ' ';
1286 else if( IsXMLToken( rAttrValue, XML_DOTTED ) )
1287 cStyleLeaderChar = '.';
1288 else
1289 cStyleLeaderChar = 0;
1290 pMutableAttrList->RemoveAttributeByIndex( i );
1291 --i;
1292 --nAttrCount;
1293 }
1294 break;
1296 {
1297 OUString aNewAttrQName(
1298 GetTransformer().GetNamespaceMap().GetQNameByKey(
1299 (*aIter).second.GetQNamePrefixFromParam1(),
1301 (*aIter).second.GetQNameTokenFromParam1()) ) );
1302 pMutableAttrList->RenameAttributeByIndex( i,
1303 aNewAttrQName );
1304 }
1305 if( IsXMLToken( aLocalName, XML_LEADER_TEXT ) )
1306 {
1307 if( rAttrValue.getLength() > 1 )
1308 {
1309 OUString aAttrValue( rAttrValue.copy( 0, 1 ) );
1310 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1311 nLeaderText = i;
1312 }
1313 }
1314 break;
1316 {
1317 OUString aAttrValue( rAttrValue );
1319 aAttrValue ) )
1320 pMutableAttrList->SetValueByIndex( i, aAttrValue );
1321 }
1322 break;
1323 default:
1324 SAL_WARN( "xmloff.transform", "unknown action" );
1325 break;
1326 }
1327 }
1328 }
1329
1330 if( cStyleLeaderChar && ' ' != cStyleLeaderChar )
1331 {
1332 if( nLeaderText != -1 )
1333 {
1334 OUString aNewAttrQName(
1335 GetTransformer().GetNamespaceMap().GetQNameByKey(
1338 pMutableAttrList->AddAttribute( aNewAttrQName,
1339 OUString( cStyleLeaderChar ) );
1340 }
1341 }
1342 else
1343 {
1344 if( nLeaderText != -1 )
1345 pMutableAttrList->RemoveAttributeByIndex( nLeaderText );
1346 }
1347
1349}
1350
1351namespace {
1352
1353class XMLConfigItemTContext_Impl : public XMLTransformerContext
1354{
1355 OUString m_aContent;
1356 bool m_bIsRedlineProtectionKey;
1357 bool m_bIsCursorX;
1358 bool m_bIsCursorY;
1359
1360public:
1361 XMLConfigItemTContext_Impl( XMLTransformerBase& rTransformer,
1362 const OUString& rQName );
1363
1364 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1365 virtual void EndElement() override;
1366
1367 virtual void Characters( const OUString& rChars ) override;
1368};
1369
1370}
1371
1372XMLConfigItemTContext_Impl::XMLConfigItemTContext_Impl(
1373 XMLTransformerBase& rImp,
1374 const OUString& rQName ) :
1375 XMLTransformerContext( rImp, rQName ),
1376 m_bIsRedlineProtectionKey( false ),
1377 m_bIsCursorX( false ),
1378 m_bIsCursorY( false )
1379{
1380}
1381
1382void XMLConfigItemTContext_Impl::StartElement(
1383 const Reference< XAttributeList >& rAttrList )
1384{
1385 sal_Int16 nAttrCount = rAttrList.is() ? rAttrList->getLength() : 0;
1386 for( sal_Int16 i=0; i < nAttrCount; i++ )
1387 {
1388 const OUString& rAttrName = rAttrList->getNameByIndex( i );
1389 OUString aLocalName;
1390 sal_uInt16 nPrefix =
1391 GetTransformer().GetNamespaceMap().GetKeyByAttrName( rAttrName,
1392 &aLocalName );
1393 if( XML_NAMESPACE_CONFIG == nPrefix )
1394 {
1395 if ( IsXMLToken( aLocalName, XML_NAME ) )
1396 {
1397 const OUString& rValue = rAttrList->getValueByIndex( i );
1398 if( rValue == "RedlineProtectionKey" )
1399 m_bIsRedlineProtectionKey = true;
1400 else if( rValue == "CursorPositionX" )
1401 m_bIsCursorX = true;
1402 else if( rValue == "CursorPositionY" )
1403 m_bIsCursorY = true;
1404
1405 break;
1406 }
1407 }
1408 }
1409
1411}
1412
1413void XMLConfigItemTContext_Impl::Characters( const OUString& rChars )
1414{
1415 OUString sChars(rChars);
1416 if (m_bIsRedlineProtectionKey)
1417 m_aContent += rChars;
1418 else if (m_bIsCursorX || m_bIsCursorY)
1419 {
1420 sal_Int32 nPos = rChars.toInt32();
1421 if (m_bIsCursorX && nPos > 255)
1422 nPos = 255;
1423 else if (m_bIsCursorY && nPos > 31999)
1424 nPos = 31999;
1425
1426 sChars = OUString::number(nPos);
1427 }
1428
1430}
1431
1432void XMLConfigItemTContext_Impl::EndElement()
1433{
1434
1435 if( m_bIsRedlineProtectionKey )
1436 {
1437 const Reference< XPropertySet > rPropSet =
1438 GetTransformer().GetPropertySet();
1439 if( rPropSet.is() )
1440 {
1441 OUString aPropName("RedlineProtectionKey");
1442 Reference< XPropertySetInfo > xPropSetInfo(
1443 rPropSet->getPropertySetInfo() );
1444 if( xPropSetInfo.is() &&
1445 xPropSetInfo->hasPropertyByName( aPropName ) )
1446 {
1447 Sequence < sal_Int8 > aKey;
1448 ::comphelper::Base64::decode( aKey, m_aContent );
1449 rPropSet->setPropertyValue( aPropName, Any( aKey ) );
1450 }
1451 }
1452 }
1454}
1455
1456namespace {
1457
1458class XMLTrackedChangesOASISTContext_Impl : public XMLTransformerContext
1459{
1460 OUString const m_aAttrQName;
1461
1462public:
1463
1464 XMLTrackedChangesOASISTContext_Impl( XMLTransformerBase& rTransformer,
1465 const OUString& rQName,
1466 sal_uInt16 nPrefix,
1468
1469 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override;
1470};
1471
1472}
1473
1474XMLTrackedChangesOASISTContext_Impl::XMLTrackedChangesOASISTContext_Impl(
1475 XMLTransformerBase& rImp,
1476 const OUString& rQName,
1477 sal_uInt16 nPrefix,
1479 XMLTransformerContext( rImp, rQName ),
1480 m_aAttrQName( rImp.GetNamespaceMap().GetQNameByKey( nPrefix,
1482{
1483}
1484
1485void XMLTrackedChangesOASISTContext_Impl::StartElement(
1486 const Reference< XAttributeList >& rAttrList )
1487{
1488 Reference< XAttributeList > xAttrList( rAttrList );
1489 const Reference< XPropertySet > rPropSet =
1490 GetTransformer().GetPropertySet();
1491 if( rPropSet.is() )
1492 {
1493 OUString aPropName("RedlineProtectionKey");
1494 Reference< XPropertySetInfo > xPropSetInfo(
1495 rPropSet->getPropertySetInfo() );
1496 if( xPropSetInfo.is() &&
1497 xPropSetInfo->hasPropertyByName( aPropName ) )
1498 {
1499 Any aAny = rPropSet->getPropertyValue( aPropName);
1500 Sequence < sal_Int8 > aKey;
1501 aAny >>= aKey;
1502 if( aKey.hasElements() )
1503 {
1504 OUStringBuffer aBuffer;
1505 ::comphelper::Base64::encode( aBuffer, aKey );
1507 new XMLMutableAttributeList( xAttrList );
1508 xAttrList = pMutableAttrList;
1509 pMutableAttrList->AddAttribute( m_aAttrQName,
1510 aBuffer.makeStringAndClear() );
1511 }
1512 }
1513 }
1515}
1516
1518 const TransformerAction_Impl& rAction,
1519 const OUString& rQName,
1520 bool bPersistent )
1521{
1522 switch( rAction.m_nActionType )
1523 {
1524 case XML_ETACTION_META:
1525 return new XMLMetaTransformerContext( *this, rQName );
1526 case XML_ETACTION_DOCUMENT:
1527 return new XMLDocumentTransformerContext( *this, rQName );
1528 case XML_ETACTION_BODY:
1529 return new XMLBodyOASISTransformerContext_Impl( *this, rQName );
1530 case XML_ETACTION_NOTES:
1531 return new XMLNotesTransformerContext( *this, rQName,
1532 static_cast< XMLTokenEnum>( rAction.m_nParam1 ), bPersistent );
1533 case XML_ETACTION_TABLE:
1534 return new XMLTableTransformerContext_Impl( *this, rQName );
1535 case XML_ETACTION_STYLE:
1536 return new XMLStyleOASISTContext( *this, rQName, bPersistent );
1537 case XML_ETACTION_STYLE_RENAME:
1538 return new XMLStyleOASISTContext( *this, rQName,
1539 rAction.GetQNamePrefixFromParam1(),
1540 rAction.GetQNameTokenFromParam1(), bPersistent );
1541 case XML_ETACTION_FRAME:
1542 return new XMLFrameOASISTransformerContext( *this, rQName );
1543 case XML_ETACTION_EVENT:
1544 return new XMLEventOASISTransformerContext( *this, rQName );
1545 case XML_ETACTION_DLG:
1546 return new XMLDlgOASISTransformerContext( *this, rQName );
1547 case XML_ETACTION_TAB_STOP:
1548 return new XMLTabStopOASISTContext_Impl( *this, rQName );
1549 case XML_ETACTION_FORM_CONTROL:
1550 {
1551 const XMLTransformerContext *pCurrent = GetCurrentContext();
1552 return new XMLControlOASISTransformerContext( *this, rQName,
1553 pCurrent && pCurrent->HasQName( XML_NAMESPACE_FORM,
1554 XML_FORM ) );
1555 }
1556 case XML_ETACTION_FORM_PROPERTY:
1557 return new XMLFormPropOASISTransformerContext( *this, rQName,
1558 static_cast< XMLTokenEnum >( rAction.m_nParam1 ) );
1559 case XML_ETACTION_CHART:
1560 return new XMLChartOASISTransformerContext( *this, rQName );
1561 case XML_ETACTION_CONFIG_ITEM:
1562 return new XMLConfigItemTContext_Impl( *this, rQName );
1563 case XML_ETACTION_TRACKED_CHANGES:
1564 return new XMLTrackedChangesOASISTContext_Impl( *this, rQName,
1565 rAction.GetQNamePrefixFromParam1(),
1566 rAction.GetQNameTokenFromParam1() );
1567 case XML_ETACTION_CHART_PLOT_AREA:
1568 return new XMLChartPlotAreaOASISTContext( *this, rQName );
1569 default:
1570 SAL_WARN( "xmloff.transform", "no user defined context found!" );
1571 break;
1572 }
1573
1574 // default is copying
1575 return new XMLTransformerContext( *this, rQName );
1576}
1577
1579 sal_uInt16 n )
1580{
1581 XMLTransformerActions *pActions = nullptr;
1582 if( n < MAX_OASIS_ACTIONS )
1583 {
1584 if( !m_aActions[n] )
1585 {
1587 {
1588 m_aActions[n].reset(
1590 }
1591 else switch( n )
1592 {
1596 break;
1600 break;
1604 break;
1608 break;
1612 break;
1616 break;
1620 break;
1624 break;
1628 break;
1632 break;
1636 break;
1640 break;
1641 case OASIS_PARA_ACTIONS:
1644 break;
1648 break;
1652 break;
1656 break;
1660 break;
1664 break;
1668 break;
1672 break;
1676 break;
1680 break;
1684 break;
1688 break;
1692 break;
1696 break;
1697 case OASIS_DLG_ACTIONS:
1700 break;
1704 break;
1708 break;
1712 break;
1716 break;
1720 break;
1724 break;
1728 break;
1729 case OASIS_FORM_ACTIONS:
1732 break;
1737 break;
1741 break;
1745 break;
1749 break;
1753 break;
1757 break;
1763 break;
1767 break;
1771 break;
1772 // Bugdoc with table won't load correctly (#i40011#, #i40015#)
1776 break;
1780 break;
1781 }
1782 }
1783 pActions = m_aActions[n].get();
1784 }
1785
1786 return pActions;
1787}
1788
1789OUString Oasis2OOoTransformer::GetEventName( const OUString& rName,
1790 bool bForm )
1791{
1792 if( bForm && !m_pFormEventMap )
1795 if( !m_pEventMap )
1797
1798 OUString aMacroName;
1799 sal_uInt16 nPrefix =
1800 GetNamespaceMap().GetKeyByAttrName( rName, &aMacroName );
1802 nPrefix, aMacroName, *m_pEventMap,
1803 bForm ? m_pFormEventMap : nullptr );
1804}
1805
1808 m_pEventMap( nullptr ),
1809 m_pFormEventMap( nullptr )
1810{
1813
1816
1819
1822
1825
1828
1831
1834
1837
1840
1843
1846
1849
1852
1855
1858
1859 for(auto & rp : m_aActions)
1860 rp.reset();
1861}
1862
1864{
1865 for(auto & rp : m_aActions)
1866 rp.reset();
1869}
1870
1871// XServiceInfo
1873{
1874 return "com.sun.star.comp.Oasis2OOoTransformer";
1875}
1876
1877sal_Bool SAL_CALL Oasis2OOoTransformer::supportsService( const OUString& ServiceName )
1878{
1879 return cppu::supportsService(this, ServiceName);
1880}
1881
1883{
1884 return { };
1885}
1886
1887// Service registration
1888
1889extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
1891 css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
1892{
1893 SAL_INFO("xmloff.transform", "Creating Oasis2OOoTransformer");
1894 return cppu::acquire(new Oasis2OOoTransformer);
1895}
1896
1897/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ OASIS_BACKGROUND_IMAGE_ACTIONS
@ OASIS_FORMULA_ACTIONS
@ OASIS_TAB_STOP_ACTIONS
@ OASIS_COLUMNS_ACTIONS
@ OASIS_TABLE_VALUE_TYPE_ACTIONS
@ OASIS_DDE_CONNECTION_DECL_ACTIONS
@ OASIS_PARA_STYLE_REF_ACTIONS
@ OASIS_FOOTNOTE_SEP_ACTIONS
@ OASIS_TEXT_VALUE_TYPE_ACTIONS
@ OASIS_ANNOTATION_ACTIONS
@ OASIS_INDEX_ENTRY_TAB_STOP_ACTIONS
@ OASIS_SHAPE_ACTIONS
@ OASIS_FORM_PROP_ACTIONS
@ OASIS_DATAPILOT_MEMBER_ACTIONS
@ MAX_OASIS_ACTIONS
@ OASIS_NOTES_ACTIONS
@ OASIS_PARA_ACTIONS
@ OASIS_STYLE_ACTIONS
@ OASIS_LINENUMBERING_ACTIONS
@ OASIS_CHART_ACTIONS
@ OASIS_MAP_STYLE_REF_ACTIONS
@ OASIS_TEXT_STYLE_REF_ACTIONS
@ OASIS_CONTENT_VALIDATION_ACTIONS
@ OASIS_CHANGE_INFO_ACTIONS
@ OASIS_SCRIPT_ACTIONS
@ OASIS_ALPHABETICAL_INDEX_MARK_ACTIONS
@ OASIS_LIST_STYLE_REF_ACTIONS
@ OASIS_DDE_CONV_MODE_ACTIONS
@ OASIS_FONT_FACE_ACTIONS
@ OASIS_DATETIME_ACTIONS
@ OASIS_SOURCE_SERVICE_ACTIONS
@ OASIS_FORM_ACTIONS
@ OASIS_XLINK_ACTIONS
@ OASIS_MASTER_PAGE_REF_ACTIONS
@ OASIS_DROP_CAP_ACTIONS
@ OASIS_DLG_ACTIONS
@ OASIS_EVENT_ACTIONS
@ OASIS_ANIMATION_ACTIONS
@ OASIS_CONNECTOR_ACTIONS
@ OASIS_FRAME_ELEM_ACTIONS
@ OASIS_DRAW_AREA_POLYGON_ACTIONS
@ OASIS_TABLE_STYLE_REF_ACTIONS
@ OASIS_CONFIG_ITEM_SET_ACTIONS
@ OASIS_DATAPILOT_LEVEL_ACTIONS
@ OASIS_FORM_CONTROL_ACTIONS
@ MAX_OASIS_PROP_ACTIONS
@ OASIS_FORM_COLUMN_ACTIONS
@ OASIS_MASTER_PAGE_ACTIONS
@ XML_ATACTION_DECODE_STYLE_NAME_REF
@ XML_ATACTION_EVENT_NAME
@ XML_ATACTION_RENAME_DECODE_STYLE_NAME_REF
@ XML_ATACTION_IN2INCH
@ XML_ATACTION_RENAME_IN2INCH
@ XML_ATACTION_RENAME_ATTRIBUTE
@ XML_ATACTION_MOVE_TO_ELEM
@ XML_ATACTION_REMOVE
@ XML_ATACTION_EOT
@ XML_ATACTION_REMOVE_ANY_NAMESPACE_PREFIX
@ XML_ATACTION_SVG_WIDTH_HEIGHT_OASIS
@ XML_ATACTION_DECODE_STYLE_NAME
@ XML_ATACTION_INS2INCHS
@ XML_ATACTION_RNG2ISO_DATETIME
@ XML_ATACTION_RENAME_NEG_PERCENT
@ XML_ATACTION_HREF
@ XML_ATACTION_REMOVE_NAMESPACE_PREFIX
@ XML_ATACTION_URI_OASIS
@ XML_ATACTION_RENAME
@ XML_ATACTION_DECODE_ID
@ XML_ATACTION_DLG_BORDER
@ XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX
@ XML_ATACTION_STYLE_FAMILY
@ XML_ATACTION_STYLE_DISPLAY_NAME
@ XML_ATACTION_IN2TWIPS
@ XML_ATACTION_RENAME_RNG2ISO_DATETIME
@ XML_ATACTION_NEG_PERCENT
@ XML_ATACTION_MACRO_NAME
@ XML_ETACTION_RENAME_ELEM_PROC_ATTRS_COND
@ XML_ETACTION_EXTRACT_CHARACTERS
@ XML_ETACTION_EOT
@ XML_ETACTION_RENAME_ELEM
@ XML_ETACTION_RENAME_ELEM_PROC_ATTRS
@ XML_ETACTION_MOVE_ELEMS_TO_ATTRS
@ XML_ETACTION_USER_DEFINED
@ XML_ETACTION_COPY
@ XML_ETACTION_MOVE_TO_ATTR
@ XML_ETACTION_COPY_CONTENT
@ XML_ETACTION_MOVE_TO_ATTR_RNG2ISO_DATETIME
@ XML_ETACTION_PROC_ATTRS
@ XML_FAMILY_TYPE_PAGE_LAYOUT
Definition: FamilyType.hxx:28
@ XML_FAMILY_TYPE_FILL_IMAGE
Definition: FamilyType.hxx:43
@ XML_FAMILY_TYPE_GRADIENT
Definition: FamilyType.hxx:41
@ XML_FAMILY_TYPE_TABLE_CELL
Definition: FamilyType.hxx:37
@ XML_FAMILY_TYPE_TEXT
Definition: FamilyType.hxx:30
@ XML_FAMILY_TYPE_HATCH
Definition: FamilyType.hxx:42
@ XML_FAMILY_TYPE_END
Definition: FamilyType.hxx:46
@ XML_FAMILY_TYPE_GRAPHIC
Definition: FamilyType.hxx:24
@ XML_FAMILY_TYPE_MARKER
Definition: FamilyType.hxx:45
@ XML_FAMILY_TYPE_STROKE_DASH
Definition: FamilyType.hxx:44
@ XML_FAMILY_TYPE_MASTER_PAGE
Definition: FamilyType.hxx:27
@ XML_FAMILY_TYPE_PARAGRAPH
Definition: FamilyType.hxx:31
@ XML_FAMILY_TYPE_PRESENTATION
Definition: FamilyType.hxx:25
@ XML_FAMILY_TYPE_DATA
Definition: FamilyType.hxx:40
@ XML_FAMILY_TYPE_LIST
Definition: FamilyType.hxx:38
@ XML_FAMILY_TYPE_HEADER_FOOTER
Definition: FamilyType.hxx:29
XMLTransformerActionInit const aTableStyleRefActionTable[]
Definition: Oasis2OOo.cxx:678
#define ENTRY2(n, l, a, p1, p2)
Definition: Oasis2OOo.cxx:88
XMLTransformerActionInit const aConnectorActionTable[]
Definition: Oasis2OOo.cxx:757
XMLTransformerActionInit const aScriptActionTable[]
Definition: Oasis2OOo.cxx:1042
XMLTransformerActionInit const aTextStyleRefActionTable[]
Definition: Oasis2OOo.cxx:641
XMLTransformerActionInit const aParaStyleRefActionTable[]
Definition: Oasis2OOo.cxx:650
XMLTransformerActionInit const aTextValueTypeActionTable[]
Definition: Oasis2OOo.cxx:852
XMLTransformerActionInit const aFormControlActionTable[]
Definition: Oasis2OOo.cxx:915
XMLTransformerActionInit const aConfigItemSetActionTable[]
Definition: Oasis2OOo.cxx:956
XMLTransformerActionInit const aDDEConnectionDeclActionTable[]
Definition: Oasis2OOo.cxx:908
XMLTransformerActionInit const aBackgroundImageActionTable[]
Definition: Oasis2OOo.cxx:900
XMLTransformerActionInit const aFormulaActionTable[]
Definition: Oasis2OOo.cxx:963
XMLTransformerActionInit const aListStyleRefActionTable[]
Definition: Oasis2OOo.cxx:657
XMLTransformerActionInit const aAnnotationActionTable[]
Definition: Oasis2OOo.cxx:882
XMLTransformerActionInit const aDataPilotLevelActionTable[]
Definition: Oasis2OOo.cxx:995
#define ENTRY1(n, l, a, p1)
Definition: Oasis2OOo.cxx:93
XMLTransformerActionInit const aDDEConvModeActionTable[]
Definition: Oasis2OOo.cxx:981
XMLTransformerActionInit const aStyleActionTable[]
Definition: Oasis2OOo.cxx:568
XMLTransformerActionInit const aContentValidationActionTable[]
Definition: Oasis2OOo.cxx:973
XMLTransformerActionInit const aDrawAreaPolygonActionTable[]
Definition: Oasis2OOo.cxx:1035
XMLTransformerActionInit const aXLinkActionTable[]
Definition: Oasis2OOo.cxx:948
XMLTransformerActionInit const aFrameActionTable[]
Definition: Oasis2OOo.cxx:602
XMLTransformerActionInit const aParaActionTable[]
Definition: Oasis2OOo.cxx:692
XMLTokenEnum const aTokenMap[]
Definition: Oasis2OOo.cxx:1070
XMLTransformerActionInit const aMasterPageRefActionTable[]
Definition: Oasis2OOo.cxx:664
XMLTransformerActionInit const aMasterPageActionTable[]
Definition: Oasis2OOo.cxx:631
XMLTransformerActionInit const aSourceServiceActionTable[]
Definition: Oasis2OOo.cxx:1002
XMLTransformerActionInit const aAlphabeticalIndexMarkActionTable[]
Definition: Oasis2OOo.cxx:1028
XMLTransformerActionInit const aDropCapActionTable[]
Definition: Oasis2OOo.cxx:833
XMLTransformerActionInit const aFootnoteSepActionTable[]
Definition: Oasis2OOo.cxx:813
XMLTransformerActionInit const aTabStopActionTable[]
Definition: Oasis2OOo.cxx:792
XMLTransformerActionInit const aDataPilotMemberActionTable[]
Definition: Oasis2OOo.cxx:988
#define ENTRY3QNQ(n, l, a, n1, l1, p2, n3, l3)
Definition: Oasis2OOo.cxx:84
XMLTransformerActionInit const aChartActionTable[]
Definition: Oasis2OOo.cxx:1009
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * xmloff_Oasis2OOoTransformer_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: Oasis2OOo.cxx:1890
XMLTransformerActionInit const aEventActionTable[]
Definition: Oasis2OOo.cxx:615
#define ENTRY1Q(n, l, a, p1, t1)
Definition: Oasis2OOo.cxx:95
XMLTransformerActionInit const aFormActionTable[]
Definition: Oasis2OOo.cxx:1019
XMLTransformerActionInit const aLineNumberingActionTable[]
Definition: Oasis2OOo.cxx:805
#define ENTRY0(n, l, a)
Definition: Oasis2OOo.cxx:98
XMLTransformerActionInit const aNotesActionTable[]
Definition: Oasis2OOo.cxx:822
XMLTransformerActionInit const aActionTable[]
Definition: Oasis2OOo.cxx:108
XMLTransformerActionInit const aIndexEntryTabStopActionTable[]
Definition: Oasis2OOo.cxx:784
XMLTransformerActionInit const aFormPropActionTable[]
Definition: Oasis2OOo.cxx:935
XMLTransformerActionInit const aChangeInfoActionTable[]
Definition: Oasis2OOo.cxx:892
XMLTransformerActionInit const aShapeActionTable[]
Definition: Oasis2OOo.cxx:702
XMLTransformerActionInit const aDlgActionTable[]
Definition: Oasis2OOo.cxx:625
XMLTransformerActionInit const aColumnsActionTable[]
Definition: Oasis2OOo.cxx:840
XMLTransformerActionInit const aTableValueTypeActionTable[]
Definition: Oasis2OOo.cxx:866
XMLTransformerActionInit const aFontFaceActionTable[]
Definition: Oasis2OOo.cxx:684
XMLTransformerActionInit const aFormColumnActionTable[]
Definition: Oasis2OOo.cxx:926
XMLTransformerActionInit const aDateTimeActionTable[]
Definition: Oasis2OOo.cxx:1051
XMLTransformerActionInit const aMapStyleRefActionTable[]
Definition: Oasis2OOo.cxx:671
static constexpr sal_Int32 RENAME_ENTRY(XMLTokenEnum f, XMLTokenEnum s)
Definition: Oasis2OOo.cxx:103
XMLTransformerActionInit const aAnimationActionTable[]
Definition: Oasis2OOo.cxx:747
#define ENTRY2QN(n, l, a, n1, l1, p2)
Definition: Oasis2OOo.cxx:90
virtual OUString SAL_CALL getImplementationName() override
Definition: Oasis2OOo.cxx:1872
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Oasis2OOo.cxx:1882
virtual OUString GetEventName(const OUString &rName, bool bForm=false) override
Definition: Oasis2OOo.cxx:1789
virtual ~Oasis2OOoTransformer() noexcept override
Definition: Oasis2OOo.cxx:1863
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Oasis2OOo.cxx:1877
virtual XMLTransformerActions * GetUserDefinedActions(sal_uInt16 n) override
Definition: Oasis2OOo.cxx:1578
Oasis2OOoTransformer() noexcept
Definition: Oasis2OOo.cxx:1806
virtual XMLTransformerContext * CreateUserDefinedContext(const TransformerAction_Impl &rAction, const OUString &rQName, bool bPersistent=false) override
Definition: Oasis2OOo.cxx:1517
XMLTransformerOASISEventMap_Impl * m_pEventMap
Definition: Oasis2OOo.hxx:30
std::unique_ptr< XMLTransformerActions > m_aActions[MAX_OASIS_ACTIONS]
Definition: Oasis2OOo.hxx:29
XMLTransformerOASISEventMap_Impl * m_pFormEventMap
Definition: Oasis2OOo.hxx:31
sal_uInt16 GetKeyByAttrName(const OUString &rAttrName, OUString *pPrefix, OUString *pLocalName, OUString *pNamespace) const
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
static OUString GetEventName(sal_uInt16 nPrefix, const OUString &rName, XMLTransformerOASISEventMap_Impl &rMap, XMLTransformerOASISEventMap_Impl *pMap2)
static XMLTransformerOASISEventMap_Impl * CreateEventMap()
static XMLTransformerOASISEventMap_Impl * CreateFormEventMap()
static void FlushEventMap(XMLTransformerOASISEventMap_Impl *p)
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
static XMLTransformerActions * CreateTransformerActions(sal_uInt16 nType)
static bool DecodeStyleName(OUString &rName)
SvXMLNamespaceMap & GetNamespaceMap()
friend class XMLTransformerContext
static bool ReplaceSingleInWithInch(OUString &rValue)
const XMLTransformerContext * GetCurrentContext() const
SvXMLNamespaceMap & GetReplaceNamespaceMap()
virtual rtl::Reference< XMLTransformerContext > CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const OUString &rQName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
virtual void Characters(const OUString &rChars)
bool HasQName(sal_uInt16 nPrefix, ::xmloff::token::XMLTokenEnum eToken) const
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)
static void encode(OUStringBuffer &aStrBuffer, const css::uno::Sequence< sal_Int8 > &aPass)
static void decode(css::uno::Sequence< sal_Int8 > &aPass, std::u16string_view sBuffer)
sal_Int64 n
sal_uInt16 nPos
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
OUString aPropName
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50
@ XML_ALPHABETICAL_INDEX_MARK
Definition: xmltoken.hxx:239
@ XML_AUTO_TEXT_EVENTS
Definition: xmltoken.hxx:295
@ XML_INDEX_ENTRY_TAB_STOP
Definition: xmltoken.hxx:1094
@ XML_LIST_LEVEL_STYLE_IMAGE
Definition: xmltoken.hxx:1221
@ XML_COVERED_TABLE_CELL
Definition: xmltoken.hxx:541
@ XML_LIST_LEVEL_STYLE_NUMBER
Definition: xmltoken.hxx:1222
@ XML_NP_PRESENTATION
Definition: xmltoken.hxx:88
@ XML_CONTENT_VALIDATION_NAME
Definition: xmltoken.hxx:509
@ XML_ALPHABETICAL_INDEX_AUTO_MARK_FILE
Definition: xmltoken.hxx:237
@ XML_INDEX_ENTRY_BIBLIOGRAPHY
Definition: xmltoken.hxx:1087
@ XML_ALPHABETICAL_INDEX_MARK_START
Definition: xmltoken.hxx:241
@ XML_INDEX_ENTRY_LINK_START
Definition: xmltoken.hxx:1091
@ XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE
Definition: xmltoken.hxx:238
@ XML_BIBLIOGRAPHY_ENTRY_TEMPLATE
Definition: xmltoken.hxx:330
@ XML_DDE_CONNECTION_DECL
Definition: xmltoken.hxx:637
@ XML_DEFAULT_STYLE_NAME
Definition: xmltoken.hxx:654
@ XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE
Definition: xmltoken.hxx:1074
@ XML_INDEX_TITLE_TEMPLATE
Definition: xmltoken.hxx:1102
@ XML_CONDITIONAL_TEXT
Definition: xmltoken.hxx:487
@ XML_DATABASE_ROW_SELECT
Definition: xmltoken.hxx:2747
@ XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE
Definition: xmltoken.hxx:1927
@ XML_DEFAULT_OUTLINE_LEVEL
Definition: xmltoken.hxx:2791
@ XML_DATA_PILOT_MEMBER
Definition: xmltoken.hxx:599
@ XML_INDEX_SOURCE_STYLE
Definition: xmltoken.hxx:1099
@ XML_INDEX_ENTRY_PAGE_NUMBER
Definition: xmltoken.hxx:1092
@ XML_OBJECT_INDEX_ENTRY_TEMPLATE
Definition: xmltoken.hxx:1426
@ XML_COUNT_IN_FLOATING_FRAMES
Definition: xmltoken.hxx:534
@ XML_APPLY_STYLE_NAME
Definition: xmltoken.hxx:269
@ XML_BACKGROUND_IMAGE
Definition: xmltoken.hxx:315
@ XML_LINENUMBERING_CONFIGURATION
Definition: xmltoken.hxx:1207
@ XML_COUNT_IN_TEXT_BOXES
Definition: xmltoken.hxx:2706
@ XML_CITATION_BODY_STYLE_NAME
Definition: xmltoken.hxx:440
@ XML_NOTES_CONFIGURATION
Definition: xmltoken.hxx:2624
@ XML_INDEX_ENTRY_CHAPTER_NUMBER
Definition: xmltoken.hxx:1089
@ XML_CONTENT_VALIDATION
Definition: xmltoken.hxx:508
@ XML_DISTANCE_AFTER_SEP
Definition: xmltoken.hxx:695
@ XML_INDEX_ENTRY_CHAPTER
Definition: xmltoken.hxx:1088
@ XML_LIST_LEVEL_STYLE_BULLET
Definition: xmltoken.hxx:1220
@ XML_EDITING_DURATION
Definition: xmltoken.hxx:731
@ XML_CREATE_DATE_STRING
Definition: xmltoken.hxx:543
@ XML_CELL_RANGE_SOURCE
Definition: xmltoken.hxx:414
@ XML_VISITED_STYLE_NAME
Definition: xmltoken.hxx:2139
@ XML_DATA_PILOT_LEVEL
Definition: xmltoken.hxx:598
@ XML_DISTANCE_BEFORE_SEP
Definition: xmltoken.hxx:696
@ XML_OUTLINE_LEVEL_STYLE
Definition: xmltoken.hxx:1458
@ XML_N_PRESENTATION
Definition: xmltoken.hxx:89
@ XML_INDEX_ENTRY_LINK_END
Definition: xmltoken.hxx:1090
@ XML_CONTROL_IMPLEMENTATION
Definition: xmltoken.hxx:2748
@ XML_DOCUMENT_CONTENT
Definition: xmltoken.hxx:702
@ XML_N_PRESENTATION_OOO
Definition: xmltoken.hxx:2613
@ XML_USER_INDEX_ENTRY_TEMPLATE
Definition: xmltoken.hxx:2093
@ XML_CHANGE_TRACK_TABLE_CELL
Definition: xmltoken.hxx:424
@ XML_TABLE_INDEX_ENTRY_TEMPLATE
Definition: xmltoken.hxx:1923
@ XML_CITATION_STYLE_NAME
Definition: xmltoken.hxx:441
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3597
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3541
sal_uInt16 GetQNamePrefixFromParam1() const
::xmloff::token::XMLTokenEnum GetQNameTokenFromParam1() const
unsigned char sal_Bool
sal_uInt16 sal_Unicode
::ucbhelper::Content m_aContent
std::unique_ptr< char[]> aBuffer
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_DLG
constexpr sal_uInt16 XML_NAMESPACE_META
constexpr sal_uInt16 XML_NAMESPACE_DC
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_FORM
constexpr sal_uInt16 XML_NAMESPACE_DR3D
constexpr sal_uInt16 XML_NAMESPACE_CHART
constexpr sal_uInt16 XML_NAMESPACE_TABLE
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
constexpr sal_uInt16 XML_NAMESPACE_CONFIG
constexpr sal_uInt16 XML_NAMESPACE_OOO
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_SCRIPT
constexpr sal_uInt16 XML_NAMESPACE_FO
constexpr sal_uInt16 XML_NAMESPACE_NUMBER
XMLTokenEnum eToken
Definition: xmltoken.cxx:40