Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <toolkit/helper/property.hxx>
30 : : #include <toolkit/helper/macros.hxx>
31 : : #include <osl/mutex.hxx>
32 : :
33 : : #include <stdlib.h> // qsort/bsearch
34 : : #include <tools/debug.hxx>
35 : : #include <com/sun/star/awt/FontWeight.hpp>
36 : : #include <com/sun/star/awt/FontSlant.hpp>
37 : : #include <com/sun/star/awt/CharSet.hpp>
38 : : #include <com/sun/star/awt/FontDescriptor.hpp>
39 : : #include <com/sun/star/awt/FontWidth.hpp>
40 : : #include <com/sun/star/awt/FontType.hpp>
41 : : #include <com/sun/star/awt/FontUnderline.hpp>
42 : : #include <com/sun/star/awt/FontStrikeout.hpp>
43 : : #include <com/sun/star/awt/FontPitch.hpp>
44 : : #include <com/sun/star/awt/XDevice.hpp>
45 : : #include <com/sun/star/awt/tree/XTreeDataModel.hpp>
46 : : #include <com/sun/star/awt/grid/XGridDataModel.hpp>
47 : : #include <com/sun/star/awt/grid/XGridColumnModel.hpp>
48 : : #include <com/sun/star/view/SelectionType.hpp>
49 : : #include <com/sun/star/style/VerticalAlignment.hpp>
50 : : #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
51 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
52 : : #include <com/sun/star/graphic/XGraphic.hpp>
53 : : #include <com/sun/star/resource/XStringResourceResolver.hpp>
54 : : #include <com/sun/star/container/XNameContainer.hpp>
55 : : #include <comphelper/types.hxx>
56 : : #include <functional>
57 : : #include <algorithm>
58 : : #include <toolkit/helper/property.hxx>
59 : :
60 : : using ::com::sun::star::uno::Any;
61 : : using ::com::sun::star::uno::Sequence;
62 : : using ::com::sun::star::uno::Reference;
63 : : using ::com::sun::star::awt::XDevice;
64 : : using ::com::sun::star::awt::FontDescriptor;
65 : : using ::com::sun::star::style::VerticalAlignment;
66 : : using ::com::sun::star::graphic::XGraphic;
67 : :
68 : 118548 : struct ImplPropertyInfo
69 : : {
70 : : ::rtl::OUString aName;
71 : : sal_uInt16 nPropId;
72 : : ::com::sun::star::uno::Type aType;
73 : : sal_Int16 nAttribs;
74 : : sal_Bool bDependsOnOthers; // eg. VALUE depends on MIN/MAX and must be set after MIN/MAX.
75 : :
76 : : ImplPropertyInfo()
77 : : {
78 : : nPropId = 0;
79 : : nAttribs = 0;
80 : : bDependsOnOthers = sal_False;
81 : : }
82 : :
83 : 12432 : ImplPropertyInfo( rtl::OUString const & theName, sal_uInt16 nId, const ::com::sun::star::uno::Type& rType,
84 : : sal_Int16 nAttrs, sal_Bool bDepends = sal_False )
85 : 12432 : : aName( theName )
86 : : {
87 : 12432 : nPropId = nId;
88 : 12432 : aType = rType;
89 : 12432 : nAttribs = nAttrs;
90 : 12432 : bDependsOnOthers = bDepends;
91 : 12432 : }
92 : :
93 : : };
94 : :
95 : : #define DECL_PROP_1( asciiname, id, type, attrib1 ) \
96 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 )
97 : : #define DECL_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
98 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 )
99 : : #define DECL_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
100 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 | ::com::sun::star::beans::PropertyAttribute::attrib3 )
101 : : #define DECL_PROP_4( asciiname, id, type, attrib1, attrib2, attrib3, attrib4 ) \
102 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 | ::com::sun::star::beans::PropertyAttribute::attrib3 | ::com::sun::star::beans::PropertyAttribute::attrib4 )
103 : :
104 : : #define DECL_DEP_PROP_1( asciiname, id, type, attrib1 ) \
105 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1, sal_True )
106 : : #define DECL_DEP_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
107 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2, sal_True )
108 : : #define DECL_DEP_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
109 : : ImplPropertyInfo( ::rtl::OUString::createFromAscii( asciiname ), BASEPROPERTY_##id, ::getCppuType( static_cast< const type* >( NULL ) ), ::com::sun::star::beans::PropertyAttribute::attrib1 | ::com::sun::star::beans::PropertyAttribute::attrib2 | ::com::sun::star::beans::PropertyAttribute::attrib3, sal_True )
110 : :
111 : 646641 : ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
112 : : {
113 : : static ImplPropertyInfo* pPropertyInfos = NULL;
114 : : static sal_uInt16 nElements = 0;
115 [ + + ]: 646641 : if( !pPropertyInfos )
116 : : {
117 [ + - ][ + - ]: 74 : ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
118 [ + - ]: 74 : if( !pPropertyInfos )
119 : : {
120 : : static ImplPropertyInfo aImplPropertyInfos [] =
121 : : {
122 [ + - ]: 74 : DECL_PROP_2 ( "AccessibleName", ACCESSIBLENAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
123 [ + - ]: 74 : DECL_PROP_3 ( "Align", ALIGN, sal_Int16, BOUND, MAYBEDEFAULT, MAYBEVOID ),
124 [ + - ]: 74 : DECL_PROP_2 ( "Autocomplete", AUTOCOMPLETE, bool, BOUND, MAYBEDEFAULT ),
125 [ + - ]: 74 : DECL_PROP_2 ( "AutoHScroll", AUTOHSCROLL, bool, BOUND, MAYBEDEFAULT ),
126 [ + - ]: 74 : DECL_PROP_1 ( "AutoMnemonics", AUTOMNEMONICS, bool, BOUND ),
127 [ + - ]: 74 : DECL_PROP_2 ( "AutoToggle", AUTOTOGGLE, bool, BOUND, MAYBEDEFAULT ),
128 [ + - ]: 74 : DECL_PROP_2 ( "AutoVScroll", AUTOVSCROLL, bool, BOUND, MAYBEDEFAULT ),
129 [ + - ]: 74 : DECL_PROP_3 ( "BackgroundColor", BACKGROUNDCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
130 [ + - ]: 74 : DECL_DEP_PROP_2 ( "BlockIncrement", BLOCKINCREMENT, sal_Int32, BOUND, MAYBEDEFAULT ),
131 [ + - ]: 74 : DECL_PROP_3 ( "Border", BORDER, sal_Int16, BOUND, MAYBEDEFAULT, MAYBEVOID ),
132 [ + - ]: 74 : DECL_DEP_PROP_3 ( "BorderColor", BORDERCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
133 [ + - ]: 74 : DECL_PROP_2 ( "Closeable", CLOSEABLE, bool, BOUND, MAYBEDEFAULT ),
134 [ + - ]: 74 : DECL_PROP_2 ( "CurrencySymbol", CURRENCYSYMBOL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
135 [ + - ]: 74 : DECL_PROP_2 ( "CustomUnitText", CUSTOMUNITTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
136 [ + - ]: 74 : DECL_DEP_PROP_3 ( "Date", DATE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
137 [ + - ]: 74 : DECL_PROP_2 ( "DateFormat", EXTDATEFORMAT, sal_Int16, BOUND, MAYBEDEFAULT ),
138 [ + - ]: 74 : DECL_PROP_2 ( "DateMax", DATEMAX, sal_Int32, BOUND, MAYBEDEFAULT ),
139 [ + - ]: 74 : DECL_PROP_2 ( "DateMin", DATEMIN, sal_Int32, BOUND, MAYBEDEFAULT ),
140 [ + - ]: 74 : DECL_PROP_3 ( "DateShowCentury", DATESHOWCENTURY, bool, BOUND, MAYBEDEFAULT, MAYBEVOID ),
141 [ + - ]: 74 : DECL_PROP_2 ( "DecimalAccuracy", DECIMALACCURACY, sal_Int16, BOUND, MAYBEDEFAULT ),
142 [ + - ]: 74 : DECL_PROP_2 ( "DefaultButton", DEFAULTBUTTON, bool, BOUND, MAYBEDEFAULT ),
143 [ + - ]: 74 : DECL_PROP_2 ( "DefaultControl", DEFAULTCONTROL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
144 [ + - ]: 74 : DECL_PROP_2 ( "DesktopAsParent", DESKTOP_AS_PARENT, bool, BOUND, MAYBEDEFAULT ),
145 [ + - ]: 74 : DECL_PROP_2 ( "DisplayBackgroundColor", DISPLAYBACKGROUNDCOLOR, sal_Int32, BOUND, MAYBEVOID ),
146 [ + - ]: 74 : DECL_PROP_2 ( "Dropdown", DROPDOWN, bool, BOUND, MAYBEDEFAULT ),
147 [ + - ]: 74 : DECL_PROP_2 ( "EchoChar", ECHOCHAR, sal_Int16, BOUND, MAYBEDEFAULT ),
148 [ + - ]: 74 : DECL_PROP_2 ( "EditMask", EDITMASK, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
149 [ + - ]: 74 : DECL_PROP_3 ( "EffectiveDefault", EFFECTIVE_DEFAULT, Any, BOUND, MAYBEDEFAULT, MAYBEVOID ),
150 [ + - ]: 74 : DECL_PROP_3 ( "EffectiveMax", EFFECTIVE_MAX, double, BOUND, MAYBEDEFAULT, MAYBEVOID ),
151 [ + - ]: 74 : DECL_PROP_3 ( "EffectiveMin", EFFECTIVE_MIN, double, BOUND, MAYBEDEFAULT, MAYBEVOID ),
152 [ + - ]: 74 : DECL_DEP_PROP_3 ( "EffectiveValue", EFFECTIVE_VALUE, Any, BOUND, MAYBEDEFAULT, MAYBEVOID ),
153 [ + - ]: 74 : DECL_PROP_2 ( "Enabled", ENABLED, bool, BOUND, MAYBEDEFAULT ),
154 [ + - ]: 74 : DECL_PROP_2 ( "EnforceFormat", ENFORCE_FORMAT, bool, BOUND, MAYBEDEFAULT ),
155 [ + - ]: 74 : DECL_PROP_3 ( "FillColor", FILLCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
156 [ + - ]: 74 : DECL_PROP_2 ( "FocusOnClick", FOCUSONCLICK, bool, BOUND, MAYBEDEFAULT ),
157 [ + - ]: 74 : DECL_PROP_2 ( "FontRelief", FONTRELIEF, sal_Int16, BOUND, MAYBEDEFAULT ),
158 [ + - ]: 74 : DECL_PROP_2 ( "FontEmphasisMark", FONTEMPHASISMARK, sal_Int16, BOUND, MAYBEDEFAULT ),
159 [ + - ]: 74 : DECL_PROP_2 ( "FontDescriptor", FONTDESCRIPTOR, FontDescriptor, BOUND, MAYBEDEFAULT ),
160 : :
161 : : // Teile des ::com::sun::star::awt::FontDescriptor
162 [ + - ]: 74 : DECL_PROP_2 ( "FontName", FONTDESCRIPTORPART_NAME, ::rtl::OUString,BOUND, MAYBEDEFAULT ),
163 [ + - ]: 74 : DECL_PROP_2 ( "FontStyleName", FONTDESCRIPTORPART_STYLENAME, ::rtl::OUString,BOUND, MAYBEDEFAULT ),
164 [ + - ]: 74 : DECL_PROP_2 ( "FontFamily", FONTDESCRIPTORPART_FAMILY, sal_Int16, BOUND, MAYBEDEFAULT ),
165 [ + - ]: 74 : DECL_PROP_2 ( "FontCharset", FONTDESCRIPTORPART_CHARSET, sal_Int16, BOUND, MAYBEDEFAULT ),
166 [ + - ]: 74 : DECL_PROP_2 ( "FontHeight", FONTDESCRIPTORPART_HEIGHT, float, BOUND, MAYBEDEFAULT ),
167 [ + - ]: 74 : DECL_PROP_2 ( "FontWidth", FONTDESCRIPTORPART_WIDTH, sal_Int16, BOUND, MAYBEDEFAULT ),
168 [ + - ]: 74 : DECL_PROP_2 ( "FontPitch", FONTDESCRIPTORPART_PITCH, sal_Int16, BOUND, MAYBEDEFAULT ),
169 [ + - ]: 74 : DECL_PROP_2 ( "FontWeight", FONTDESCRIPTORPART_WEIGHT, float, BOUND, MAYBEDEFAULT ),
170 [ + - ]: 74 : DECL_PROP_2 ( "FontCharWidth", FONTDESCRIPTORPART_CHARWIDTH, float, BOUND, MAYBEDEFAULT ),
171 [ + - ]: 74 : DECL_PROP_2 ( "FontOrientation", FONTDESCRIPTORPART_ORIENTATION, float, BOUND, MAYBEDEFAULT ),
172 [ + - ]: 74 : DECL_PROP_2 ( "FontSlant", FONTDESCRIPTORPART_SLANT, sal_Int16, BOUND, MAYBEDEFAULT ),
173 [ + - ]: 74 : DECL_PROP_2 ( "FontUnderline", FONTDESCRIPTORPART_UNDERLINE, sal_Int16, BOUND, MAYBEDEFAULT ),
174 [ + - ]: 74 : DECL_PROP_2 ( "FontStrikeout", FONTDESCRIPTORPART_STRIKEOUT, sal_Int16, BOUND, MAYBEDEFAULT ),
175 [ + - ]: 74 : DECL_PROP_2 ( "FontKerning", FONTDESCRIPTORPART_KERNING, bool, BOUND, MAYBEDEFAULT ),
176 [ + - ]: 74 : DECL_PROP_2 ( "FontWordLineMode", FONTDESCRIPTORPART_WORDLINEMODE, bool, BOUND, MAYBEDEFAULT ),
177 [ + - ]: 74 : DECL_PROP_2 ( "FontType", FONTDESCRIPTORPART_TYPE, sal_Int16, BOUND, MAYBEDEFAULT ),
178 : :
179 [ + - ]: 74 : DECL_PROP_3 ( "FormatKey", FORMATKEY, sal_Int32, BOUND, MAYBEVOID, TRANSIENT ),
180 [ + - ]: 74 : DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
181 : :
182 [ + - ]: 74 : DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< XGraphic >, BOUND, TRANSIENT ),
183 [ + - ]: 74 : DECL_PROP_2 ( "GroupName", GROUPNAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
184 [ + - ]: 74 : DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
185 [ + - ]: 74 : DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
186 [ + - ]: 74 : DECL_PROP_2 ( "HideInactiveSelection", HIDEINACTIVESELECTION, bool, BOUND, MAYBEDEFAULT ),
187 [ + - ]: 74 : DECL_PROP_2 ( "HighContrastMode", HIGHCONTRASTMODE, bool, BOUND, MAYBEDEFAULT ),
188 [ + - ]: 74 : DECL_PROP_2 ( "HScroll", HSCROLL, bool, BOUND, MAYBEDEFAULT ),
189 [ + - ]: 74 : DECL_PROP_2 ( "HardLineBreaks", HARDLINEBREAKS, bool, BOUND, MAYBEDEFAULT ),
190 [ + - ]: 74 : DECL_PROP_2 ( "ImageAlign", IMAGEALIGN, sal_Int16, BOUND, MAYBEDEFAULT),
191 [ + - ]: 74 : DECL_PROP_2 ( "ImagePosition", IMAGEPOSITION, sal_Int16, BOUND, MAYBEDEFAULT),
192 [ + - ]: 74 : DECL_PROP_2 ( "ImageURL", IMAGEURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
193 [ + - ]: 74 : DECL_PROP_3 ( "ItemSeparatorPos", ITEM_SEPARATOR_POS, sal_Int16, BOUND, MAYBEDEFAULT, MAYBEVOID ),
194 [ + - ]: 74 : DECL_PROP_2 ( "Label", LABEL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
195 [ + - ]: 74 : DECL_PROP_3 ( "LineColor", LINECOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
196 [ + - ]: 74 : DECL_PROP_2 ( "LineCount", LINECOUNT, sal_Int16, BOUND, MAYBEDEFAULT ),
197 [ + - ]: 74 : DECL_PROP_2 ( "LineEndFormat", LINE_END_FORMAT, sal_Int16, BOUND, MAYBEDEFAULT ),
198 [ + - ]: 74 : DECL_DEP_PROP_2 ( "LineIncrement", LINEINCREMENT, sal_Int32, BOUND, MAYBEDEFAULT ),
199 [ + - ]: 74 : DECL_PROP_2 ( "LiteralMask", LITERALMASK, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
200 [ + - ]: 74 : DECL_PROP_2 ( "LiveScroll", LIVE_SCROLL, bool, BOUND, MAYBEDEFAULT ),
201 [ + - ]: 74 : DECL_PROP_2 ( "MaxTextLen", MAXTEXTLEN, sal_Int16, BOUND, MAYBEDEFAULT ),
202 [ + - ]: 74 : DECL_PROP_2 ( "Moveable", MOVEABLE, bool, BOUND, MAYBEDEFAULT ),
203 [ + - ]: 74 : DECL_PROP_1 ( "MouseTransparent", MOUSETRANSPARENT, bool, BOUND ),
204 [ + - ]: 74 : DECL_PROP_2 ( "MultiLine", MULTILINE, bool, BOUND, MAYBEDEFAULT ),
205 [ + - ]: 74 : DECL_PROP_2 ( "MultiSelection", MULTISELECTION, bool, BOUND, MAYBEDEFAULT ),
206 [ + - ]: 74 : DECL_PROP_2 ( "MultiSelectionSimpleMode", MULTISELECTION_SIMPLEMODE, bool, BOUND, MAYBEDEFAULT ),
207 [ + - ]: 74 : DECL_PROP_2 ( "NativeWidgetLook", NATIVE_WIDGET_LOOK, bool, BOUND, MAYBEDEFAULT ),
208 [ + - ]: 74 : DECL_PROP_2 ( "NoLabel", NOLABEL, bool, BOUND, MAYBEDEFAULT ),
209 [ + - ]: 74 : DECL_PROP_2 ( "Orientation", ORIENTATION, sal_Int32, BOUND, MAYBEDEFAULT ),
210 [ + - ]: 74 : DECL_PROP_2 ( "PaintTransparent", PAINTTRANSPARENT, bool, BOUND, MAYBEDEFAULT ),
211 [ + - ]: 74 : DECL_PROP_2 ( "PluginParent", PLUGINPARENT, sal_Int64, BOUND, MAYBEDEFAULT ),
212 [ + - ]: 74 : DECL_PROP_2 ( "PrependCurrencySymbol", CURSYM_POSITION, bool, BOUND, MAYBEDEFAULT ),
213 [ + - ]: 74 : DECL_PROP_2 ( "Printable", PRINTABLE, bool, BOUND, MAYBEDEFAULT ),
214 [ + - ]: 74 : DECL_DEP_PROP_3 ( "ProgressValue", PROGRESSVALUE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
215 [ + - ]: 74 : DECL_PROP_2 ( "ProgressValueMax", PROGRESSVALUE_MAX, sal_Int32, BOUND, MAYBEDEFAULT ),
216 [ + - ]: 74 : DECL_PROP_2 ( "ProgressValueMin", PROGRESSVALUE_MIN, sal_Int32, BOUND, MAYBEDEFAULT ),
217 [ + - ]: 74 : DECL_PROP_2 ( "PushButtonType", PUSHBUTTONTYPE, sal_Int16, BOUND, MAYBEDEFAULT),
218 [ + - ]: 74 : DECL_PROP_2 ( "ReadOnly", READONLY, bool, BOUND, MAYBEDEFAULT ),
219 [ + - ]: 74 : DECL_PROP_2 ( "Repeat", REPEAT, bool, BOUND, MAYBEDEFAULT ),
220 [ + - ]: 74 : DECL_PROP_2 ( "AutoRepeat", AUTO_REPEAT, sal_Bool, BOUND, MAYBEDEFAULT ),
221 [ + - ]: 74 : DECL_PROP_2 ( "RepeatDelay", REPEAT_DELAY, sal_Int32, BOUND, MAYBEDEFAULT ),
222 [ + - ]: 74 : DECL_PROP_2 ( "ScaleImage", SCALEIMAGE, bool, BOUND, MAYBEDEFAULT ),
223 [ + - ]: 74 : DECL_PROP_2 ( "ScaleMode", IMAGE_SCALE_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
224 [ + - ]: 74 : DECL_DEP_PROP_3 ( "ScrollValue", SCROLLVALUE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
225 [ + - ]: 74 : DECL_PROP_2 ( "ScrollValueMax", SCROLLVALUE_MAX, sal_Int32, BOUND, MAYBEDEFAULT ),
226 [ + - ]: 74 : DECL_PROP_2 ( "ScrollValueMin", SCROLLVALUE_MIN, sal_Int32, BOUND, MAYBEDEFAULT ),
227 [ + - ]: 74 : DECL_DEP_PROP_2 ( "SelectedItems", SELECTEDITEMS, Sequence<sal_Int16>, BOUND, MAYBEDEFAULT ),
228 [ + - ]: 74 : DECL_PROP_2 ( "ShowThousandsSeparator", NUMSHOWTHOUSANDSEP, bool, BOUND, MAYBEDEFAULT ),
229 [ + - ]: 74 : DECL_PROP_2 ( "Sizeable", SIZEABLE, bool, BOUND, MAYBEDEFAULT ),
230 [ + - ]: 74 : DECL_PROP_2 ( "Spin", SPIN, bool, BOUND, MAYBEDEFAULT ),
231 [ + - ]: 74 : DECL_PROP_2 ( "SpinIncrement", SPININCREMENT, sal_Int32, BOUND, MAYBEDEFAULT ),
232 [ + - ]: 74 : DECL_DEP_PROP_2 ( "SpinValue", SPINVALUE, sal_Int32, BOUND, MAYBEDEFAULT ),
233 [ + - ]: 74 : DECL_PROP_2 ( "SpinValueMax", SPINVALUE_MAX, sal_Int32, BOUND, MAYBEDEFAULT ),
234 [ + - ]: 74 : DECL_PROP_2 ( "SpinValueMin", SPINVALUE_MIN, sal_Int32, BOUND, MAYBEDEFAULT ),
235 [ + - ]: 74 : DECL_DEP_PROP_2 ( "State", STATE, sal_Int16, BOUND, MAYBEDEFAULT ),
236 [ + - ]: 74 : DECL_PROP_2 ( "StrictFormat", STRICTFORMAT, bool, BOUND, MAYBEDEFAULT ),
237 [ + - ]: 74 : DECL_PROP_2 ( "StringItemList", STRINGITEMLIST, Sequence< ::rtl::OUString >, BOUND, MAYBEDEFAULT ),
238 [ + - ]: 74 : DECL_PROP_2 ( "VisualEffect", VISUALEFFECT, sal_Int16, BOUND, MAYBEDEFAULT ),
239 [ + - ]: 74 : DECL_PROP_3 ( "SymbolColor", SYMBOL_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
240 [ + - ]: 74 : DECL_PROP_3 ( "Tabstop", TABSTOP, bool, BOUND, MAYBEDEFAULT, MAYBEVOID ),
241 [ + - ]: 74 : DECL_PROP_2 ( "Text", TEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
242 [ + - ]: 74 : DECL_PROP_3 ( "TextColor", TEXTCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
243 [ + - ]: 74 : DECL_PROP_3 ( "TextLineColor", TEXTLINECOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
244 [ + - ]: 74 : DECL_DEP_PROP_3 ( "Time", TIME, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
245 [ + - ]: 74 : DECL_PROP_2 ( "TimeFormat", EXTTIMEFORMAT, sal_Int16, BOUND, MAYBEDEFAULT ),
246 [ + - ]: 74 : DECL_PROP_2 ( "TimeMax", TIMEMAX, sal_Int32, BOUND, MAYBEDEFAULT ),
247 [ + - ]: 74 : DECL_PROP_2 ( "TimeMin", TIMEMIN, sal_Int32, BOUND, MAYBEDEFAULT ),
248 [ + - ]: 74 : DECL_PROP_2 ( "Title", TITLE, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
249 [ + - ]: 74 : DECL_PROP_2 ( "Toggle", TOGGLE, bool, BOUND, MAYBEDEFAULT ),
250 [ + - ]: 74 : DECL_PROP_3 ( "TreatAsNumber", TREATASNUMBER, bool, BOUND, MAYBEDEFAULT,TRANSIENT ),
251 [ + - ]: 74 : DECL_PROP_2 ( "TriState", TRISTATE, bool, BOUND, MAYBEDEFAULT ),
252 [ + - ]: 74 : DECL_PROP_2 ( "Unit", UNIT, sal_Int16, BOUND, MAYBEDEFAULT ),
253 [ + - ]: 74 : DECL_PROP_2 ( "VScroll", VSCROLL, bool, BOUND, MAYBEDEFAULT ),
254 [ + - ]: 74 : DECL_DEP_PROP_3 ( "Value", VALUE_DOUBLE, double, BOUND, MAYBEDEFAULT, MAYBEVOID ),
255 [ + - ]: 74 : DECL_PROP_2 ( "ValueMax", VALUEMAX_DOUBLE, double, BOUND, MAYBEDEFAULT ),
256 [ + - ]: 74 : DECL_PROP_2 ( "ValueMin", VALUEMIN_DOUBLE, double, BOUND, MAYBEDEFAULT ),
257 [ + - ]: 74 : DECL_PROP_2 ( "ValueStep", VALUESTEP_DOUBLE, double, BOUND, MAYBEDEFAULT ),
258 [ + - ]: 74 : DECL_PROP_3 ( "VerticalAlign", VERTICALALIGN, VerticalAlignment, BOUND, MAYBEDEFAULT, MAYBEVOID ),
259 [ + - ]: 74 : DECL_DEP_PROP_3 ( "VisibleSize", VISIBLESIZE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
260 [ + - ]: 74 : DECL_PROP_2 ( "Activated", ACTIVATED, sal_Bool, BOUND, MAYBEDEFAULT ),
261 [ + - ]: 74 : DECL_PROP_2 ( "Complete", COMPLETE, sal_Bool, BOUND, MAYBEDEFAULT ),
262 [ + - ]: 74 : DECL_PROP_2 ( "CurrentItemID", CURRENTITEMID, sal_Int16, BOUND, MAYBEDEFAULT ),
263 : :
264 [ + - ]: 74 : DECL_PROP_2 ( "MouseWheelBehavior", MOUSE_WHEEL_BEHAVIOUR, sal_Int16, BOUND, MAYBEDEFAULT ),
265 [ + - ]: 74 : DECL_PROP_2 ( "StepTime", STEP_TIME, sal_Int32, BOUND, MAYBEDEFAULT ),
266 [ + - ]: 74 : DECL_PROP_2 ( "Decoration", DECORATION, sal_Bool, BOUND, MAYBEDEFAULT ),
267 : :
268 [ + - ]: 74 : DECL_PROP_2 ( "SelectionType", TREE_SELECTIONTYPE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT ),
269 [ + - ]: 74 : DECL_PROP_2 ( "Editable", TREE_EDITABLE, sal_Bool, BOUND, MAYBEDEFAULT ),
270 [ + - ]: 74 : DECL_PROP_3 ( "DataModel", TREE_DATAMODEL, Reference< ::com::sun::star::awt::tree::XTreeDataModel >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
271 [ + - ]: 74 : DECL_PROP_2 ( "RootDisplayed", TREE_ROOTDISPLAYED, sal_Bool, BOUND, MAYBEDEFAULT ),
272 [ + - ]: 74 : DECL_PROP_2 ( "ShowsHandles", TREE_SHOWSHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
273 [ + - ]: 74 : DECL_PROP_2 ( "ShowsRootHandles", TREE_SHOWSROOTHANDLES, sal_Bool, BOUND, MAYBEDEFAULT ),
274 [ + - ]: 74 : DECL_PROP_3 ( "RowHeight", ROW_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
275 [ + - ]: 74 : DECL_PROP_2 ( "InvokesStopNodeEditing", TREE_INVOKESSTOPNODEEDITING, sal_Bool, BOUND, MAYBEDEFAULT ),
276 [ + - ]: 74 : DECL_PROP_2 ( "DialogSourceURL", DIALOGSOURCEURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
277 [ + - ]: 74 : DECL_PROP_2 ( "URL", URL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
278 [ + - ]: 74 : DECL_PROP_2 ( "WritingMode", WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT ),
279 [ + - ]: 74 : DECL_PROP_3 ( "ContextWritingMode", CONTEXT_WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT ),
280 [ + - ]: 74 : DECL_PROP_2 ( "ShowRowHeader", GRID_SHOWROWHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
281 [ + - ]: 74 : DECL_PROP_2 ( "RowHeaderWidth", ROW_HEADER_WIDTH, sal_Int32, BOUND, MAYBEDEFAULT ),
282 [ + - ]: 74 : DECL_PROP_2 ( "ShowColumnHeader", GRID_SHOWCOLUMNHEADER, sal_Bool, BOUND, MAYBEDEFAULT ),
283 [ + - ]: 74 : DECL_PROP_3 ( "ColumnHeaderHeight", COLUMN_HEADER_HEIGHT, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
284 [ + - ]: 74 : DECL_PROP_1 ( "GridDataModel", GRID_DATAMODEL, Reference< ::com::sun::star::awt::grid::XGridDataModel >, BOUND ),
285 [ + - ]: 74 : DECL_PROP_1 ( "ColumnModel", GRID_COLUMNMODEL, Reference< ::com::sun::star::awt::grid::XGridColumnModel >, BOUND ),
286 [ + - ]: 74 : DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
287 [ + - ]: 74 : DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ),
288 [ + - ]: 74 : DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ),
289 [ + - ]: 74 : DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
290 [ + - ]: 74 : DECL_PROP_3 ( "HeaderTextColor", GRID_HEADER_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
291 [ + - ]: 74 : DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
292 [ + - ]: 74 : DECL_PROP_3 ( "RowBackgroundColors", GRID_ROW_BACKGROUND_COLORS, Sequence< sal_Int32 >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
293 [ + - ]: 74 : DECL_PROP_2 ( "UseGridLines", USE_GRID_LINES, sal_Bool, BOUND, MAYBEDEFAULT ),
294 [ + - ]: 74 : DECL_DEP_PROP_3 ( "MultiPageValue", MULTIPAGEVALUE, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
295 [ + - ]: 74 : DECL_PROP_3 ( "AllDialogChildren", USERFORMCONTAINEES, Reference< ::com::sun::star::container::XNameContainer >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
296 [ + - ][ + - ]: 25012 : };
[ # # # #
# # ][ + + ]
297 : 74 : pPropertyInfos = aImplPropertyInfos;
298 : 74 : nElements = sizeof( aImplPropertyInfos ) / sizeof( ImplPropertyInfo );
299 [ + - ]: 74 : }
300 : : }
301 : 646641 : rElementCount = nElements;
302 : 646641 : return pPropertyInfos;
303 : : }
304 : :
305 : :
306 : : struct ImplPropertyInfoCompareFunctor : ::std::binary_function<ImplPropertyInfo,::rtl::OUString,bool>
307 : : {
308 : 154438 : inline bool operator()(const ImplPropertyInfo& lhs,const ImplPropertyInfo& rhs) const
309 : : {
310 : 154438 : return lhs.aName.compareTo(rhs.aName) < 0;
311 : : }
312 : 2911771 : inline bool operator()(const ImplPropertyInfo& lhs,const ::rtl::OUString& rhs) const
313 : : {
314 : 2911771 : return lhs.aName.compareTo(rhs) < 0;
315 : : }
316 : : inline bool operator()(const ::rtl::OUString& lhs,const ImplPropertyInfo& rhs) const
317 : : {
318 : : return lhs.compareTo(rhs.aName) < 0;
319 : : }
320 : : };
321 : :
322 : 646567 : void ImplAssertValidPropertyArray()
323 : : {
324 : : static sal_Bool bSorted = sal_False;
325 [ + + ]: 646567 : if( !bSorted )
326 : : {
327 : : sal_uInt16 nElements;
328 [ + - ]: 74 : ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
329 [ + - ]: 74 : ::std::sort(pInfos, pInfos+nElements,ImplPropertyInfoCompareFunctor());
330 : 74 : bSorted = sal_True;
331 : : }
332 : 646567 : }
333 : :
334 : 389033 : sal_uInt16 GetPropertyId( const ::rtl::OUString& rPropertyName )
335 : : {
336 [ + - ]: 389033 : ImplAssertValidPropertyArray();
337 : :
338 : : sal_uInt16 nElements;
339 [ + - ]: 389033 : ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
340 [ + - ]: 389033 : ImplPropertyInfo* pInf = ::std::lower_bound(pInfos,pInfos+nElements,rPropertyName,ImplPropertyInfoCompareFunctor());
341 : : /*
342 : : (ImplPropertyInfo*)
343 : : bsearch( &aSearch, pInfos, nElements, sizeof( ImplPropertyInfo ), ImplPropertyInfoCompare );
344 : : */
345 : :
346 [ + - ][ + - ]: 389033 : return ( pInf && pInf != (pInfos+nElements) && pInf->aName == rPropertyName) ? pInf->nPropId: 0;
[ + + ]
347 : : }
348 : :
349 : 251963 : const ImplPropertyInfo* ImplGetImplPropertyInfo( sal_uInt16 nPropertyId )
350 : : {
351 [ + - ]: 251963 : ImplAssertValidPropertyArray();
352 : :
353 : : sal_uInt16 nElements;
354 [ + - ]: 251963 : ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
355 : : sal_uInt16 n;
356 [ + - ][ + + ]: 20293091 : for ( n = 0; n < nElements && pInfos[n].nPropId != nPropertyId; ++n)
[ + + ]
357 : : ;
358 : :
359 [ + - ]: 251963 : return (n < nElements) ? &pInfos[n] : NULL;
360 : : }
361 : :
362 : 5571 : sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId )
363 : : {
364 [ + - ]: 5571 : ImplAssertValidPropertyArray();
365 : :
366 : : sal_uInt16 nElements;
367 [ + - ]: 5571 : ImplPropertyInfo* pInfos = ImplGetPropertyInfos( nElements );
368 [ + - ]: 533652 : for ( sal_uInt16 n = nElements; n; )
369 : : {
370 [ + + ]: 533652 : if ( pInfos[--n].nPropId == nPropertyId )
371 : 5571 : return n;
372 : : }
373 : 5571 : return 0xFFFF;
374 : : }
375 : :
376 : 53855 : const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId )
377 : : {
378 : 53855 : const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
379 : : DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
380 : 53855 : return pImplPropertyInfo->aName;
381 : : }
382 : :
383 : 66686 : const ::com::sun::star::uno::Type* GetPropertyType( sal_uInt16 nPropertyId )
384 : : {
385 : 66686 : const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
386 : : DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
387 [ + - ]: 66686 : return pImplPropertyInfo ? &pImplPropertyInfo->aType : NULL;
388 : : }
389 : :
390 : 100901 : sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId )
391 : : {
392 : 100901 : const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
393 : : DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
394 [ + - ]: 100901 : return pImplPropertyInfo ? pImplPropertyInfo->nAttribs : 0;
395 : : }
396 : :
397 : 30521 : sal_Bool DoesDependOnOthers( sal_uInt16 nPropertyId )
398 : : {
399 : 30521 : const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
400 : : DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
401 [ + - ]: 30521 : return pImplPropertyInfo ? pImplPropertyInfo->bDependsOnOthers : sal_False;
402 : : }
403 : :
404 : 63124 : sal_Bool CompareProperties( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 )
405 : : {
406 : 63124 : return ::comphelper::compare( r1, r2 );
407 : : }
408 : :
409 : :
410 : :
411 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|