1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
/*************************************************************************
*
* $RCSfile: property.cxx,v $
*
* $Revision: 1.17 $
*
* last change: $Author: mt $ $Date: 2002-12-10 07:14:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
#include <toolkit/helper/property.hxx>
#include <toolkit/helper/macros.hxx>
#ifndef _OSL_MUTEX_HXX_
#include <osl/mutex.hxx>
#endif
#include <stdlib.h> // qsort/bsearch
#include <tools/debug.hxx>
#ifndef _COM_SUN_STAR_AWT_FONTWEIGHT_HPP_
#include <com/sun/star/awt/FontWeight.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTSLANT_HPP_
#include <com/sun/star/awt/FontSlant.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_CHARSET_HPP_
#include <com/sun/star/awt/CharSet.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
#include <com/sun/star/awt/FontDescriptor.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTWIDTH_HPP_
#include <com/sun/star/awt/FontWidth.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTTYPE_HPP_
#include <com/sun/star/awt/FontType.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTUNDERLINE_HPP_
#include <com/sun/star/awt/FontUnderline.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTSTRIKEOUT_HPP_
#include <com/sun/star/awt/FontStrikeout.hpp>
#endif
#ifndef _COM_SUN_STAR_AWT_FONTPITCH_HPP_
#include <com/sun/star/awt/FontPitch.hpp>
#endif
#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
#endif
#include <toolkit/helper/property.hxx>
struct ImplPropertyInfo
{
::rtl::OUString aName;
sal_uInt16 nPropId;
::com::sun::star::uno::Type aType;
sal_Int16 nAttribs;
sal_Bool bDependsOnOthers; // eg. VALUE depends on MIN/MAX and must be set after MIN/MAX.
ImplPropertyInfo()
{
nPropId = 0;
nAttribs = 0;
bDependsOnOthers = sal_False;
}
ImplPropertyInfo( const sal_Unicode* pName, sal_uInt16 nId, const ::com::sun::star::uno::Type& rType,
sal_Int16 nAttrs, sal_Bool bDepends = sal_False )
: aName( pName )
{
nPropId = nId;
aType = rType;
nAttribs = nAttrs;
bDependsOnOthers = bDepends;
}
};
ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
{
static ImplPropertyInfo* pPropertyInfos = NULL;
static sal_uInt16 nElements = 0;
if( !pPropertyInfos )
{
::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
if( !pPropertyInfos )
{
static ImplPropertyInfo __FAR_DATA aImplPropertyInfos [] =
{
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "AccessibleName" ), BASEPROPERTY_ACCESSIBLENAME, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Align" ), BASEPROPERTY_ALIGN, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Autocomplete" ), BASEPROPERTY_AUTOCOMPLETE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "AutoMnemonics" ), BASEPROPERTY_AUTOMNEMONICS, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "AutoToggle" ), BASEPROPERTY_AUTOTOGGLE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "BackgroundColor" ), BASEPROPERTY_BACKGROUNDCOLOR, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "BlockIncrement" ), BASEPROPERTY_BLOCKINCREMENT, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Border" ), BASEPROPERTY_BORDER, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Closeable" ), BASEPROPERTY_CLOSEABLE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "CurrencySymbol" ), BASEPROPERTY_CURRENCYSYMBOL, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Date" ), BASEPROPERTY_DATE, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DateFormat" ), BASEPROPERTY_EXTDATEFORMAT, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DateMax" ), BASEPROPERTY_DATEMAX, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DateMin" ), BASEPROPERTY_DATEMIN, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DateShowCentury" ), BASEPROPERTY_DATESHOWCENTURY, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DecimalAccuracy" ), BASEPROPERTY_DECIMALACCURACY, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DefaultButton" ), BASEPROPERTY_DEFAULTBUTTON, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DefaultControl" ), BASEPROPERTY_DEFAULTCONTROL, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "DisplayBackgroundColor" ), BASEPROPERTY_DISPLAYBACKGROUNDCOLOR, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Dropdown" ), BASEPROPERTY_DROPDOWN, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "EchoChar" ), BASEPROPERTY_ECHOCHAR, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "EditMask" ), BASEPROPERTY_EDITMASK, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "EffectiveDefault" ), BASEPROPERTY_EFFECTIVE_DEFAULT, ::getCppuType((const ::com::sun::star::uno::Any*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "EffectiveMax" ), BASEPROPERTY_EFFECTIVE_MAX, ::getCppuType((const double*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "EffectiveMin" ), BASEPROPERTY_EFFECTIVE_MIN, ::getCppuType((const double*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "EffectiveValue" ), BASEPROPERTY_EFFECTIVE_VALUE, ::getCppuType((const ::com::sun::star::uno::Any*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Enabled" ), BASEPROPERTY_ENABLED, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FillColor" ), BASEPROPERTY_FILLCOLOR, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FocusSelectionHide" ), BASEPROPERTY_FOCUSSELECTIONHIDE,::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontRelief" ), BASEPROPERTY_FONTRELIEF, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontEmphasisMark" ), BASEPROPERTY_FONTEMPHASISMARK, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontDescriptor" ), BASEPROPERTY_FONTDESCRIPTOR, ::getCppuType((const ::com::sun::star::awt::FontDescriptor*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
// Teile des ::com::sun::star::awt::FontDescriptor
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontName" ), BASEPROPERTY_FONTDESCRIPTORPART_NAME, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontStyleName" ), BASEPROPERTY_FONTDESCRIPTORPART_STYLENAME, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontFamily" ), BASEPROPERTY_FONTDESCRIPTORPART_FAMILY, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontCharset" ), BASEPROPERTY_FONTDESCRIPTORPART_CHARSET, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontHeight" ), BASEPROPERTY_FONTDESCRIPTORPART_HEIGHT, ::getCppuType((const float*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontWidth" ), BASEPROPERTY_FONTDESCRIPTORPART_WIDTH, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontPitch" ), BASEPROPERTY_FONTDESCRIPTORPART_PITCH, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontWeight" ), BASEPROPERTY_FONTDESCRIPTORPART_WEIGHT, ::getCppuType((const float*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontCharWidth" ), BASEPROPERTY_FONTDESCRIPTORPART_CHARWIDTH, ::getCppuType((const float*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontOrientation" ), BASEPROPERTY_FONTDESCRIPTORPART_ORIENTATION, ::getCppuType((const float*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontSlant" ), BASEPROPERTY_FONTDESCRIPTORPART_SLANT, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontUnderline" ), BASEPROPERTY_FONTDESCRIPTORPART_UNDERLINE, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontStrikeout" ), BASEPROPERTY_FONTDESCRIPTORPART_STRIKEOUT, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontKerning" ), BASEPROPERTY_FONTDESCRIPTORPART_KERNING, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontWordLineMode" ), BASEPROPERTY_FONTDESCRIPTORPART_WORDLINEMODE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FontType" ), BASEPROPERTY_FONTDESCRIPTORPART_TYPE, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT /*, PropertyState_AMBIGUOUS_VALUE */ ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FormatKey" ), BASEPROPERTY_FORMATKEY, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEVOID|::com::sun::star::beans::PropertyAttribute::TRANSIENT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "FormatsSupplier" ), BASEPROPERTY_FORMATSSUPPLIER, ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEVOID|::com::sun::star::beans::PropertyAttribute::TRANSIENT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "HelpText" ), BASEPROPERTY_HELPTEXT, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "HelpURL" ), BASEPROPERTY_HELPURL, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "HScroll" ), BASEPROPERTY_HSCROLL, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "HardLineBreaks" ), BASEPROPERTY_HARDLINEBREAKS, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ImageAlign" ), BASEPROPERTY_IMAGEALIGN, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ImageURL" ), BASEPROPERTY_IMAGEURL, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Label" ), BASEPROPERTY_LABEL, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "LineColor" ), BASEPROPERTY_LINECOLOR, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "LineCount" ), BASEPROPERTY_LINECOUNT, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "LineIncrement" ), BASEPROPERTY_LINEINCREMENT, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "LiteralMask" ), BASEPROPERTY_LITERALMASK, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "MaxTextLen" ), BASEPROPERTY_MAXTEXTLEN, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Moveable" ), BASEPROPERTY_MOVEABLE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "MouseTransparent" ), BASEPROPERTY_MOUSETRANSPARENT, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "MultiLine" ), BASEPROPERTY_MULTILINE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "MultiSelection" ), BASEPROPERTY_MULTISELECTION, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Orientation" ), BASEPROPERTY_ORIENTATION, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "PrependCurrencySymbol" ), BASEPROPERTY_CURSYM_POSITION, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Printable" ), BASEPROPERTY_PRINTABLE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ProgressValue" ), BASEPROPERTY_PROGRESSVALUE, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ProgressValueMax" ), BASEPROPERTY_PROGRESSVALUE_MAX, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ProgressValueMin" ), BASEPROPERTY_PROGRESSVALUE_MIN, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "PushButtonType" ), BASEPROPERTY_PUSHBUTTONTYPE, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ReadOnly" ), BASEPROPERTY_READONLY, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ScaleImage" ), BASEPROPERTY_SCALEIMAGE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ScrollValue" ), BASEPROPERTY_SCROLLVALUE, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ScrollValueMax" ), BASEPROPERTY_SCROLLVALUE_MAX, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "SelectedItems" ), BASEPROPERTY_SELECTEDITEMS, ::getCppuType((::com::sun::star::uno::Sequence<sal_Int16>*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ShowThousandsSeparator" ), BASEPROPERTY_NUMSHOWTHOUSANDSEP,::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Sizeable" ), BASEPROPERTY_SIZEABLE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Spin" ), BASEPROPERTY_SPIN, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "State" ), BASEPROPERTY_STATE, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "StrictFormat" ), BASEPROPERTY_STRICTFORMAT, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "StringItemList" ), BASEPROPERTY_STRINGITEMLIST, ::getCppuType((::com::sun::star::uno::Sequence< ::rtl::OUString >*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Tabstop" ), BASEPROPERTY_TABSTOP, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Text" ), BASEPROPERTY_TEXT, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TextColor" ), BASEPROPERTY_TEXTCOLOR, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TextLineColor" ), BASEPROPERTY_TEXTLINECOLOR, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Time" ), BASEPROPERTY_TIME, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TimeFormat" ), BASEPROPERTY_EXTTIMEFORMAT, ::getCppuType((const sal_Int16*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TimeMax" ), BASEPROPERTY_TIMEMAX, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TimeMin" ), BASEPROPERTY_TIMEMIN, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Title" ), BASEPROPERTY_TITLE, ::getCppuType((const ::rtl::OUString*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TreatAsNumber" ), BASEPROPERTY_TREATASNUMBER, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::TRANSIENT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "TriState" ), BASEPROPERTY_TRISTATE, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "VScroll" ), BASEPROPERTY_VSCROLL, ::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "Value" ), BASEPROPERTY_VALUE_DOUBLE, ::getCppuType((const double*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ValueMax" ), BASEPROPERTY_VALUEMAX_DOUBLE, ::getCppuType((const double*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ValueMin" ), BASEPROPERTY_VALUEMIN_DOUBLE, ::getCppuType((const double*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "ValueStep" ), BASEPROPERTY_VALUESTEP_DOUBLE, ::getCppuType((const double*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT ),
ImplPropertyInfo( ::rtl::OUString::createFromAscii( "VisibleSize" ), BASEPROPERTY_VISIBLESIZE, ::getCppuType((const sal_Int32*)0), ::com::sun::star::beans::PropertyAttribute::BOUND|::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT|::com::sun::star::beans::PropertyAttribute::MAYBEVOID, sal_True ),
};
pPropertyInfos = aImplPropertyInfos;
nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo );
}
}
rElementCount = nElements;
return pPropertyInfos;
}
static int
#if defined( WNT )
__cdecl
#endif
#if defined( ICC ) && defined( OS2 )
_Optlink
#endif
ImplPropertyInfoCompare( const void* pFirst, const void* pSecond)
{
return ((ImplPropertyInfo*)pFirst)->aName.compareTo( ((ImplPropertyInfo*)pSecond)->aName );
}
void ImplAssertValidPropertyArray()
{
static sal_Bool bSorted = sal_False;
if( !bSorted )
{
sal_uInt16 nElements;
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
qsort( pInfos, nElements, sizeof( ImplPropertyInfo ), ImplPropertyInfoCompare );
bSorted = sal_True;
}
}
sal_uInt16 GetPropertyId( const ::rtl::OUString& rPropertyName )
{
ImplAssertValidPropertyArray();
ImplPropertyInfo aSearch;
aSearch.aName = rPropertyName;
sal_uInt16 nElements;
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
ImplPropertyInfo* pInf = (ImplPropertyInfo*)
bsearch( &aSearch, pInfos, nElements, sizeof( ImplPropertyInfo ), ImplPropertyInfoCompare );
return pInf ? pInf->nPropId: 0;
}
const ImplPropertyInfo* ImplGetImplPropertyInfo( sal_uInt16 nPropertyId )
{
ImplAssertValidPropertyArray();
const ImplPropertyInfo* pImplPropertyInfo = NULL;
sal_uInt16 nElements;
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
for ( sal_uInt16 n = nElements; n && !pImplPropertyInfo; )
{
if ( pInfos[--n].nPropId == nPropertyId )
pImplPropertyInfo = &pInfos[n];
}
return pImplPropertyInfo;
}
sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId )
{
ImplAssertValidPropertyArray();
sal_uInt16 nElements;
ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
for ( sal_uInt16 n = nElements; n; )
{
if ( pInfos[--n].nPropId == nPropertyId )
return n;
}
return 0xFFFF;
}
const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId )
{
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
return pImplPropertyInfo->aName;
}
const ::com::sun::star::uno::Type* GetPropertyType( sal_uInt16 nPropertyId )
{
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
return pImplPropertyInfo ? &pImplPropertyInfo->aType : NULL;
}
sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId )
{
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
return pImplPropertyInfo ? pImplPropertyInfo->nAttribs : NULL;
}
sal_Bool DoesDependOnOthers( sal_uInt16 nPropertyId )
{
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
return pImplPropertyInfo ? pImplPropertyInfo->bDependsOnOthers : sal_False;
}
sal_Bool CompareProperties( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 )
{
return ::comphelper::compare( r1, r2 );
}
|