1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/xml/sax/SAXParseException.hpp>
21 #include <com/sun/star/xml/sax/SAXException.hpp>
22 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
23 #include <com/sun/star/xml/sax/XAttributeList.hpp>
25 #include <sax/tools/converter.hxx>
27 #include <xmloff/nmspmap.hxx>
28 #include <xmloff/xmltoken.hxx>
29 #include "xmloff/xmlnmspe.hxx"
30 #include "PropType.hxx"
31 #include "DeepTContext.hxx"
32 #include "RenameElemTContext.hxx"
33 #include "ProcAttrTContext.hxx"
34 #include "ActionMapTypesOOo.hxx"
35 #include "MutableAttrList.hxx"
36 #include "TransformerActions.hxx"
37 #include "PropertyActionsOOo.hxx"
38 #include "TransformerBase.hxx"
40 #include "StyleOOoTContext.hxx"
41 #include <xmloff/xmluconv.hxx>
42 #include <rtl/ustrbuf.hxx>
43 #include <rtl/math.hxx>
45 using namespace ::xmloff::token
;
46 using namespace ::com::sun::star::uno
;
47 using namespace ::com::sun::star::xml::sax
;
49 const sal_uInt16 MAX_PROP_TYPES
= 4;
50 #define ENTRY4(a,b,c,d) \
51 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
52 XML_PROP_TYPE_##c, XML_PROP_TYPE_##d }
53 #define ENTRY3(a,b,c) \
54 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
55 XML_PROP_TYPE_##c, XML_PROP_TYPE_END }
57 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
58 XML_PROP_TYPE_END, XML_PROP_TYPE_END }
60 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##END, \
61 XML_PROP_TYPE_END, XML_PROP_TYPE_END }
63 static XMLPropType aPropTypes
[XML_FAMILY_TYPE_END
][MAX_PROP_TYPES
] =
65 ENTRY3( GRAPHIC
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_GRAPHIC,
66 ENTRY3( GRAPHIC
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_PRESENTATION,
67 ENTRY1( DRAWING_PAGE
), // XML_FAMILY_TYPE_DRAWING_PAGE,
68 ENTRY1( END
), // XML_FAMILY_TYPE_MASTER_PAGE
69 ENTRY1( PAGE_LAYOUT
), // XML_FAMILY_TYPE_PAGE_LAYOUT,
70 ENTRY1( HEADER_FOOTER
), // XML_FAMILY_TYPE_HEADER_FOOTER
71 ENTRY1( TEXT
), // XML_FAMILY_TYPE_TEXT,
72 ENTRY2( PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_PARAGRAPH,
73 ENTRY1( RUBY
), //XML_FAMILY_TYPE_RUBY,
74 ENTRY1( SECTION
), // XML_FAMILY_TYPE_SECTION,
75 ENTRY1( TABLE
), // XML_FAMILY_TYPE_TABLE,
76 ENTRY1( TABLE_COLUMN
), // XML_FAMILY_TYPE_TABLE_COLUMN,
77 ENTRY1( TABLE_ROW
), // XML_FAMILY_TYPE_TABLE_ROW,
78 ENTRY3( TABLE_CELL
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_TABLE_CELL,
79 ENTRY1( LIST_LEVEL
), // XML_FAMILY_TYPE_LIST,
80 ENTRY4( CHART
, GRAPHIC
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_CHART,
81 ENTRY1( TEXT
), // XML_FAMILY_TYPE_DATA,
82 ENTRY1( END
), // XML_FAMILY_TYPE_GRADIENT,
83 ENTRY1( END
), // XML_FAMILY_TYPE_HATCH,
84 ENTRY1( END
), // XML_FAMILY_TYPE_FILL_IMAGE,
85 ENTRY1( END
), // XML_FAMILY_TYPE_STROKE_DASH,
86 ENTRY1( END
), // XML_FAMILY_TYPE_MARKER,
87 ENTRY1( END
) // XML_FAMILY_TYPE_PRESENTATION_PAGE_LAYOUT,
90 static XMLTokenEnum aPropTokens
[XML_PROP_TYPE_END
] =
92 XML_GRAPHIC_PROPERTIES
,
93 XML_DRAWING_PAGE_PROPERTIES
,
94 XML_PAGE_LAYOUT_PROPERTIES
,
95 XML_HEADER_FOOTER_PROPERTIES
,
97 XML_PARAGRAPH_PROPERTIES
,
99 XML_SECTION_PROPERTIES
,
100 XML_TABLE_PROPERTIES
,
101 XML_TABLE_COLUMN_PROPERTIES
,
102 XML_TABLE_ROW_PROPERTIES
,
103 XML_TABLE_CELL_PROPERTIES
,
104 XML_LIST_LEVEL_PROPERTIES
,
108 static sal_uInt16 aAttrActionMaps
[XML_PROP_TYPE_END
] =
110 PROP_OOO_GRAPHIC_ATTR_ACTIONS
,
111 PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS
, // DRAWING_PAGE
112 PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS
,
113 PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS
,
114 PROP_OOO_TEXT_ATTR_ACTIONS
,
115 PROP_OOO_PARAGRAPH_ATTR_ACTIONS
,
116 MAX_OOO_PROP_ACTIONS
, // RUBY
117 PROP_OOO_SECTION_ATTR_ACTIONS
,
118 PROP_OOO_TABLE_ATTR_ACTIONS
,
119 PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS
,
120 PROP_OOO_TABLE_ROW_ATTR_ACTIONS
,
121 PROP_OOO_TABLE_CELL_ATTR_ACTIONS
,
122 PROP_OOO_LIST_LEVEL_ATTR_ACTIONS
,
123 PROP_OOO_CHART_ATTR_ACTIONS
126 static sal_uInt16 aElemActionMaps
[XML_PROP_TYPE_END
] =
128 PROP_OOO_GRAPHIC_ELEM_ACTIONS
,
129 MAX_OOO_PROP_ACTIONS
,
130 MAX_OOO_PROP_ACTIONS
,
131 MAX_OOO_PROP_ACTIONS
,
132 PROP_OOO_TEXT_ELEM_ACTIONS
,
133 PROP_OOO_PARAGRAPH_ELEM_ACTIONS
,
134 MAX_OOO_PROP_ACTIONS
,
135 MAX_OOO_PROP_ACTIONS
,
136 MAX_OOO_PROP_ACTIONS
,
137 MAX_OOO_PROP_ACTIONS
,
138 MAX_OOO_PROP_ACTIONS
,
139 PROP_OOO_TABLE_CELL_ELEM_ACTIONS
,
140 MAX_OOO_PROP_ACTIONS
,
141 PROP_OOO_CHART_ELEM_ACTIONS
145 //------------------------------------------------------------------------------
147 class XMLTypedPropertiesOOoTContext_Impl
: public XMLPersElemContentTContext
149 ::com::sun::star::uno::Reference
<
150 ::com::sun::star::xml::sax::XAttributeList
> m_xAttrList
;
156 XMLTypedPropertiesOOoTContext_Impl( XMLTransformerBase
& rTransformer
,
157 const OUString
& rQName
);
159 virtual ~XMLTypedPropertiesOOoTContext_Impl();
161 using XMLPersAttrListTContext::AddAttribute
;
162 void AddAttribute( const OUString
&sName
,
163 const OUString
&sValue
);
164 void AddAttribute( sal_uInt16 nPrefix
, XMLTokenEnum eToken
,
165 const OUString
&sValue
);
167 virtual void StartElement( const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& rAttrList
);
169 virtual void Export();
172 TYPEINIT1( XMLTypedPropertiesOOoTContext_Impl
, XMLPersElemContentTContext
);
174 XMLTypedPropertiesOOoTContext_Impl::XMLTypedPropertiesOOoTContext_Impl(
175 XMLTransformerBase
& rImp
,
176 const OUString
& rQName
) :
177 XMLPersElemContentTContext( rImp
, rQName
),
178 m_xAttrList( new XMLMutableAttributeList() )
182 XMLTypedPropertiesOOoTContext_Impl::~XMLTypedPropertiesOOoTContext_Impl()
186 void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
187 const OUString
&sName
,
188 const OUString
&sValue
)
190 static_cast< XMLMutableAttributeList
* >( m_xAttrList
.get() )
191 ->AddAttribute( sName
, sValue
);
194 void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
195 sal_uInt16 nPrefix
, XMLTokenEnum eToken
,
196 const OUString
&sValue
)
199 GetTransformer().GetNamespaceMap().GetQNameByKey(
200 nPrefix
, ::xmloff::token::GetXMLToken( eToken
) ) );
201 static_cast< XMLMutableAttributeList
* >( m_xAttrList
.get() )
202 ->AddAttribute( sName
, sValue
);
205 void XMLTypedPropertiesOOoTContext_Impl::StartElement(
206 const Reference
< XAttributeList
>& )
208 // empty, ignore even the attribute list
211 void XMLTypedPropertiesOOoTContext_Impl::Export()
213 if( m_xAttrList
->getLength() || HasElementContent() )
215 GetTransformer().GetDocHandler()->startElement( GetQName(), m_xAttrList
);
217 GetTransformer().GetDocHandler()->endElement( GetQName() );
221 //------------------------------------------------------------------------------
223 class XMLPropertiesOOoTContext_Impl
: public XMLTransformerContext
225 ::rtl::Reference
< XMLTypedPropertiesOOoTContext_Impl
>
226 m_aPropContexts
[MAX_PROP_TYPES
];
228 typedef XMLPropType XMLPropTypes
[MAX_PROP_TYPES
];
230 XMLPropTypes m_aPropTypes
;
232 sal_Bool m_bPersistent
;
234 XMLTypedPropertiesOOoTContext_Impl
*GetPropContextAndAction(
235 TransformerAction_Impl
& rAction
,
236 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
239 XMLTypedPropertiesOOoTContext_Impl
*GetPropContext(
247 XMLPropertiesOOoTContext_Impl( XMLTransformerBase
& rTransformer
,
248 const OUString
& rQName
,
249 XMLPropTypes
& rTypes
,
250 sal_Bool bPersistent
);
252 virtual ~XMLPropertiesOOoTContext_Impl();
254 XMLTransformerContext
*CreateChildContext(
256 const OUString
& rLocalName
,
257 const OUString
& rQName
,
258 const Reference
< XAttributeList
>& rAttrList
);
260 virtual void StartElement( const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& rAttrList
);
262 virtual void EndElement();
264 virtual void Characters( const OUString
& rChars
);
266 virtual void Export();
268 virtual sal_Bool
IsPersistent() const;
271 TYPEINIT1( XMLPropertiesOOoTContext_Impl
, XMLTransformerContext
);
273 XMLTypedPropertiesOOoTContext_Impl
274 *XMLPropertiesOOoTContext_Impl::GetPropContext(
277 sal_uInt16 nIndex
= MAX_PROP_TYPES
;
278 for( sal_uInt16 i
=0; i
< MAX_PROP_TYPES
; i
++ )
280 if( m_aPropTypes
[i
] == eType
)
286 if( MAX_PROP_TYPES
== nIndex
)
289 if( !m_aPropContexts
[nIndex
].is() )
291 m_aPropContexts
[nIndex
] =
292 new XMLTypedPropertiesOOoTContext_Impl(
294 GetTransformer().GetNamespaceMap().GetQNameByKey(
296 ::xmloff::token::GetXMLToken(
297 aPropTokens
[m_aPropTypes
[nIndex
]] ) ));
300 return m_aPropContexts
[nIndex
].get();
304 XMLTypedPropertiesOOoTContext_Impl
305 *XMLPropertiesOOoTContext_Impl::GetPropContextAndAction(
306 TransformerAction_Impl
& rAction
,
307 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
310 rAction
.m_nActionType
= XML_ATACTION_COPY
;
311 sal_uInt16 nIndex
= 0;
313 XMLTransformerActions::key_type
aKey( nPrefix
, rLocalName
);
315 while( i
< MAX_PROP_TYPES
&& XML_PROP_TYPE_END
!=m_aPropTypes
[i
])
317 sal_uInt16 nActionMap
=
318 (bElem
? aElemActionMaps
: aAttrActionMaps
)[m_aPropTypes
[i
]];
319 if( nActionMap
< MAX_OOO_PROP_ACTIONS
)
321 XMLTransformerActions
*pActions
=
322 GetTransformer().GetUserDefinedActions( nActionMap
);
323 OSL_ENSURE( pActions
, "go no actions" );
326 XMLTransformerActions::const_iterator aIter
=
327 pActions
->find( aKey
);
329 if( !(aIter
== pActions
->end()) )
331 rAction
= (*aIter
).second
;
341 if( !( XML_NAMESPACE_NONE
== nPrefix
||
342 (XML_NAMESPACE_UNKNOWN_FLAG
& nPrefix
) ||
343 XML_PROP_TYPE_END
==m_aPropTypes
[1] ||
344 (i
<MAX_PROP_TYPES
&& XML_PROP_TYPE_END
!=m_aPropTypes
[i
]) ) )
346 OString
aTmp("Didnt't find property: ");
347 const OUString
& rPrefix
=
348 GetTransformer().GetNamespaceMap().GetPrefixByKey( nPrefix
);
349 aTmp
+= OString( rPrefix
.getStr(), rPrefix
.getLength(),
350 RTL_TEXTENCODING_ASCII_US
);
351 aTmp
+= OString::valueOf( ':' );
352 aTmp
+= OString( rLocalName
.getStr(), rLocalName
.getLength(),
353 RTL_TEXTENCODING_ASCII_US
);
354 aTmp
+= OString(", assuming <style:");
355 const OUString
& rName
=
356 ::xmloff::token::GetXMLToken( aPropTokens
[m_aPropTypes
[0]] );
357 aTmp
+= OString( rName
.getStr(), rName
.getLength(),
358 RTL_TEXTENCODING_ASCII_US
);
359 aTmp
+= OString::valueOf( '>' );
361 OSL_FAIL(aTmp
.getStr());
365 if( !m_aPropContexts
[nIndex
].is() )
367 m_aPropContexts
[nIndex
] =
368 new XMLTypedPropertiesOOoTContext_Impl(
370 GetTransformer().GetNamespaceMap().GetQNameByKey(
372 ::xmloff::token::GetXMLToken(
373 aPropTokens
[m_aPropTypes
[nIndex
]] ) ));
376 return m_aPropContexts
[nIndex
].get();
379 XMLPropertiesOOoTContext_Impl::XMLPropertiesOOoTContext_Impl(
380 XMLTransformerBase
& rImp
,
381 const OUString
& rQName
,
382 XMLPropTypes
& rTypes
,
383 sal_Bool bPersistent
) :
384 XMLTransformerContext( rImp
, rQName
),
385 m_bPersistent( bPersistent
)
387 for( sal_uInt16 i
=0; i
< MAX_PROP_TYPES
; ++i
)
389 // remember the types that belong to the attribute and element lists
390 m_aPropTypes
[i
] = rTypes
[i
];
394 XMLPropertiesOOoTContext_Impl::~XMLPropertiesOOoTContext_Impl()
398 XMLTransformerContext
*XMLPropertiesOOoTContext_Impl::CreateChildContext(
400 const OUString
& rLocalName
,
401 const OUString
& rQName
,
402 const Reference
< XAttributeList
>& rAttrList
)
404 TransformerAction_Impl aAction
;
405 return GetPropContextAndAction( aAction
, nPrefix
, rLocalName
, sal_True
)
406 ->CreateChildContext( nPrefix
, rLocalName
, rQName
, rAttrList
);
410 void XMLPropertiesOOoTContext_Impl::StartElement(
411 const Reference
< XAttributeList
>& rAttrList
)
413 Reference
< XAttributeList
> xAttrList( rAttrList
);
415 XMLTypedPropertiesOOoTContext_Impl
* pIntervalMinorDivisorContext
= 0;
416 double fIntervalMajor
= 0.0;
417 double fIntervalMinor
= 0.0;
418 sal_Bool bMoveProtect
= sal_False
;
419 sal_Bool bSizeProtect
= sal_False
;
420 OUString aProtectAttrValue
;
421 XMLTypedPropertiesOOoTContext_Impl
* pProtectContext
= 0;
423 /* Attribute <style:mirror> has to be priority over attribute <style:draw>.
424 The filter from OpenDocument file format to OpenOffice.org file format
425 produces styles with both attributes. (#i49139#)
427 sal_Bool
bExistStyleMirror( sal_False
);
428 OUString aStyleMirrorAttrValue
;
429 sal_Bool
bExistDrawMirror( sal_False
);
430 OUString aDrawMirrorAttrValue
;
431 XMLTypedPropertiesOOoTContext_Impl
* pMirrorContext( 0L );
433 sal_Int16 nAttrCount
= xAttrList
.is() ? xAttrList
->getLength() : 0;
434 for( sal_Int16 i
=0; i
< nAttrCount
; i
++ )
436 const OUString sAttrName
= xAttrList
->getNameByIndex( i
);
437 const OUString sAttrValue
= xAttrList
->getValueByIndex( i
);
440 GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName
,
442 TransformerAction_Impl aAction
;
443 XMLTypedPropertiesOOoTContext_Impl
*pContext
=
444 GetPropContextAndAction( aAction
, nPrefix
, aLocalName
, sal_False
);
445 switch( aAction
.m_nActionType
)
447 case XML_ATACTION_REMOVE
:
449 case XML_ATACTION_COPY
:
450 pContext
->AddAttribute( sAttrName
, sAttrValue
);
452 case XML_ATACTION_COPY_DUPLICATE
:
454 pContext
->AddAttribute( sAttrName
, sAttrValue
);
455 XMLTypedPropertiesOOoTContext_Impl
*pContext2
=
456 GetPropContext( (XMLPropType
)aAction
.m_nParam1
);
458 pContext2
->AddAttribute( sAttrName
, sAttrValue
);
461 case XML_ATACTION_RENAME
:
463 pContext
->AddAttribute( aAction
.GetQNamePrefixFromParam1(),
464 aAction
.GetQNameTokenFromParam1(),
468 case XML_ATACTION_ENCODE_STYLE_NAME_REF
:
470 OUString
aAttrValue( sAttrValue
);
471 GetTransformer().EncodeStyleName(aAttrValue
);
472 pContext
->AddAttribute( sAttrName
, aAttrValue
);
475 case XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF
:
477 OUString
aAttrValue( sAttrValue
);
478 GetTransformer().EncodeStyleName(aAttrValue
);
479 pContext
->AddAttribute( aAction
.GetQNamePrefixFromParam1(),
480 aAction
.GetQNameTokenFromParam1(),
484 case XML_ATACTION_NEG_PERCENT
:
486 OUString
aAttrValue( sAttrValue
);
487 GetTransformer().NegPercent(aAttrValue
);
488 pContext
->AddAttribute( sAttrName
, aAttrValue
);
491 case XML_ATACTION_RENAME_NEG_PERCENT
:
493 OUString
aAttrValue( sAttrValue
);
494 GetTransformer().NegPercent(aAttrValue
);
495 pContext
->AddAttribute( aAction
.GetQNamePrefixFromParam1(),
496 aAction
.GetQNameTokenFromParam1(),
500 case XML_ATACTION_INCH2IN
:
502 OUString
aAttrValue( sAttrValue
);
503 XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue
);
504 pContext
->AddAttribute( sAttrName
, aAttrValue
);
507 case XML_ATACTION_INCH2IN_DUPLICATE
:
509 OUString
aAttrValue( sAttrValue
);
510 XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue
);
511 pContext
->AddAttribute( sAttrName
, aAttrValue
);
512 XMLTypedPropertiesOOoTContext_Impl
*pContext2
=
513 GetPropContext( (XMLPropType
)aAction
.m_nParam1
);
515 pContext2
->AddAttribute( sAttrName
, aAttrValue
);
518 case XML_ATACTION_INCHS2INS
:
520 OUString
aAttrValue( sAttrValue
);
521 XMLTransformerBase::ReplaceInchWithIn( aAttrValue
);
522 pContext
->AddAttribute( sAttrName
, aAttrValue
);
525 case XML_PTACTION_LINE_MODE
:
527 OUString
aAttrValue( GetXMLToken(
528 IsXMLToken( sAttrValue
, XML_TRUE
)
530 : XML_SKIP_WHITE_SPACE
) );
532 GetTransformer().GetNamespaceMap().GetQNameByKey(
534 GetXMLToken( XML_TEXT_UNDERLINE_MODE
) ) );
535 pContext
->AddAttribute( aAttrQName
, aAttrValue
);
538 GetTransformer().GetNamespaceMap().GetQNameByKey(
540 GetXMLToken( XML_TEXT_LINE_THROUGH_MODE
) );
541 pContext
->AddAttribute( aAttrQName
, aAttrValue
);
544 case XML_PTACTION_KEEP_WITH_NEXT
:
546 OUString
aAttrValue( GetXMLToken(
547 IsXMLToken( sAttrValue
, XML_TRUE
)
550 pContext
->AddAttribute( sAttrName
, aAttrValue
);
553 case XML_PTACTION_UNDERLINE
:
555 XMLTokenEnum eToken
= GetTransformer().GetToken( sAttrValue
);
556 sal_Bool bBold
= sal_False
, bDouble
= sal_False
;
570 case XML_BOLD_DOTTED
:
578 case XML_BOLD_LONG_DASH
:
579 eToken
= XML_LONG_DASH
;
582 case XML_BOLD_DOT_DASH
:
583 eToken
= XML_DOT_DASH
;
586 case XML_BOLD_DOT_DOT_DASH
:
587 eToken
= XML_DOT_DOT_DASH
;
594 case XML_DOUBLE_WAVE
:
603 OSL_FAIL( "xmloff::XMLPropertiesOOoTContext_Impl::StartElement(), unknown underline token!" );
606 pContext
->AddAttribute(
607 GetTransformer().GetNamespaceMap().GetQNameByKey(
609 GetXMLToken( XML_TEXT_UNDERLINE_STYLE
) ),
610 eToken
!= XML_TOKEN_END
? GetXMLToken( eToken
)
613 pContext
->AddAttribute(
614 GetTransformer().GetNamespaceMap().GetQNameByKey(
616 GetXMLToken( XML_TEXT_UNDERLINE_TYPE
) ),
617 GetXMLToken( XML_DOUBLE
) );
619 pContext
->AddAttribute(
620 GetTransformer().GetNamespaceMap().GetQNameByKey(
622 GetXMLToken( XML_TEXT_UNDERLINE_WIDTH
) ),
623 GetXMLToken( XML_BOLD
) );
626 case XML_PTACTION_LINETHROUGH
:
628 XMLTokenEnum eToken
= GetTransformer().GetToken( sAttrValue
);
629 sal_Bool bBold
= sal_False
, bDouble
= sal_False
;
633 case XML_SINGLE_LINE
:
636 case XML_DOUBLE_LINE
:
655 pContext
->AddAttribute(
656 GetTransformer().GetNamespaceMap().GetQNameByKey(
658 GetXMLToken( XML_TEXT_LINE_THROUGH_STYLE
) ),
659 eToken
!= XML_TOKEN_END
? GetXMLToken( eToken
)
662 pContext
->AddAttribute(
663 GetTransformer().GetNamespaceMap().GetQNameByKey(
665 GetXMLToken( XML_TEXT_LINE_THROUGH_TYPE
) ),
666 GetXMLToken( XML_DOUBLE
) );
668 pContext
->AddAttribute(
669 GetTransformer().GetNamespaceMap().GetQNameByKey(
671 GetXMLToken( XML_TEXT_LINE_THROUGH_WIDTH
) ),
672 GetXMLToken( XML_BOLD
) );
674 pContext
->AddAttribute(
675 GetTransformer().GetNamespaceMap().GetQNameByKey(
677 GetXMLToken( XML_TEXT_LINE_THROUGH_TEXT
) ),
678 OUString::valueOf( c
) );
681 case XML_PTACTION_SPLINES
:
683 sal_Int32 nSplineType
= sAttrValue
.toInt32();
684 OUString aNewAttrName
= GetTransformer().GetNamespaceMap().GetQNameByKey(
685 XML_NAMESPACE_CHART
, GetXMLToken( XML_INTERPOLATION
) );
687 switch( nSplineType
)
691 pContext
->AddAttribute(
692 aNewAttrName
, GetXMLToken( XML_NONE
));
696 pContext
->AddAttribute(
697 aNewAttrName
, GetXMLToken( XML_CUBIC_SPLINE
));
701 pContext
->AddAttribute(
702 aNewAttrName
, GetXMLToken( XML_B_SPLINE
));
706 OSL_FAIL( "invalid spline type" );
707 pContext
->AddAttribute(
708 aNewAttrName
, GetXMLToken( XML_NONE
));
713 case XML_PTACTION_INTERVAL_MAJOR
:
714 pContext
->AddAttribute( sAttrName
, sAttrValue
);
715 ::sax::Converter::convertDouble( fIntervalMajor
, sAttrValue
);
717 case XML_PTACTION_INTERVAL_MINOR
:
718 ::sax::Converter::convertDouble( fIntervalMinor
, sAttrValue
);
719 pIntervalMinorDivisorContext
= pContext
;
721 case XML_PTACTION_SYMBOL
:
723 sal_Int32 nSymbolType
= sAttrValue
.toInt32();
724 OUString aNewAttrName
= GetTransformer().GetNamespaceMap().GetQNameByKey(
725 XML_NAMESPACE_CHART
, GetXMLToken( XML_SYMBOL_TYPE
) );
727 if( nSymbolType
>= 0 )
729 pContext
->AddAttribute( aNewAttrName
, GetXMLToken( XML_NAMED_SYMBOL
));
730 enum XMLTokenEnum eToken
= XML_TOKEN_INVALID
;
731 switch( nSymbolType
)
735 // "square" has an awkward token name
736 eToken
= XML_GRADIENTSTYLE_SQUARE
;
740 eToken
= XML_DIAMOND
;
744 eToken
= XML_ARROW_DOWN
;
748 eToken
= XML_ARROW_UP
;
752 eToken
= XML_ARROW_RIGHT
;
756 eToken
= XML_ARROW_LEFT
;
760 eToken
= XML_BOW_TIE
;
764 eToken
= XML_HOURGLASS
;
779 eToken
= XML_ASTERISK
;
782 eToken
= XML_HORIZONTAL_BAR
;
785 eToken
= XML_VERTICAL_BAR
;
788 OSL_FAIL( "invalid named symbol" );
792 if( eToken
!= XML_TOKEN_INVALID
)
794 pContext
->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey(
795 XML_NAMESPACE_CHART
, GetXMLToken( XML_SYMBOL_NAME
)),
796 GetXMLToken( eToken
));
801 switch( nSymbolType
)
805 pContext
->AddAttribute(
806 aNewAttrName
, GetXMLToken( XML_NONE
));
810 pContext
->AddAttribute(
811 aNewAttrName
, GetXMLToken( XML_AUTOMATIC
));
815 pContext
->AddAttribute(
816 aNewAttrName
, GetXMLToken( XML_IMAGE
));
819 OSL_FAIL( "invalid symbol type" );
820 pContext
->AddAttribute(
821 aNewAttrName
, GetXMLToken( XML_NONE
));
827 case XML_PTACTION_SYMBOL_IMAGE_NAME
:
829 // create an xlink:href element for URI attribute
830 XMLPersAttrListTContext
*pSymbolImageContext
= new XMLPersAttrListTContext(
831 GetTransformer(), GetTransformer().GetNamespaceMap().GetQNameByKey(
832 XML_NAMESPACE_CHART
, GetXMLToken( XML_SYMBOL_IMAGE
)));
834 OUString
aAttrValue( sAttrValue
);
835 if( GetTransformer().ConvertURIToOASIS( aAttrValue
, sal_True
))
837 pSymbolImageContext
->AddAttribute( XML_NAMESPACE_XLINK
, XML_HREF
, aAttrValue
);
838 pContext
->AddContent( pSymbolImageContext
);
844 case XML_PTACTION_TRANSPARENCY
:
846 OUString
aAttrValue( sAttrValue
);
847 GetTransformer().NegPercent(aAttrValue
);
848 pContext
->AddAttribute( XML_NAMESPACE_DRAW
,
851 pContext
->AddAttribute( XML_NAMESPACE_DRAW
,
857 case XML_PTACTION_BREAK_INSIDE
:
859 pContext
->AddAttribute(
860 XML_NAMESPACE_FO
, XML_KEEP_TOGETHER
,
862 IsXMLToken( sAttrValue
, XML_COLUMNSPLIT_AVOID
)
867 case XML_ATACTION_CAPTION_ESCAPE_OOO
:
869 OUString
aAttrValue( sAttrValue
);
870 if( aAttrValue
.indexOf( sal_Unicode('%') ) != -1 )
872 sal_Int32 nValue
= 0;
873 ::sax::Converter::convertPercent( nValue
, sAttrValue
);
878 ::sax::Converter::convertPercent( aOut
, nValue
);
879 aAttrValue
= aOut
.makeStringAndClear();
884 XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue
);
887 pContext
->AddAttribute( sAttrName
, aAttrValue
);
890 case XML_ATACTION_MOVE_PROTECT
:
891 bMoveProtect
= IsXMLToken( sAttrValue
, XML_TRUE
);
892 pProtectContext
= pContext
;
894 case XML_ATACTION_SIZE_PROTECT
:
895 bSizeProtect
= IsXMLToken( sAttrValue
, XML_TRUE
);
896 pProtectContext
= pContext
;
898 case XML_ATACTION_PROTECT
:
899 aProtectAttrValue
= sAttrValue
;
900 pProtectContext
= pContext
;
902 case XML_ATACTION_DRAW_MIRROR_OOO
: // renames draw:mirror to style:mirror and adapts values
904 // OpenDocument file format: attribute value of <style:mirror> wrong (#i49139#)
905 aDrawMirrorAttrValue
=
906 GetXMLToken( IsXMLToken( sAttrValue
, XML_TRUE
)
907 ? XML_HORIZONTAL
: XML_NONE
);
908 bExistDrawMirror
= sal_True
;
909 pMirrorContext
= pContext
;
912 // OpenDocument file format: attribute value of <style:mirror> wrong (#i49139#)
913 case XML_ATACTION_STYLE_MIRROR_OOO
: // adapts style:mirror values
915 SvXMLTokenEnumerator
aTokenEnum( sAttrValue
);
917 while( aTokenEnum
.getNextToken( aToken
) )
919 if ( !aStyleMirrorAttrValue
.isEmpty() )
921 aStyleMirrorAttrValue
+= OUString(" " );
924 if ( IsXMLToken( aToken
, XML_HORIZONTAL_ON_LEFT_PAGES
) )
926 aStyleMirrorAttrValue
+= GetXMLToken( XML_HORIZONTAL_ON_EVEN
);
928 else if ( IsXMLToken( aToken
, XML_HORIZONTAL_ON_RIGHT_PAGES
) )
930 aStyleMirrorAttrValue
+= GetXMLToken( XML_HORIZONTAL_ON_ODD
);
934 aStyleMirrorAttrValue
+= aToken
;
937 bExistStyleMirror
= sal_True
;
938 pMirrorContext
= pContext
;
941 case XML_ATACTION_GAMMA_OOO
: // converts double value to percentage
943 double fValue
= sAttrValue
.toDouble();
944 sal_Int32 nValue
= (sal_Int32
)((fValue
* 100.0) + ( fValue
> 0 ? 0.5 : - 0.5 ) );
947 ::sax::Converter::convertPercent( aOut
, nValue
);
948 OUString
aAttrValue( aOut
.makeStringAndClear() );
949 pContext
->AddAttribute( sAttrName
, aAttrValue
);
952 case XML_ATACTION_OPACITY_FIX
:
955 if( sAttrValue
.indexOf( sal_Unicode('%') ) != -1 )
957 ::sax::Converter::convertPercent( nValue
, sAttrValue
);
961 nValue
= sal_Int32( sAttrValue
.toDouble() * 100.0 );
963 nValue
= 100 - nValue
;
966 ::sax::Converter::convertPercent( aOut
, nValue
);
967 pContext
->AddAttribute( sAttrName
, aOut
.makeStringAndClear() );
971 OSL_ENSURE( !this, "unknown action" );
976 // OpenDocument file format: attribute value of <style:mirror> wrong (#i49139#)
977 if ( bExistStyleMirror
)
979 pMirrorContext
->AddAttribute(
980 GetTransformer().GetNamespaceMap().GetQNameByKey(
981 XML_NAMESPACE_STYLE
, GetXMLToken( XML_MIRROR
) ),
982 aStyleMirrorAttrValue
);
984 else if ( bExistDrawMirror
)
986 pMirrorContext
->AddAttribute(
987 GetTransformer().GetNamespaceMap().GetQNameByKey(
988 XML_NAMESPACE_STYLE
, GetXMLToken( XML_MIRROR
) ),
989 aDrawMirrorAttrValue
);
992 if( bMoveProtect
|| bSizeProtect
|| !aProtectAttrValue
.isEmpty() )
994 if( (bMoveProtect
||bSizeProtect
) && IsXMLToken( aProtectAttrValue
, XML_NONE
) )
995 aProtectAttrValue
= OUString();
997 const OUString
& rPosition
= GetXMLToken( XML_POSITION
);
998 if( bMoveProtect
&& -1 == aProtectAttrValue
.indexOf( rPosition
) )
1000 if( !aProtectAttrValue
.isEmpty() )
1001 aProtectAttrValue
+= OUString::valueOf( sal_Unicode( ' ' ) );
1002 aProtectAttrValue
+= rPosition
;
1005 const OUString
& rSize
= GetXMLToken( XML_SIZE
);
1006 if( bSizeProtect
&& -1 == aProtectAttrValue
.indexOf( rSize
) )
1008 if( !aProtectAttrValue
.isEmpty() )
1009 aProtectAttrValue
+= OUString::valueOf( sal_Unicode( ' ' ) );
1010 aProtectAttrValue
+= rSize
;
1013 pProtectContext
->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE
, GetXMLToken( XML_PROTECT
) ), aProtectAttrValue
);
1016 if( pIntervalMinorDivisorContext
)
1018 if( fIntervalMinor
!= 0.0 )
1020 sal_Int32 nIntervalMinorDivisor
= static_cast< sal_Int32
>(
1021 ::rtl::math::round( fIntervalMajor
/ fIntervalMinor
));
1023 OUStringBuffer aBuf
;
1024 ::sax::Converter::convertNumber( aBuf
, nIntervalMinorDivisor
);
1025 pIntervalMinorDivisorContext
->AddAttribute(
1026 GetTransformer().GetNamespaceMap().GetQNameByKey(
1027 XML_NAMESPACE_CHART
,
1028 GetXMLToken( XML_INTERVAL_MINOR_DIVISOR
)),
1029 aBuf
.makeStringAndClear());
1034 void XMLPropertiesOOoTContext_Impl::EndElement()
1036 if( !m_bPersistent
)
1040 void XMLPropertiesOOoTContext_Impl::Characters( const OUString
& )
1045 void XMLPropertiesOOoTContext_Impl::Export()
1048 for( sal_uInt16 i
=0; i
< MAX_PROP_TYPES
; i
++ )
1050 if( m_aPropContexts
[i
].is() )
1051 m_aPropContexts
[i
]->Export();
1055 sal_Bool
XMLPropertiesOOoTContext_Impl::IsPersistent() const
1057 return m_bPersistent
;
1061 //------------------------------------------------------------------------------
1063 TYPEINIT1( XMLStyleOOoTContext
, XMLPersElemContentTContext
);
1065 XMLStyleOOoTContext::XMLStyleOOoTContext( XMLTransformerBase
& rImp
,
1066 const OUString
& rQName
,
1068 sal_Bool bPersistent
) :
1069 XMLPersElemContentTContext( rImp
, rQName
),
1071 m_bPersistent( bPersistent
)
1075 XMLStyleOOoTContext::XMLStyleOOoTContext(
1076 XMLTransformerBase
& rImp
,
1077 const OUString
& rQName
,
1080 ::xmloff::token::XMLTokenEnum eToken
,
1081 sal_Bool bPersistent
) :
1082 XMLPersElemContentTContext( rImp
, rQName
, nPrefix
, eToken
),
1084 m_bPersistent( bPersistent
)
1088 XMLStyleOOoTContext::~XMLStyleOOoTContext()
1092 XMLTransformerContext
*XMLStyleOOoTContext::CreateChildContext(
1094 const OUString
& rLocalName
,
1095 const OUString
& rQName
,
1096 const Reference
< XAttributeList
>& rAttrList
)
1098 XMLTransformerContext
*pContext
= 0;
1100 if( XML_NAMESPACE_STYLE
== nPrefix
&&
1101 IsXMLToken( rLocalName
, XML_PROPERTIES
) )
1103 if( aPropTypes
[m_eFamily
][0] == XML_PROP_TYPE_END
)
1105 OSL_ENSURE( !this, "unexpected properties element" );
1106 pContext
= m_bPersistent
1107 ? XMLPersElemContentTContext::CreateChildContext(
1108 nPrefix
, rLocalName
, rQName
, rAttrList
)
1109 : XMLTransformerContext::CreateChildContext(
1110 nPrefix
, rLocalName
, rQName
, rAttrList
);
1112 else if( aPropTypes
[m_eFamily
][1] == XML_PROP_TYPE_END
)
1114 sal_uInt16 nActionMap
=
1115 aAttrActionMaps
[aPropTypes
[m_eFamily
][0]];
1116 if( nActionMap
< MAX_OOO_PROP_ACTIONS
)
1118 pContext
= new XMLPropertiesOOoTContext_Impl(
1119 GetTransformer(), rQName
,
1120 aPropTypes
[m_eFamily
], m_bPersistent
);
1125 pContext
= new XMLPersElemContentTContext(
1126 GetTransformer(), rQName
,
1127 XML_NAMESPACE_STYLE
,
1128 aPropTokens
[aPropTypes
[m_eFamily
][0]] );
1130 pContext
= new XMLRenameElemTransformerContext(
1131 GetTransformer(), rQName
,
1132 XML_NAMESPACE_STYLE
,
1133 aPropTokens
[aPropTypes
[m_eFamily
][0]] );
1138 pContext
= new XMLPropertiesOOoTContext_Impl(
1139 GetTransformer(), rQName
,
1140 aPropTypes
[m_eFamily
], m_bPersistent
);
1144 AddContent( pContext
);
1148 pContext
= m_bPersistent
1149 ? XMLPersElemContentTContext::CreateChildContext(
1150 nPrefix
, rLocalName
, rQName
, rAttrList
)
1151 : XMLTransformerContext::CreateChildContext(
1152 nPrefix
, rLocalName
, rQName
, rAttrList
);
1158 void XMLStyleOOoTContext::StartElement(
1159 const Reference
< XAttributeList
>& rAttrList
)
1161 XMLTransformerActions
*pActions
=
1162 GetTransformer().GetUserDefinedActions( OOO_STYLE_ACTIONS
);
1163 OSL_ENSURE( pActions
, "go no actions" );
1165 Reference
< XAttributeList
> xAttrList( rAttrList
);
1166 XMLMutableAttributeList
*pMutableAttrList
= 0;
1167 sal_Int16 nAttrCount
= xAttrList
.is() ? xAttrList
->getLength() : 0;
1168 for( sal_Int16 i
=0; i
< nAttrCount
; i
++ )
1170 const OUString sAttrName
= xAttrList
->getNameByIndex( i
);
1171 OUString aLocalName
;
1172 sal_uInt16 nPrefix
=
1173 GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName
,
1175 XMLTransformerActions::key_type
aKey( nPrefix
, aLocalName
);
1176 XMLTransformerActions::const_iterator aIter
=
1177 pActions
->find( aKey
);
1178 if( !(aIter
== pActions
->end() ) )
1180 if( !pMutableAttrList
)
1183 new XMLMutableAttributeList( xAttrList
);
1184 xAttrList
= pMutableAttrList
;
1186 const OUString sAttrValue
= xAttrList
->getValueByIndex( i
);
1187 switch( (*aIter
).second
.m_nActionType
)
1189 case XML_ATACTION_STYLE_FAMILY
:
1191 sal_Bool bControl
= sal_False
;
1192 if( XML_FAMILY_TYPE_END
== m_eFamily
)
1194 if( IsXMLToken( sAttrValue
, XML_GRAPHICS
) )
1195 m_eFamily
= XML_FAMILY_TYPE_GRAPHIC
;
1196 else if( IsXMLToken( sAttrValue
, XML_PRESENTATION
) )
1197 m_eFamily
= XML_FAMILY_TYPE_PRESENTATION
;
1198 else if( IsXMLToken( sAttrValue
, XML_DRAWING_PAGE
) )
1199 m_eFamily
= XML_FAMILY_TYPE_DRAWING_PAGE
;
1200 else if( IsXMLToken( sAttrValue
, XML_TEXT
) )
1201 m_eFamily
= XML_FAMILY_TYPE_TEXT
;
1202 else if( IsXMLToken( sAttrValue
, XML_PARAGRAPH
) )
1203 m_eFamily
= XML_FAMILY_TYPE_PARAGRAPH
;
1204 else if( IsXMLToken( sAttrValue
, XML_RUBY
) )
1205 m_eFamily
= XML_FAMILY_TYPE_RUBY
;
1206 else if( IsXMLToken( sAttrValue
, XML_SECTION
) )
1207 m_eFamily
= XML_FAMILY_TYPE_SECTION
;
1208 else if( IsXMLToken( sAttrValue
, XML_TABLE
) )
1209 m_eFamily
= XML_FAMILY_TYPE_TABLE
;
1210 else if( IsXMLToken( sAttrValue
, XML_TABLE_COLUMN
) )
1211 m_eFamily
= XML_FAMILY_TYPE_TABLE_COLUMN
;
1212 else if( IsXMLToken( sAttrValue
, XML_TABLE_ROW
) )
1213 m_eFamily
= XML_FAMILY_TYPE_TABLE_ROW
;
1214 else if( IsXMLToken( sAttrValue
, XML_TABLE_CELL
) )
1215 m_eFamily
= XML_FAMILY_TYPE_TABLE_CELL
;
1216 else if( IsXMLToken( sAttrValue
, XML_CHART
) )
1217 m_eFamily
= XML_FAMILY_TYPE_CHART
;
1218 else if( IsXMLToken( sAttrValue
, XML_CONTROL
) )
1220 m_eFamily
= XML_FAMILY_TYPE_PARAGRAPH
;
1221 bControl
= sal_True
;
1224 if( XML_FAMILY_TYPE_GRAPHIC
== m_eFamily
)
1226 pMutableAttrList
->SetValueByIndex( i
,
1227 GetXMLToken( XML_GRAPHIC
) );
1231 pMutableAttrList
->SetValueByIndex( i
,
1232 GetXMLToken( XML_PARAGRAPH
) );
1236 case XML_ATACTION_INCH2IN
:
1238 OUString
aAttrValue( sAttrValue
);
1239 if( XMLTransformerBase::ReplaceSingleInchWithIn(
1241 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1244 case XML_ATACTION_ENCODE_STYLE_NAME
:
1246 OUString
aAttrValue( sAttrValue
);
1247 if( GetTransformer().EncodeStyleName(aAttrValue
) )
1249 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1250 OUString
aNewAttrQName(
1251 GetTransformer().GetNamespaceMap().
1253 nPrefix
, ::xmloff::token::GetXMLToken(
1254 XML_DISPLAY_NAME
) ) );
1255 pMutableAttrList
->AddAttribute( aNewAttrQName
,
1260 case XML_ATACTION_ENCODE_STYLE_NAME_REF
:
1262 OUString
aAttrValue( sAttrValue
);
1263 if( GetTransformer().EncodeStyleName(aAttrValue
) )
1264 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1267 case XML_ATACTION_NEG_PERCENT
:
1269 OUString
aAttrValue( sAttrValue
);
1270 if( GetTransformer().NegPercent(aAttrValue
) )
1271 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1274 case XML_ATACTION_URI_OOO
:
1276 OUString
aAttrValue( sAttrValue
);
1277 if( GetTransformer().ConvertURIToOASIS( aAttrValue
,
1278 static_cast< sal_Bool
>((*aIter
).second
.m_nParam1
)))
1279 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1283 OSL_ENSURE( !this, "unknown action" );
1288 if( XML_FAMILY_TYPE_END
== m_eFamily
)
1289 m_eFamily
= XML_FAMILY_TYPE_TEXT
;
1291 XMLPersElemContentTContext::StartElement( xAttrList
);
1293 GetTransformer().GetDocHandler()->startElement( GetExportQName(),
1297 void XMLStyleOOoTContext::EndElement()
1300 XMLPersElemContentTContext::EndElement();
1302 GetTransformer().GetDocHandler()->endElement( GetExportQName() );
1305 void XMLStyleOOoTContext::Characters( const OUString
& )
1307 // element content only:
1310 sal_Bool
XMLStyleOOoTContext::IsPersistent() const
1312 return m_bPersistent
;
1315 XMLTransformerActions
*XMLStyleOOoTContext::CreateTransformerActions(
1318 XMLTransformerActionInit
*pInit
= 0;
1322 case PROP_OOO_GRAPHIC_ATTR_ACTIONS
:
1323 pInit
= aGraphicPropertyOOoAttrActionTable
;
1325 case PROP_OOO_GRAPHIC_ELEM_ACTIONS
:
1326 pInit
= aGraphicPropertyOOoElemActionTable
;
1328 case PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS
:
1329 pInit
= aDrawingPagePropertyOOoAttrActionTable
;
1331 case PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS
:
1332 pInit
= aPageLayoutPropertyOOoAttrActionTable
;
1334 case PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS
:
1335 pInit
= aHeaderFooterPropertyOOoAttrActionTable
;
1337 case PROP_OOO_TEXT_ATTR_ACTIONS
:
1338 pInit
= aTextPropertyOOoAttrActionTable
;
1340 case PROP_OOO_TEXT_ELEM_ACTIONS
:
1341 pInit
= aTextPropertyOOoElemActionTable
;
1343 case PROP_OOO_PARAGRAPH_ATTR_ACTIONS
:
1344 pInit
= aParagraphPropertyOOoAttrActionTable
;
1346 case PROP_OOO_PARAGRAPH_ELEM_ACTIONS
:
1347 pInit
= aParagraphPropertyOOoElemActionTable
;
1349 case PROP_OOO_SECTION_ATTR_ACTIONS
:
1350 pInit
= aSectionPropertyOOoAttrActionTable
;
1352 case PROP_OOO_TABLE_ATTR_ACTIONS
:
1353 pInit
= aTablePropertyOOoAttrActionTable
;
1355 case PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS
:
1356 pInit
= aTableColumnPropertyOOoAttrActionTable
;
1358 case PROP_OOO_TABLE_ROW_ATTR_ACTIONS
:
1359 pInit
= aTableRowPropertyOOoAttrActionTable
;
1361 case PROP_OOO_TABLE_CELL_ATTR_ACTIONS
:
1362 pInit
= aTableCellPropertyOOoAttrActionTable
;
1364 case PROP_OOO_TABLE_CELL_ELEM_ACTIONS
:
1365 pInit
= aTableCellPropertyOOoElemActionTable
;
1367 case PROP_OOO_LIST_LEVEL_ATTR_ACTIONS
:
1368 pInit
= aListLevelPropertyOOoAttrActionTable
;
1370 case PROP_OOO_CHART_ATTR_ACTIONS
:
1371 pInit
= aChartPropertyOOoAttrActionTable
;
1373 case PROP_OOO_CHART_ELEM_ACTIONS
:
1374 pInit
= aChartPropertyOOoElemActionTable
;
1378 XMLTransformerActions
*pActions
= 0;
1380 pActions
= new XMLTransformerActions( pInit
);
1385 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */