Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/toolkit/source/helper/property.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include <helper/property.hxx>
21
22
#include <tools/debug.hxx>
23
#include <com/sun/star/awt/FontDescriptor.hpp>
24
#include <com/sun/star/awt/XDevice.hpp>
25
#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
26
#include <com/sun/star/awt/grid/XGridDataModel.hpp>
27
#include <com/sun/star/awt/grid/XGridColumnModel.hpp>
28
#include <com/sun/star/view/SelectionType.hpp>
29
#include <com/sun/star/style/VerticalAlignment.hpp>
30
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
31
#include <com/sun/star/util/Date.hpp>
32
#include <com/sun/star/util/Time.hpp>
33
#include <com/sun/star/beans/PropertyAttribute.hpp>
34
#include <com/sun/star/graphic/XGraphic.hpp>
35
#include <com/sun/star/container/XNameContainer.hpp>
36
#include <algorithm>
37
#include <string_view>
38
#include <utility>
39
#include <unordered_map>
40
41
using ::com::sun::star::uno::Any;
42
using ::com::sun::star::uno::Sequence;
43
using ::com::sun::star::uno::Reference;
44
using ::com::sun::star::awt::XDevice;
45
using ::com::sun::star::awt::FontDescriptor;
46
using ::com::sun::star::style::VerticalAlignment;
47
using ::com::sun::star::graphic::XGraphic;
48
49
using namespace com::sun::star;
50
51
namespace {
52
53
struct ImplPropertyInfo
54
{
55
    css::uno::Type           aType;
56
    sal_uInt16               nPropId;
57
    sal_Int16                nAttribs;
58
    bool                     bDependsOnOthers;   // eg. VALUE depends on MIN/MAX and must be set after MIN/MAX.
59
60
    ImplPropertyInfo( sal_uInt16 nId, const css::uno::Type& rType,
61
                        sal_Int16 nAttrs, bool bDepends = false )
62
180
         : aType(rType)
63
180
         , nPropId(nId)
64
180
         , nAttribs(nAttrs)
65
180
         , bDependsOnOthers(bDepends)
66
180
     {
67
180
     }
68
69
};
70
71
}
72
73
#define DECL_PROP_1( asciiname, id, type, attrib1 ) \
74
108
    { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 ) }
75
#define DECL_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
76
3.40k
    { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 ) }
77
#define DECL_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
78
945
    { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3 ) }
79
80
#define DECL_DEP_PROP_2( asciiname, id, type, attrib1, attrib2 ) \
81
162
    { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2, true ) }
82
#define DECL_DEP_PROP_3( asciiname, id, type, attrib1, attrib2, attrib3 ) \
83
243
    { asciiname, ImplPropertyInfo( BASEPROPERTY_##id, cppu::UnoType<type>::get(), css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3, true ) }
84
85
typedef std::unordered_map<OUString, ImplPropertyInfo> ImpPropertyInfoMap;
86
static const ImpPropertyInfoMap & ImplGetPropertyInfos()
87
27
{
88
27
    static const ImpPropertyInfoMap aImplPropertyInfos {
89
27
        DECL_PROP_2     ( "AccessibleName",         ACCESSIBLENAME,         OUString,       BOUND, MAYBEDEFAULT ),
90
27
        DECL_PROP_3     ( "Align",                  ALIGN,                  sal_Int16,      BOUND, MAYBEDEFAULT, MAYBEVOID ),
91
27
        DECL_PROP_2     ( "Autocomplete",           AUTOCOMPLETE,           bool,           BOUND, MAYBEDEFAULT ),
92
27
        DECL_PROP_2     ( "AutoHScroll",            AUTOHSCROLL,            bool,           BOUND, MAYBEDEFAULT ),
93
27
        DECL_PROP_1     ( "AutoMnemonics",          AUTOMNEMONICS,          bool,           BOUND ),
94
27
        DECL_PROP_2     ( "AutoToggle",             AUTOTOGGLE,             bool,           BOUND, MAYBEDEFAULT ),
95
27
        DECL_PROP_2     ( "AutoVScroll",            AUTOVSCROLL,            bool,           BOUND, MAYBEDEFAULT ),
96
27
        DECL_PROP_3     ( "BackgroundColor",        BACKGROUNDCOLOR,        sal_Int32,      BOUND, MAYBEDEFAULT, MAYBEVOID ),
97
27
        DECL_DEP_PROP_2 ( "BlockIncrement",         BLOCKINCREMENT,         sal_Int32,      BOUND, MAYBEDEFAULT ),
98
27
        DECL_PROP_3     ( "Border",                 BORDER,                 sal_Int16,      BOUND, MAYBEDEFAULT, MAYBEVOID ),
99
27
        DECL_DEP_PROP_3 ( "BorderColor",            BORDERCOLOR,            sal_Int32,      BOUND, MAYBEDEFAULT, MAYBEVOID ),
100
27
        DECL_PROP_2     ( "Closeable",              CLOSEABLE,              bool,           BOUND, MAYBEDEFAULT ),
101
27
        DECL_PROP_2     ( "CurrencySymbol",         CURRENCYSYMBOL,         OUString,       BOUND, MAYBEDEFAULT ),
102
27
        DECL_PROP_2     ( "CustomUnitText",         CUSTOMUNITTEXT,         OUString,       BOUND, MAYBEDEFAULT ),
103
27
        DECL_DEP_PROP_3 ( "Date",                   DATE,                   util::Date,     BOUND, MAYBEDEFAULT, MAYBEVOID ),
104
27
        DECL_PROP_2     ( "DateFormat",             EXTDATEFORMAT,          sal_Int16,      BOUND, MAYBEDEFAULT ),
105
27
        DECL_PROP_2     ( "DateMax",                DATEMAX,                util::Date,     BOUND, MAYBEDEFAULT ),
106
27
        DECL_PROP_2     ( "DateMin",                DATEMIN,                util::Date,     BOUND, MAYBEDEFAULT ),
107
27
        DECL_PROP_3     ( "DateShowCentury",        DATESHOWCENTURY,        bool,           BOUND, MAYBEDEFAULT, MAYBEVOID ),
108
27
        DECL_PROP_2     ( "DecimalAccuracy",        DECIMALACCURACY,        sal_Int16,      BOUND, MAYBEDEFAULT ),
109
27
        DECL_PROP_2     ( "DefaultButton",          DEFAULTBUTTON,          bool,           BOUND, MAYBEDEFAULT ),
110
27
        DECL_PROP_2     ( "DefaultControl",         DEFAULTCONTROL,         OUString,       BOUND, MAYBEDEFAULT ),
111
27
        DECL_PROP_2     ( "DesktopAsParent",        DESKTOP_AS_PARENT,      bool,           BOUND, MAYBEDEFAULT ),
112
27
        DECL_PROP_2     ( "DisplayBackgroundColor", DISPLAYBACKGROUNDCOLOR, sal_Int32,      BOUND, MAYBEVOID ),
113
27
        DECL_PROP_2     ( "Dropdown",               DROPDOWN,               bool,           BOUND, MAYBEDEFAULT ),
114
27
        DECL_PROP_2     ( "EchoChar",               ECHOCHAR,               sal_Int16,      BOUND, MAYBEDEFAULT ),
115
27
        DECL_PROP_2     ( "EditMask",               EDITMASK,               OUString,       BOUND, MAYBEDEFAULT ),
116
27
        DECL_PROP_3     ( "EffectiveDefault",       EFFECTIVE_DEFAULT,      Any,            BOUND, MAYBEDEFAULT, MAYBEVOID ),
117
27
        DECL_PROP_3     ( "EffectiveMax",           EFFECTIVE_MAX,          double,         BOUND, MAYBEDEFAULT, MAYBEVOID ),
118
27
        DECL_PROP_3     ( "EffectiveMin",           EFFECTIVE_MIN,          double,         BOUND, MAYBEDEFAULT, MAYBEVOID ),
119
27
        DECL_DEP_PROP_3 ( "EffectiveValue",         EFFECTIVE_VALUE,        Any,            BOUND, MAYBEDEFAULT, MAYBEVOID ),
120
27
        DECL_PROP_2     ( "Enabled",                ENABLED,                bool,           BOUND, MAYBEDEFAULT ),
121
27
        DECL_PROP_2     ( "EnforceFormat",          ENFORCE_FORMAT,         bool,           BOUND, MAYBEDEFAULT ),
122
27
        DECL_PROP_3     ( "FillColor",              FILLCOLOR,              sal_Int32,      BOUND, MAYBEDEFAULT, MAYBEVOID ),
123
27
        DECL_PROP_2     ( "FocusOnClick",           FOCUSONCLICK,           bool,           BOUND, MAYBEDEFAULT ),
124
27
        DECL_PROP_2     ( "FontRelief",             FONTRELIEF,             sal_Int16,      BOUND, MAYBEDEFAULT ),
125
27
        DECL_PROP_2     ( "FontEmphasisMark",       FONTEMPHASISMARK,       sal_Int16,      BOUND, MAYBEDEFAULT ),
126
27
        DECL_PROP_2     ( "FontDescriptor",         FONTDESCRIPTOR,         FontDescriptor, BOUND, MAYBEDEFAULT ),
127
128
        // parts of css::awt::FontDescriptor
129
27
        DECL_PROP_2     ( "FontName",               FONTDESCRIPTORPART_NAME,         OUString,  BOUND, MAYBEDEFAULT ),
130
27
        DECL_PROP_2     ( "FontStyleName",          FONTDESCRIPTORPART_STYLENAME,    OUString,  BOUND, MAYBEDEFAULT ),
131
27
        DECL_PROP_2     ( "FontFamily",             FONTDESCRIPTORPART_FAMILY,       sal_Int16, BOUND, MAYBEDEFAULT ),
132
27
        DECL_PROP_2     ( "FontCharset",            FONTDESCRIPTORPART_CHARSET,      sal_Int16, BOUND, MAYBEDEFAULT ),
133
27
        DECL_PROP_2     ( "FontHeight",             FONTDESCRIPTORPART_HEIGHT,       float,     BOUND, MAYBEDEFAULT ),
134
27
        DECL_PROP_2     ( "FontWidth",              FONTDESCRIPTORPART_WIDTH,        sal_Int16, BOUND, MAYBEDEFAULT ),
135
27
        DECL_PROP_2     ( "FontPitch",              FONTDESCRIPTORPART_PITCH,        sal_Int16, BOUND, MAYBEDEFAULT ),
136
27
        DECL_PROP_2     ( "FontWeight",             FONTDESCRIPTORPART_WEIGHT,       float,     BOUND, MAYBEDEFAULT ),
137
27
        DECL_PROP_2     ( "FontCharWidth",          FONTDESCRIPTORPART_CHARWIDTH,    float,     BOUND, MAYBEDEFAULT ),
138
27
        DECL_PROP_2     ( "FontOrientation",        FONTDESCRIPTORPART_ORIENTATION,  float,     BOUND, MAYBEDEFAULT ),
139
27
        DECL_PROP_2     ( "FontSlant",              FONTDESCRIPTORPART_SLANT,        sal_Int16, BOUND, MAYBEDEFAULT ),
140
27
        DECL_PROP_2     ( "FontUnderline",          FONTDESCRIPTORPART_UNDERLINE,    sal_Int16, BOUND, MAYBEDEFAULT ),
141
27
        DECL_PROP_2     ( "FontStrikeout",          FONTDESCRIPTORPART_STRIKEOUT,    sal_Int16, BOUND, MAYBEDEFAULT ),
142
27
        DECL_PROP_2     ( "FontKerning",            FONTDESCRIPTORPART_KERNING,      bool,      BOUND, MAYBEDEFAULT ),
143
27
        DECL_PROP_2     ( "FontWordLineMode",       FONTDESCRIPTORPART_WORDLINEMODE, bool,      BOUND, MAYBEDEFAULT ),
144
27
        DECL_PROP_2     ( "FontType",               FONTDESCRIPTORPART_TYPE,         sal_Int16, BOUND, MAYBEDEFAULT ),
145
146
27
        DECL_PROP_3     ( "FormatKey",              FORMATKEY,          sal_Int32,      BOUND, MAYBEVOID, TRANSIENT ),
147
27
        DECL_PROP_3     ( "FormatsSupplier",        FORMATSSUPPLIER,    Reference< css::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
148
149
27
        DECL_PROP_2     ( "Graphic",                GRAPHIC,            Reference< XGraphic >, BOUND, TRANSIENT ),
150
27
        DECL_PROP_2     ( "GroupName",              GROUPNAME,          OUString,           BOUND, MAYBEDEFAULT ),
151
27
        DECL_PROP_2     ( "HelpText",               HELPTEXT,           OUString,           BOUND, MAYBEDEFAULT ),
152
27
        DECL_PROP_2     ( "HelpURL",                HELPURL,            OUString,           BOUND, MAYBEDEFAULT ),
153
27
        DECL_PROP_2     ( "HideInactiveSelection",  HIDEINACTIVESELECTION, bool,            BOUND, MAYBEDEFAULT ),
154
27
        DECL_PROP_2     ( "HighContrastMode",       HIGHCONTRASTMODE,   bool,               BOUND, MAYBEDEFAULT ),
155
27
        DECL_PROP_2     ( "HScroll",                HSCROLL,            bool,               BOUND, MAYBEDEFAULT ),
156
27
        DECL_PROP_2     ( "HardLineBreaks",         HARDLINEBREAKS,     bool,               BOUND, MAYBEDEFAULT ),
157
27
        DECL_PROP_3     ( "HighlightColor",         HIGHLIGHT_COLOR,    sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID),
158
27
        DECL_PROP_3     ( "HighlightTextColor",     HIGHLIGHT_TEXT_COLOR, sal_Int32,        BOUND, MAYBEDEFAULT, MAYBEVOID),
159
27
        DECL_PROP_2     ( "ImageAlign",             IMAGEALIGN,         sal_Int16,          BOUND, MAYBEDEFAULT),
160
27
        DECL_PROP_2     ( "ImagePosition",          IMAGEPOSITION,      sal_Int16,          BOUND, MAYBEDEFAULT),
161
27
        DECL_PROP_2     ( "ImageURL",               IMAGEURL,           css::uno::Any,      BOUND, MAYBEDEFAULT ),
162
27
        DECL_PROP_3     ( "ItemSeparatorPos",       ITEM_SEPARATOR_POS, sal_Int16,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
163
27
        DECL_PROP_2     ( "Label",                  LABEL,              OUString,           BOUND, MAYBEDEFAULT ),
164
27
        DECL_PROP_3     ( "LineColor",              LINECOLOR,          sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
165
27
        DECL_PROP_2     ( "LineCount",              LINECOUNT,          sal_Int16,          BOUND, MAYBEDEFAULT ),
166
27
        DECL_PROP_2     ( "LineEndFormat",          LINE_END_FORMAT,    sal_Int16,          BOUND, MAYBEDEFAULT ),
167
27
        DECL_DEP_PROP_2 ( "LineIncrement",          LINEINCREMENT,      sal_Int32,          BOUND, MAYBEDEFAULT ),
168
27
        DECL_PROP_2     ( "LiteralMask",            LITERALMASK,        OUString,           BOUND, MAYBEDEFAULT ),
169
27
        DECL_PROP_2     ( "LiveScroll",             LIVE_SCROLL,        bool,               BOUND, MAYBEDEFAULT ),
170
27
        DECL_PROP_2     ( "MaxTextLen",             MAXTEXTLEN,         sal_Int16,          BOUND, MAYBEDEFAULT ),
171
27
        DECL_PROP_2     ( "Moveable",               MOVEABLE,           bool,               BOUND, MAYBEDEFAULT ),
172
27
        DECL_PROP_1     ( "MouseTransparent",       MOUSETRANSPARENT,   bool,               BOUND ),
173
27
        DECL_PROP_2     ( "MultiLine",              MULTILINE,          bool,               BOUND, MAYBEDEFAULT ),
174
27
        DECL_PROP_2     ( "MultiSelection",         MULTISELECTION,     bool,               BOUND, MAYBEDEFAULT ),
175
27
        DECL_PROP_2     ( "MultiSelectionSimpleMode",   MULTISELECTION_SIMPLEMODE,    bool, BOUND, MAYBEDEFAULT ),
176
27
        DECL_PROP_2     ( "NativeWidgetLook",       NATIVE_WIDGET_LOOK, bool,               BOUND, MAYBEDEFAULT ),
177
27
        DECL_PROP_2     ( "NoLabel",                NOLABEL,            bool,               BOUND, MAYBEDEFAULT ),
178
27
        DECL_PROP_2     ( "Orientation",            ORIENTATION,        sal_Int32,          BOUND, MAYBEDEFAULT ),
179
27
        DECL_PROP_2     ( "PaintTransparent",       PAINTTRANSPARENT,   bool,               BOUND, MAYBEDEFAULT ),
180
27
        DECL_PROP_2     ( "PluginParent",           PLUGINPARENT,       sal_Int64,          BOUND, MAYBEDEFAULT ),
181
27
        DECL_PROP_2     ( "PrependCurrencySymbol",  CURSYM_POSITION,    bool,               BOUND, MAYBEDEFAULT ),
182
27
        DECL_PROP_2     ( "Printable",              PRINTABLE,          bool,               BOUND, MAYBEDEFAULT ),
183
27
        DECL_DEP_PROP_3 ( "ProgressValue",          PROGRESSVALUE,      sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
184
27
        DECL_PROP_2     ( "ProgressValueMax",       PROGRESSVALUE_MAX,  sal_Int32,          BOUND, MAYBEDEFAULT ),
185
27
        DECL_PROP_2     ( "ProgressValueMin",       PROGRESSVALUE_MIN,  sal_Int32,          BOUND, MAYBEDEFAULT ),
186
27
        DECL_PROP_2     ( "PushButtonType",         PUSHBUTTONTYPE,     sal_Int16,          BOUND, MAYBEDEFAULT),
187
27
        DECL_PROP_2     ( "ReadOnly",               READONLY,           bool,               BOUND, MAYBEDEFAULT ),
188
27
        DECL_PROP_2     ( "Repeat",                 REPEAT,             bool,               BOUND, MAYBEDEFAULT ),
189
27
        DECL_PROP_2     ( "AutoRepeat",             AUTO_REPEAT,        sal_Bool,           BOUND, MAYBEDEFAULT ),
190
27
        DECL_PROP_2     ( "RepeatDelay",            REPEAT_DELAY,       sal_Int32,          BOUND, MAYBEDEFAULT ),
191
27
        DECL_PROP_2     ( "ScaleImage",             SCALEIMAGE,         bool,               BOUND, MAYBEDEFAULT ),
192
27
        DECL_DEP_PROP_2 ( "ScaleMode",              IMAGE_SCALE_MODE,   sal_Int16,          BOUND, MAYBEDEFAULT ),
193
27
        DECL_DEP_PROP_3 ( "ScrollValue",            SCROLLVALUE,        sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
194
27
        DECL_PROP_2     ( "ScrollValueMax",         SCROLLVALUE_MAX,    sal_Int32,          BOUND, MAYBEDEFAULT ),
195
27
        DECL_PROP_2     ( "ScrollValueMin",         SCROLLVALUE_MIN,    sal_Int32,          BOUND, MAYBEDEFAULT ),
196
27
        DECL_PROP_2     ( "ScrollWidth",            SCROLLWIDTH,        sal_Int32,          BOUND, MAYBEDEFAULT ),
197
27
        DECL_PROP_2     ( "ScrollHeight",           SCROLLHEIGHT,       sal_Int32,          BOUND, MAYBEDEFAULT ),
198
27
        DECL_PROP_2     ( "ScrollTop",              SCROLLTOP,          sal_Int32,          BOUND, MAYBEDEFAULT ),
199
27
        DECL_PROP_2     ( "ScrollLeft",             SCROLLLEFT,         sal_Int32,          BOUND, MAYBEDEFAULT ),
200
27
        DECL_DEP_PROP_2 ( "SelectedItems",          SELECTEDITEMS,      Sequence<sal_Int16>, BOUND, MAYBEDEFAULT ),
201
27
        DECL_PROP_2     ( "ShowThousandsSeparator", NUMSHOWTHOUSANDSEP, bool,               BOUND, MAYBEDEFAULT ),
202
27
        DECL_PROP_2     ( "Sizeable",               SIZEABLE,           bool,               BOUND, MAYBEDEFAULT ),
203
27
        DECL_PROP_2     ( "Spin",                   SPIN,               bool,               BOUND, MAYBEDEFAULT ),
204
27
        DECL_PROP_2     ( "SpinIncrement",          SPININCREMENT,      sal_Int32,          BOUND, MAYBEDEFAULT ),
205
27
        DECL_DEP_PROP_2 ( "SpinValue",              SPINVALUE,          sal_Int32,          BOUND, MAYBEDEFAULT ),
206
27
        DECL_PROP_2     ( "SpinValueMax",           SPINVALUE_MAX,      sal_Int32,          BOUND, MAYBEDEFAULT ),
207
27
        DECL_PROP_2     ( "SpinValueMin",           SPINVALUE_MIN,      sal_Int32,          BOUND, MAYBEDEFAULT ),
208
27
        DECL_DEP_PROP_2 ( "State",                  STATE,              sal_Int16,          BOUND, MAYBEDEFAULT ),
209
27
        DECL_PROP_2     ( "StrictFormat",           STRICTFORMAT,       bool,               BOUND, MAYBEDEFAULT ),
210
27
        DECL_PROP_2     ( "StringItemList",         STRINGITEMLIST,     Sequence< OUString >, BOUND, MAYBEDEFAULT ),
211
27
        DECL_PROP_2     ( "TypedItemList",          TYPEDITEMLIST,      Sequence< Any >,    BOUND, MAYBEDEFAULT ),
212
27
        DECL_PROP_2     ( "VisualEffect",           VISUALEFFECT,       sal_Int16,          BOUND, MAYBEDEFAULT ),
213
27
        DECL_PROP_3     ( "SymbolColor",            SYMBOL_COLOR,       sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
214
27
        DECL_PROP_3     ( "Tabstop",                TABSTOP,            bool,               BOUND, MAYBEDEFAULT, MAYBEVOID ),
215
27
        DECL_PROP_2     ( "Text",                   TEXT,               OUString,           BOUND, MAYBEDEFAULT ),
216
27
        DECL_PROP_3     ( "TextColor",              TEXTCOLOR,          sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
217
27
        DECL_PROP_3     ( "TextLineColor",          TEXTLINECOLOR,      sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
218
27
        DECL_DEP_PROP_3 ( "Time",                   TIME,               util::Time,         BOUND, MAYBEDEFAULT, MAYBEVOID ),
219
27
        DECL_PROP_2     ( "TimeFormat",             EXTTIMEFORMAT,      sal_Int16,          BOUND, MAYBEDEFAULT ),
220
27
        DECL_PROP_2     ( "TimeMax",                TIMEMAX,            util::Time,         BOUND, MAYBEDEFAULT ),
221
27
        DECL_PROP_2     ( "TimeMin",                TIMEMIN,            util::Time,         BOUND, MAYBEDEFAULT ),
222
27
        DECL_PROP_2     ( "Title",                  TITLE,              OUString,           BOUND, MAYBEDEFAULT ),
223
27
        DECL_PROP_2     ( "Toggle",                 TOGGLE,             bool,               BOUND, MAYBEDEFAULT ),
224
27
        DECL_PROP_3     ( "TreatAsNumber",          TREATASNUMBER,      bool,               BOUND, MAYBEDEFAULT,TRANSIENT ),
225
27
        DECL_PROP_2     ( "TriState",               TRISTATE,           bool,               BOUND, MAYBEDEFAULT ),
226
27
        DECL_PROP_2     ( "Unit",                   UNIT,               sal_Int16,          BOUND, MAYBEDEFAULT ),
227
27
        DECL_PROP_2     ( "VScroll",                VSCROLL,            bool,               BOUND, MAYBEDEFAULT ),
228
27
        DECL_DEP_PROP_3 ( "Value",                  VALUE_DOUBLE,       double,             BOUND, MAYBEDEFAULT, MAYBEVOID ),
229
27
        DECL_PROP_2     ( "ValueMax",               VALUEMAX_DOUBLE,    double,             BOUND, MAYBEDEFAULT ),
230
27
        DECL_PROP_2     ( "ValueMin",               VALUEMIN_DOUBLE,    double,             BOUND, MAYBEDEFAULT ),
231
27
        DECL_PROP_2     ( "ValueStep",              VALUESTEP_DOUBLE,   double,             BOUND, MAYBEDEFAULT ),
232
27
        DECL_PROP_3     ( "VerticalAlign",          VERTICALALIGN,      VerticalAlignment,  BOUND, MAYBEDEFAULT, MAYBEVOID ),
233
27
        DECL_DEP_PROP_3 ( "VisibleSize",            VISIBLESIZE,        sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
234
27
        DECL_PROP_2     ( "Activated",              ACTIVATED,          sal_Bool,           BOUND, MAYBEDEFAULT ),
235
27
        DECL_PROP_2     ( "Complete",               COMPLETE,           sal_Bool,           BOUND, MAYBEDEFAULT ),
236
27
        DECL_PROP_2     ( "CurrentItemID",          CURRENTITEMID,      sal_Int16,          BOUND, MAYBEDEFAULT ),
237
238
27
        DECL_PROP_2     ( "MouseWheelBehavior",     MOUSE_WHEEL_BEHAVIOUR,  sal_Int16,      BOUND, MAYBEDEFAULT ),
239
27
        DECL_PROP_2     ( "StepTime",               STEP_TIME,              sal_Int32,      BOUND, MAYBEDEFAULT ),
240
27
        DECL_PROP_2     ( "Decoration",             DECORATION,             sal_Bool,       BOUND, MAYBEDEFAULT ),
241
242
27
        DECL_PROP_2     ( "SelectionType",          TREE_SELECTIONTYPE,     css::view::SelectionType, BOUND, MAYBEDEFAULT ),
243
27
        DECL_PROP_2     ( "Editable",               TREE_EDITABLE,          sal_Bool,           BOUND, MAYBEDEFAULT ),
244
27
        DECL_PROP_3     ( "DataModel",              TREE_DATAMODEL,         Reference< css::awt::tree::XTreeDataModel >,BOUND, MAYBEDEFAULT, MAYBEVOID ),
245
27
        DECL_PROP_2     ( "RootDisplayed",          TREE_ROOTDISPLAYED,     sal_Bool,           BOUND, MAYBEDEFAULT ),
246
27
        DECL_PROP_2     ( "ShowsHandles",           TREE_SHOWSHANDLES,      sal_Bool,           BOUND, MAYBEDEFAULT ),
247
27
        DECL_PROP_2     ( "ShowsRootHandles",       TREE_SHOWSROOTHANDLES,  sal_Bool,           BOUND, MAYBEDEFAULT ),
248
27
        DECL_PROP_3     ( "RowHeight",              ROW_HEIGHT,             sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
249
27
        DECL_PROP_2     ( "InvokesStopNodeEditing", TREE_INVOKESSTOPNODEEDITING, sal_Bool,      BOUND, MAYBEDEFAULT ),
250
27
        DECL_PROP_2     ( "DialogSourceURL",        DIALOGSOURCEURL,        OUString,           BOUND, MAYBEDEFAULT ),
251
27
        DECL_PROP_2     ( "URL",                    URL,                    OUString,           BOUND, MAYBEDEFAULT ),
252
27
        DECL_PROP_2     ( "WritingMode",            WRITING_MODE,           sal_Int16,          BOUND, MAYBEDEFAULT ),
253
27
        DECL_PROP_3     ( "ContextWritingMode",     CONTEXT_WRITING_MODE,   sal_Int16,          BOUND, MAYBEDEFAULT, TRANSIENT ),
254
27
        DECL_PROP_2     ( "ShowRowHeader",          GRID_SHOWROWHEADER,     sal_Bool,           BOUND, MAYBEDEFAULT ),
255
27
        DECL_PROP_2     ( "RowHeaderWidth",         ROW_HEADER_WIDTH,       sal_Int32,          BOUND, MAYBEDEFAULT ),
256
27
        DECL_PROP_2     ( "ShowColumnHeader",       GRID_SHOWCOLUMNHEADER,  sal_Bool,           BOUND, MAYBEDEFAULT ),
257
27
        DECL_PROP_3     ( "ColumnHeaderHeight",     COLUMN_HEADER_HEIGHT,   sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
258
27
        DECL_PROP_1     ( "GridDataModel",          GRID_DATAMODEL,         Reference< css::awt::grid::XGridDataModel >, BOUND ),
259
27
        DECL_PROP_1     ( "ColumnModel",            GRID_COLUMNMODEL,       Reference< css::awt::grid::XGridColumnModel >, BOUND ),
260
27
        DECL_PROP_3     ( "SelectionModel",         GRID_SELECTIONMODE,     css::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ),
261
27
        DECL_PROP_2     ( "EnableVisible",          ENABLEVISIBLE,          sal_Bool,           BOUND, MAYBEDEFAULT ),
262
27
        DECL_PROP_3     ( "ReferenceDevice",        REFERENCE_DEVICE,       Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ),
263
27
        DECL_PROP_3     ( "HeaderBackgroundColor",  GRID_HEADER_BACKGROUND, sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
264
27
        DECL_PROP_3     ( "HeaderTextColor",        GRID_HEADER_TEXT_COLOR, sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
265
27
        DECL_PROP_3     ( "GridLineColor",          GRID_LINE_COLOR,        sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
266
27
        DECL_PROP_3     ( "RowBackgroundColors",    GRID_ROW_BACKGROUND_COLORS, Sequence< sal_Int32 >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
267
27
        DECL_PROP_2     ( "UseGridLines",           USE_GRID_LINES,         sal_Bool,           BOUND, MAYBEDEFAULT ),
268
27
        DECL_DEP_PROP_3 ( "MultiPageValue",         MULTIPAGEVALUE,         sal_Int32,          BOUND, MAYBEDEFAULT, MAYBEVOID ),
269
27
        DECL_PROP_3     ( "AllDialogChildren",      USERFORMCONTAINEES,     Reference< css::container::XNameContainer >, BOUND, MAYBEDEFAULT, MAYBEVOID ),
270
27
        DECL_PROP_3     ( "ActiveSelectionBackgroundColor",   ACTIVE_SEL_BACKGROUND_COLOR,   sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
271
27
        DECL_PROP_3     ( "InactiveSelectionBackgroundColor", INACTIVE_SEL_BACKGROUND_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
272
27
        DECL_PROP_3     ( "ActiveSelectionTextColor",         ACTIVE_SEL_TEXT_COLOR,         sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
273
27
        DECL_PROP_3     ( "InactiveSelectionTextColor",       INACTIVE_SEL_TEXT_COLOR,       sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ),
274
275
27
        DECL_PROP_2("Referer", REFERER, OUString, BOUND, MAYBEVOID),
276
27
    };
277
27
    return aImplPropertyInfos;
278
27
}
279
280
sal_uInt16 GetPropertyId( const OUString& rPropertyName )
281
0
{
282
0
    const ImpPropertyInfoMap & rMap = ImplGetPropertyInfos();
283
0
    auto it = rMap.find(rPropertyName);
284
0
    return it != rMap.end() ? it->second.nPropId : 0;
285
0
}
286
287
static const ImplPropertyInfo* ImplGetImplPropertyInfo( sal_uInt16 nPropertyId )
288
18
{
289
18
    const ImpPropertyInfoMap & rMap = ImplGetPropertyInfos();
290
291
18
    for (auto const & rPair : rMap)
292
2.33k
        if (rPair.second.nPropId == nPropertyId)
293
18
            return &rPair.second;
294
0
    return nullptr;
295
18
}
296
297
const OUString& GetPropertyName( sal_uInt16 nPropertyId )
298
9
{
299
9
    const ImpPropertyInfoMap & rMap = ImplGetPropertyInfos();
300
301
9
    for (auto const & rPair : rMap)
302
1.16k
        if (rPair.second.nPropId == nPropertyId)
303
9
            return rPair.first;
304
305
9
    assert(false && "Invalid PropertyId!");
306
0
    static const OUString EMPTY;
307
0
    return EMPTY;
308
9
}
309
310
const css::uno::Type* GetPropertyType( sal_uInt16 nPropertyId )
311
9
{
312
9
    const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
313
9
    DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
314
9
    return pImplPropertyInfo ? &pImplPropertyInfo->aType : nullptr;
315
9
}
316
317
sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId )
318
9
{
319
9
    const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
320
9
    DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
321
9
    return pImplPropertyInfo ? pImplPropertyInfo->nAttribs : 0;
322
9
}
323
324
bool DoesDependOnOthers( sal_uInt16 nPropertyId )
325
0
{
326
0
    const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
327
0
    DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
328
0
    return pImplPropertyInfo && pImplPropertyInfo->bDependsOnOthers;
329
0
}
330
331
bool CompareProperties( const css::uno::Any& r1, const css::uno::Any& r2 )
332
0
{
333
0
    return r1 == r2;
334
0
}
335
336
337
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */