xref: /AOO41X/main/xmloff/source/forms/formattributes.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
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 "formattributes.hxx"
31*cdf0e10cSrcweir #include "xmloff/xmlnmspe.hxx"
32*cdf0e10cSrcweir #include <xmloff/xmluconv.hxx>
33*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
34*cdf0e10cSrcweir #include <rtl/logfile.hxx>
35*cdf0e10cSrcweir //.........................................................................
36*cdf0e10cSrcweir namespace xmloff
37*cdf0e10cSrcweir {
38*cdf0e10cSrcweir //.........................................................................
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir 	using namespace ::com::sun::star::uno;
41*cdf0e10cSrcweir 	using namespace ::com::sun::star::lang;
42*cdf0e10cSrcweir 	using namespace ::com::sun::star::beans;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir 	//=====================================================================
46*cdf0e10cSrcweir 	//= OAttributeMetaData
47*cdf0e10cSrcweir 	//=====================================================================
48*cdf0e10cSrcweir 	//---------------------------------------------------------------------
49*cdf0e10cSrcweir 	const sal_Char* OAttributeMetaData::getCommonControlAttributeName(sal_Int32 _nId)
50*cdf0e10cSrcweir 	{
51*cdf0e10cSrcweir 		switch (_nId)
52*cdf0e10cSrcweir 		{
53*cdf0e10cSrcweir 			case CCA_NAME: 				return "name";
54*cdf0e10cSrcweir 			case CCA_SERVICE_NAME: 		return "control-implementation";
55*cdf0e10cSrcweir 			case CCA_BUTTON_TYPE: 		return "button-type";
56*cdf0e10cSrcweir // disabled(AddAttributeIdLegacy)	case CCA_CONTROL_ID: 		return "id";
57*cdf0e10cSrcweir 			case CCA_CURRENT_SELECTED: 	return "current-selected";
58*cdf0e10cSrcweir 			case CCA_CURRENT_VALUE: 	return "current-value";
59*cdf0e10cSrcweir 			case CCA_DISABLED: 			return "disabled";
60*cdf0e10cSrcweir 			case CCA_ENABLEVISIBLE: 	return "visible";
61*cdf0e10cSrcweir 			case CCA_DROPDOWN: 			return "dropdown";
62*cdf0e10cSrcweir 			case CCA_FOR: 				return "for";
63*cdf0e10cSrcweir 			case CCA_IMAGE_DATA: 		return "image-data";
64*cdf0e10cSrcweir 			case CCA_LABEL: 			return "label";
65*cdf0e10cSrcweir 			case CCA_MAX_LENGTH: 		return "max-length";
66*cdf0e10cSrcweir 			case CCA_PRINTABLE: 		return "printable";
67*cdf0e10cSrcweir 			case CCA_READONLY: 			return "readonly";
68*cdf0e10cSrcweir 			case CCA_SELECTED: 			return "selected";
69*cdf0e10cSrcweir 			case CCA_SIZE: 				return "size";
70*cdf0e10cSrcweir 			case CCA_TAB_INDEX: 		return "tab-index";
71*cdf0e10cSrcweir 			case CCA_TARGET_FRAME: 		return "target-frame";
72*cdf0e10cSrcweir 			case CCA_TARGET_LOCATION: 	return "href";		// the only special thing here: TargetLocation is represented by an xlink:href attribute
73*cdf0e10cSrcweir 			case CCA_TAB_STOP: 			return "tab-stop";
74*cdf0e10cSrcweir 			case CCA_TITLE: 			return "title";
75*cdf0e10cSrcweir 			case CCA_VALUE: 			return "value";
76*cdf0e10cSrcweir             case CCA_ORIENTATION:       return "orientation";
77*cdf0e10cSrcweir             case CCA_VISUAL_EFFECT:     return "visual-effect";
78*cdf0e10cSrcweir 			default:
79*cdf0e10cSrcweir 				OSL_ENSURE(sal_False, "OAttributeMetaData::getCommonControlAttributeName: invalid id (maybe you or-ed two flags?)!");
80*cdf0e10cSrcweir 		}
81*cdf0e10cSrcweir 		return "";
82*cdf0e10cSrcweir 	}
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	//---------------------------------------------------------------------
85*cdf0e10cSrcweir 	sal_uInt16 OAttributeMetaData::getCommonControlAttributeNamespace(sal_Int32 _nId)
86*cdf0e10cSrcweir 	{
87*cdf0e10cSrcweir 		if (CCA_TARGET_LOCATION == _nId)
88*cdf0e10cSrcweir 			return XML_NAMESPACE_XLINK;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 		if (CCA_TARGET_FRAME == _nId)
91*cdf0e10cSrcweir 			return XML_NAMESPACE_OFFICE;
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 		return XML_NAMESPACE_FORM;
94*cdf0e10cSrcweir 	}
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 	//---------------------------------------------------------------------
97*cdf0e10cSrcweir 	const sal_Char* OAttributeMetaData::getFormAttributeName(FormAttributes _eAttrib)
98*cdf0e10cSrcweir 	{
99*cdf0e10cSrcweir 		switch (_eAttrib)
100*cdf0e10cSrcweir 		{
101*cdf0e10cSrcweir 			case faName: 				return "name";
102*cdf0e10cSrcweir 			case faServiceName: 		return "service-name";
103*cdf0e10cSrcweir 			case faAction: 				return "href";		// the only special thing here: Action is represented by an xlink:href attribute
104*cdf0e10cSrcweir 			case faEnctype: 			return "enctype";
105*cdf0e10cSrcweir 			case faMethod: 				return "method";
106*cdf0e10cSrcweir 			case faTargetFrame: 		return "target-frame";
107*cdf0e10cSrcweir 			case faAllowDeletes:		return "allow-deletes";
108*cdf0e10cSrcweir 			case faAllowInserts:		return "allow-inserts";
109*cdf0e10cSrcweir 			case faAllowUpdates:		return "allow-updates";
110*cdf0e10cSrcweir 			case faApplyFilter: 		return "apply-filter";
111*cdf0e10cSrcweir 			case faCommand: 			return "command";
112*cdf0e10cSrcweir 			case faCommandType: 		return "command-type";
113*cdf0e10cSrcweir 			case faEscapeProcessing:	return "escape-processing";
114*cdf0e10cSrcweir 			case faDatasource: 			return "datasource";
115*cdf0e10cSrcweir 			case faConnectionResource: 	return "connection-resource";
116*cdf0e10cSrcweir 			case faDetailFiels: 		return "detail-fields";
117*cdf0e10cSrcweir 			case faFilter: 				return "filter";
118*cdf0e10cSrcweir 			case faIgnoreResult: 		return "ignore-result";
119*cdf0e10cSrcweir 			case faMasterFields: 		return "master-fields";
120*cdf0e10cSrcweir 			case faNavigationMode:		return "navigation-mode";
121*cdf0e10cSrcweir 			case faOrder: 				return "order";
122*cdf0e10cSrcweir 			case faTabbingCycle: 		return "tab-cycle";
123*cdf0e10cSrcweir 			default:
124*cdf0e10cSrcweir 				OSL_ENSURE(sal_False, "OAttributeMetaData::getFormAttributeName: invalid id!");
125*cdf0e10cSrcweir 		}
126*cdf0e10cSrcweir 		return "";
127*cdf0e10cSrcweir 	}
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	//---------------------------------------------------------------------
130*cdf0e10cSrcweir 	sal_uInt16 OAttributeMetaData::getFormAttributeNamespace(FormAttributes _eAttrib)
131*cdf0e10cSrcweir 	{
132*cdf0e10cSrcweir 		if (faAction == _eAttrib)
133*cdf0e10cSrcweir 			return XML_NAMESPACE_XLINK;
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 		if (faTargetFrame == _eAttrib)
136*cdf0e10cSrcweir 			return XML_NAMESPACE_OFFICE;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 		return XML_NAMESPACE_FORM;
139*cdf0e10cSrcweir 	}
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 	//---------------------------------------------------------------------
142*cdf0e10cSrcweir 	const sal_Char* OAttributeMetaData::getDatabaseAttributeName(sal_Int32 _nId)
143*cdf0e10cSrcweir 	{
144*cdf0e10cSrcweir 		switch (_nId)
145*cdf0e10cSrcweir 		{
146*cdf0e10cSrcweir 			case DA_BOUND_COLUMN:		return "bound-column";
147*cdf0e10cSrcweir 			case DA_CONVERT_EMPTY:		return "convert-empty-to-null";
148*cdf0e10cSrcweir 			case DA_DATA_FIELD:			return "data-field";
149*cdf0e10cSrcweir 			case DA_LIST_SOURCE:		return "list-source";
150*cdf0e10cSrcweir 			case DA_LIST_SOURCE_TYPE:	return "list-source-type";
151*cdf0e10cSrcweir             case DA_INPUT_REQUIRED:	    return "input-required";
152*cdf0e10cSrcweir 			default:
153*cdf0e10cSrcweir 				OSL_ENSURE(sal_False, "OAttributeMetaData::getDatabaseAttributeName: invalid id (maybe you or-ed two flags?)!");
154*cdf0e10cSrcweir 		}
155*cdf0e10cSrcweir 		return "";
156*cdf0e10cSrcweir 	}
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	//---------------------------------------------------------------------
159*cdf0e10cSrcweir 	sal_uInt16 OAttributeMetaData::getDatabaseAttributeNamespace(sal_Int32 /*_nId*/)
160*cdf0e10cSrcweir 	{
161*cdf0e10cSrcweir 		// nothing special here
162*cdf0e10cSrcweir 		return XML_NAMESPACE_FORM;
163*cdf0e10cSrcweir 	}
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 	//---------------------------------------------------------------------
166*cdf0e10cSrcweir     const sal_Char* OAttributeMetaData::getBindingAttributeName(sal_Int32 _nId)
167*cdf0e10cSrcweir     {
168*cdf0e10cSrcweir 		switch (_nId)
169*cdf0e10cSrcweir 		{
170*cdf0e10cSrcweir 			case BA_LINKED_CELL:       return "linked-cell";
171*cdf0e10cSrcweir             case BA_LIST_LINKING_TYPE: return "list-linkage-type";
172*cdf0e10cSrcweir 			case BA_LIST_CELL_RANGE:   return "source-cell-range";
173*cdf0e10cSrcweir 			default:
174*cdf0e10cSrcweir 				OSL_ENSURE(sal_False, "OAttributeMetaData::getBindingAttributeName: invalid id (maybe you or-ed two flags?)!");
175*cdf0e10cSrcweir 		}
176*cdf0e10cSrcweir 		return "";
177*cdf0e10cSrcweir     }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 	//---------------------------------------------------------------------
180*cdf0e10cSrcweir 	sal_uInt16 OAttributeMetaData::getBindingAttributeNamespace(sal_Int32)
181*cdf0e10cSrcweir     {
182*cdf0e10cSrcweir 		// nothing special here
183*cdf0e10cSrcweir 		return XML_NAMESPACE_FORM;
184*cdf0e10cSrcweir     }
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir 	//---------------------------------------------------------------------
187*cdf0e10cSrcweir 	const sal_Char* OAttributeMetaData::getSpecialAttributeName(sal_Int32 _nId)
188*cdf0e10cSrcweir 	{
189*cdf0e10cSrcweir 		switch (_nId)
190*cdf0e10cSrcweir 		{
191*cdf0e10cSrcweir 			case SCA_ECHO_CHAR: 			return "echo-char";
192*cdf0e10cSrcweir 			case SCA_MAX_VALUE:				return "max-value";
193*cdf0e10cSrcweir 			case SCA_MIN_VALUE:				return "min-value";
194*cdf0e10cSrcweir 			case SCA_VALIDATION:			return "validation";
195*cdf0e10cSrcweir 			case SCA_MULTI_LINE:			return "multi-line";
196*cdf0e10cSrcweir 			case SCA_AUTOMATIC_COMPLETION:	return "auto-complete";
197*cdf0e10cSrcweir 			case SCA_MULTIPLE: 				return "multiple";
198*cdf0e10cSrcweir 			case SCA_DEFAULT_BUTTON: 		return "default-button";
199*cdf0e10cSrcweir 			case SCA_CURRENT_STATE: 		return "current-state";
200*cdf0e10cSrcweir 			case SCA_IS_TRISTATE: 			return "is-tristate";
201*cdf0e10cSrcweir 			case SCA_STATE: 				return "state";
202*cdf0e10cSrcweir 			case SCA_COLUMN_STYLE_NAME:		return "text-style-name";
203*cdf0e10cSrcweir 			case SCA_STEP_SIZE:		        return "step-size";
204*cdf0e10cSrcweir 			case SCA_PAGE_STEP_SIZE:		return "page-step-size";
205*cdf0e10cSrcweir 			case SCA_REPEAT_DELAY:		    return "delay-for-repeat";
206*cdf0e10cSrcweir             case SCA_TOGGLE:                return "toggle";
207*cdf0e10cSrcweir             case SCA_FOCUS_ON_CLICK:        return "focus-on-click";
208*cdf0e10cSrcweir 			default:
209*cdf0e10cSrcweir 				OSL_ENSURE(sal_False, "OAttributeMetaData::getSpecialAttributeName: invalid id (maybe you or-ed two flags?)!");
210*cdf0e10cSrcweir 		}
211*cdf0e10cSrcweir 		return "";
212*cdf0e10cSrcweir 	}
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 	//---------------------------------------------------------------------
215*cdf0e10cSrcweir 	sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 /*_nId*/)
216*cdf0e10cSrcweir 	{
217*cdf0e10cSrcweir 		// nothing special here
218*cdf0e10cSrcweir 		return XML_NAMESPACE_FORM;
219*cdf0e10cSrcweir 	}
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir 	//---------------------------------------------------------------------
222*cdf0e10cSrcweir 	const sal_Char* OAttributeMetaData::getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib)
223*cdf0e10cSrcweir 	{
224*cdf0e10cSrcweir 		switch (_eAttrib)
225*cdf0e10cSrcweir 		{
226*cdf0e10cSrcweir 			case ofaAutomaticFocus:		return "automatic-focus";
227*cdf0e10cSrcweir 			case ofaApplyDesignMode:	return "apply-design-mode";
228*cdf0e10cSrcweir 			default:
229*cdf0e10cSrcweir 				OSL_ENSURE(sal_False, "OAttributeMetaData::getOfficeFormsAttributeName: invalid id!");
230*cdf0e10cSrcweir 		}
231*cdf0e10cSrcweir 		return "";
232*cdf0e10cSrcweir 	}
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	//---------------------------------------------------------------------
235*cdf0e10cSrcweir 	sal_uInt16 OAttributeMetaData::getOfficeFormsAttributeNamespace(OfficeFormsAttributes /* _eAttrib */)
236*cdf0e10cSrcweir 	{
237*cdf0e10cSrcweir 		// nothing special here
238*cdf0e10cSrcweir 		return XML_NAMESPACE_FORM;
239*cdf0e10cSrcweir 	}
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir 	//=====================================================================
242*cdf0e10cSrcweir 	//= OAttribute2Property
243*cdf0e10cSrcweir 	//=====================================================================
244*cdf0e10cSrcweir 	//---------------------------------------------------------------------
245*cdf0e10cSrcweir 	OAttribute2Property::OAttribute2Property()
246*cdf0e10cSrcweir 	{
247*cdf0e10cSrcweir 	}
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir 	//---------------------------------------------------------------------
250*cdf0e10cSrcweir 	OAttribute2Property::~OAttribute2Property()
251*cdf0e10cSrcweir 	{
252*cdf0e10cSrcweir 	}
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir 	//---------------------------------------------------------------------
255*cdf0e10cSrcweir 	const OAttribute2Property::AttributeAssignment* OAttribute2Property::getAttributeTranslation(
256*cdf0e10cSrcweir 			const ::rtl::OUString& _rAttribName)
257*cdf0e10cSrcweir 	{
258*cdf0e10cSrcweir 		ConstAttributeAssignmentsIterator aPos = m_aKnownProperties.find(_rAttribName);
259*cdf0e10cSrcweir 		if (m_aKnownProperties.end() != aPos)
260*cdf0e10cSrcweir 			return &aPos->second;
261*cdf0e10cSrcweir 		return NULL;
262*cdf0e10cSrcweir 	}
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir 	//---------------------------------------------------------------------
265*cdf0e10cSrcweir 	void OAttribute2Property::addStringProperty(
266*cdf0e10cSrcweir 		const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
267*cdf0e10cSrcweir 		const sal_Char* _pAttributeDefault)
268*cdf0e10cSrcweir 	{
269*cdf0e10cSrcweir 		implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< ::rtl::OUString* >(NULL) ),
270*cdf0e10cSrcweir 			_pAttributeDefault ? ::rtl::OUString::createFromAscii(_pAttributeDefault) : ::rtl::OUString());
271*cdf0e10cSrcweir 	}
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir 	//---------------------------------------------------------------------
274*cdf0e10cSrcweir 	void OAttribute2Property::addBooleanProperty(
275*cdf0e10cSrcweir 		const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
276*cdf0e10cSrcweir 		const sal_Bool _bAttributeDefault, const sal_Bool _bInverseSemantics)
277*cdf0e10cSrcweir 	{
278*cdf0e10cSrcweir 		::rtl::OUStringBuffer aDefault;
279*cdf0e10cSrcweir 		SvXMLUnitConverter::convertBool(aDefault, _bAttributeDefault);
280*cdf0e10cSrcweir 		AttributeAssignment& aAssignment = implAdd(_pAttributeName, _rPropertyName, ::getBooleanCppuType(), aDefault.makeStringAndClear());
281*cdf0e10cSrcweir 		aAssignment.bInverseSemantics = _bInverseSemantics;
282*cdf0e10cSrcweir 	}
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir 	//---------------------------------------------------------------------
285*cdf0e10cSrcweir 	void OAttribute2Property::addInt16Property(
286*cdf0e10cSrcweir 		const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
287*cdf0e10cSrcweir 		const sal_Int16 _nAttributeDefault)
288*cdf0e10cSrcweir 	{
289*cdf0e10cSrcweir 		::rtl::OUStringBuffer aDefault;
290*cdf0e10cSrcweir 		SvXMLUnitConverter::convertNumber(aDefault, (sal_Int32)_nAttributeDefault);
291*cdf0e10cSrcweir 		implAdd(_pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int16* >(NULL) ), aDefault.makeStringAndClear());
292*cdf0e10cSrcweir 	}
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir 	//---------------------------------------------------------------------
295*cdf0e10cSrcweir 	void OAttribute2Property::addInt32Property(
296*cdf0e10cSrcweir 		const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
297*cdf0e10cSrcweir 		const sal_Int32 _nAttributeDefault)
298*cdf0e10cSrcweir 	{
299*cdf0e10cSrcweir 		::rtl::OUStringBuffer aDefault;
300*cdf0e10cSrcweir 		SvXMLUnitConverter::convertNumber( aDefault, _nAttributeDefault );
301*cdf0e10cSrcweir 		implAdd( _pAttributeName, _rPropertyName, ::getCppuType( static_cast< sal_Int32* >(NULL) ), aDefault.makeStringAndClear() );
302*cdf0e10cSrcweir 	}
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir 	//---------------------------------------------------------------------
305*cdf0e10cSrcweir 	void OAttribute2Property::addEnumProperty(
306*cdf0e10cSrcweir 			const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
307*cdf0e10cSrcweir 			const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap,
308*cdf0e10cSrcweir 			const ::com::sun::star::uno::Type* _pType)
309*cdf0e10cSrcweir 	{
310*cdf0e10cSrcweir 		::rtl::OUStringBuffer aDefault;
311*cdf0e10cSrcweir 		SvXMLUnitConverter::convertEnum(aDefault, _nAttributeDefault, _pValueMap);
312*cdf0e10cSrcweir 		AttributeAssignment& aAssignment = implAdd(_pAttributeName, _rPropertyName,
313*cdf0e10cSrcweir 			_pType ? *_pType : ::getCppuType( static_cast< sal_Int32* >(NULL) ),
314*cdf0e10cSrcweir 				// this assumes that the setPropertyValue for enums can handle int32's ....
315*cdf0e10cSrcweir 			aDefault.makeStringAndClear());
316*cdf0e10cSrcweir 		aAssignment.pEnumMap = _pValueMap;
317*cdf0e10cSrcweir 	}
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir 	//---------------------------------------------------------------------
320*cdf0e10cSrcweir 	OAttribute2Property::AttributeAssignment& OAttribute2Property::implAdd(
321*cdf0e10cSrcweir 			const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName,
322*cdf0e10cSrcweir 			const ::com::sun::star::uno::Type& _rType, const ::rtl::OUString& /*_rDefaultString*/)
323*cdf0e10cSrcweir 	{
324*cdf0e10cSrcweir 		OSL_ENSURE(m_aKnownProperties.end() == m_aKnownProperties.find(::rtl::OUString::createFromAscii(_pAttributeName)),
325*cdf0e10cSrcweir 			"OAttribute2Property::implAdd: already have this attribute!");
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir 		::rtl::OUString sAttributeName = ::rtl::OUString::createFromAscii(_pAttributeName);
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir 		AttributeAssignment aAssignment;
330*cdf0e10cSrcweir 		aAssignment.sAttributeName = sAttributeName;
331*cdf0e10cSrcweir 		aAssignment.sPropertyName = _rPropertyName;
332*cdf0e10cSrcweir 		aAssignment.aPropertyType = _rType;
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 		// redundance, the accessor is stored in aAssignment.sAttributeName, too
335*cdf0e10cSrcweir 		return m_aKnownProperties[sAttributeName] = aAssignment;
336*cdf0e10cSrcweir 	}
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir //.........................................................................
339*cdf0e10cSrcweir }	// namespace xmloff
340*cdf0e10cSrcweir //.........................................................................
341*cdf0e10cSrcweir 
342