1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: StyleOOoTContext.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include <com/sun/star/xml/sax/SAXParseException.hpp>
34 #include <com/sun/star/xml/sax/SAXException.hpp>
35 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
36 #include <com/sun/star/xml/sax/XAttributeList.hpp>
37 #include <xmloff/nmspmap.hxx>
38 #include <xmloff/xmltoken.hxx>
39 #include "xmlnmspe.hxx"
40 #include "PropType.hxx"
41 #include "DeepTContext.hxx"
42 #include "RenameElemTContext.hxx"
43 #include "ProcAttrTContext.hxx"
44 #include "ActionMapTypesOOo.hxx"
45 #include "MutableAttrList.hxx"
46 #include "TransformerActions.hxx"
47 #include "PropertyActionsOOo.hxx"
48 #ifndef _XMLOFF_TRANSFORMERBASE_HXX
49 #include "TransformerBase.hxx"
52 #ifndef _XMLOFF_STYLEOASISTCONTEXT_HXX
53 #include "StyleOOoTContext.hxx"
55 #include <xmloff/xmluconv.hxx>
56 #include <rtl/ustrbuf.hxx>
57 #include <rtl/math.hxx>
59 using ::rtl::OUString
;
60 using namespace ::xmloff::token
;
61 using namespace ::com::sun::star::uno
;
62 using namespace ::com::sun::star::xml::sax
;
64 const sal_uInt16 MAX_PROP_TYPES
= 4;
65 #define ENTRY4(a,b,c,d) \
66 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
67 XML_PROP_TYPE_##c, XML_PROP_TYPE_##d }
68 #define ENTRY3(a,b,c) \
69 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
70 XML_PROP_TYPE_##c, XML_PROP_TYPE_END }
72 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
73 XML_PROP_TYPE_END, XML_PROP_TYPE_END }
75 { XML_PROP_TYPE_##a, XML_PROP_TYPE_##END, \
76 XML_PROP_TYPE_END, XML_PROP_TYPE_END }
78 static XMLPropType aPropTypes
[XML_FAMILY_TYPE_END
][MAX_PROP_TYPES
] =
80 ENTRY3( GRAPHIC
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_GRAPHIC,
81 ENTRY3( GRAPHIC
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_PRESENTATION,
82 ENTRY1( DRAWING_PAGE
), // XML_FAMILY_TYPE_DRAWING_PAGE,
83 ENTRY1( END
), // XML_FAMILY_TYPE_MASTER_PAGE
84 ENTRY1( PAGE_LAYOUT
), // XML_FAMILY_TYPE_PAGE_LAYOUT,
85 ENTRY1( HEADER_FOOTER
), // XML_FAMILY_TYPE_HEADER_FOOTER
86 ENTRY1( TEXT
), // XML_FAMILY_TYPE_TEXT,
87 ENTRY2( PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_PARAGRAPH,
88 ENTRY1( RUBY
), //XML_FAMILY_TYPE_RUBY,
89 ENTRY1( SECTION
), // XML_FAMILY_TYPE_SECTION,
90 ENTRY1( TABLE
), // XML_FAMILY_TYPE_TABLE,
91 ENTRY1( TABLE_COLUMN
), // XML_FAMILY_TYPE_TABLE_COLUMN,
92 ENTRY1( TABLE_ROW
), // XML_FAMILY_TYPE_TABLE_ROW,
93 ENTRY3( TABLE_CELL
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_TABLE_CELL,
94 ENTRY1( LIST_LEVEL
), // XML_FAMILY_TYPE_LIST,
95 ENTRY4( CHART
, GRAPHIC
, PARAGRAPH
, TEXT
), // XML_FAMILY_TYPE_CHART,
96 ENTRY1( TEXT
), // XML_FAMILY_TYPE_DATA,
97 ENTRY1( END
), // XML_FAMILY_TYPE_GRADIENT,
98 ENTRY1( END
), // XML_FAMILY_TYPE_HATCH,
99 ENTRY1( END
), // XML_FAMILY_TYPE_FILL_IMAGE,
100 ENTRY1( END
), // XML_FAMILY_TYPE_STROKE_DASH,
101 ENTRY1( END
), // XML_FAMILY_TYPE_MARKER,
102 ENTRY1( END
) // XML_FAMILY_TYPE_PRESENTATION_PAGE_LAYOUT,
105 static XMLTokenEnum aPropTokens
[XML_PROP_TYPE_END
] =
107 XML_GRAPHIC_PROPERTIES
,
108 XML_DRAWING_PAGE_PROPERTIES
,
109 XML_PAGE_LAYOUT_PROPERTIES
,
110 XML_HEADER_FOOTER_PROPERTIES
,
112 XML_PARAGRAPH_PROPERTIES
,
114 XML_SECTION_PROPERTIES
,
115 XML_TABLE_PROPERTIES
,
116 XML_TABLE_COLUMN_PROPERTIES
,
117 XML_TABLE_ROW_PROPERTIES
,
118 XML_TABLE_CELL_PROPERTIES
,
119 XML_LIST_LEVEL_PROPERTIES
,
123 static sal_uInt16 aAttrActionMaps
[XML_PROP_TYPE_END
] =
125 PROP_OOO_GRAPHIC_ATTR_ACTIONS
,
126 PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS
, // DRAWING_PAGE
127 PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS
,
128 PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS
,
129 PROP_OOO_TEXT_ATTR_ACTIONS
,
130 PROP_OOO_PARAGRAPH_ATTR_ACTIONS
,
131 MAX_OOO_PROP_ACTIONS
, // RUBY
132 PROP_OOO_SECTION_ATTR_ACTIONS
,
133 PROP_OOO_TABLE_ATTR_ACTIONS
,
134 PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS
,
135 PROP_OOO_TABLE_ROW_ATTR_ACTIONS
,
136 PROP_OOO_TABLE_CELL_ATTR_ACTIONS
,
137 PROP_OOO_LIST_LEVEL_ATTR_ACTIONS
,
138 PROP_OOO_CHART_ATTR_ACTIONS
141 static sal_uInt16 aElemActionMaps
[XML_PROP_TYPE_END
] =
143 PROP_OOO_GRAPHIC_ELEM_ACTIONS
,
144 MAX_OOO_PROP_ACTIONS
,
145 MAX_OOO_PROP_ACTIONS
,
146 MAX_OOO_PROP_ACTIONS
,
147 PROP_OOO_TEXT_ELEM_ACTIONS
,
148 PROP_OOO_PARAGRAPH_ELEM_ACTIONS
,
149 MAX_OOO_PROP_ACTIONS
,
150 MAX_OOO_PROP_ACTIONS
,
151 MAX_OOO_PROP_ACTIONS
,
152 MAX_OOO_PROP_ACTIONS
,
153 MAX_OOO_PROP_ACTIONS
,
154 PROP_OOO_TABLE_CELL_ELEM_ACTIONS
,
155 MAX_OOO_PROP_ACTIONS
,
156 PROP_OOO_CHART_ELEM_ACTIONS
160 //------------------------------------------------------------------------------
162 class XMLTypedPropertiesOOoTContext_Impl
: public XMLPersElemContentTContext
164 ::com::sun::star::uno::Reference
<
165 ::com::sun::star::xml::sax::XAttributeList
> m_xAttrList
;
171 XMLTypedPropertiesOOoTContext_Impl( XMLTransformerBase
& rTransformer
,
172 const ::rtl::OUString
& rQName
);
174 virtual ~XMLTypedPropertiesOOoTContext_Impl();
176 using XMLPersAttrListTContext::AddAttribute
;
177 void AddAttribute( const ::rtl::OUString
&sName
,
178 const ::rtl::OUString
&sValue
);
179 void AddAttribute( sal_uInt16 nPrefix
, XMLTokenEnum eToken
,
180 const ::rtl::OUString
&sValue
);
182 virtual void StartElement( const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& rAttrList
);
184 virtual void Export();
187 TYPEINIT1( XMLTypedPropertiesOOoTContext_Impl
, XMLPersElemContentTContext
);
189 XMLTypedPropertiesOOoTContext_Impl::XMLTypedPropertiesOOoTContext_Impl(
190 XMLTransformerBase
& rImp
,
191 const OUString
& rQName
) :
192 XMLPersElemContentTContext( rImp
, rQName
),
193 m_xAttrList( new XMLMutableAttributeList() )
197 XMLTypedPropertiesOOoTContext_Impl::~XMLTypedPropertiesOOoTContext_Impl()
201 void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
202 const ::rtl::OUString
&sName
,
203 const ::rtl::OUString
&sValue
)
205 static_cast< XMLMutableAttributeList
* >( m_xAttrList
.get() )
206 ->AddAttribute( sName
, sValue
);
209 void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
210 sal_uInt16 nPrefix
, XMLTokenEnum eToken
,
211 const ::rtl::OUString
&sValue
)
214 GetTransformer().GetNamespaceMap().GetQNameByKey(
215 nPrefix
, ::xmloff::token::GetXMLToken( eToken
) ) );
216 static_cast< XMLMutableAttributeList
* >( m_xAttrList
.get() )
217 ->AddAttribute( sName
, sValue
);
220 void XMLTypedPropertiesOOoTContext_Impl::StartElement(
221 const Reference
< XAttributeList
>& )
223 // empty, ignore even the attribute list
226 void XMLTypedPropertiesOOoTContext_Impl::Export()
228 if( m_xAttrList
->getLength() || HasElementContent() )
230 GetTransformer().GetDocHandler()->startElement( GetQName(), m_xAttrList
);
232 GetTransformer().GetDocHandler()->endElement( GetQName() );
236 //------------------------------------------------------------------------------
238 class XMLPropertiesOOoTContext_Impl
: public XMLTransformerContext
240 ::rtl::Reference
< XMLTypedPropertiesOOoTContext_Impl
>
241 m_aPropContexts
[MAX_PROP_TYPES
];
243 typedef XMLPropType XMLPropTypes
[MAX_PROP_TYPES
];
245 XMLPropTypes m_aPropTypes
;
247 sal_Bool m_bPersistent
;
249 XMLTypedPropertiesOOoTContext_Impl
*GetPropContextAndAction(
250 TransformerAction_Impl
& rAction
,
251 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
254 XMLTypedPropertiesOOoTContext_Impl
*GetPropContext(
262 XMLPropertiesOOoTContext_Impl( XMLTransformerBase
& rTransformer
,
263 const ::rtl::OUString
& rQName
,
264 XMLPropTypes
& rTypes
,
265 sal_Bool bPersistent
);
267 virtual ~XMLPropertiesOOoTContext_Impl();
269 XMLTransformerContext
*CreateChildContext(
271 const OUString
& rLocalName
,
272 const OUString
& rQName
,
273 const Reference
< XAttributeList
>& rAttrList
);
275 virtual void StartElement( const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& rAttrList
);
277 virtual void EndElement();
279 virtual void Characters( const ::rtl::OUString
& rChars
);
281 virtual void Export();
283 virtual sal_Bool
IsPersistent() const;
286 TYPEINIT1( XMLPropertiesOOoTContext_Impl
, XMLTransformerContext
);
288 XMLTypedPropertiesOOoTContext_Impl
289 *XMLPropertiesOOoTContext_Impl::GetPropContext(
292 sal_uInt16 nIndex
= MAX_PROP_TYPES
;
293 for( sal_uInt16 i
=0; i
< MAX_PROP_TYPES
; i
++ )
295 if( m_aPropTypes
[i
] == eType
)
301 if( MAX_PROP_TYPES
== nIndex
)
304 if( !m_aPropContexts
[nIndex
].is() )
306 m_aPropContexts
[nIndex
] =
307 new XMLTypedPropertiesOOoTContext_Impl(
309 GetTransformer().GetNamespaceMap().GetQNameByKey(
311 ::xmloff::token::GetXMLToken(
312 aPropTokens
[m_aPropTypes
[nIndex
]] ) ));
315 return m_aPropContexts
[nIndex
].get();
319 XMLTypedPropertiesOOoTContext_Impl
320 *XMLPropertiesOOoTContext_Impl::GetPropContextAndAction(
321 TransformerAction_Impl
& rAction
,
322 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
325 rAction
.m_nActionType
= XML_ATACTION_COPY
;
326 sal_uInt16 nIndex
= 0;
328 XMLTransformerActions::key_type
aKey( nPrefix
, rLocalName
);
330 while( i
< MAX_PROP_TYPES
&& XML_PROP_TYPE_END
!=m_aPropTypes
[i
])
332 sal_uInt16 nActionMap
=
333 (bElem
? aElemActionMaps
: aAttrActionMaps
)[m_aPropTypes
[i
]];
334 if( nActionMap
< MAX_OOO_PROP_ACTIONS
)
336 XMLTransformerActions
*pActions
=
337 GetTransformer().GetUserDefinedActions( nActionMap
);
338 OSL_ENSURE( pActions
, "go no actions" );
341 XMLTransformerActions::const_iterator aIter
=
342 pActions
->find( aKey
);
344 if( !(aIter
== pActions
->end()) )
346 rAction
= (*aIter
).second
;
356 if( !( XML_NAMESPACE_NONE
== nPrefix
||
357 (XML_NAMESPACE_UNKNOWN_FLAG
& nPrefix
) ||
358 XML_PROP_TYPE_END
==m_aPropTypes
[1] ||
359 (i
<MAX_PROP_TYPES
&& XML_PROP_TYPE_END
!=m_aPropTypes
[i
]) ) )
361 ::rtl::OString
aTmp("Didnt't find property: ");
362 const ::rtl::OUString
& rPrefix
=
363 GetTransformer().GetNamespaceMap().GetPrefixByKey( nPrefix
);
364 aTmp
+= ::rtl::OString( rPrefix
.getStr(), rPrefix
.getLength(),
365 RTL_TEXTENCODING_ASCII_US
);
366 aTmp
+= ::rtl::OString::valueOf( ':' );
367 aTmp
+= ::rtl::OString( rLocalName
.getStr(), rLocalName
.getLength(),
368 RTL_TEXTENCODING_ASCII_US
);
369 aTmp
+= ::rtl::OString(", assuming <style:");
370 const ::rtl::OUString
& rName
=
371 ::xmloff::token::GetXMLToken( aPropTokens
[m_aPropTypes
[0]] );
372 aTmp
+= ::rtl::OString( rName
.getStr(), rName
.getLength(),
373 RTL_TEXTENCODING_ASCII_US
);
374 aTmp
+= ::rtl::OString::valueOf( '>' );
376 OSL_ENSURE( !this, aTmp
);
380 if( !m_aPropContexts
[nIndex
].is() )
382 m_aPropContexts
[nIndex
] =
383 new XMLTypedPropertiesOOoTContext_Impl(
385 GetTransformer().GetNamespaceMap().GetQNameByKey(
387 ::xmloff::token::GetXMLToken(
388 aPropTokens
[m_aPropTypes
[nIndex
]] ) ));
391 return m_aPropContexts
[nIndex
].get();
394 XMLPropertiesOOoTContext_Impl::XMLPropertiesOOoTContext_Impl(
395 XMLTransformerBase
& rImp
,
396 const OUString
& rQName
,
397 XMLPropTypes
& rTypes
,
398 sal_Bool bPersistent
) :
399 XMLTransformerContext( rImp
, rQName
),
400 m_bPersistent( bPersistent
)
402 for( sal_uInt16 i
=0; i
< MAX_PROP_TYPES
; ++i
)
404 // remember the types that belong to the attribute and element lists
405 m_aPropTypes
[i
] = rTypes
[i
];
409 XMLPropertiesOOoTContext_Impl::~XMLPropertiesOOoTContext_Impl()
413 XMLTransformerContext
*XMLPropertiesOOoTContext_Impl::CreateChildContext(
415 const OUString
& rLocalName
,
416 const OUString
& rQName
,
417 const Reference
< XAttributeList
>& rAttrList
)
419 TransformerAction_Impl aAction
;
420 return GetPropContextAndAction( aAction
, nPrefix
, rLocalName
, sal_True
)
421 ->CreateChildContext( nPrefix
, rLocalName
, rQName
, rAttrList
);
425 void XMLPropertiesOOoTContext_Impl::StartElement(
426 const Reference
< XAttributeList
>& rAttrList
)
428 Reference
< XAttributeList
> xAttrList( rAttrList
);
430 XMLTypedPropertiesOOoTContext_Impl
* pIntervalMinorDivisorContext
= 0;
431 double fIntervalMajor
= 0.0;
432 double fIntervalMinor
= 0.0;
433 sal_Bool bMoveProtect
= sal_False
;
434 sal_Bool bSizeProtect
= sal_False
;
435 OUString aProtectAttrValue
;
436 XMLTypedPropertiesOOoTContext_Impl
* pProtectContext
= 0;
438 // --> OD 2005-05-13 #i49139# - attribute <style:mirror> has to be priority
439 // over attribute <style:draw>. The filter from OpenDocument file format
440 // to OpenOffice.org file format produces styles with both attributes.
441 sal_Bool
bExistStyleMirror( sal_False
);
442 OUString aStyleMirrorAttrValue
;
443 sal_Bool
bExistDrawMirror( sal_False
);
444 OUString aDrawMirrorAttrValue
;
445 XMLTypedPropertiesOOoTContext_Impl
* pMirrorContext( 0L );
448 sal_Int16 nAttrCount
= xAttrList
.is() ? xAttrList
->getLength() : 0;
449 for( sal_Int16 i
=0; i
< nAttrCount
; i
++ )
451 const OUString sAttrName
= xAttrList
->getNameByIndex( i
);
452 const OUString sAttrValue
= xAttrList
->getValueByIndex( i
);
455 GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName
,
457 TransformerAction_Impl aAction
;
458 XMLTypedPropertiesOOoTContext_Impl
*pContext
=
459 GetPropContextAndAction( aAction
, nPrefix
, aLocalName
, sal_False
);
460 switch( aAction
.m_nActionType
)
462 case XML_ATACTION_REMOVE
:
464 case XML_ATACTION_COPY
:
465 pContext
->AddAttribute( sAttrName
, sAttrValue
);
467 case XML_ATACTION_COPY_DUPLICATE
:
469 pContext
->AddAttribute( sAttrName
, sAttrValue
);
470 XMLTypedPropertiesOOoTContext_Impl
*pContext2
=
471 GetPropContext( (XMLPropType
)aAction
.m_nParam1
);
473 pContext2
->AddAttribute( sAttrName
, sAttrValue
);
476 case XML_ATACTION_RENAME
:
478 pContext
->AddAttribute( aAction
.GetQNamePrefixFromParam1(),
479 aAction
.GetQNameTokenFromParam1(),
483 case XML_ATACTION_ENCODE_STYLE_NAME_REF
:
485 OUString
aAttrValue( sAttrValue
);
486 GetTransformer().EncodeStyleName(aAttrValue
);
487 pContext
->AddAttribute( sAttrName
, aAttrValue
);
490 case XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF
:
492 OUString
aAttrValue( sAttrValue
);
493 GetTransformer().EncodeStyleName(aAttrValue
);
494 pContext
->AddAttribute( aAction
.GetQNamePrefixFromParam1(),
495 aAction
.GetQNameTokenFromParam1(),
499 case XML_ATACTION_NEG_PERCENT
:
501 OUString
aAttrValue( sAttrValue
);
502 GetTransformer().NegPercent(aAttrValue
);
503 pContext
->AddAttribute( sAttrName
, aAttrValue
);
506 case XML_ATACTION_RENAME_NEG_PERCENT
:
508 OUString
aAttrValue( sAttrValue
);
509 GetTransformer().NegPercent(aAttrValue
);
510 pContext
->AddAttribute( aAction
.GetQNamePrefixFromParam1(),
511 aAction
.GetQNameTokenFromParam1(),
515 case XML_ATACTION_INCH2IN
:
517 OUString
aAttrValue( sAttrValue
);
518 XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue
);
519 pContext
->AddAttribute( sAttrName
, aAttrValue
);
522 case XML_ATACTION_INCH2IN_DUPLICATE
:
524 OUString
aAttrValue( sAttrValue
);
525 XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue
);
526 pContext
->AddAttribute( sAttrName
, aAttrValue
);
527 XMLTypedPropertiesOOoTContext_Impl
*pContext2
=
528 GetPropContext( (XMLPropType
)aAction
.m_nParam1
);
530 pContext2
->AddAttribute( sAttrName
, aAttrValue
);
533 case XML_ATACTION_INCHS2INS
:
535 OUString
aAttrValue( sAttrValue
);
536 XMLTransformerBase::ReplaceInchWithIn( aAttrValue
);
537 pContext
->AddAttribute( sAttrName
, aAttrValue
);
540 case XML_PTACTION_LINE_MODE
:
542 OUString
aAttrValue( GetXMLToken(
543 IsXMLToken( sAttrValue
, XML_TRUE
)
545 : XML_SKIP_WHITE_SPACE
) );
547 GetTransformer().GetNamespaceMap().GetQNameByKey(
549 GetXMLToken( XML_TEXT_UNDERLINE_MODE
) ) );
550 pContext
->AddAttribute( aAttrQName
, aAttrValue
);
553 GetTransformer().GetNamespaceMap().GetQNameByKey(
555 GetXMLToken( XML_TEXT_LINE_THROUGH_MODE
) );
556 pContext
->AddAttribute( aAttrQName
, aAttrValue
);
559 case XML_PTACTION_KEEP_WITH_NEXT
:
561 OUString
aAttrValue( GetXMLToken(
562 IsXMLToken( sAttrValue
, XML_TRUE
)
565 pContext
->AddAttribute( sAttrName
, aAttrValue
);
568 case XML_PTACTION_UNDERLINE
:
570 XMLTokenEnum eToken
= GetTransformer().GetToken( sAttrValue
);
571 sal_Bool bBold
= sal_False
, bDouble
= sal_False
;
585 case XML_BOLD_DOTTED
:
593 case XML_BOLD_LONG_DASH
:
594 eToken
= XML_LONG_DASH
;
597 case XML_BOLD_DOT_DASH
:
598 eToken
= XML_DOT_DASH
;
601 case XML_BOLD_DOT_DOT_DASH
:
602 eToken
= XML_DOT_DOT_DASH
;
609 case XML_DOUBLE_WAVE
:
618 OSL_ENSURE( false, "xmloff::XMLPropertiesOOoTContext_Impl::StartElement(), unknown underline token!" );
621 pContext
->AddAttribute(
622 GetTransformer().GetNamespaceMap().GetQNameByKey(
624 GetXMLToken( XML_TEXT_UNDERLINE_STYLE
) ),
625 eToken
!= XML_TOKEN_END
? GetXMLToken( eToken
)
628 pContext
->AddAttribute(
629 GetTransformer().GetNamespaceMap().GetQNameByKey(
631 GetXMLToken( XML_TEXT_UNDERLINE_TYPE
) ),
632 GetXMLToken( XML_DOUBLE
) );
634 pContext
->AddAttribute(
635 GetTransformer().GetNamespaceMap().GetQNameByKey(
637 GetXMLToken( XML_TEXT_UNDERLINE_WIDTH
) ),
638 GetXMLToken( XML_BOLD
) );
641 case XML_PTACTION_LINETHROUGH
:
643 XMLTokenEnum eToken
= GetTransformer().GetToken( sAttrValue
);
644 sal_Bool bBold
= sal_False
, bDouble
= sal_False
;
648 case XML_SINGLE_LINE
:
651 case XML_DOUBLE_LINE
:
670 pContext
->AddAttribute(
671 GetTransformer().GetNamespaceMap().GetQNameByKey(
673 GetXMLToken( XML_TEXT_LINE_THROUGH_STYLE
) ),
674 eToken
!= XML_TOKEN_END
? GetXMLToken( eToken
)
677 pContext
->AddAttribute(
678 GetTransformer().GetNamespaceMap().GetQNameByKey(
680 GetXMLToken( XML_TEXT_LINE_THROUGH_TYPE
) ),
681 GetXMLToken( XML_DOUBLE
) );
683 pContext
->AddAttribute(
684 GetTransformer().GetNamespaceMap().GetQNameByKey(
686 GetXMLToken( XML_TEXT_LINE_THROUGH_WIDTH
) ),
687 GetXMLToken( XML_BOLD
) );
689 pContext
->AddAttribute(
690 GetTransformer().GetNamespaceMap().GetQNameByKey(
692 GetXMLToken( XML_TEXT_LINE_THROUGH_TEXT
) ),
693 OUString::valueOf( c
) );
696 case XML_PTACTION_SPLINES
:
698 sal_Int32 nSplineType
= sAttrValue
.toInt32();
699 OUString aNewAttrName
= GetTransformer().GetNamespaceMap().GetQNameByKey(
700 XML_NAMESPACE_CHART
, GetXMLToken( XML_INTERPOLATION
) );
702 switch( nSplineType
)
706 pContext
->AddAttribute(
707 aNewAttrName
, GetXMLToken( XML_NONE
));
711 pContext
->AddAttribute(
712 aNewAttrName
, GetXMLToken( XML_CUBIC_SPLINE
));
716 pContext
->AddAttribute(
717 aNewAttrName
, GetXMLToken( XML_B_SPLINE
));
721 OSL_ENSURE( false, "invalid spline type" );
722 pContext
->AddAttribute(
723 aNewAttrName
, GetXMLToken( XML_NONE
));
728 case XML_PTACTION_INTERVAL_MAJOR
:
729 pContext
->AddAttribute( sAttrName
, sAttrValue
);
730 SvXMLUnitConverter::convertDouble( fIntervalMajor
, sAttrValue
);
732 case XML_PTACTION_INTERVAL_MINOR
:
733 SvXMLUnitConverter::convertDouble( fIntervalMinor
, sAttrValue
);
734 pIntervalMinorDivisorContext
= pContext
;
736 case XML_PTACTION_SYMBOL
:
738 sal_Int32 nSymbolType
= sAttrValue
.toInt32();
739 OUString aNewAttrName
= GetTransformer().GetNamespaceMap().GetQNameByKey(
740 XML_NAMESPACE_CHART
, GetXMLToken( XML_SYMBOL_TYPE
) );
742 if( nSymbolType
>= 0 )
744 pContext
->AddAttribute( aNewAttrName
, GetXMLToken( XML_NAMED_SYMBOL
));
745 enum XMLTokenEnum eToken
= XML_TOKEN_INVALID
;
746 switch( nSymbolType
)
750 // "square" has an awkward token name
751 eToken
= XML_GRADIENTSTYLE_SQUARE
;
755 eToken
= XML_DIAMOND
;
759 eToken
= XML_ARROW_DOWN
;
763 eToken
= XML_ARROW_UP
;
767 eToken
= XML_ARROW_RIGHT
;
771 eToken
= XML_ARROW_LEFT
;
775 eToken
= XML_BOW_TIE
;
779 eToken
= XML_HOURGLASS
;
782 OSL_ENSURE( false, "invalid named symbol" );
786 if( eToken
!= XML_TOKEN_INVALID
)
788 pContext
->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey(
789 XML_NAMESPACE_CHART
, GetXMLToken( XML_SYMBOL_NAME
)),
790 GetXMLToken( eToken
));
795 switch( nSymbolType
)
799 pContext
->AddAttribute(
800 aNewAttrName
, GetXMLToken( XML_NONE
));
804 pContext
->AddAttribute(
805 aNewAttrName
, GetXMLToken( XML_AUTOMATIC
));
809 pContext
->AddAttribute(
810 aNewAttrName
, GetXMLToken( XML_IMAGE
));
813 OSL_ENSURE( false, "invalid symbol type" );
814 pContext
->AddAttribute(
815 aNewAttrName
, GetXMLToken( XML_NONE
));
821 case XML_PTACTION_SYMBOL_IMAGE_NAME
:
823 // create an xlink:href element for URI attribute
824 XMLPersAttrListTContext
*pSymbolImageContext
= new XMLPersAttrListTContext(
825 GetTransformer(), GetTransformer().GetNamespaceMap().GetQNameByKey(
826 XML_NAMESPACE_CHART
, GetXMLToken( XML_SYMBOL_IMAGE
)));
828 OUString
aAttrValue( sAttrValue
);
829 if( GetTransformer().ConvertURIToOASIS( aAttrValue
, sal_True
))
831 pSymbolImageContext
->AddAttribute( XML_NAMESPACE_XLINK
, XML_HREF
, aAttrValue
);
832 pContext
->AddContent( pSymbolImageContext
);
838 case XML_PTACTION_TRANSPARENCY
:
840 OUString
aAttrValue( sAttrValue
);
841 GetTransformer().NegPercent(aAttrValue
);
842 pContext
->AddAttribute( XML_NAMESPACE_DRAW
,
845 pContext
->AddAttribute( XML_NAMESPACE_DRAW
,
851 case XML_PTACTION_BREAK_INSIDE
:
853 pContext
->AddAttribute(
854 XML_NAMESPACE_FO
, XML_KEEP_TOGETHER
,
856 IsXMLToken( sAttrValue
, XML_COLUMNSPLIT_AVOID
)
861 case XML_ATACTION_CAPTION_ESCAPE_OOO
:
863 OUString
aAttrValue( sAttrValue
);
864 if( aAttrValue
.indexOf( sal_Unicode('%') ) != -1 )
866 sal_Int32 nValue
= 0;
867 SvXMLUnitConverter::convertPercent( nValue
, sAttrValue
);
871 rtl::OUStringBuffer aOut
;
872 SvXMLUnitConverter::convertPercent( aOut
, nValue
);
873 aAttrValue
= aOut
.makeStringAndClear();
878 XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue
);
881 pContext
->AddAttribute( sAttrName
, aAttrValue
);
884 case XML_ATACTION_MOVE_PROTECT
:
885 bMoveProtect
= IsXMLToken( sAttrValue
, XML_TRUE
);
886 pProtectContext
= pContext
;
888 case XML_ATACTION_SIZE_PROTECT
:
889 bSizeProtect
= IsXMLToken( sAttrValue
, XML_TRUE
);
890 pProtectContext
= pContext
;
892 case XML_ATACTION_PROTECT
:
893 aProtectAttrValue
= sAttrValue
;
894 pProtectContext
= pContext
;
896 case XML_ATACTION_DRAW_MIRROR_OOO
: // renames draw:mirror to style:mirror and adapts values
898 // --> OD 2005-05-13 #i49139#
899 aDrawMirrorAttrValue
=
900 GetXMLToken( IsXMLToken( sAttrValue
, XML_TRUE
)
901 ? XML_HORIZONTAL
: XML_NONE
);
902 bExistDrawMirror
= sal_True
;
903 pMirrorContext
= pContext
;
907 // --> OD 2005-05-12 #i49139#
908 case XML_ATACTION_STYLE_MIRROR_OOO
: // adapts style:mirror values
910 SvXMLTokenEnumerator
aTokenEnum( sAttrValue
);
912 while( aTokenEnum
.getNextToken( aToken
) )
914 if ( aStyleMirrorAttrValue
.getLength() > 0 )
916 aStyleMirrorAttrValue
+= rtl::OUString::createFromAscii( " " );
919 if ( IsXMLToken( aToken
, XML_HORIZONTAL_ON_LEFT_PAGES
) )
921 aStyleMirrorAttrValue
+= GetXMLToken( XML_HORIZONTAL_ON_EVEN
);
923 else if ( IsXMLToken( aToken
, XML_HORIZONTAL_ON_RIGHT_PAGES
) )
925 aStyleMirrorAttrValue
+= GetXMLToken( XML_HORIZONTAL_ON_ODD
);
929 aStyleMirrorAttrValue
+= aToken
;
932 bExistStyleMirror
= sal_True
;
933 pMirrorContext
= pContext
;
937 case XML_ATACTION_GAMMA_OOO
: // converts double value to percentage
939 double fValue
= sAttrValue
.toDouble();
940 sal_Int32 nValue
= (sal_Int32
)((fValue
* 100.0) + ( fValue
> 0 ? 0.5 : - 0.5 ) );
942 rtl::OUStringBuffer aOut
;
943 SvXMLUnitConverter::convertPercent( aOut
, nValue
);
944 OUString
aAttrValue( aOut
.makeStringAndClear() );
945 pContext
->AddAttribute( sAttrName
, aAttrValue
);
948 case XML_ATACTION_OPACITY_FIX
:
951 if( sAttrValue
.indexOf( sal_Unicode('%') ) != -1 )
953 SvXMLUnitConverter::convertPercent( nValue
, sAttrValue
);
957 nValue
= sal_Int32( sAttrValue
.toDouble() * 100.0 );
959 nValue
= 100 - nValue
;
961 rtl::OUStringBuffer aOut
;
962 SvXMLUnitConverter::convertPercent( aOut
, nValue
);
963 pContext
->AddAttribute( sAttrName
, aOut
.makeStringAndClear() );
967 OSL_ENSURE( !this, "unknown action" );
972 // --> OD 2005-05-13 #i49139#
973 if ( bExistStyleMirror
)
975 pMirrorContext
->AddAttribute(
976 GetTransformer().GetNamespaceMap().GetQNameByKey(
977 XML_NAMESPACE_STYLE
, GetXMLToken( XML_MIRROR
) ),
978 aStyleMirrorAttrValue
);
980 else if ( bExistDrawMirror
)
982 pMirrorContext
->AddAttribute(
983 GetTransformer().GetNamespaceMap().GetQNameByKey(
984 XML_NAMESPACE_STYLE
, GetXMLToken( XML_MIRROR
) ),
985 aDrawMirrorAttrValue
);
989 if( bMoveProtect
|| bSizeProtect
|| aProtectAttrValue
.getLength() )
991 if( (bMoveProtect
||bSizeProtect
) && IsXMLToken( aProtectAttrValue
, XML_NONE
) )
992 aProtectAttrValue
= OUString();
994 const OUString
& rPosition
= GetXMLToken( XML_POSITION
);
995 if( bMoveProtect
&& -1 == aProtectAttrValue
.indexOf( rPosition
) )
997 if( aProtectAttrValue
.getLength() )
998 aProtectAttrValue
+= OUString::valueOf( sal_Unicode( ' ' ) );
999 aProtectAttrValue
+= rPosition
;
1002 const OUString
& rSize
= GetXMLToken( XML_SIZE
);
1003 if( bSizeProtect
&& -1 == aProtectAttrValue
.indexOf( rSize
) )
1005 if( aProtectAttrValue
.getLength() )
1006 aProtectAttrValue
+= OUString::valueOf( sal_Unicode( ' ' ) );
1007 aProtectAttrValue
+= rSize
;
1010 pProtectContext
->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE
, GetXMLToken( XML_PROTECT
) ), aProtectAttrValue
);
1013 if( pIntervalMinorDivisorContext
)
1015 if( fIntervalMinor
!= 0.0 )
1017 sal_Int32 nIntervalMinorDivisor
= static_cast< sal_Int32
>(
1018 ::rtl::math::round( fIntervalMajor
/ fIntervalMinor
));
1020 ::rtl::OUStringBuffer aBuf
;
1021 SvXMLUnitConverter::convertNumber( aBuf
, nIntervalMinorDivisor
);
1022 pIntervalMinorDivisorContext
->AddAttribute(
1023 GetTransformer().GetNamespaceMap().GetQNameByKey(
1024 XML_NAMESPACE_CHART
,
1025 GetXMLToken( XML_INTERVAL_MINOR_DIVISOR
)),
1026 aBuf
.makeStringAndClear());
1031 void XMLPropertiesOOoTContext_Impl::EndElement()
1033 if( !m_bPersistent
)
1037 void XMLPropertiesOOoTContext_Impl::Characters( const OUString
& )
1042 void XMLPropertiesOOoTContext_Impl::Export()
1045 for( sal_uInt16 i
=0; i
< MAX_PROP_TYPES
; i
++ )
1047 if( m_aPropContexts
[i
].is() )
1048 m_aPropContexts
[i
]->Export();
1052 sal_Bool
XMLPropertiesOOoTContext_Impl::IsPersistent() const
1054 return m_bPersistent
;
1058 //------------------------------------------------------------------------------
1060 TYPEINIT1( XMLStyleOOoTContext
, XMLPersElemContentTContext
);
1062 XMLStyleOOoTContext::XMLStyleOOoTContext( XMLTransformerBase
& rImp
,
1063 const OUString
& rQName
,
1065 sal_Bool bPersistent
) :
1066 XMLPersElemContentTContext( rImp
, rQName
),
1068 m_bPersistent( bPersistent
)
1072 XMLStyleOOoTContext::XMLStyleOOoTContext(
1073 XMLTransformerBase
& rImp
,
1074 const OUString
& rQName
,
1077 ::xmloff::token::XMLTokenEnum eToken
,
1078 sal_Bool bPersistent
) :
1079 XMLPersElemContentTContext( rImp
, rQName
, nPrefix
, eToken
),
1081 m_bPersistent( bPersistent
)
1085 XMLStyleOOoTContext::~XMLStyleOOoTContext()
1089 XMLTransformerContext
*XMLStyleOOoTContext::CreateChildContext(
1091 const OUString
& rLocalName
,
1092 const OUString
& rQName
,
1093 const Reference
< XAttributeList
>& rAttrList
)
1095 XMLTransformerContext
*pContext
= 0;
1097 if( XML_NAMESPACE_STYLE
== nPrefix
&&
1098 IsXMLToken( rLocalName
, XML_PROPERTIES
) )
1100 if( aPropTypes
[m_eFamily
][0] == XML_PROP_TYPE_END
)
1102 OSL_ENSURE( !this, "unexpected properties element" );
1103 pContext
= m_bPersistent
1104 ? XMLPersElemContentTContext::CreateChildContext(
1105 nPrefix
, rLocalName
, rQName
, rAttrList
)
1106 : XMLTransformerContext::CreateChildContext(
1107 nPrefix
, rLocalName
, rQName
, rAttrList
);
1109 else if( aPropTypes
[m_eFamily
][1] == XML_PROP_TYPE_END
)
1111 sal_uInt16 nActionMap
=
1112 aAttrActionMaps
[aPropTypes
[m_eFamily
][0]];
1113 if( nActionMap
< MAX_OOO_PROP_ACTIONS
)
1115 pContext
= new XMLPropertiesOOoTContext_Impl(
1116 GetTransformer(), rQName
,
1117 aPropTypes
[m_eFamily
], m_bPersistent
);
1122 pContext
= new XMLPersElemContentTContext(
1123 GetTransformer(), rQName
,
1124 XML_NAMESPACE_STYLE
,
1125 aPropTokens
[aPropTypes
[m_eFamily
][0]] );
1127 pContext
= new XMLRenameElemTransformerContext(
1128 GetTransformer(), rQName
,
1129 XML_NAMESPACE_STYLE
,
1130 aPropTokens
[aPropTypes
[m_eFamily
][0]] );
1135 pContext
= new XMLPropertiesOOoTContext_Impl(
1136 GetTransformer(), rQName
,
1137 aPropTypes
[m_eFamily
], m_bPersistent
);
1141 AddContent( pContext
);
1145 pContext
= m_bPersistent
1146 ? XMLPersElemContentTContext::CreateChildContext(
1147 nPrefix
, rLocalName
, rQName
, rAttrList
)
1148 : XMLTransformerContext::CreateChildContext(
1149 nPrefix
, rLocalName
, rQName
, rAttrList
);
1155 void XMLStyleOOoTContext::StartElement(
1156 const Reference
< XAttributeList
>& rAttrList
)
1158 XMLTransformerActions
*pActions
=
1159 GetTransformer().GetUserDefinedActions( OOO_STYLE_ACTIONS
);
1160 OSL_ENSURE( pActions
, "go no actions" );
1162 Reference
< XAttributeList
> xAttrList( rAttrList
);
1163 XMLMutableAttributeList
*pMutableAttrList
= 0;
1164 sal_Int16 nAttrCount
= xAttrList
.is() ? xAttrList
->getLength() : 0;
1165 for( sal_Int16 i
=0; i
< nAttrCount
; i
++ )
1167 const OUString sAttrName
= xAttrList
->getNameByIndex( i
);
1168 OUString aLocalName
;
1169 sal_uInt16 nPrefix
=
1170 GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName
,
1172 XMLTransformerActions::key_type
aKey( nPrefix
, aLocalName
);
1173 XMLTransformerActions::const_iterator aIter
=
1174 pActions
->find( aKey
);
1175 if( !(aIter
== pActions
->end() ) )
1177 if( !pMutableAttrList
)
1180 new XMLMutableAttributeList( xAttrList
);
1181 xAttrList
= pMutableAttrList
;
1183 const OUString sAttrValue
= xAttrList
->getValueByIndex( i
);
1184 switch( (*aIter
).second
.m_nActionType
)
1186 case XML_ATACTION_STYLE_FAMILY
:
1188 sal_Bool bControl
= sal_False
;
1189 if( XML_FAMILY_TYPE_END
== m_eFamily
)
1191 if( IsXMLToken( sAttrValue
, XML_GRAPHICS
) )
1192 m_eFamily
= XML_FAMILY_TYPE_GRAPHIC
;
1193 else if( IsXMLToken( sAttrValue
, XML_PRESENTATION
) )
1194 m_eFamily
= XML_FAMILY_TYPE_PRESENTATION
;
1195 else if( IsXMLToken( sAttrValue
, XML_DRAWING_PAGE
) )
1196 m_eFamily
= XML_FAMILY_TYPE_DRAWING_PAGE
;
1197 else if( IsXMLToken( sAttrValue
, XML_TEXT
) )
1198 m_eFamily
= XML_FAMILY_TYPE_TEXT
;
1199 else if( IsXMLToken( sAttrValue
, XML_PARAGRAPH
) )
1200 m_eFamily
= XML_FAMILY_TYPE_PARAGRAPH
;
1201 else if( IsXMLToken( sAttrValue
, XML_RUBY
) )
1202 m_eFamily
= XML_FAMILY_TYPE_RUBY
;
1203 else if( IsXMLToken( sAttrValue
, XML_SECTION
) )
1204 m_eFamily
= XML_FAMILY_TYPE_SECTION
;
1205 else if( IsXMLToken( sAttrValue
, XML_TABLE
) )
1206 m_eFamily
= XML_FAMILY_TYPE_TABLE
;
1207 else if( IsXMLToken( sAttrValue
, XML_TABLE_COLUMN
) )
1208 m_eFamily
= XML_FAMILY_TYPE_TABLE_COLUMN
;
1209 else if( IsXMLToken( sAttrValue
, XML_TABLE_ROW
) )
1210 m_eFamily
= XML_FAMILY_TYPE_TABLE_ROW
;
1211 else if( IsXMLToken( sAttrValue
, XML_TABLE_CELL
) )
1212 m_eFamily
= XML_FAMILY_TYPE_TABLE_CELL
;
1213 else if( IsXMLToken( sAttrValue
, XML_CHART
) )
1214 m_eFamily
= XML_FAMILY_TYPE_CHART
;
1215 else if( IsXMLToken( sAttrValue
, XML_CONTROL
) )
1217 m_eFamily
= XML_FAMILY_TYPE_PARAGRAPH
;
1218 bControl
= sal_True
;
1221 if( XML_FAMILY_TYPE_GRAPHIC
== m_eFamily
)
1223 pMutableAttrList
->SetValueByIndex( i
,
1224 GetXMLToken( XML_GRAPHIC
) );
1228 pMutableAttrList
->SetValueByIndex( i
,
1229 GetXMLToken( XML_PARAGRAPH
) );
1233 case XML_ATACTION_INCH2IN
:
1235 OUString
aAttrValue( sAttrValue
);
1236 if( XMLTransformerBase::ReplaceSingleInchWithIn(
1238 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1241 case XML_ATACTION_ENCODE_STYLE_NAME
:
1243 OUString
aAttrValue( sAttrValue
);
1244 if( GetTransformer().EncodeStyleName(aAttrValue
) )
1246 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1247 OUString
aNewAttrQName(
1248 GetTransformer().GetNamespaceMap().
1250 nPrefix
, ::xmloff::token::GetXMLToken(
1251 XML_DISPLAY_NAME
) ) );
1252 pMutableAttrList
->AddAttribute( aNewAttrQName
,
1257 case XML_ATACTION_ENCODE_STYLE_NAME_REF
:
1259 OUString
aAttrValue( sAttrValue
);
1260 if( GetTransformer().EncodeStyleName(aAttrValue
) )
1261 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1264 case XML_ATACTION_NEG_PERCENT
:
1266 OUString
aAttrValue( sAttrValue
);
1267 if( GetTransformer().NegPercent(aAttrValue
) )
1268 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1271 case XML_ATACTION_URI_OOO
:
1273 OUString
aAttrValue( sAttrValue
);
1274 if( GetTransformer().ConvertURIToOASIS( aAttrValue
,
1275 static_cast< sal_Bool
>((*aIter
).second
.m_nParam1
)))
1276 pMutableAttrList
->SetValueByIndex( i
, aAttrValue
);
1280 OSL_ENSURE( !this, "unknown action" );
1285 if( XML_FAMILY_TYPE_END
== m_eFamily
)
1286 m_eFamily
= XML_FAMILY_TYPE_TEXT
;
1288 XMLPersElemContentTContext::StartElement( xAttrList
);
1290 GetTransformer().GetDocHandler()->startElement( GetExportQName(),
1294 void XMLStyleOOoTContext::EndElement()
1297 XMLPersElemContentTContext::EndElement();
1299 GetTransformer().GetDocHandler()->endElement( GetExportQName() );
1302 void XMLStyleOOoTContext::Characters( const OUString
& )
1304 // element content only:
1307 sal_Bool
XMLStyleOOoTContext::IsPersistent() const
1309 return m_bPersistent
;
1312 XMLTransformerActions
*XMLStyleOOoTContext::CreateTransformerActions(
1315 XMLTransformerActionInit
*pInit
= 0;
1319 case PROP_OOO_GRAPHIC_ATTR_ACTIONS
:
1320 pInit
= aGraphicPropertyOOoAttrActionTable
;
1322 case PROP_OOO_GRAPHIC_ELEM_ACTIONS
:
1323 pInit
= aGraphicPropertyOOoElemActionTable
;
1325 case PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS
:
1326 pInit
= aDrawingPagePropertyOOoAttrActionTable
;
1328 case PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS
:
1329 pInit
= aPageLayoutPropertyOOoAttrActionTable
;
1331 case PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS
:
1332 pInit
= aHeaderFooterPropertyOOoAttrActionTable
;
1334 case PROP_OOO_TEXT_ATTR_ACTIONS
:
1335 pInit
= aTextPropertyOOoAttrActionTable
;
1337 case PROP_OOO_TEXT_ELEM_ACTIONS
:
1338 pInit
= aTextPropertyOOoElemActionTable
;
1340 case PROP_OOO_PARAGRAPH_ATTR_ACTIONS
:
1341 pInit
= aParagraphPropertyOOoAttrActionTable
;
1343 case PROP_OOO_PARAGRAPH_ELEM_ACTIONS
:
1344 pInit
= aParagraphPropertyOOoElemActionTable
;
1346 case PROP_OOO_SECTION_ATTR_ACTIONS
:
1347 pInit
= aSectionPropertyOOoAttrActionTable
;
1349 case PROP_OOO_TABLE_ATTR_ACTIONS
:
1350 pInit
= aTablePropertyOOoAttrActionTable
;
1352 case PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS
:
1353 pInit
= aTableColumnPropertyOOoAttrActionTable
;
1355 case PROP_OOO_TABLE_ROW_ATTR_ACTIONS
:
1356 pInit
= aTableRowPropertyOOoAttrActionTable
;
1358 case PROP_OOO_TABLE_CELL_ATTR_ACTIONS
:
1359 pInit
= aTableCellPropertyOOoAttrActionTable
;
1361 case PROP_OOO_TABLE_CELL_ELEM_ACTIONS
:
1362 pInit
= aTableCellPropertyOOoElemActionTable
;
1364 case PROP_OOO_LIST_LEVEL_ATTR_ACTIONS
:
1365 pInit
= aListLevelPropertyOOoAttrActionTable
;
1367 case PROP_OOO_CHART_ATTR_ACTIONS
:
1368 pInit
= aChartPropertyOOoAttrActionTable
;
1370 case PROP_OOO_CHART_ELEM_ACTIONS
:
1371 pInit
= aChartPropertyOOoElemActionTable
;
1375 XMLTransformerActions
*pActions
= 0;
1377 pActions
= new XMLTransformerActions( pInit
);