1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
30*cdf0e10cSrcweir #include <com/sun/star/xml/sax/SAXParseException.hpp>
31*cdf0e10cSrcweir #include <com/sun/star/xml/sax/SAXException.hpp>
32*cdf0e10cSrcweir #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/xml/sax/XAttributeList.hpp>
34*cdf0e10cSrcweir #include <xmloff/nmspmap.hxx>
35*cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
36*cdf0e10cSrcweir #include "xmloff/xmlnmspe.hxx"
37*cdf0e10cSrcweir #include "PropType.hxx"
38*cdf0e10cSrcweir #include "DeepTContext.hxx"
39*cdf0e10cSrcweir #include "RenameElemTContext.hxx"
40*cdf0e10cSrcweir #include "ProcAttrTContext.hxx"
41*cdf0e10cSrcweir #include "ActionMapTypesOOo.hxx"
42*cdf0e10cSrcweir #include "MutableAttrList.hxx"
43*cdf0e10cSrcweir #include "TransformerActions.hxx"
44*cdf0e10cSrcweir #include "PropertyActionsOOo.hxx"
45*cdf0e10cSrcweir #ifndef _XMLOFF_TRANSFORMERBASE_HXX
46*cdf0e10cSrcweir #include "TransformerBase.hxx"
47*cdf0e10cSrcweir #endif
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir #ifndef _XMLOFF_STYLEOASISTCONTEXT_HXX
50*cdf0e10cSrcweir #include "StyleOOoTContext.hxx"
51*cdf0e10cSrcweir #endif
52*cdf0e10cSrcweir #include <xmloff/xmluconv.hxx>
53*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
54*cdf0e10cSrcweir #include <rtl/math.hxx>
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir using ::rtl::OUString;
57*cdf0e10cSrcweir using namespace ::xmloff::token;
58*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
59*cdf0e10cSrcweir using namespace ::com::sun::star::xml::sax;
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir const sal_uInt16 MAX_PROP_TYPES = 4;
62*cdf0e10cSrcweir #define ENTRY4(a,b,c,d) \
63*cdf0e10cSrcweir 	{ XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
64*cdf0e10cSrcweir 		XML_PROP_TYPE_##c, XML_PROP_TYPE_##d  }
65*cdf0e10cSrcweir #define ENTRY3(a,b,c) \
66*cdf0e10cSrcweir 	{ XML_PROP_TYPE_##a, XML_PROP_TYPE_##b,  \
67*cdf0e10cSrcweir 		XML_PROP_TYPE_##c, XML_PROP_TYPE_END }
68*cdf0e10cSrcweir #define ENTRY2(a,b) \
69*cdf0e10cSrcweir 	{ XML_PROP_TYPE_##a, XML_PROP_TYPE_##b, \
70*cdf0e10cSrcweir 		XML_PROP_TYPE_END, XML_PROP_TYPE_END }
71*cdf0e10cSrcweir #define ENTRY1(a) \
72*cdf0e10cSrcweir 	{ XML_PROP_TYPE_##a, XML_PROP_TYPE_##END, \
73*cdf0e10cSrcweir 		XML_PROP_TYPE_END, XML_PROP_TYPE_END }
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir static XMLPropType aPropTypes[XML_FAMILY_TYPE_END][MAX_PROP_TYPES] =
76*cdf0e10cSrcweir {
77*cdf0e10cSrcweir 	ENTRY3( GRAPHIC, PARAGRAPH, TEXT ),			// XML_FAMILY_TYPE_GRAPHIC,
78*cdf0e10cSrcweir 	ENTRY3( GRAPHIC, PARAGRAPH, TEXT ),			// XML_FAMILY_TYPE_PRESENTATION,
79*cdf0e10cSrcweir 	ENTRY1( DRAWING_PAGE ),						// XML_FAMILY_TYPE_DRAWING_PAGE,
80*cdf0e10cSrcweir 	ENTRY1( END ),								// XML_FAMILY_TYPE_MASTER_PAGE
81*cdf0e10cSrcweir 	ENTRY1( PAGE_LAYOUT ),						// XML_FAMILY_TYPE_PAGE_LAYOUT,
82*cdf0e10cSrcweir 	ENTRY1( HEADER_FOOTER ),					// XML_FAMILY_TYPE_HEADER_FOOTER
83*cdf0e10cSrcweir 	ENTRY1( TEXT ),								// XML_FAMILY_TYPE_TEXT,
84*cdf0e10cSrcweir 	ENTRY2( PARAGRAPH, TEXT ),					// XML_FAMILY_TYPE_PARAGRAPH,
85*cdf0e10cSrcweir 	ENTRY1( RUBY ),								//XML_FAMILY_TYPE_RUBY,
86*cdf0e10cSrcweir 	ENTRY1( SECTION ),							// XML_FAMILY_TYPE_SECTION,
87*cdf0e10cSrcweir 	ENTRY1( TABLE ),							// XML_FAMILY_TYPE_TABLE,
88*cdf0e10cSrcweir 	ENTRY1( TABLE_COLUMN ),						// XML_FAMILY_TYPE_TABLE_COLUMN,
89*cdf0e10cSrcweir 	ENTRY1( TABLE_ROW ),						// XML_FAMILY_TYPE_TABLE_ROW,
90*cdf0e10cSrcweir 	ENTRY3( TABLE_CELL, PARAGRAPH, TEXT ),		// XML_FAMILY_TYPE_TABLE_CELL,
91*cdf0e10cSrcweir 	ENTRY1( LIST_LEVEL ),						// XML_FAMILY_TYPE_LIST,
92*cdf0e10cSrcweir 	ENTRY4( CHART, GRAPHIC, PARAGRAPH, TEXT ),	// XML_FAMILY_TYPE_CHART,
93*cdf0e10cSrcweir 	ENTRY1( TEXT ),								// XML_FAMILY_TYPE_DATA,
94*cdf0e10cSrcweir 	ENTRY1( END ),								// XML_FAMILY_TYPE_GRADIENT,
95*cdf0e10cSrcweir 	ENTRY1( END ),								// XML_FAMILY_TYPE_HATCH,
96*cdf0e10cSrcweir 	ENTRY1( END ),								// XML_FAMILY_TYPE_FILL_IMAGE,
97*cdf0e10cSrcweir 	ENTRY1( END ),								// XML_FAMILY_TYPE_STROKE_DASH,
98*cdf0e10cSrcweir 	ENTRY1( END ),								// XML_FAMILY_TYPE_MARKER,
99*cdf0e10cSrcweir 	ENTRY1( END )								// XML_FAMILY_TYPE_PRESENTATION_PAGE_LAYOUT,
100*cdf0e10cSrcweir };
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir static XMLTokenEnum aPropTokens[XML_PROP_TYPE_END] =
103*cdf0e10cSrcweir {
104*cdf0e10cSrcweir 	XML_GRAPHIC_PROPERTIES,
105*cdf0e10cSrcweir 	XML_DRAWING_PAGE_PROPERTIES,
106*cdf0e10cSrcweir 	XML_PAGE_LAYOUT_PROPERTIES,
107*cdf0e10cSrcweir 	XML_HEADER_FOOTER_PROPERTIES,
108*cdf0e10cSrcweir 	XML_TEXT_PROPERTIES,
109*cdf0e10cSrcweir 	XML_PARAGRAPH_PROPERTIES,
110*cdf0e10cSrcweir 	XML_RUBY_PROPERTIES,
111*cdf0e10cSrcweir 	XML_SECTION_PROPERTIES,
112*cdf0e10cSrcweir 	XML_TABLE_PROPERTIES,
113*cdf0e10cSrcweir 	XML_TABLE_COLUMN_PROPERTIES,
114*cdf0e10cSrcweir 	XML_TABLE_ROW_PROPERTIES,
115*cdf0e10cSrcweir 	XML_TABLE_CELL_PROPERTIES,
116*cdf0e10cSrcweir 	XML_LIST_LEVEL_PROPERTIES,
117*cdf0e10cSrcweir 	XML_CHART_PROPERTIES
118*cdf0e10cSrcweir };
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir static sal_uInt16 aAttrActionMaps[XML_PROP_TYPE_END] =
121*cdf0e10cSrcweir {
122*cdf0e10cSrcweir 	PROP_OOO_GRAPHIC_ATTR_ACTIONS,
123*cdf0e10cSrcweir 	PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS,		// DRAWING_PAGE
124*cdf0e10cSrcweir 	PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS,
125*cdf0e10cSrcweir 	PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS,
126*cdf0e10cSrcweir 	PROP_OOO_TEXT_ATTR_ACTIONS,
127*cdf0e10cSrcweir 	PROP_OOO_PARAGRAPH_ATTR_ACTIONS,
128*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,		// RUBY
129*cdf0e10cSrcweir 	PROP_OOO_SECTION_ATTR_ACTIONS,
130*cdf0e10cSrcweir 	PROP_OOO_TABLE_ATTR_ACTIONS,
131*cdf0e10cSrcweir 	PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS,
132*cdf0e10cSrcweir 	PROP_OOO_TABLE_ROW_ATTR_ACTIONS,
133*cdf0e10cSrcweir 	PROP_OOO_TABLE_CELL_ATTR_ACTIONS,
134*cdf0e10cSrcweir 	PROP_OOO_LIST_LEVEL_ATTR_ACTIONS,
135*cdf0e10cSrcweir 	PROP_OOO_CHART_ATTR_ACTIONS
136*cdf0e10cSrcweir };
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir static sal_uInt16 aElemActionMaps[XML_PROP_TYPE_END] =
139*cdf0e10cSrcweir {
140*cdf0e10cSrcweir 	PROP_OOO_GRAPHIC_ELEM_ACTIONS,
141*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
142*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
143*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
144*cdf0e10cSrcweir 	PROP_OOO_TEXT_ELEM_ACTIONS,
145*cdf0e10cSrcweir 	PROP_OOO_PARAGRAPH_ELEM_ACTIONS,
146*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
147*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
148*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
149*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
150*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
151*cdf0e10cSrcweir 	PROP_OOO_TABLE_CELL_ELEM_ACTIONS,
152*cdf0e10cSrcweir 	MAX_OOO_PROP_ACTIONS,
153*cdf0e10cSrcweir 	PROP_OOO_CHART_ELEM_ACTIONS
154*cdf0e10cSrcweir };
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir //------------------------------------------------------------------------------
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir class XMLTypedPropertiesOOoTContext_Impl : public XMLPersElemContentTContext
160*cdf0e10cSrcweir {
161*cdf0e10cSrcweir 	::com::sun::star::uno::Reference<
162*cdf0e10cSrcweir 		::com::sun::star::xml::sax::XAttributeList > m_xAttrList;
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir public:
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 	TYPEINFO();
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 	XMLTypedPropertiesOOoTContext_Impl( XMLTransformerBase& rTransformer,
169*cdf0e10cSrcweir 						   const ::rtl::OUString& rQName );
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir 	virtual ~XMLTypedPropertiesOOoTContext_Impl();
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir     using XMLPersAttrListTContext::AddAttribute;
174*cdf0e10cSrcweir 	void AddAttribute( const ::rtl::OUString &sName ,
175*cdf0e10cSrcweir 					   const ::rtl::OUString &sValue );
176*cdf0e10cSrcweir 	void AddAttribute( sal_uInt16 nPrefix, XMLTokenEnum eToken,
177*cdf0e10cSrcweir 					   const ::rtl::OUString &sValue );
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& rAttrList );
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 	virtual void Export();
182*cdf0e10cSrcweir };
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir TYPEINIT1( XMLTypedPropertiesOOoTContext_Impl, XMLPersElemContentTContext );
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir XMLTypedPropertiesOOoTContext_Impl::XMLTypedPropertiesOOoTContext_Impl(
187*cdf0e10cSrcweir 	XMLTransformerBase& rImp,
188*cdf0e10cSrcweir 	const OUString& rQName ) :
189*cdf0e10cSrcweir 	XMLPersElemContentTContext( rImp, rQName ),
190*cdf0e10cSrcweir 	m_xAttrList( new XMLMutableAttributeList() )
191*cdf0e10cSrcweir {
192*cdf0e10cSrcweir }
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir XMLTypedPropertiesOOoTContext_Impl::~XMLTypedPropertiesOOoTContext_Impl()
195*cdf0e10cSrcweir {
196*cdf0e10cSrcweir }
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
199*cdf0e10cSrcweir 	const ::rtl::OUString &sName ,
200*cdf0e10cSrcweir 	const ::rtl::OUString &sValue )
201*cdf0e10cSrcweir {
202*cdf0e10cSrcweir 	static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
203*cdf0e10cSrcweir 			->AddAttribute( sName, sValue );
204*cdf0e10cSrcweir }
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir void XMLTypedPropertiesOOoTContext_Impl::AddAttribute(
207*cdf0e10cSrcweir 	sal_uInt16 nPrefix, XMLTokenEnum eToken,
208*cdf0e10cSrcweir 	const ::rtl::OUString &sValue )
209*cdf0e10cSrcweir {
210*cdf0e10cSrcweir 	OUString sName(
211*cdf0e10cSrcweir 			GetTransformer().GetNamespaceMap().GetQNameByKey(
212*cdf0e10cSrcweir 						nPrefix, ::xmloff::token::GetXMLToken( eToken ) ) );
213*cdf0e10cSrcweir 	static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
214*cdf0e10cSrcweir 			->AddAttribute( sName, sValue );
215*cdf0e10cSrcweir }
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir void XMLTypedPropertiesOOoTContext_Impl::StartElement(
218*cdf0e10cSrcweir 		const Reference< XAttributeList >& )
219*cdf0e10cSrcweir {
220*cdf0e10cSrcweir 	// empty, ignore even the attribute list
221*cdf0e10cSrcweir }
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir void XMLTypedPropertiesOOoTContext_Impl::Export()
224*cdf0e10cSrcweir {
225*cdf0e10cSrcweir 	if( m_xAttrList->getLength() || HasElementContent() )
226*cdf0e10cSrcweir 	{
227*cdf0e10cSrcweir 		GetTransformer().GetDocHandler()->startElement( GetQName(), m_xAttrList );
228*cdf0e10cSrcweir 		ExportContent();
229*cdf0e10cSrcweir 		GetTransformer().GetDocHandler()->endElement( GetQName() );
230*cdf0e10cSrcweir 	}
231*cdf0e10cSrcweir }
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir //------------------------------------------------------------------------------
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir class XMLPropertiesOOoTContext_Impl : public XMLTransformerContext
236*cdf0e10cSrcweir {
237*cdf0e10cSrcweir 	::rtl::Reference < XMLTypedPropertiesOOoTContext_Impl >
238*cdf0e10cSrcweir 		m_aPropContexts[MAX_PROP_TYPES];
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 	typedef XMLPropType XMLPropTypes[MAX_PROP_TYPES];
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 	XMLPropTypes m_aPropTypes;
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir 	sal_Bool m_bPersistent;
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir 	XMLTypedPropertiesOOoTContext_Impl *GetPropContextAndAction(
247*cdf0e10cSrcweir 			TransformerAction_Impl& rAction,
248*cdf0e10cSrcweir 			sal_uInt16 nPrefix, const OUString& rLocalName,
249*cdf0e10cSrcweir 		    sal_Bool bElem );
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir 	XMLTypedPropertiesOOoTContext_Impl *GetPropContext(
252*cdf0e10cSrcweir 			XMLPropType eType );
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir public:
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir 	TYPEINFO();
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir 	XMLPropertiesOOoTContext_Impl( XMLTransformerBase& rTransformer,
260*cdf0e10cSrcweir 						   const ::rtl::OUString& rQName,
261*cdf0e10cSrcweir 		   					XMLPropTypes& rTypes,
262*cdf0e10cSrcweir 		   					sal_Bool bPersistent );
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir 	virtual ~XMLPropertiesOOoTContext_Impl();
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 	XMLTransformerContext *CreateChildContext(
267*cdf0e10cSrcweir 			sal_uInt16 nPrefix,
268*cdf0e10cSrcweir 			const OUString& rLocalName,
269*cdf0e10cSrcweir 			const OUString& rQName,
270*cdf0e10cSrcweir 			const Reference< XAttributeList >& rAttrList );
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir 	virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& rAttrList );
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir 	virtual void EndElement();
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir 	virtual void Characters( const ::rtl::OUString& rChars );
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 	virtual void Export();
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 	virtual sal_Bool IsPersistent() const;
281*cdf0e10cSrcweir };
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir TYPEINIT1( XMLPropertiesOOoTContext_Impl, XMLTransformerContext );
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir XMLTypedPropertiesOOoTContext_Impl
286*cdf0e10cSrcweir 	*XMLPropertiesOOoTContext_Impl::GetPropContext(
287*cdf0e10cSrcweir 			XMLPropType eType )
288*cdf0e10cSrcweir {
289*cdf0e10cSrcweir 	sal_uInt16 nIndex = MAX_PROP_TYPES;
290*cdf0e10cSrcweir 	for( sal_uInt16 i=0; i< MAX_PROP_TYPES; i++ )
291*cdf0e10cSrcweir 	{
292*cdf0e10cSrcweir 		if( m_aPropTypes[i] == eType )
293*cdf0e10cSrcweir 		{
294*cdf0e10cSrcweir 			nIndex = i;
295*cdf0e10cSrcweir 			break;
296*cdf0e10cSrcweir 		}
297*cdf0e10cSrcweir 	}
298*cdf0e10cSrcweir 	if( MAX_PROP_TYPES == nIndex )
299*cdf0e10cSrcweir 		return 0;
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir 	if( !m_aPropContexts[nIndex].is() )
302*cdf0e10cSrcweir 	{
303*cdf0e10cSrcweir 		m_aPropContexts[nIndex] =
304*cdf0e10cSrcweir 			new XMLTypedPropertiesOOoTContext_Impl(
305*cdf0e10cSrcweir 					GetTransformer(),
306*cdf0e10cSrcweir 					GetTransformer().GetNamespaceMap().GetQNameByKey(
307*cdf0e10cSrcweir 						XML_NAMESPACE_STYLE,
308*cdf0e10cSrcweir 						::xmloff::token::GetXMLToken(
309*cdf0e10cSrcweir 							aPropTokens[m_aPropTypes[nIndex]] ) ));
310*cdf0e10cSrcweir 	}
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir 	return m_aPropContexts[nIndex].get();
313*cdf0e10cSrcweir }
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir XMLTypedPropertiesOOoTContext_Impl
317*cdf0e10cSrcweir 	*XMLPropertiesOOoTContext_Impl::GetPropContextAndAction(
318*cdf0e10cSrcweir 			TransformerAction_Impl& rAction,
319*cdf0e10cSrcweir 			sal_uInt16 nPrefix, const OUString& rLocalName,
320*cdf0e10cSrcweir 		    sal_Bool bElem )
321*cdf0e10cSrcweir {
322*cdf0e10cSrcweir 	rAction.m_nActionType = XML_ATACTION_COPY;
323*cdf0e10cSrcweir 	sal_uInt16 nIndex = 0;
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir 	XMLTransformerActions::key_type aKey( nPrefix, rLocalName );
326*cdf0e10cSrcweir 	sal_uInt16 i=0;
327*cdf0e10cSrcweir 	while( i < MAX_PROP_TYPES && XML_PROP_TYPE_END!=m_aPropTypes[i])
328*cdf0e10cSrcweir 	{
329*cdf0e10cSrcweir 		sal_uInt16 nActionMap =
330*cdf0e10cSrcweir 			(bElem ? aElemActionMaps : aAttrActionMaps)[m_aPropTypes[i]];
331*cdf0e10cSrcweir 		if( nActionMap < MAX_OOO_PROP_ACTIONS )
332*cdf0e10cSrcweir 		{
333*cdf0e10cSrcweir 			XMLTransformerActions *pActions =
334*cdf0e10cSrcweir 				GetTransformer().GetUserDefinedActions( nActionMap );
335*cdf0e10cSrcweir 			OSL_ENSURE( pActions, "go no actions" );
336*cdf0e10cSrcweir 			if( pActions )
337*cdf0e10cSrcweir 			{
338*cdf0e10cSrcweir 				XMLTransformerActions::const_iterator aIter =
339*cdf0e10cSrcweir 					pActions->find( aKey );
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir 				if( !(aIter == pActions->end()) )
342*cdf0e10cSrcweir 				{
343*cdf0e10cSrcweir 					rAction = (*aIter).second;
344*cdf0e10cSrcweir 					nIndex = i;
345*cdf0e10cSrcweir 					break;
346*cdf0e10cSrcweir 				}
347*cdf0e10cSrcweir 			}
348*cdf0e10cSrcweir 		}
349*cdf0e10cSrcweir 		++i;
350*cdf0e10cSrcweir 	}
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir #ifdef DBG_UTIL
353*cdf0e10cSrcweir 	if( !( XML_NAMESPACE_NONE == nPrefix ||
354*cdf0e10cSrcweir 				(XML_NAMESPACE_UNKNOWN_FLAG & nPrefix) ||
355*cdf0e10cSrcweir 				XML_PROP_TYPE_END==m_aPropTypes[1] ||
356*cdf0e10cSrcweir 				(i<MAX_PROP_TYPES && XML_PROP_TYPE_END!=m_aPropTypes[i]) ) )
357*cdf0e10cSrcweir 	{
358*cdf0e10cSrcweir 		::rtl::OString aTmp("Didnt't find property: ");
359*cdf0e10cSrcweir 		const ::rtl::OUString& rPrefix =
360*cdf0e10cSrcweir 			GetTransformer().GetNamespaceMap().GetPrefixByKey( nPrefix );
361*cdf0e10cSrcweir 		aTmp +=	::rtl::OString( rPrefix.getStr(), rPrefix.getLength(),
362*cdf0e10cSrcweir 								RTL_TEXTENCODING_ASCII_US );
363*cdf0e10cSrcweir 		aTmp += ::rtl::OString::valueOf( ':' );
364*cdf0e10cSrcweir 		aTmp +=	::rtl::OString( rLocalName.getStr(), rLocalName.getLength(),
365*cdf0e10cSrcweir 								RTL_TEXTENCODING_ASCII_US );
366*cdf0e10cSrcweir 		aTmp += ::rtl::OString(", assuming <style:");
367*cdf0e10cSrcweir 		const ::rtl::OUString& rName =
368*cdf0e10cSrcweir 			::xmloff::token::GetXMLToken( aPropTokens[m_aPropTypes[0]] );
369*cdf0e10cSrcweir 		aTmp +=	::rtl::OString( rName.getStr(), rName.getLength(),
370*cdf0e10cSrcweir 								RTL_TEXTENCODING_ASCII_US );
371*cdf0e10cSrcweir 		aTmp += ::rtl::OString::valueOf( '>' );
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir 		OSL_ENSURE( !this, aTmp );
374*cdf0e10cSrcweir 	}
375*cdf0e10cSrcweir #endif
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir 	if( !m_aPropContexts[nIndex].is() )
378*cdf0e10cSrcweir 	{
379*cdf0e10cSrcweir 		m_aPropContexts[nIndex] =
380*cdf0e10cSrcweir 			new XMLTypedPropertiesOOoTContext_Impl(
381*cdf0e10cSrcweir 					GetTransformer(),
382*cdf0e10cSrcweir 					GetTransformer().GetNamespaceMap().GetQNameByKey(
383*cdf0e10cSrcweir 						XML_NAMESPACE_STYLE,
384*cdf0e10cSrcweir 						::xmloff::token::GetXMLToken(
385*cdf0e10cSrcweir 							aPropTokens[m_aPropTypes[nIndex]] ) ));
386*cdf0e10cSrcweir 	}
387*cdf0e10cSrcweir 
388*cdf0e10cSrcweir 	return m_aPropContexts[nIndex].get();
389*cdf0e10cSrcweir }
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir XMLPropertiesOOoTContext_Impl::XMLPropertiesOOoTContext_Impl(
392*cdf0e10cSrcweir 	XMLTransformerBase& rImp,
393*cdf0e10cSrcweir 	const OUString& rQName,
394*cdf0e10cSrcweir 	XMLPropTypes& rTypes,
395*cdf0e10cSrcweir 	sal_Bool bPersistent	) :
396*cdf0e10cSrcweir 	XMLTransformerContext( rImp, rQName ),
397*cdf0e10cSrcweir 	m_bPersistent( bPersistent )
398*cdf0e10cSrcweir {
399*cdf0e10cSrcweir 	for( sal_uInt16 i=0; i < MAX_PROP_TYPES; ++i )
400*cdf0e10cSrcweir 	{
401*cdf0e10cSrcweir 		// remember the types that belong to the attribute and element lists
402*cdf0e10cSrcweir 		m_aPropTypes[i] = rTypes[i];
403*cdf0e10cSrcweir 	}
404*cdf0e10cSrcweir }
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir XMLPropertiesOOoTContext_Impl::~XMLPropertiesOOoTContext_Impl()
407*cdf0e10cSrcweir {
408*cdf0e10cSrcweir }
409*cdf0e10cSrcweir 
410*cdf0e10cSrcweir XMLTransformerContext *XMLPropertiesOOoTContext_Impl::CreateChildContext(
411*cdf0e10cSrcweir 			sal_uInt16 nPrefix,
412*cdf0e10cSrcweir 			const OUString& rLocalName,
413*cdf0e10cSrcweir 			const OUString& rQName,
414*cdf0e10cSrcweir 			const Reference< XAttributeList >& rAttrList )
415*cdf0e10cSrcweir {
416*cdf0e10cSrcweir 	TransformerAction_Impl aAction;
417*cdf0e10cSrcweir 	return GetPropContextAndAction( aAction, nPrefix, rLocalName, sal_True )
418*cdf0e10cSrcweir 				->CreateChildContext( nPrefix, rLocalName, rQName, rAttrList );
419*cdf0e10cSrcweir }
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir 
422*cdf0e10cSrcweir void XMLPropertiesOOoTContext_Impl::StartElement(
423*cdf0e10cSrcweir 		const Reference< XAttributeList >& rAttrList )
424*cdf0e10cSrcweir {
425*cdf0e10cSrcweir 	Reference< XAttributeList > xAttrList( rAttrList );
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir     XMLTypedPropertiesOOoTContext_Impl * pIntervalMinorDivisorContext = 0;
428*cdf0e10cSrcweir     double fIntervalMajor = 0.0;
429*cdf0e10cSrcweir     double fIntervalMinor = 0.0;
430*cdf0e10cSrcweir 	sal_Bool bMoveProtect = sal_False;
431*cdf0e10cSrcweir 	sal_Bool bSizeProtect = sal_False;
432*cdf0e10cSrcweir 	OUString aProtectAttrValue;
433*cdf0e10cSrcweir 	XMLTypedPropertiesOOoTContext_Impl * pProtectContext = 0;
434*cdf0e10cSrcweir 
435*cdf0e10cSrcweir     // --> OD 2005-05-13 #i49139# - attribute <style:mirror> has to be priority
436*cdf0e10cSrcweir     // over attribute <style:draw>. The filter from OpenDocument file format
437*cdf0e10cSrcweir     // to OpenOffice.org file format produces styles with both attributes.
438*cdf0e10cSrcweir     sal_Bool bExistStyleMirror( sal_False );
439*cdf0e10cSrcweir     OUString aStyleMirrorAttrValue;
440*cdf0e10cSrcweir     sal_Bool bExistDrawMirror( sal_False );
441*cdf0e10cSrcweir     OUString aDrawMirrorAttrValue;
442*cdf0e10cSrcweir     XMLTypedPropertiesOOoTContext_Impl* pMirrorContext( 0L );
443*cdf0e10cSrcweir     // <--
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir 	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
446*cdf0e10cSrcweir 	for( sal_Int16 i=0; i < nAttrCount; i++ )
447*cdf0e10cSrcweir 	{
448*cdf0e10cSrcweir 		const OUString sAttrName = xAttrList->getNameByIndex( i );
449*cdf0e10cSrcweir 		const OUString sAttrValue = xAttrList->getValueByIndex( i );
450*cdf0e10cSrcweir 		OUString aLocalName;
451*cdf0e10cSrcweir 		sal_uInt16 nPrefix =
452*cdf0e10cSrcweir 			GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName,
453*cdf0e10cSrcweir 																 &aLocalName );
454*cdf0e10cSrcweir 		TransformerAction_Impl aAction;
455*cdf0e10cSrcweir 		XMLTypedPropertiesOOoTContext_Impl *pContext =
456*cdf0e10cSrcweir 			GetPropContextAndAction( aAction, nPrefix, aLocalName, sal_False );
457*cdf0e10cSrcweir 		switch( aAction.m_nActionType )
458*cdf0e10cSrcweir 		{
459*cdf0e10cSrcweir 		case XML_ATACTION_REMOVE:
460*cdf0e10cSrcweir 			break;
461*cdf0e10cSrcweir 		case XML_ATACTION_COPY:
462*cdf0e10cSrcweir 			pContext->AddAttribute( sAttrName, sAttrValue );
463*cdf0e10cSrcweir 			break;
464*cdf0e10cSrcweir 		case XML_ATACTION_COPY_DUPLICATE:
465*cdf0e10cSrcweir             {
466*cdf0e10cSrcweir 			    pContext->AddAttribute( sAttrName, sAttrValue );
467*cdf0e10cSrcweir 				XMLTypedPropertiesOOoTContext_Impl *pContext2 =
468*cdf0e10cSrcweir 					GetPropContext( (XMLPropType)aAction.m_nParam1 );
469*cdf0e10cSrcweir 				if( pContext2 )
470*cdf0e10cSrcweir 					pContext2->AddAttribute( sAttrName, sAttrValue );
471*cdf0e10cSrcweir             }
472*cdf0e10cSrcweir 			break;
473*cdf0e10cSrcweir 		case XML_ATACTION_RENAME:
474*cdf0e10cSrcweir 			{
475*cdf0e10cSrcweir 				pContext->AddAttribute( aAction.GetQNamePrefixFromParam1(),
476*cdf0e10cSrcweir 										aAction.GetQNameTokenFromParam1(),
477*cdf0e10cSrcweir 										sAttrValue );
478*cdf0e10cSrcweir 			}
479*cdf0e10cSrcweir 			break;
480*cdf0e10cSrcweir 		case XML_ATACTION_ENCODE_STYLE_NAME_REF:
481*cdf0e10cSrcweir 			{
482*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
483*cdf0e10cSrcweir 				GetTransformer().EncodeStyleName(aAttrValue);
484*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aAttrValue );
485*cdf0e10cSrcweir 			}
486*cdf0e10cSrcweir 			break;
487*cdf0e10cSrcweir 		case XML_ATACTION_RENAME_ENCODE_STYLE_NAME_REF:
488*cdf0e10cSrcweir 			{
489*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
490*cdf0e10cSrcweir 				GetTransformer().EncodeStyleName(aAttrValue);
491*cdf0e10cSrcweir 				pContext->AddAttribute( aAction.GetQNamePrefixFromParam1(),
492*cdf0e10cSrcweir 										aAction.GetQNameTokenFromParam1(),
493*cdf0e10cSrcweir 										aAttrValue );
494*cdf0e10cSrcweir 			}
495*cdf0e10cSrcweir 			break;
496*cdf0e10cSrcweir 		case XML_ATACTION_NEG_PERCENT:
497*cdf0e10cSrcweir 			{
498*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
499*cdf0e10cSrcweir 				GetTransformer().NegPercent(aAttrValue);
500*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aAttrValue );
501*cdf0e10cSrcweir 			}
502*cdf0e10cSrcweir 			break;
503*cdf0e10cSrcweir 		case XML_ATACTION_RENAME_NEG_PERCENT:
504*cdf0e10cSrcweir 			{
505*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
506*cdf0e10cSrcweir 				GetTransformer().NegPercent(aAttrValue);
507*cdf0e10cSrcweir 				pContext->AddAttribute( aAction.GetQNamePrefixFromParam1(),
508*cdf0e10cSrcweir 										aAction.GetQNameTokenFromParam1(),
509*cdf0e10cSrcweir 										aAttrValue );
510*cdf0e10cSrcweir 			}
511*cdf0e10cSrcweir 			break;
512*cdf0e10cSrcweir 		case XML_ATACTION_INCH2IN:
513*cdf0e10cSrcweir 			{
514*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
515*cdf0e10cSrcweir 				XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue );
516*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aAttrValue );
517*cdf0e10cSrcweir 			}
518*cdf0e10cSrcweir 			break;
519*cdf0e10cSrcweir 		case XML_ATACTION_INCH2IN_DUPLICATE:
520*cdf0e10cSrcweir 			{
521*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
522*cdf0e10cSrcweir 				XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue );
523*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aAttrValue );
524*cdf0e10cSrcweir 				XMLTypedPropertiesOOoTContext_Impl *pContext2 =
525*cdf0e10cSrcweir 					GetPropContext( (XMLPropType)aAction.m_nParam1 );
526*cdf0e10cSrcweir 				if( pContext2 )
527*cdf0e10cSrcweir 					pContext2->AddAttribute( sAttrName, aAttrValue );
528*cdf0e10cSrcweir 			}
529*cdf0e10cSrcweir 			break;
530*cdf0e10cSrcweir 		case XML_ATACTION_INCHS2INS:
531*cdf0e10cSrcweir 			{
532*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
533*cdf0e10cSrcweir 				XMLTransformerBase::ReplaceInchWithIn( aAttrValue );
534*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aAttrValue );
535*cdf0e10cSrcweir 			}
536*cdf0e10cSrcweir 			break;
537*cdf0e10cSrcweir 		case XML_PTACTION_LINE_MODE:
538*cdf0e10cSrcweir 			{
539*cdf0e10cSrcweir 				OUString aAttrValue( GetXMLToken(
540*cdf0e10cSrcweir 										IsXMLToken( sAttrValue, XML_TRUE )
541*cdf0e10cSrcweir 											? XML_CONTINUOUS
542*cdf0e10cSrcweir 											: XML_SKIP_WHITE_SPACE) );
543*cdf0e10cSrcweir 				OUString aAttrQName(
544*cdf0e10cSrcweir 						GetTransformer().GetNamespaceMap().GetQNameByKey(
545*cdf0e10cSrcweir 							XML_NAMESPACE_STYLE,
546*cdf0e10cSrcweir 							GetXMLToken( XML_TEXT_UNDERLINE_MODE ) ) );
547*cdf0e10cSrcweir 				pContext->AddAttribute( aAttrQName, aAttrValue );
548*cdf0e10cSrcweir 
549*cdf0e10cSrcweir 				aAttrQName =
550*cdf0e10cSrcweir 						GetTransformer().GetNamespaceMap().GetQNameByKey(
551*cdf0e10cSrcweir 							XML_NAMESPACE_STYLE,
552*cdf0e10cSrcweir 							GetXMLToken( XML_TEXT_LINE_THROUGH_MODE ) );
553*cdf0e10cSrcweir 				pContext->AddAttribute( aAttrQName, aAttrValue );
554*cdf0e10cSrcweir 			}
555*cdf0e10cSrcweir 			break;
556*cdf0e10cSrcweir 		case XML_PTACTION_KEEP_WITH_NEXT:
557*cdf0e10cSrcweir 			{
558*cdf0e10cSrcweir 				OUString aAttrValue( GetXMLToken(
559*cdf0e10cSrcweir 										IsXMLToken( sAttrValue, XML_TRUE )
560*cdf0e10cSrcweir 											? XML_ALWAYS
561*cdf0e10cSrcweir 											: XML_AUTO) );
562*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aAttrValue );
563*cdf0e10cSrcweir 			}
564*cdf0e10cSrcweir 			break;
565*cdf0e10cSrcweir 		case XML_PTACTION_UNDERLINE:
566*cdf0e10cSrcweir 			{
567*cdf0e10cSrcweir 				XMLTokenEnum eToken = GetTransformer().GetToken( sAttrValue );
568*cdf0e10cSrcweir 				sal_Bool bBold = sal_False, bDouble = sal_False;
569*cdf0e10cSrcweir 				switch( eToken )
570*cdf0e10cSrcweir 				{
571*cdf0e10cSrcweir 				case XML_SINGLE:
572*cdf0e10cSrcweir 					eToken = XML_SOLID;
573*cdf0e10cSrcweir 					break;
574*cdf0e10cSrcweir 				case XML_DOUBLE:
575*cdf0e10cSrcweir 					eToken = XML_SOLID;
576*cdf0e10cSrcweir 					bDouble = sal_True;
577*cdf0e10cSrcweir 					break;
578*cdf0e10cSrcweir 				case XML_BOLD:
579*cdf0e10cSrcweir 					eToken = XML_SOLID;
580*cdf0e10cSrcweir 					bBold = sal_True;
581*cdf0e10cSrcweir 					break;
582*cdf0e10cSrcweir 				case XML_BOLD_DOTTED:
583*cdf0e10cSrcweir 					eToken = XML_DOTTED;
584*cdf0e10cSrcweir 					bBold = sal_True;
585*cdf0e10cSrcweir 					break;
586*cdf0e10cSrcweir 				case XML_BOLD_DASH:
587*cdf0e10cSrcweir 					eToken = XML_DASH;
588*cdf0e10cSrcweir 					bBold = sal_True;
589*cdf0e10cSrcweir 					break;
590*cdf0e10cSrcweir 				case XML_BOLD_LONG_DASH:
591*cdf0e10cSrcweir 					eToken = XML_LONG_DASH;
592*cdf0e10cSrcweir 					bBold = sal_True;
593*cdf0e10cSrcweir 					break;
594*cdf0e10cSrcweir 				case XML_BOLD_DOT_DASH:
595*cdf0e10cSrcweir 					eToken = XML_DOT_DASH;
596*cdf0e10cSrcweir 					bBold = sal_True;
597*cdf0e10cSrcweir 					break;
598*cdf0e10cSrcweir 				case XML_BOLD_DOT_DOT_DASH:
599*cdf0e10cSrcweir 					eToken = XML_DOT_DOT_DASH;
600*cdf0e10cSrcweir 					bBold = sal_True;
601*cdf0e10cSrcweir 					break;
602*cdf0e10cSrcweir 				case XML_BOLD_WAVE:
603*cdf0e10cSrcweir 					eToken = XML_WAVE;
604*cdf0e10cSrcweir 					bBold = sal_True;
605*cdf0e10cSrcweir 					break;
606*cdf0e10cSrcweir 				case XML_DOUBLE_WAVE:
607*cdf0e10cSrcweir 					eToken = XML_WAVE;
608*cdf0e10cSrcweir 					bDouble = sal_True;
609*cdf0e10cSrcweir 					break;
610*cdf0e10cSrcweir 				case XML_NONE:
611*cdf0e10cSrcweir 					eToken = XML_NONE;
612*cdf0e10cSrcweir 					bDouble = sal_False;
613*cdf0e10cSrcweir 					break;
614*cdf0e10cSrcweir 				default:
615*cdf0e10cSrcweir 					OSL_ENSURE( false, "xmloff::XMLPropertiesOOoTContext_Impl::StartElement(), unknown underline token!" );
616*cdf0e10cSrcweir 					break;
617*cdf0e10cSrcweir 				}
618*cdf0e10cSrcweir 				pContext->AddAttribute(
619*cdf0e10cSrcweir 						GetTransformer().GetNamespaceMap().GetQNameByKey(
620*cdf0e10cSrcweir 							XML_NAMESPACE_STYLE,
621*cdf0e10cSrcweir 							GetXMLToken( XML_TEXT_UNDERLINE_STYLE ) ),
622*cdf0e10cSrcweir 						eToken != XML_TOKEN_END ? GetXMLToken( eToken )
623*cdf0e10cSrcweir 					   							: sAttrValue	);
624*cdf0e10cSrcweir 				if( bDouble )
625*cdf0e10cSrcweir 					pContext->AddAttribute(
626*cdf0e10cSrcweir 							GetTransformer().GetNamespaceMap().GetQNameByKey(
627*cdf0e10cSrcweir 								XML_NAMESPACE_STYLE,
628*cdf0e10cSrcweir 								GetXMLToken( XML_TEXT_UNDERLINE_TYPE ) ),
629*cdf0e10cSrcweir 							GetXMLToken( XML_DOUBLE ) );
630*cdf0e10cSrcweir 				if( bBold )
631*cdf0e10cSrcweir 					pContext->AddAttribute(
632*cdf0e10cSrcweir 							GetTransformer().GetNamespaceMap().GetQNameByKey(
633*cdf0e10cSrcweir 								XML_NAMESPACE_STYLE,
634*cdf0e10cSrcweir 								GetXMLToken( XML_TEXT_UNDERLINE_WIDTH ) ),
635*cdf0e10cSrcweir 							GetXMLToken( XML_BOLD ) );
636*cdf0e10cSrcweir 			}
637*cdf0e10cSrcweir 			break;
638*cdf0e10cSrcweir 		case XML_PTACTION_LINETHROUGH:
639*cdf0e10cSrcweir 			{
640*cdf0e10cSrcweir 				XMLTokenEnum eToken = GetTransformer().GetToken( sAttrValue );
641*cdf0e10cSrcweir 				sal_Bool bBold = sal_False, bDouble = sal_False;
642*cdf0e10cSrcweir 				sal_Unicode c = 0;
643*cdf0e10cSrcweir 				switch( eToken )
644*cdf0e10cSrcweir 				{
645*cdf0e10cSrcweir 				case XML_SINGLE_LINE:
646*cdf0e10cSrcweir 					eToken = XML_SOLID;
647*cdf0e10cSrcweir 					break;
648*cdf0e10cSrcweir 				case XML_DOUBLE_LINE:
649*cdf0e10cSrcweir 					eToken = XML_SOLID;
650*cdf0e10cSrcweir 					bDouble = sal_True;
651*cdf0e10cSrcweir 					break;
652*cdf0e10cSrcweir 				case XML_THICK_LINE:
653*cdf0e10cSrcweir 					eToken = XML_SOLID;
654*cdf0e10cSrcweir 					bBold = sal_True;
655*cdf0e10cSrcweir 					break;
656*cdf0e10cSrcweir 				case XML_SLASH:
657*cdf0e10cSrcweir 					eToken = XML_SOLID;
658*cdf0e10cSrcweir 					c = '/';
659*cdf0e10cSrcweir 					break;
660*cdf0e10cSrcweir 				case XML_uX:
661*cdf0e10cSrcweir 					eToken = XML_SOLID;
662*cdf0e10cSrcweir 					c = 'X';
663*cdf0e10cSrcweir 					break;
664*cdf0e10cSrcweir 				default:
665*cdf0e10cSrcweir 					break;
666*cdf0e10cSrcweir 				}
667*cdf0e10cSrcweir 				pContext->AddAttribute(
668*cdf0e10cSrcweir 						GetTransformer().GetNamespaceMap().GetQNameByKey(
669*cdf0e10cSrcweir 							XML_NAMESPACE_STYLE,
670*cdf0e10cSrcweir 							GetXMLToken( XML_TEXT_LINE_THROUGH_STYLE ) ),
671*cdf0e10cSrcweir 						eToken != XML_TOKEN_END ? GetXMLToken( eToken )
672*cdf0e10cSrcweir 					   							: sAttrValue	);
673*cdf0e10cSrcweir 				if( bDouble )
674*cdf0e10cSrcweir 					pContext->AddAttribute(
675*cdf0e10cSrcweir 							GetTransformer().GetNamespaceMap().GetQNameByKey(
676*cdf0e10cSrcweir 								XML_NAMESPACE_STYLE,
677*cdf0e10cSrcweir 								GetXMLToken( XML_TEXT_LINE_THROUGH_TYPE ) ),
678*cdf0e10cSrcweir 							GetXMLToken( XML_DOUBLE ) );
679*cdf0e10cSrcweir 				if( bBold )
680*cdf0e10cSrcweir 					pContext->AddAttribute(
681*cdf0e10cSrcweir 							GetTransformer().GetNamespaceMap().GetQNameByKey(
682*cdf0e10cSrcweir 								XML_NAMESPACE_STYLE,
683*cdf0e10cSrcweir 								GetXMLToken( XML_TEXT_LINE_THROUGH_WIDTH ) ),
684*cdf0e10cSrcweir 							GetXMLToken( XML_BOLD ) );
685*cdf0e10cSrcweir 				if( c )
686*cdf0e10cSrcweir 					pContext->AddAttribute(
687*cdf0e10cSrcweir 							GetTransformer().GetNamespaceMap().GetQNameByKey(
688*cdf0e10cSrcweir 								XML_NAMESPACE_STYLE,
689*cdf0e10cSrcweir 								GetXMLToken( XML_TEXT_LINE_THROUGH_TEXT ) ),
690*cdf0e10cSrcweir 							OUString::valueOf( c ) );
691*cdf0e10cSrcweir 			}
692*cdf0e10cSrcweir 			break;
693*cdf0e10cSrcweir 		case XML_PTACTION_SPLINES:
694*cdf0e10cSrcweir             {
695*cdf0e10cSrcweir                 sal_Int32 nSplineType = sAttrValue.toInt32();
696*cdf0e10cSrcweir                 OUString aNewAttrName = GetTransformer().GetNamespaceMap().GetQNameByKey(
697*cdf0e10cSrcweir                     XML_NAMESPACE_CHART, GetXMLToken( XML_INTERPOLATION ) );
698*cdf0e10cSrcweir 
699*cdf0e10cSrcweir                 switch( nSplineType )
700*cdf0e10cSrcweir                 {
701*cdf0e10cSrcweir                     // straight lines
702*cdf0e10cSrcweir                     case 0:
703*cdf0e10cSrcweir                         pContext->AddAttribute(
704*cdf0e10cSrcweir                             aNewAttrName, GetXMLToken( XML_NONE ));
705*cdf0e10cSrcweir                         break;
706*cdf0e10cSrcweir                     // cubic spline
707*cdf0e10cSrcweir                     case 1:
708*cdf0e10cSrcweir                         pContext->AddAttribute(
709*cdf0e10cSrcweir                             aNewAttrName, GetXMLToken( XML_CUBIC_SPLINE ));
710*cdf0e10cSrcweir                         break;
711*cdf0e10cSrcweir                     // B-spline
712*cdf0e10cSrcweir                     case 2:
713*cdf0e10cSrcweir                         pContext->AddAttribute(
714*cdf0e10cSrcweir                             aNewAttrName, GetXMLToken( XML_B_SPLINE ));
715*cdf0e10cSrcweir                         break;
716*cdf0e10cSrcweir 
717*cdf0e10cSrcweir                     default:
718*cdf0e10cSrcweir                         OSL_ENSURE( false, "invalid spline type" );
719*cdf0e10cSrcweir                         pContext->AddAttribute(
720*cdf0e10cSrcweir                             aNewAttrName, GetXMLToken( XML_NONE ));
721*cdf0e10cSrcweir                         break;
722*cdf0e10cSrcweir                 }
723*cdf0e10cSrcweir             }
724*cdf0e10cSrcweir             break;
725*cdf0e10cSrcweir         case XML_PTACTION_INTERVAL_MAJOR:
726*cdf0e10cSrcweir             pContext->AddAttribute( sAttrName, sAttrValue );
727*cdf0e10cSrcweir             SvXMLUnitConverter::convertDouble( fIntervalMajor, sAttrValue );
728*cdf0e10cSrcweir             break;
729*cdf0e10cSrcweir         case XML_PTACTION_INTERVAL_MINOR:
730*cdf0e10cSrcweir             SvXMLUnitConverter::convertDouble( fIntervalMinor, sAttrValue );
731*cdf0e10cSrcweir             pIntervalMinorDivisorContext = pContext;
732*cdf0e10cSrcweir             break;
733*cdf0e10cSrcweir         case XML_PTACTION_SYMBOL:
734*cdf0e10cSrcweir             {
735*cdf0e10cSrcweir                 sal_Int32 nSymbolType = sAttrValue.toInt32();
736*cdf0e10cSrcweir                 OUString aNewAttrName = GetTransformer().GetNamespaceMap().GetQNameByKey(
737*cdf0e10cSrcweir                     XML_NAMESPACE_CHART, GetXMLToken( XML_SYMBOL_TYPE ) );
738*cdf0e10cSrcweir 
739*cdf0e10cSrcweir                 if( nSymbolType >= 0 )
740*cdf0e10cSrcweir                 {
741*cdf0e10cSrcweir                     pContext->AddAttribute( aNewAttrName, GetXMLToken( XML_NAMED_SYMBOL ));
742*cdf0e10cSrcweir                     enum XMLTokenEnum eToken = XML_TOKEN_INVALID;
743*cdf0e10cSrcweir                     switch( nSymbolType )
744*cdf0e10cSrcweir                     {
745*cdf0e10cSrcweir                         // SYMBOL0
746*cdf0e10cSrcweir                         case 0:
747*cdf0e10cSrcweir                             // "square" has an awkward token name
748*cdf0e10cSrcweir                             eToken = XML_GRADIENTSTYLE_SQUARE;
749*cdf0e10cSrcweir                             break;
750*cdf0e10cSrcweir                         // SYMBOL1
751*cdf0e10cSrcweir                         case 1:
752*cdf0e10cSrcweir                             eToken = XML_DIAMOND;
753*cdf0e10cSrcweir                             break;
754*cdf0e10cSrcweir                         // SYMBOL2
755*cdf0e10cSrcweir                         case 2:
756*cdf0e10cSrcweir                             eToken = XML_ARROW_DOWN;
757*cdf0e10cSrcweir                             break;
758*cdf0e10cSrcweir                         // SYMBOL3
759*cdf0e10cSrcweir                         case 3:
760*cdf0e10cSrcweir                             eToken = XML_ARROW_UP;
761*cdf0e10cSrcweir                             break;
762*cdf0e10cSrcweir                         // SYMBOL4
763*cdf0e10cSrcweir                         case 4:
764*cdf0e10cSrcweir                             eToken = XML_ARROW_RIGHT;
765*cdf0e10cSrcweir                             break;
766*cdf0e10cSrcweir                         // SYMBOL5
767*cdf0e10cSrcweir                         case 5:
768*cdf0e10cSrcweir                             eToken = XML_ARROW_LEFT;
769*cdf0e10cSrcweir                             break;
770*cdf0e10cSrcweir                         // SYMBOL6
771*cdf0e10cSrcweir                         case 6:
772*cdf0e10cSrcweir                             eToken = XML_BOW_TIE;
773*cdf0e10cSrcweir                             break;
774*cdf0e10cSrcweir                         // SYMBOL7
775*cdf0e10cSrcweir                         case 7:
776*cdf0e10cSrcweir                             eToken = XML_HOURGLASS;
777*cdf0e10cSrcweir                             break;
778*cdf0e10cSrcweir                         default:
779*cdf0e10cSrcweir                             OSL_ENSURE( false, "invalid named symbol" );
780*cdf0e10cSrcweir                             break;
781*cdf0e10cSrcweir                     }
782*cdf0e10cSrcweir 
783*cdf0e10cSrcweir                     if( eToken != XML_TOKEN_INVALID )
784*cdf0e10cSrcweir                     {
785*cdf0e10cSrcweir                         pContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey(
786*cdf0e10cSrcweir                                                     XML_NAMESPACE_CHART, GetXMLToken( XML_SYMBOL_NAME )),
787*cdf0e10cSrcweir                                                 GetXMLToken( eToken ));
788*cdf0e10cSrcweir                     }
789*cdf0e10cSrcweir                 }
790*cdf0e10cSrcweir                 else
791*cdf0e10cSrcweir                 {
792*cdf0e10cSrcweir                     switch( nSymbolType )
793*cdf0e10cSrcweir                     {
794*cdf0e10cSrcweir                         // NONE
795*cdf0e10cSrcweir                         case -3:
796*cdf0e10cSrcweir                             pContext->AddAttribute(
797*cdf0e10cSrcweir                                 aNewAttrName, GetXMLToken( XML_NONE ));
798*cdf0e10cSrcweir                             break;
799*cdf0e10cSrcweir                             // AUTO
800*cdf0e10cSrcweir                         case -2:
801*cdf0e10cSrcweir                             pContext->AddAttribute(
802*cdf0e10cSrcweir                                 aNewAttrName, GetXMLToken( XML_AUTOMATIC ));
803*cdf0e10cSrcweir                             break;
804*cdf0e10cSrcweir                             // BITMAPURL
805*cdf0e10cSrcweir                         case -1:
806*cdf0e10cSrcweir                             pContext->AddAttribute(
807*cdf0e10cSrcweir                                 aNewAttrName, GetXMLToken( XML_IMAGE ));
808*cdf0e10cSrcweir                             break;
809*cdf0e10cSrcweir                         default:
810*cdf0e10cSrcweir                             OSL_ENSURE( false, "invalid symbol type" );
811*cdf0e10cSrcweir                             pContext->AddAttribute(
812*cdf0e10cSrcweir                                 aNewAttrName, GetXMLToken( XML_NONE ));
813*cdf0e10cSrcweir                             break;
814*cdf0e10cSrcweir                     }
815*cdf0e10cSrcweir                 }
816*cdf0e10cSrcweir             }
817*cdf0e10cSrcweir             break;
818*cdf0e10cSrcweir         case XML_PTACTION_SYMBOL_IMAGE_NAME:
819*cdf0e10cSrcweir             {
820*cdf0e10cSrcweir                 // create an xlink:href element for URI attribute
821*cdf0e10cSrcweir                 XMLPersAttrListTContext *pSymbolImageContext = new XMLPersAttrListTContext(
822*cdf0e10cSrcweir                     GetTransformer(), GetTransformer().GetNamespaceMap().GetQNameByKey(
823*cdf0e10cSrcweir                         XML_NAMESPACE_CHART, GetXMLToken( XML_SYMBOL_IMAGE )));
824*cdf0e10cSrcweir 
825*cdf0e10cSrcweir                 OUString aAttrValue( sAttrValue );
826*cdf0e10cSrcweir                 if( GetTransformer().ConvertURIToOASIS( aAttrValue, sal_True ))
827*cdf0e10cSrcweir                 {
828*cdf0e10cSrcweir                     pSymbolImageContext->AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aAttrValue );
829*cdf0e10cSrcweir                     pContext->AddContent( pSymbolImageContext );
830*cdf0e10cSrcweir                 }
831*cdf0e10cSrcweir             }
832*cdf0e10cSrcweir             break;
833*cdf0e10cSrcweir 
834*cdf0e10cSrcweir 		// #i25616#
835*cdf0e10cSrcweir 		case XML_PTACTION_TRANSPARENCY :
836*cdf0e10cSrcweir 			{
837*cdf0e10cSrcweir 				OUString aAttrValue( sAttrValue );
838*cdf0e10cSrcweir 				GetTransformer().NegPercent(aAttrValue);
839*cdf0e10cSrcweir 				pContext->AddAttribute( XML_NAMESPACE_DRAW,
840*cdf0e10cSrcweir 										XML_OPACITY,
841*cdf0e10cSrcweir 										aAttrValue );
842*cdf0e10cSrcweir 				pContext->AddAttribute( XML_NAMESPACE_DRAW,
843*cdf0e10cSrcweir 										XML_IMAGE_OPACITY,
844*cdf0e10cSrcweir 										aAttrValue );
845*cdf0e10cSrcweir 			}
846*cdf0e10cSrcweir 			break;
847*cdf0e10cSrcweir 
848*cdf0e10cSrcweir         case XML_PTACTION_BREAK_INSIDE:
849*cdf0e10cSrcweir             {
850*cdf0e10cSrcweir                 pContext->AddAttribute(
851*cdf0e10cSrcweir                     XML_NAMESPACE_FO, XML_KEEP_TOGETHER,
852*cdf0e10cSrcweir                     GetXMLToken(
853*cdf0e10cSrcweir                         IsXMLToken( sAttrValue, XML_COLUMNSPLIT_AVOID )
854*cdf0e10cSrcweir                         ? XML_ALWAYS
855*cdf0e10cSrcweir                         : XML_AUTO ) );
856*cdf0e10cSrcweir             }
857*cdf0e10cSrcweir             break;
858*cdf0e10cSrcweir 		case XML_ATACTION_CAPTION_ESCAPE_OOO:
859*cdf0e10cSrcweir 			{
860*cdf0e10cSrcweir                 OUString aAttrValue( sAttrValue );
861*cdf0e10cSrcweir 				if( aAttrValue.indexOf( sal_Unicode('%') ) != -1 )
862*cdf0e10cSrcweir 				{
863*cdf0e10cSrcweir 					sal_Int32 nValue = 0;
864*cdf0e10cSrcweir                     SvXMLUnitConverter::convertPercent( nValue, sAttrValue );
865*cdf0e10cSrcweir 					if( nValue )
866*cdf0e10cSrcweir 					{
867*cdf0e10cSrcweir 						nValue /= 100;
868*cdf0e10cSrcweir 						rtl::OUStringBuffer aOut;
869*cdf0e10cSrcweir 					 	SvXMLUnitConverter::convertPercent( aOut, nValue );
870*cdf0e10cSrcweir 						aAttrValue = aOut.makeStringAndClear();
871*cdf0e10cSrcweir 					}
872*cdf0e10cSrcweir 				}
873*cdf0e10cSrcweir 				else
874*cdf0e10cSrcweir 				{
875*cdf0e10cSrcweir 					XMLTransformerBase::ReplaceSingleInchWithIn( aAttrValue );
876*cdf0e10cSrcweir 				}
877*cdf0e10cSrcweir 
878*cdf0e10cSrcweir                 pContext->AddAttribute( sAttrName, aAttrValue );
879*cdf0e10cSrcweir 			}
880*cdf0e10cSrcweir 			break;
881*cdf0e10cSrcweir 		case XML_ATACTION_MOVE_PROTECT:
882*cdf0e10cSrcweir             bMoveProtect = IsXMLToken( sAttrValue, XML_TRUE );
883*cdf0e10cSrcweir 			pProtectContext = pContext;
884*cdf0e10cSrcweir 			break;
885*cdf0e10cSrcweir 		case XML_ATACTION_SIZE_PROTECT:
886*cdf0e10cSrcweir             bSizeProtect = IsXMLToken( sAttrValue, XML_TRUE );
887*cdf0e10cSrcweir 			pProtectContext = pContext;
888*cdf0e10cSrcweir 			break;
889*cdf0e10cSrcweir 		case XML_ATACTION_PROTECT:
890*cdf0e10cSrcweir             aProtectAttrValue = sAttrValue;
891*cdf0e10cSrcweir 			pProtectContext = pContext;
892*cdf0e10cSrcweir 			break;
893*cdf0e10cSrcweir 		case XML_ATACTION_DRAW_MIRROR_OOO:	 // renames draw:mirror to style:mirror and adapts values
894*cdf0e10cSrcweir 			{
895*cdf0e10cSrcweir                 // --> OD 2005-05-13 #i49139#
896*cdf0e10cSrcweir                 aDrawMirrorAttrValue =
897*cdf0e10cSrcweir                                 GetXMLToken( IsXMLToken( sAttrValue, XML_TRUE )
898*cdf0e10cSrcweir                                              ? XML_HORIZONTAL : XML_NONE );
899*cdf0e10cSrcweir                 bExistDrawMirror = sal_True;
900*cdf0e10cSrcweir                 pMirrorContext = pContext;
901*cdf0e10cSrcweir                 // <--
902*cdf0e10cSrcweir 			}
903*cdf0e10cSrcweir 			break;
904*cdf0e10cSrcweir         // --> OD 2005-05-12 #i49139#
905*cdf0e10cSrcweir         case XML_ATACTION_STYLE_MIRROR_OOO:   // adapts style:mirror values
906*cdf0e10cSrcweir             {
907*cdf0e10cSrcweir                 SvXMLTokenEnumerator aTokenEnum( sAttrValue );
908*cdf0e10cSrcweir                 OUString aToken;
909*cdf0e10cSrcweir                 while( aTokenEnum.getNextToken( aToken ) )
910*cdf0e10cSrcweir                 {
911*cdf0e10cSrcweir                     if ( aStyleMirrorAttrValue.getLength() > 0 )
912*cdf0e10cSrcweir                     {
913*cdf0e10cSrcweir                         aStyleMirrorAttrValue += rtl::OUString::createFromAscii( " " );
914*cdf0e10cSrcweir                     }
915*cdf0e10cSrcweir 
916*cdf0e10cSrcweir                     if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_LEFT_PAGES ) )
917*cdf0e10cSrcweir                     {
918*cdf0e10cSrcweir                         aStyleMirrorAttrValue += GetXMLToken( XML_HORIZONTAL_ON_EVEN );
919*cdf0e10cSrcweir                     }
920*cdf0e10cSrcweir                     else if ( IsXMLToken( aToken, XML_HORIZONTAL_ON_RIGHT_PAGES ) )
921*cdf0e10cSrcweir                     {
922*cdf0e10cSrcweir                         aStyleMirrorAttrValue += GetXMLToken( XML_HORIZONTAL_ON_ODD );
923*cdf0e10cSrcweir                     }
924*cdf0e10cSrcweir                     else
925*cdf0e10cSrcweir                     {
926*cdf0e10cSrcweir                         aStyleMirrorAttrValue += aToken;
927*cdf0e10cSrcweir                     }
928*cdf0e10cSrcweir                 }
929*cdf0e10cSrcweir                 bExistStyleMirror = sal_True;
930*cdf0e10cSrcweir                 pMirrorContext = pContext;
931*cdf0e10cSrcweir             }
932*cdf0e10cSrcweir             break;
933*cdf0e10cSrcweir         // <--
934*cdf0e10cSrcweir 		case XML_ATACTION_GAMMA_OOO:		// converts double value to percentage
935*cdf0e10cSrcweir 			{
936*cdf0e10cSrcweir                 double fValue = sAttrValue.toDouble();
937*cdf0e10cSrcweir 				sal_Int32 nValue = (sal_Int32)((fValue * 100.0) + ( fValue > 0 ? 0.5 : - 0.5 ) );
938*cdf0e10cSrcweir 
939*cdf0e10cSrcweir 				rtl::OUStringBuffer aOut;
940*cdf0e10cSrcweir 				SvXMLUnitConverter::convertPercent( aOut, nValue );
941*cdf0e10cSrcweir 				OUString aAttrValue( aOut.makeStringAndClear() );
942*cdf0e10cSrcweir                 pContext->AddAttribute( sAttrName, aAttrValue );
943*cdf0e10cSrcweir 			}
944*cdf0e10cSrcweir 			break;
945*cdf0e10cSrcweir 		case XML_ATACTION_OPACITY_FIX:
946*cdf0e10cSrcweir 			{
947*cdf0e10cSrcweir 				sal_Int32 nValue;
948*cdf0e10cSrcweir 				if( sAttrValue.indexOf( sal_Unicode('%') ) != -1 )
949*cdf0e10cSrcweir 				{
950*cdf0e10cSrcweir 					SvXMLUnitConverter::convertPercent( nValue, sAttrValue );
951*cdf0e10cSrcweir 				}
952*cdf0e10cSrcweir 				else
953*cdf0e10cSrcweir 				{
954*cdf0e10cSrcweir 					nValue = sal_Int32( sAttrValue.toDouble() * 100.0 );
955*cdf0e10cSrcweir 				}
956*cdf0e10cSrcweir 				nValue = 100 - nValue;
957*cdf0e10cSrcweir 
958*cdf0e10cSrcweir 				rtl::OUStringBuffer aOut;
959*cdf0e10cSrcweir 				SvXMLUnitConverter::convertPercent( aOut, nValue );
960*cdf0e10cSrcweir 				pContext->AddAttribute( sAttrName, aOut.makeStringAndClear() );
961*cdf0e10cSrcweir 			}
962*cdf0e10cSrcweir 			break;
963*cdf0e10cSrcweir 		default:
964*cdf0e10cSrcweir 			OSL_ENSURE( !this, "unknown action" );
965*cdf0e10cSrcweir 			break;
966*cdf0e10cSrcweir 		}
967*cdf0e10cSrcweir 	}
968*cdf0e10cSrcweir 
969*cdf0e10cSrcweir     // --> OD 2005-05-13 #i49139#
970*cdf0e10cSrcweir     if ( bExistStyleMirror )
971*cdf0e10cSrcweir     {
972*cdf0e10cSrcweir         pMirrorContext->AddAttribute(
973*cdf0e10cSrcweir                         GetTransformer().GetNamespaceMap().GetQNameByKey(
974*cdf0e10cSrcweir                                 XML_NAMESPACE_STYLE, GetXMLToken( XML_MIRROR ) ),
975*cdf0e10cSrcweir                         aStyleMirrorAttrValue);
976*cdf0e10cSrcweir     }
977*cdf0e10cSrcweir     else if ( bExistDrawMirror )
978*cdf0e10cSrcweir     {
979*cdf0e10cSrcweir         pMirrorContext->AddAttribute(
980*cdf0e10cSrcweir                         GetTransformer().GetNamespaceMap().GetQNameByKey(
981*cdf0e10cSrcweir                                 XML_NAMESPACE_STYLE, GetXMLToken( XML_MIRROR ) ),
982*cdf0e10cSrcweir                         aDrawMirrorAttrValue);
983*cdf0e10cSrcweir     }
984*cdf0e10cSrcweir     // <--
985*cdf0e10cSrcweir 
986*cdf0e10cSrcweir 	if( bMoveProtect || bSizeProtect || aProtectAttrValue.getLength() )
987*cdf0e10cSrcweir 	{
988*cdf0e10cSrcweir 		if( (bMoveProtect ||bSizeProtect) && IsXMLToken( aProtectAttrValue, XML_NONE ) )
989*cdf0e10cSrcweir 			aProtectAttrValue = OUString();
990*cdf0e10cSrcweir 
991*cdf0e10cSrcweir 		const OUString& rPosition = GetXMLToken( XML_POSITION );
992*cdf0e10cSrcweir 		if( bMoveProtect && -1 == aProtectAttrValue.indexOf( rPosition ) )
993*cdf0e10cSrcweir 		{
994*cdf0e10cSrcweir 			if( aProtectAttrValue.getLength() )
995*cdf0e10cSrcweir 				aProtectAttrValue += OUString::valueOf( sal_Unicode( ' ' ) );
996*cdf0e10cSrcweir 			aProtectAttrValue += rPosition;
997*cdf0e10cSrcweir 		}
998*cdf0e10cSrcweir 
999*cdf0e10cSrcweir 		const OUString& rSize = GetXMLToken( XML_SIZE );
1000*cdf0e10cSrcweir 		if( bSizeProtect && -1 == aProtectAttrValue.indexOf( rSize ) )
1001*cdf0e10cSrcweir 		{
1002*cdf0e10cSrcweir 			if( aProtectAttrValue.getLength() )
1003*cdf0e10cSrcweir 				aProtectAttrValue += OUString::valueOf( sal_Unicode( ' ' ) );
1004*cdf0e10cSrcweir 			aProtectAttrValue += rSize;
1005*cdf0e10cSrcweir 		}
1006*cdf0e10cSrcweir 
1007*cdf0e10cSrcweir 		pProtectContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE, GetXMLToken( XML_PROTECT ) ), aProtectAttrValue );
1008*cdf0e10cSrcweir 	}
1009*cdf0e10cSrcweir 
1010*cdf0e10cSrcweir     if( pIntervalMinorDivisorContext )
1011*cdf0e10cSrcweir     {
1012*cdf0e10cSrcweir         if( fIntervalMinor != 0.0 )
1013*cdf0e10cSrcweir         {
1014*cdf0e10cSrcweir             sal_Int32 nIntervalMinorDivisor = static_cast< sal_Int32 >(
1015*cdf0e10cSrcweir                 ::rtl::math::round( fIntervalMajor / fIntervalMinor ));
1016*cdf0e10cSrcweir 
1017*cdf0e10cSrcweir             ::rtl::OUStringBuffer aBuf;
1018*cdf0e10cSrcweir             SvXMLUnitConverter::convertNumber( aBuf, nIntervalMinorDivisor );
1019*cdf0e10cSrcweir             pIntervalMinorDivisorContext->AddAttribute(
1020*cdf0e10cSrcweir                 GetTransformer().GetNamespaceMap().GetQNameByKey(
1021*cdf0e10cSrcweir                     XML_NAMESPACE_CHART,
1022*cdf0e10cSrcweir                     GetXMLToken( XML_INTERVAL_MINOR_DIVISOR )),
1023*cdf0e10cSrcweir                 aBuf.makeStringAndClear());
1024*cdf0e10cSrcweir         }
1025*cdf0e10cSrcweir     }
1026*cdf0e10cSrcweir }
1027*cdf0e10cSrcweir 
1028*cdf0e10cSrcweir void XMLPropertiesOOoTContext_Impl::EndElement()
1029*cdf0e10cSrcweir {
1030*cdf0e10cSrcweir 	if( !m_bPersistent )
1031*cdf0e10cSrcweir 		Export();
1032*cdf0e10cSrcweir }
1033*cdf0e10cSrcweir 
1034*cdf0e10cSrcweir void XMLPropertiesOOoTContext_Impl::Characters( const OUString& )
1035*cdf0e10cSrcweir {
1036*cdf0e10cSrcweir 	// ignore them
1037*cdf0e10cSrcweir }
1038*cdf0e10cSrcweir 
1039*cdf0e10cSrcweir void XMLPropertiesOOoTContext_Impl::Export()
1040*cdf0e10cSrcweir {
1041*cdf0e10cSrcweir 
1042*cdf0e10cSrcweir 	for( sal_uInt16 i=0; i < MAX_PROP_TYPES; i++ )
1043*cdf0e10cSrcweir 	{
1044*cdf0e10cSrcweir 		if( m_aPropContexts[i].is() )
1045*cdf0e10cSrcweir 			m_aPropContexts[i]->Export();
1046*cdf0e10cSrcweir 	}
1047*cdf0e10cSrcweir }
1048*cdf0e10cSrcweir 
1049*cdf0e10cSrcweir sal_Bool XMLPropertiesOOoTContext_Impl::IsPersistent() const
1050*cdf0e10cSrcweir {
1051*cdf0e10cSrcweir 	return m_bPersistent;
1052*cdf0e10cSrcweir }
1053*cdf0e10cSrcweir 
1054*cdf0e10cSrcweir 
1055*cdf0e10cSrcweir //------------------------------------------------------------------------------
1056*cdf0e10cSrcweir 
1057*cdf0e10cSrcweir TYPEINIT1( XMLStyleOOoTContext, XMLPersElemContentTContext );
1058*cdf0e10cSrcweir 
1059*cdf0e10cSrcweir XMLStyleOOoTContext::XMLStyleOOoTContext( XMLTransformerBase& rImp,
1060*cdf0e10cSrcweir 							  			  const OUString& rQName,
1061*cdf0e10cSrcweir 		   				   				  XMLFamilyType eT,
1062*cdf0e10cSrcweir 	   									  sal_Bool bPersistent ) :
1063*cdf0e10cSrcweir 	XMLPersElemContentTContext( rImp, rQName ),
1064*cdf0e10cSrcweir 	m_eFamily( eT ),
1065*cdf0e10cSrcweir 	m_bPersistent( bPersistent )
1066*cdf0e10cSrcweir {
1067*cdf0e10cSrcweir }
1068*cdf0e10cSrcweir 
1069*cdf0e10cSrcweir XMLStyleOOoTContext::XMLStyleOOoTContext(
1070*cdf0e10cSrcweir 		XMLTransformerBase& rImp,
1071*cdf0e10cSrcweir 	  	const OUString& rQName,
1072*cdf0e10cSrcweir 	    XMLFamilyType eT,
1073*cdf0e10cSrcweir 	    sal_uInt16 nPrefix,
1074*cdf0e10cSrcweir 		::xmloff::token::XMLTokenEnum eToken,
1075*cdf0e10cSrcweir 	   	sal_Bool bPersistent ) :
1076*cdf0e10cSrcweir 	XMLPersElemContentTContext( rImp, rQName, nPrefix, eToken ),
1077*cdf0e10cSrcweir 	m_eFamily( eT ),
1078*cdf0e10cSrcweir 	m_bPersistent( bPersistent )
1079*cdf0e10cSrcweir {
1080*cdf0e10cSrcweir }
1081*cdf0e10cSrcweir 
1082*cdf0e10cSrcweir XMLStyleOOoTContext::~XMLStyleOOoTContext()
1083*cdf0e10cSrcweir {
1084*cdf0e10cSrcweir }
1085*cdf0e10cSrcweir 
1086*cdf0e10cSrcweir XMLTransformerContext *XMLStyleOOoTContext::CreateChildContext(
1087*cdf0e10cSrcweir 			sal_uInt16 nPrefix,
1088*cdf0e10cSrcweir 			const OUString& rLocalName,
1089*cdf0e10cSrcweir 			const OUString& rQName,
1090*cdf0e10cSrcweir 			const Reference< XAttributeList >& rAttrList )
1091*cdf0e10cSrcweir {
1092*cdf0e10cSrcweir 	XMLTransformerContext *pContext = 0;
1093*cdf0e10cSrcweir 
1094*cdf0e10cSrcweir 	if( XML_NAMESPACE_STYLE == nPrefix &&
1095*cdf0e10cSrcweir 		IsXMLToken( rLocalName, XML_PROPERTIES ) )
1096*cdf0e10cSrcweir 	{
1097*cdf0e10cSrcweir 		if( aPropTypes[m_eFamily][0] == XML_PROP_TYPE_END )
1098*cdf0e10cSrcweir 		{
1099*cdf0e10cSrcweir 			OSL_ENSURE( !this, "unexpected properties element" );
1100*cdf0e10cSrcweir 			pContext = m_bPersistent
1101*cdf0e10cSrcweir 							? XMLPersElemContentTContext::CreateChildContext(
1102*cdf0e10cSrcweir 									nPrefix, rLocalName, rQName, rAttrList )
1103*cdf0e10cSrcweir 							: XMLTransformerContext::CreateChildContext(
1104*cdf0e10cSrcweir 									nPrefix, rLocalName, rQName, rAttrList );
1105*cdf0e10cSrcweir 		}
1106*cdf0e10cSrcweir 		else if( aPropTypes[m_eFamily][1] == XML_PROP_TYPE_END )
1107*cdf0e10cSrcweir 		{
1108*cdf0e10cSrcweir 			sal_uInt16 nActionMap =
1109*cdf0e10cSrcweir 				aAttrActionMaps[aPropTypes[m_eFamily][0]];
1110*cdf0e10cSrcweir 			if( nActionMap < MAX_OOO_PROP_ACTIONS )
1111*cdf0e10cSrcweir 			{
1112*cdf0e10cSrcweir 				pContext = new XMLPropertiesOOoTContext_Impl(
1113*cdf0e10cSrcweir 									GetTransformer(), rQName,
1114*cdf0e10cSrcweir 									aPropTypes[m_eFamily], m_bPersistent );
1115*cdf0e10cSrcweir 			}
1116*cdf0e10cSrcweir 			else
1117*cdf0e10cSrcweir 			{
1118*cdf0e10cSrcweir 				if( m_bPersistent )
1119*cdf0e10cSrcweir 					pContext = new XMLPersElemContentTContext(
1120*cdf0e10cSrcweir 									GetTransformer(), rQName,
1121*cdf0e10cSrcweir 									XML_NAMESPACE_STYLE,
1122*cdf0e10cSrcweir 									aPropTokens[aPropTypes[m_eFamily][0]] );
1123*cdf0e10cSrcweir 				else
1124*cdf0e10cSrcweir 					pContext = new XMLRenameElemTransformerContext(
1125*cdf0e10cSrcweir 									GetTransformer(), rQName,
1126*cdf0e10cSrcweir 									XML_NAMESPACE_STYLE,
1127*cdf0e10cSrcweir 									aPropTokens[aPropTypes[m_eFamily][0]] );
1128*cdf0e10cSrcweir 			}
1129*cdf0e10cSrcweir 		}
1130*cdf0e10cSrcweir 		else
1131*cdf0e10cSrcweir 		{
1132*cdf0e10cSrcweir 			pContext = new XMLPropertiesOOoTContext_Impl(
1133*cdf0e10cSrcweir 								GetTransformer(), rQName,
1134*cdf0e10cSrcweir 								aPropTypes[m_eFamily], m_bPersistent);
1135*cdf0e10cSrcweir 		}
1136*cdf0e10cSrcweir 
1137*cdf0e10cSrcweir 		if( m_bPersistent )
1138*cdf0e10cSrcweir 			AddContent( pContext );
1139*cdf0e10cSrcweir 	}
1140*cdf0e10cSrcweir 	else
1141*cdf0e10cSrcweir 	{
1142*cdf0e10cSrcweir 		pContext = m_bPersistent
1143*cdf0e10cSrcweir 						? XMLPersElemContentTContext::CreateChildContext(
1144*cdf0e10cSrcweir 								nPrefix, rLocalName, rQName, rAttrList )
1145*cdf0e10cSrcweir 						: XMLTransformerContext::CreateChildContext(
1146*cdf0e10cSrcweir 								nPrefix, rLocalName, rQName, rAttrList );
1147*cdf0e10cSrcweir 	}
1148*cdf0e10cSrcweir 
1149*cdf0e10cSrcweir 	return pContext;
1150*cdf0e10cSrcweir }
1151*cdf0e10cSrcweir 
1152*cdf0e10cSrcweir void XMLStyleOOoTContext::StartElement(
1153*cdf0e10cSrcweir 		const Reference< XAttributeList >& rAttrList )
1154*cdf0e10cSrcweir {
1155*cdf0e10cSrcweir 	XMLTransformerActions *pActions =
1156*cdf0e10cSrcweir 		GetTransformer().GetUserDefinedActions( OOO_STYLE_ACTIONS );
1157*cdf0e10cSrcweir 	OSL_ENSURE( pActions, "go no actions" );
1158*cdf0e10cSrcweir 
1159*cdf0e10cSrcweir 	Reference< XAttributeList > xAttrList( rAttrList );
1160*cdf0e10cSrcweir 	XMLMutableAttributeList *pMutableAttrList = 0;
1161*cdf0e10cSrcweir 	sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
1162*cdf0e10cSrcweir 	for( sal_Int16 i=0; i < nAttrCount; i++ )
1163*cdf0e10cSrcweir 	{
1164*cdf0e10cSrcweir 		const OUString sAttrName = xAttrList->getNameByIndex( i );
1165*cdf0e10cSrcweir 		OUString aLocalName;
1166*cdf0e10cSrcweir 		sal_uInt16 nPrefix =
1167*cdf0e10cSrcweir 			GetTransformer().GetNamespaceMap().GetKeyByAttrName( sAttrName,
1168*cdf0e10cSrcweir 																 &aLocalName );
1169*cdf0e10cSrcweir 		XMLTransformerActions::key_type aKey( nPrefix, aLocalName );
1170*cdf0e10cSrcweir 		XMLTransformerActions::const_iterator aIter =
1171*cdf0e10cSrcweir 			pActions->find( aKey );
1172*cdf0e10cSrcweir 		if( !(aIter == pActions->end() ) )
1173*cdf0e10cSrcweir 		{
1174*cdf0e10cSrcweir 			if( !pMutableAttrList )
1175*cdf0e10cSrcweir 			{
1176*cdf0e10cSrcweir 				pMutableAttrList =
1177*cdf0e10cSrcweir 					new XMLMutableAttributeList( xAttrList );
1178*cdf0e10cSrcweir 				xAttrList = pMutableAttrList;
1179*cdf0e10cSrcweir 			}
1180*cdf0e10cSrcweir 			const OUString sAttrValue = xAttrList->getValueByIndex( i );
1181*cdf0e10cSrcweir 			switch( (*aIter).second.m_nActionType )
1182*cdf0e10cSrcweir 			{
1183*cdf0e10cSrcweir 			case XML_ATACTION_STYLE_FAMILY:
1184*cdf0e10cSrcweir 				{
1185*cdf0e10cSrcweir 					sal_Bool bControl = sal_False;
1186*cdf0e10cSrcweir 					if( XML_FAMILY_TYPE_END == m_eFamily )
1187*cdf0e10cSrcweir 					{
1188*cdf0e10cSrcweir 						if( IsXMLToken( sAttrValue, XML_GRAPHICS ) )
1189*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_GRAPHIC;
1190*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_PRESENTATION ) )
1191*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_PRESENTATION;
1192*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_DRAWING_PAGE ) )
1193*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_DRAWING_PAGE;
1194*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_TEXT) )
1195*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_TEXT;
1196*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_PARAGRAPH) )
1197*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_PARAGRAPH;
1198*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_RUBY) )
1199*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_RUBY;
1200*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_SECTION) )
1201*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_SECTION;
1202*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_TABLE) )
1203*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_TABLE;
1204*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_TABLE_COLUMN) )
1205*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_TABLE_COLUMN;
1206*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_TABLE_ROW) )
1207*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_TABLE_ROW;
1208*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_TABLE_CELL) )
1209*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_TABLE_CELL;
1210*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_CHART) )
1211*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_CHART;
1212*cdf0e10cSrcweir 						else if( IsXMLToken( sAttrValue, XML_CONTROL) )
1213*cdf0e10cSrcweir 						{
1214*cdf0e10cSrcweir 							m_eFamily = XML_FAMILY_TYPE_PARAGRAPH;
1215*cdf0e10cSrcweir 							bControl = sal_True;
1216*cdf0e10cSrcweir 						}
1217*cdf0e10cSrcweir 					}
1218*cdf0e10cSrcweir 					if( XML_FAMILY_TYPE_GRAPHIC == m_eFamily )
1219*cdf0e10cSrcweir 					{
1220*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i,
1221*cdf0e10cSrcweir 												GetXMLToken( XML_GRAPHIC ) );
1222*cdf0e10cSrcweir 					}
1223*cdf0e10cSrcweir 					else if( bControl )
1224*cdf0e10cSrcweir 					{
1225*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i,
1226*cdf0e10cSrcweir 												GetXMLToken( XML_PARAGRAPH ) );
1227*cdf0e10cSrcweir 					}
1228*cdf0e10cSrcweir 				}
1229*cdf0e10cSrcweir 				break;
1230*cdf0e10cSrcweir 			case XML_ATACTION_INCH2IN:
1231*cdf0e10cSrcweir 				{
1232*cdf0e10cSrcweir 					OUString aAttrValue( sAttrValue );
1233*cdf0e10cSrcweir 					if( XMLTransformerBase::ReplaceSingleInchWithIn(
1234*cdf0e10cSrcweir 								aAttrValue ) )
1235*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1236*cdf0e10cSrcweir 				}
1237*cdf0e10cSrcweir 				break;
1238*cdf0e10cSrcweir 			case XML_ATACTION_ENCODE_STYLE_NAME:
1239*cdf0e10cSrcweir 				{
1240*cdf0e10cSrcweir 					OUString aAttrValue( sAttrValue );
1241*cdf0e10cSrcweir 					if( GetTransformer().EncodeStyleName(aAttrValue) )
1242*cdf0e10cSrcweir 					{
1243*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1244*cdf0e10cSrcweir 						OUString aNewAttrQName(
1245*cdf0e10cSrcweir 							GetTransformer().GetNamespaceMap().
1246*cdf0e10cSrcweir 								GetQNameByKey(
1247*cdf0e10cSrcweir 									nPrefix, ::xmloff::token::GetXMLToken(
1248*cdf0e10cSrcweir 										XML_DISPLAY_NAME ) ) );
1249*cdf0e10cSrcweir 						pMutableAttrList->AddAttribute( aNewAttrQName,
1250*cdf0e10cSrcweir 														sAttrValue );
1251*cdf0e10cSrcweir 					}
1252*cdf0e10cSrcweir 				}
1253*cdf0e10cSrcweir 				break;
1254*cdf0e10cSrcweir 			case XML_ATACTION_ENCODE_STYLE_NAME_REF:
1255*cdf0e10cSrcweir 				{
1256*cdf0e10cSrcweir 					OUString aAttrValue( sAttrValue );
1257*cdf0e10cSrcweir 					if( GetTransformer().EncodeStyleName(aAttrValue) )
1258*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1259*cdf0e10cSrcweir 				}
1260*cdf0e10cSrcweir 				break;
1261*cdf0e10cSrcweir 			case XML_ATACTION_NEG_PERCENT:
1262*cdf0e10cSrcweir 				{
1263*cdf0e10cSrcweir 					OUString aAttrValue( sAttrValue );
1264*cdf0e10cSrcweir 					if( GetTransformer().NegPercent(aAttrValue) )
1265*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1266*cdf0e10cSrcweir 				}
1267*cdf0e10cSrcweir 				break;
1268*cdf0e10cSrcweir 			case XML_ATACTION_URI_OOO:
1269*cdf0e10cSrcweir 				{
1270*cdf0e10cSrcweir 					OUString aAttrValue( sAttrValue );
1271*cdf0e10cSrcweir 					if( GetTransformer().ConvertURIToOASIS( aAttrValue,
1272*cdf0e10cSrcweir 							static_cast< sal_Bool >((*aIter).second.m_nParam1)))
1273*cdf0e10cSrcweir 						pMutableAttrList->SetValueByIndex( i, aAttrValue );
1274*cdf0e10cSrcweir 				}
1275*cdf0e10cSrcweir 				break;
1276*cdf0e10cSrcweir 			default:
1277*cdf0e10cSrcweir 				OSL_ENSURE( !this, "unknown action" );
1278*cdf0e10cSrcweir 				break;
1279*cdf0e10cSrcweir 			}
1280*cdf0e10cSrcweir 		}
1281*cdf0e10cSrcweir 	}
1282*cdf0e10cSrcweir 	if( XML_FAMILY_TYPE_END == m_eFamily )
1283*cdf0e10cSrcweir 		m_eFamily = XML_FAMILY_TYPE_TEXT;
1284*cdf0e10cSrcweir 	if( m_bPersistent )
1285*cdf0e10cSrcweir 		XMLPersElemContentTContext::StartElement( xAttrList );
1286*cdf0e10cSrcweir 	else
1287*cdf0e10cSrcweir 		GetTransformer().GetDocHandler()->startElement( GetExportQName(),
1288*cdf0e10cSrcweir 														xAttrList );
1289*cdf0e10cSrcweir }
1290*cdf0e10cSrcweir 
1291*cdf0e10cSrcweir void XMLStyleOOoTContext::EndElement()
1292*cdf0e10cSrcweir {
1293*cdf0e10cSrcweir 	if( m_bPersistent )
1294*cdf0e10cSrcweir 		XMLPersElemContentTContext::EndElement();
1295*cdf0e10cSrcweir 	else
1296*cdf0e10cSrcweir 		GetTransformer().GetDocHandler()->endElement( GetExportQName() );
1297*cdf0e10cSrcweir }
1298*cdf0e10cSrcweir 
1299*cdf0e10cSrcweir void XMLStyleOOoTContext::Characters( const OUString& )
1300*cdf0e10cSrcweir {
1301*cdf0e10cSrcweir 	// element content only:
1302*cdf0e10cSrcweir }
1303*cdf0e10cSrcweir 
1304*cdf0e10cSrcweir sal_Bool XMLStyleOOoTContext::IsPersistent() const
1305*cdf0e10cSrcweir {
1306*cdf0e10cSrcweir 	return m_bPersistent;
1307*cdf0e10cSrcweir }
1308*cdf0e10cSrcweir 
1309*cdf0e10cSrcweir XMLTransformerActions *XMLStyleOOoTContext::CreateTransformerActions(
1310*cdf0e10cSrcweir 		sal_uInt16 nType )
1311*cdf0e10cSrcweir {
1312*cdf0e10cSrcweir 	XMLTransformerActionInit *pInit = 0;
1313*cdf0e10cSrcweir 
1314*cdf0e10cSrcweir 	switch( nType )
1315*cdf0e10cSrcweir 	{
1316*cdf0e10cSrcweir 	case PROP_OOO_GRAPHIC_ATTR_ACTIONS:
1317*cdf0e10cSrcweir 		pInit = aGraphicPropertyOOoAttrActionTable;
1318*cdf0e10cSrcweir 		break;
1319*cdf0e10cSrcweir 	case PROP_OOO_GRAPHIC_ELEM_ACTIONS:
1320*cdf0e10cSrcweir 		pInit = aGraphicPropertyOOoElemActionTable;
1321*cdf0e10cSrcweir 		break;
1322*cdf0e10cSrcweir 	case PROP_OOO_DRAWING_PAGE_ATTR_ACTIONS:
1323*cdf0e10cSrcweir 		pInit = aDrawingPagePropertyOOoAttrActionTable;
1324*cdf0e10cSrcweir 		break;
1325*cdf0e10cSrcweir 	case PROP_OOO_PAGE_LAYOUT_ATTR_ACTIONS:
1326*cdf0e10cSrcweir 		pInit = aPageLayoutPropertyOOoAttrActionTable;
1327*cdf0e10cSrcweir 		break;
1328*cdf0e10cSrcweir 	case PROP_OOO_HEADER_FOOTER_ATTR_ACTIONS:
1329*cdf0e10cSrcweir 		pInit = aHeaderFooterPropertyOOoAttrActionTable;
1330*cdf0e10cSrcweir 		break;
1331*cdf0e10cSrcweir 	case PROP_OOO_TEXT_ATTR_ACTIONS:
1332*cdf0e10cSrcweir 		pInit = aTextPropertyOOoAttrActionTable;
1333*cdf0e10cSrcweir 		break;
1334*cdf0e10cSrcweir 	case PROP_OOO_TEXT_ELEM_ACTIONS:
1335*cdf0e10cSrcweir 		pInit = aTextPropertyOOoElemActionTable;
1336*cdf0e10cSrcweir 		break;
1337*cdf0e10cSrcweir 	case PROP_OOO_PARAGRAPH_ATTR_ACTIONS:
1338*cdf0e10cSrcweir 		pInit = aParagraphPropertyOOoAttrActionTable;
1339*cdf0e10cSrcweir 		break;
1340*cdf0e10cSrcweir     case PROP_OOO_PARAGRAPH_ELEM_ACTIONS:
1341*cdf0e10cSrcweir 		pInit = aParagraphPropertyOOoElemActionTable;
1342*cdf0e10cSrcweir 		break;
1343*cdf0e10cSrcweir 	case PROP_OOO_SECTION_ATTR_ACTIONS:
1344*cdf0e10cSrcweir 		pInit = aSectionPropertyOOoAttrActionTable;
1345*cdf0e10cSrcweir 		break;
1346*cdf0e10cSrcweir 	case PROP_OOO_TABLE_ATTR_ACTIONS:
1347*cdf0e10cSrcweir 		pInit = aTablePropertyOOoAttrActionTable;
1348*cdf0e10cSrcweir 		break;
1349*cdf0e10cSrcweir 	case PROP_OOO_TABLE_COLUMN_ATTR_ACTIONS:
1350*cdf0e10cSrcweir 		pInit = aTableColumnPropertyOOoAttrActionTable;
1351*cdf0e10cSrcweir 		break;
1352*cdf0e10cSrcweir 	case PROP_OOO_TABLE_ROW_ATTR_ACTIONS:
1353*cdf0e10cSrcweir 		pInit = aTableRowPropertyOOoAttrActionTable;
1354*cdf0e10cSrcweir 		break;
1355*cdf0e10cSrcweir 	case PROP_OOO_TABLE_CELL_ATTR_ACTIONS:
1356*cdf0e10cSrcweir 		pInit = aTableCellPropertyOOoAttrActionTable;
1357*cdf0e10cSrcweir 		break;
1358*cdf0e10cSrcweir 	case PROP_OOO_TABLE_CELL_ELEM_ACTIONS:
1359*cdf0e10cSrcweir 		pInit = aTableCellPropertyOOoElemActionTable;
1360*cdf0e10cSrcweir 		break;
1361*cdf0e10cSrcweir 	case PROP_OOO_LIST_LEVEL_ATTR_ACTIONS:
1362*cdf0e10cSrcweir 		pInit = aListLevelPropertyOOoAttrActionTable;
1363*cdf0e10cSrcweir 		break;
1364*cdf0e10cSrcweir 	case PROP_OOO_CHART_ATTR_ACTIONS:
1365*cdf0e10cSrcweir 		pInit = aChartPropertyOOoAttrActionTable;
1366*cdf0e10cSrcweir 		break;
1367*cdf0e10cSrcweir 	case PROP_OOO_CHART_ELEM_ACTIONS:
1368*cdf0e10cSrcweir 		pInit = aChartPropertyOOoElemActionTable;
1369*cdf0e10cSrcweir 		break;
1370*cdf0e10cSrcweir 	}
1371*cdf0e10cSrcweir 
1372*cdf0e10cSrcweir 	XMLTransformerActions *pActions = 0;
1373*cdf0e10cSrcweir 	if( pInit )
1374*cdf0e10cSrcweir 		pActions = new XMLTransformerActions( pInit );
1375*cdf0e10cSrcweir 
1376*cdf0e10cSrcweir 	return pActions;
1377*cdf0e10cSrcweir }
1378