Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/xmloff/source/style/prhdlfac.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 <xmloff/prhdlfac.hxx>
21
22
#include <com/sun/star/drawing/ColorMode.hpp>
23
#include <com/sun/star/text/HorizontalAdjust.hpp>
24
#include <com/sun/star/text/WritingMode2.hpp>
25
#include <com/sun/star/text/VertOrientation.hpp>
26
#include <com/sun/star/text/ScriptHintType.hpp>
27
28
#include <sal/log.hxx>
29
#include <xmloff/xmlement.hxx>
30
#include <xmloff/xmltypes.hxx>
31
#include <xmloff/xmltoken.hxx>
32
#include <xmloff/xmlprhdl.hxx>
33
#include <xmlbahdl.hxx>
34
#include <xmloff/NamedBoolPropertyHdl.hxx>
35
#include <xmloff/XMLConstantsPropertyHandler.hxx>
36
#include "cdouthdl.hxx"
37
#include "csmaphdl.hxx"
38
#include "fonthdl.hxx"
39
#include "kernihdl.hxx"
40
#include "postuhdl.hxx"
41
#include "shadwhdl.hxx"
42
#include "shdwdhdl.hxx"
43
#include "undlihdl.hxx"
44
#include "weighhdl.hxx"
45
#include "breakhdl.hxx"
46
#include "adjushdl.hxx"
47
#include "escphdl.hxx"
48
#include "chrhghdl.hxx"
49
#include "chrlohdl.hxx"
50
#include "lspachdl.hxx"
51
#include "bordrhdl.hxx"
52
#include "tabsthdl.hxx"
53
#include <xmloff/EnumPropertyHdl.hxx>
54
#include <AttributeContainerHandler.hxx>
55
#include "durationhdl.hxx"
56
#include <XMLRectangleMembersHandler.hxx>
57
#include <XMLNumberWithAutoForVoidPropHdl.hxx>
58
#include "DrawAspectHdl.hxx"
59
#include <xmloff/XMLComplexColorHandler.hxx>
60
61
#include <map>
62
63
using namespace ::com::sun::star;
64
using namespace ::xmloff::token;
65
66
SvXMLEnumMapEntry<drawing::ColorMode> const aXML_ColorMode_EnumMap[] =
67
{
68
    { XML_GREYSCALE,    drawing::ColorMode_GREYS },
69
    { XML_MONO,         drawing::ColorMode_MONO },
70
    { XML_WATERMARK,    drawing::ColorMode_WATERMARK },
71
    { XML_STANDARD,     drawing::ColorMode_STANDARD },
72
    { XML_TOKEN_INVALID, drawing::ColorMode(0) }
73
};
74
75
SvXMLEnumMapEntry<text::HorizontalAdjust> const aXML_HorizontalAdjust_Enum[] =
76
{
77
    { XML_LEFT,     text::HorizontalAdjust_LEFT },
78
    { XML_CENTER,   text::HorizontalAdjust_CENTER },
79
    { XML_RIGHT,    text::HorizontalAdjust_RIGHT },
80
    { XML_TOKEN_INVALID, text::HorizontalAdjust(0) }
81
};
82
83
// aXML_WritingDirection_Enum is used with and without 'page'
84
// attribute, so you'll find uses of aXML_WritingDirection_Enum
85
// directly, as well as &(aXML_WritingDirection_Enum[1])
86
SvXMLEnumMapEntry<sal_uInt16> const aXML_WritingDirection_Enum[] =
87
{
88
    // aXML_WritingDirection_Enum
89
    { XML_PAGE,     text::WritingMode2::PAGE },
90
91
    // &(aXML_WritingDirection_Enum[1])
92
    { XML_LR_TB,    text::WritingMode2::LR_TB },
93
    { XML_RL_TB,    text::WritingMode2::RL_TB },
94
    { XML_TB_RL,    text::WritingMode2::TB_RL },
95
    { XML_TB_LR,    text::WritingMode2::TB_LR },
96
    { XML_BT_LR,    text::WritingMode2::BT_LR },
97
98
    // alternative names of the above, as accepted by XSL
99
    { XML_LR,       text::WritingMode2::LR_TB },
100
    { XML_RL,       text::WritingMode2::RL_TB },
101
    { XML_TB,       text::WritingMode2::TB_RL },
102
103
    // vertical as clockwise 90deg rotation, for OOXML vert="vert"
104
    { XML_TB_RL90,     text::WritingMode2::TB_RL90 },
105
106
    { XML_TOKEN_INVALID, 0 }
107
};
108
109
SvXMLEnumMapEntry<sal_uInt16> const pXML_VertPos_Enum[] =
110
{
111
    { XML_FROM_TOP,         text::VertOrientation::NONE       },
112
    { XML_TOP,              text::VertOrientation::TOP        },
113
    { XML_TOP,              text::VertOrientation::CHAR_TOP   },  // export only
114
    { XML_TOP,              text::VertOrientation::LINE_TOP   },  // export only
115
    { XML_MIDDLE,           text::VertOrientation::CENTER     },
116
    { XML_MIDDLE,           text::VertOrientation::CHAR_CENTER    },  // export only
117
    { XML_MIDDLE,           text::VertOrientation::LINE_CENTER    },  // export only
118
    { XML_BOTTOM,           text::VertOrientation::BOTTOM         },
119
    { XML_BOTTOM,           text::VertOrientation::CHAR_BOTTOM    },  // export only
120
    { XML_BOTTOM,           text::VertOrientation::LINE_BOTTOM    },  // export only
121
    { XML_BELOW,            text::VertOrientation::CHAR_BOTTOM    },  // import only
122
    { XML_TOKEN_INVALID, 0 }
123
};
124
125
SvXMLEnumMapEntry<sal_uInt16> const pXML_ScriptType_Enum[]
126
    = { { XML_IGNORE, text::ScriptHintType::IGNORE },
127
        { XML_LATIN, text::ScriptHintType::LATIN },
128
        { XML_ASIAN, text::ScriptHintType::ASIAN },
129
        { XML_COMPLEX, text::ScriptHintType::COMPLEX },
130
        { XML_TOKEN_INVALID, text::ScriptHintType::AUTOMATIC } };
131
132
typedef std::map<sal_Int32, const XMLPropertyHandler*> CacheMap;
133
134
struct XMLPropertyHandlerFactory::Impl
135
{
136
    mutable CacheMap maHandlerCache;
137
};
138
139
XMLPropertyHandlerFactory::XMLPropertyHandlerFactory() :
140
364k
    mpImpl(new Impl) {}
141
142
XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory()
143
364k
{
144
364k
    for( const auto& rCacheEntry : mpImpl->maHandlerCache )
145
19.0M
        delete rCacheEntry.second;
146
364k
}
147
148
// Interface
149
const XMLPropertyHandler* XMLPropertyHandlerFactory::GetPropertyHandler( sal_Int32 nType ) const
150
46.3M
{
151
46.3M
    SAL_WARN_IF( (nType & ~(sal_uInt32(MID_FLAG_MASK))) != 0, "xmloff",
152
46.3M
                "GetPropertyHandler called with flags in type" );
153
46.3M
    return GetBasicHandler( nType );
154
46.3M
}
155
156
// Helper-methods to create and cache PropertyHandler
157
const XMLPropertyHandler* XMLPropertyHandlerFactory::GetHdlCache( sal_Int32 nType ) const
158
46.3M
{
159
46.3M
    const XMLPropertyHandler* pRet = nullptr;
160
161
46.3M
    if( mpImpl->maHandlerCache.find( nType ) != mpImpl->maHandlerCache.end() )
162
27.3M
        pRet = mpImpl->maHandlerCache.find( nType )->second;
163
164
46.3M
    return pRet;
165
46.3M
}
166
167
void XMLPropertyHandlerFactory::PutHdlCache( sal_Int32 nType, const XMLPropertyHandler* pHdl ) const
168
19.0M
{
169
19.0M
    mpImpl->maHandlerCache[nType] = pHdl;
170
19.0M
}
171
172
const XMLPropertyHandler* XMLPropertyHandlerFactory::GetBasicHandler( sal_Int32 nType ) const
173
46.3M
{
174
46.3M
    const XMLPropertyHandler* pPropHdl = GetHdlCache( nType );
175
46.3M
    if( pPropHdl )
176
27.3M
        return pPropHdl;
177
178
19.0M
    std::unique_ptr<XMLPropertyHandler> pNewPropHdl = CreatePropertyHandler( nType );
179
19.0M
    if( pNewPropHdl )
180
11.8M
        PutHdlCache( nType, pNewPropHdl.get() );
181
19.0M
    return pNewPropHdl.release();
182
46.3M
}
183
184
std::unique_ptr<XMLPropertyHandler> XMLPropertyHandlerFactory::CreatePropertyHandler( sal_Int32 nType )
185
19.0M
{
186
19.0M
    std::unique_ptr<XMLPropertyHandler> pPropHdl;
187
188
19.0M
    switch( nType )
189
19.0M
    {
190
325k
        case XML_TYPE_BOOL :
191
325k
            pPropHdl.reset(new XMLBoolPropHdl);
192
325k
            break;
193
0
        case XML_TYPE_BOOL_FALSE :
194
0
            pPropHdl.reset(new XMLBoolFalsePropHdl);
195
0
            break;
196
296k
        case XML_TYPE_MEASURE :
197
296k
            pPropHdl.reset(new XMLMeasurePropHdl( 4 ));
198
296k
            break;
199
0
        case XML_TYPE_MEASURE8 :
200
0
            pPropHdl.reset(new XMLMeasurePropHdl( 1 ));
201
0
            break;
202
41.2k
        case XML_TYPE_MEASURE16:
203
41.2k
            pPropHdl.reset(new XMLMeasurePropHdl( 2 ));
204
41.2k
            break;
205
97.2k
        case XML_TYPE_UNIT_MEASURE:
206
97.2k
            pPropHdl = std::make_unique<XMLUnitMeasurePropHdl>();
207
97.2k
            break;
208
182k
        case XML_TYPE_PERCENT :
209
182k
            pPropHdl.reset(new XMLPercentPropHdl( 4 ));
210
182k
            break;
211
47.6k
        case XML_TYPE_PERCENT8 :
212
47.6k
            pPropHdl.reset(new XMLPercentPropHdl( 1 ));
213
47.6k
            break;
214
216k
        case XML_TYPE_PERCENT16 :
215
216k
            pPropHdl.reset(new XMLPercentPropHdl( 2 ));
216
216k
            break;
217
0
        case XML_TYPE_PERCENT100:
218
0
            pPropHdl.reset(new XML100thPercentPropHdl);
219
0
            break;
220
81.0k
        case XML_TYPE_DOUBLE_PERCENT :
221
81.0k
            pPropHdl.reset(new XMLDoublePercentPropHdl);
222
81.0k
            break;
223
81.0k
        case XML_TYPE_NEG_PERCENT :
224
81.0k
            pPropHdl.reset(new XMLNegPercentPropHdl( 4 ));
225
81.0k
            break;
226
0
        case XML_TYPE_NEG_PERCENT8 :
227
0
            pPropHdl.reset(new XMLNegPercentPropHdl( 1 ));
228
0
            break;
229
217k
        case XML_TYPE_NEG_PERCENT16 :
230
217k
            pPropHdl.reset(new XMLNegPercentPropHdl( 2 ));
231
217k
            break;
232
81.0k
        case XML_TYPE_MEASURE_PX :
233
81.0k
            pPropHdl.reset(new XMLMeasurePxPropHdl( 4 ));
234
81.0k
            break;
235
296k
        case XML_TYPE_STRING :
236
296k
            pPropHdl.reset(new XMLStringPropHdl);
237
296k
            break;
238
217k
        case XML_TYPE_COLOR :
239
217k
            pPropHdl.reset(new XMLColorPropHdl);
240
217k
            break;
241
131k
        case XML_TYPE_HEX :
242
131k
            pPropHdl.reset(new XMLHexPropHdl);
243
131k
            break;
244
213k
        case XML_TYPE_NUMBER :
245
213k
            pPropHdl.reset(new XMLNumberPropHdl( 4 ));
246
213k
            break;
247
97.2k
        case XML_TYPE_NUMBER8 :
248
97.2k
            pPropHdl.reset(new XMLNumberPropHdl( 1 ));
249
97.2k
            break;
250
192k
        case XML_TYPE_NUMBER16:
251
192k
            pPropHdl.reset(new XMLNumberPropHdl( 2 ));
252
192k
            break;
253
0
        case XML_TYPE_NUMBER_NONE :
254
0
            pPropHdl.reset(new XMLNumberNonePropHdl);
255
0
            break;
256
0
        case XML_TYPE_NUMBER8_NONE :
257
0
            pPropHdl.reset(new XMLNumberNonePropHdl( 1 ));
258
0
            break;
259
97.2k
        case XML_TYPE_NUMBER16_NONE :
260
97.2k
            pPropHdl.reset(new XMLNumberNonePropHdl( 2 ));
261
97.2k
            break;
262
64
        case XML_TYPE_DOUBLE :
263
64
            pPropHdl.reset(new XMLDoublePropHdl);
264
64
            break;
265
34.7k
        case XML_TYPE_NBOOL :
266
34.7k
            pPropHdl.reset(new XMLNBoolPropHdl);
267
34.7k
            break;
268
261k
        case XML_TYPE_COLORTRANSPARENT :
269
261k
            pPropHdl.reset(new XMLColorTransparentPropHdl);
270
261k
            break;
271
251k
        case XML_TYPE_ISTRANSPARENT :
272
251k
            pPropHdl.reset(new XMLIsTransparentPropHdl);
273
251k
            break;
274
176k
        case XML_TYPE_COLORAUTO :
275
176k
            pPropHdl.reset(new XMLColorAutoPropHdl);
276
176k
            break;
277
138k
        case XML_TYPE_ISAUTOCOLOR :
278
138k
            pPropHdl.reset(new XMLIsAutoColorPropHdl);
279
138k
            break;
280
254k
        case XML_TYPE_BUILDIN_CMP_ONLY :
281
254k
            pPropHdl.reset(new XMLCompareOnlyPropHdl);
282
254k
            break;
283
284
37.1k
        case XML_TYPE_RECTANGLE_LEFT :
285
74.3k
        case XML_TYPE_RECTANGLE_TOP :
286
111k
        case XML_TYPE_RECTANGLE_WIDTH :
287
148k
        case XML_TYPE_RECTANGLE_HEIGHT :
288
148k
            pPropHdl.reset(new XMLRectangleMembersHdl( nType ));
289
148k
            break;
290
291
138k
        case XML_TYPE_TEXT_CROSSEDOUT_TYPE:
292
138k
            pPropHdl.reset(new XMLCrossedOutTypePropHdl) ;
293
138k
            break;
294
138k
        case XML_TYPE_TEXT_CROSSEDOUT_STYLE:
295
138k
            pPropHdl.reset(new XMLCrossedOutStylePropHdl) ;
296
138k
            break;
297
138k
        case XML_TYPE_TEXT_CROSSEDOUT_WIDTH:
298
138k
            pPropHdl.reset(new XMLCrossedOutWidthPropHdl) ;
299
138k
            break;
300
138k
        case XML_TYPE_TEXT_CROSSEDOUT_TEXT:
301
138k
            pPropHdl.reset(new XMLCrossedOutTextPropHdl) ;
302
138k
            break;
303
0
        case XML_TYPE_TEXT_BOOLCROSSEDOUT:
304
0
            pPropHdl.reset(new XMLNamedBoolPropertyHdl(
305
0
                GetXMLToken(XML_SOLID),
306
0
                GetXMLToken(XML_NONE) ));
307
0
            break;
308
131k
        case XML_TYPE_TEXT_ESCAPEMENT:
309
131k
            pPropHdl.reset(new XMLEscapementPropHdl);
310
131k
            break;
311
131k
        case XML_TYPE_TEXT_ESCAPEMENT_HEIGHT:
312
131k
            pPropHdl.reset(new XMLEscapementHeightPropHdl);
313
131k
            break;
314
131k
        case XML_TYPE_TEXT_CASEMAP:
315
131k
            pPropHdl.reset(new XMLCaseMapPropHdl);
316
131k
            break;
317
131k
        case XML_TYPE_TEXT_CASEMAP_VAR:
318
131k
            pPropHdl.reset(new XMLCaseMapVariantHdl);
319
131k
            break;
320
138k
        case XML_TYPE_TEXT_FONTFAMILYNAME:
321
138k
            pPropHdl.reset(new XMLFontFamilyNamePropHdl);
322
138k
            break;
323
138k
        case XML_TYPE_TEXT_FONTFAMILY:
324
138k
            pPropHdl.reset(new XMLFontFamilyPropHdl);
325
138k
            break;
326
138k
        case XML_TYPE_TEXT_FONTENCODING:
327
138k
            pPropHdl.reset(new XMLFontEncodingPropHdl);
328
138k
            break;
329
138k
        case XML_TYPE_TEXT_FONTPITCH:
330
138k
            pPropHdl.reset(new XMLFontPitchPropHdl);
331
138k
            break;
332
131k
        case XML_TYPE_TEXT_KERNING:
333
131k
            pPropHdl.reset(new XMLKerningPropHdl);
334
131k
            break;
335
138k
        case XML_TYPE_TEXT_POSTURE:
336
138k
            pPropHdl.reset(new XMLPosturePropHdl);
337
138k
            break;
338
138k
        case XML_TYPE_TEXT_SHADOWED:
339
138k
            pPropHdl.reset(new XMLShadowedPropHdl);
340
138k
            break;
341
138k
        case XML_TYPE_TEXT_UNDERLINE_TYPE:
342
138k
            pPropHdl.reset(new XMLUnderlineTypePropHdl);
343
138k
            break;
344
138k
        case XML_TYPE_TEXT_UNDERLINE_STYLE:
345
138k
            pPropHdl.reset(new XMLUnderlineStylePropHdl);
346
138k
            break;
347
138k
        case XML_TYPE_TEXT_UNDERLINE_WIDTH:
348
138k
            pPropHdl.reset(new XMLUnderlineWidthPropHdl);
349
138k
            break;
350
138k
        case XML_TYPE_TEXT_UNDERLINE_COLOR:
351
138k
            pPropHdl.reset(new XMLColorTransparentPropHdl( XML_FONT_COLOR ));
352
138k
            break;
353
138k
        case XML_TYPE_TEXT_UNDERLINE_HASCOLOR:
354
138k
            pPropHdl.reset(new XMLIsTransparentPropHdl( XML_FONT_COLOR,
355
138k
                                                     false ));
356
138k
            break;
357
131k
        case XML_TYPE_TEXT_OVERLINE_TYPE:
358
131k
            pPropHdl.reset(new XMLUnderlineTypePropHdl);
359
131k
            break;
360
131k
        case XML_TYPE_TEXT_OVERLINE_STYLE:
361
131k
            pPropHdl.reset(new XMLUnderlineStylePropHdl);
362
131k
            break;
363
131k
        case XML_TYPE_TEXT_OVERLINE_WIDTH:
364
131k
            pPropHdl.reset(new XMLUnderlineWidthPropHdl);
365
131k
            break;
366
131k
        case XML_TYPE_TEXT_OVERLINE_COLOR:
367
131k
            pPropHdl.reset(new XMLColorTransparentPropHdl( XML_FONT_COLOR ));
368
131k
            break;
369
131k
        case XML_TYPE_TEXT_OVERLINE_HASCOLOR:
370
131k
            pPropHdl.reset(new XMLIsTransparentPropHdl( XML_FONT_COLOR,
371
131k
                                                     false ));
372
131k
            break;
373
138k
        case XML_TYPE_TEXT_WEIGHT:
374
138k
            pPropHdl.reset(new XMLFontWeightPropHdl);
375
138k
            break;
376
97.2k
        case XML_TYPE_TEXT_SPLIT:
377
97.2k
            pPropHdl.reset(new XMLNamedBoolPropertyHdl(
378
97.2k
                GetXMLToken(XML_AUTO),
379
97.2k
                GetXMLToken(XML_ALWAYS) ));
380
97.2k
            break;
381
97.2k
        case XML_TYPE_TEXT_BREAKBEFORE:
382
97.2k
            pPropHdl.reset(new XMLFmtBreakBeforePropHdl);
383
97.2k
            break;
384
97.2k
        case XML_TYPE_TEXT_BREAKAFTER:
385
97.2k
            pPropHdl.reset(new XMLFmtBreakAfterPropHdl);
386
97.2k
            break;
387
217k
        case XML_TYPE_TEXT_SHADOW:
388
217k
            pPropHdl.reset(new XMLShadowPropHdl);
389
217k
            break;
390
104k
        case XML_TYPE_TEXT_ADJUST:
391
104k
            pPropHdl.reset(new XMLParaAdjustPropHdl);
392
104k
            break;
393
97.2k
        case XML_TYPE_TEXT_ADJUSTLAST:
394
97.2k
            pPropHdl.reset(new XMLLastLineAdjustPropHdl);
395
97.2k
            break;
396
138k
        case XML_TYPE_CHAR_HEIGHT:
397
138k
            pPropHdl.reset(new XMLCharHeightHdl);
398
138k
            break;
399
131k
        case XML_TYPE_CHAR_HEIGHT_PROP:
400
131k
            pPropHdl.reset(new XMLCharHeightPropHdl);
401
131k
            break;
402
131k
        case XML_TYPE_CHAR_HEIGHT_DIFF:
403
131k
            pPropHdl.reset(new XMLCharHeightDiffHdl);
404
131k
            break;
405
131k
        case XML_TYPE_CHAR_RFC_LANGUAGE_TAG:
406
131k
            pPropHdl.reset(new XMLCharRfcLanguageTagHdl);
407
131k
            break;
408
131k
        case XML_TYPE_CHAR_LANGUAGE:
409
131k
            pPropHdl.reset(new XMLCharLanguageHdl);
410
131k
            break;
411
131k
        case XML_TYPE_CHAR_SCRIPT:
412
131k
            pPropHdl.reset(new XMLCharScriptHdl);
413
131k
            break;
414
131k
        case XML_TYPE_CHAR_COUNTRY:
415
131k
            pPropHdl.reset(new XMLCharCountryHdl);
416
131k
            break;
417
97.2k
        case XML_TYPE_LINE_SPACE_FIXED:
418
97.2k
            pPropHdl.reset(new XMLLineHeightHdl);
419
97.2k
            break;
420
97.2k
        case XML_TYPE_LINE_SPACE_MINIMUM:
421
97.2k
            pPropHdl.reset(new XMLLineHeightAtLeastHdl);
422
97.2k
            break;
423
97.2k
        case XML_TYPE_LINE_SPACE_DISTANCE:
424
97.2k
            pPropHdl.reset(new XMLLineSpacingHdl);
425
97.2k
            break;
426
217k
        case XML_TYPE_BORDER_WIDTH:
427
217k
            pPropHdl.reset(new XMLBorderWidthHdl);
428
217k
            break;
429
226k
        case XML_TYPE_BORDER:
430
226k
            pPropHdl.reset(new XMLBorderHdl);
431
226k
            break;
432
97.2k
        case XML_TYPE_TEXT_TABSTOP:
433
97.2k
            pPropHdl.reset(new XMLTabStopPropHdl);
434
97.2k
            break;
435
226k
        case XML_TYPE_ATTRIBUTE_CONTAINER:
436
226k
            pPropHdl.reset(new XMLAttributeContainerHandler);
437
226k
            break;
438
81.0k
        case XML_TYPE_COLOR_MODE:
439
81.0k
            pPropHdl.reset(new XMLEnumPropertyHdl(aXML_ColorMode_EnumMap));
440
81.0k
            break;
441
37.1k
        case XML_TYPE_DURATION16_MS:
442
37.1k
            pPropHdl.reset(new XMLDurationMS16PropHdl_Impl);
443
37.1k
            break;
444
3.72k
        case XML_TYPE_TEXT_HORIZONTAL_ADJUST:
445
3.72k
            pPropHdl.reset(new XMLEnumPropertyHdl(aXML_HorizontalAdjust_Enum));
446
3.72k
            break;
447
81.0k
        case XML_TYPE_TEXT_DRAW_ASPECT:
448
81.0k
            pPropHdl.reset(new DrawAspectHdl);
449
81.0k
            break;
450
41.2k
        case XML_TYPE_TEXT_WRITING_MODE:
451
41.2k
            pPropHdl.reset(new XMLConstantsPropertyHandler(
452
41.2k
                &(aXML_WritingDirection_Enum[1]),
453
41.2k
                XML_LR_TB));
454
41.2k
            break;
455
220k
        case XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT:
456
220k
            pPropHdl.reset(new XMLConstantsPropertyHandler(
457
220k
                aXML_WritingDirection_Enum,
458
220k
                XML_PAGE));
459
220k
            break;
460
131k
        case XML_TYPE_TEXT_HIDDEN_AS_DISPLAY:
461
131k
            pPropHdl.reset(new XMLNamedBoolPropertyHdl(
462
131k
                GetXMLToken(XML_NONE),
463
131k
                GetXMLToken(XML_TRUE) ));
464
131k
            break;
465
182k
        case XML_TYPE_STYLENAME :
466
182k
            pPropHdl.reset(new XMLStyleNamePropHdl);
467
182k
            break;
468
0
        case XML_TYPE_NUMBER_NO_ZERO:
469
0
            pPropHdl.reset(new XMLNumberWithoutZeroPropHdl( 4 ));
470
0
            break;
471
0
        case XML_TYPE_NUMBER8_NO_ZERO:
472
0
            pPropHdl.reset(new XMLNumberWithoutZeroPropHdl( 1 ));
473
0
            break;
474
97.2k
        case XML_TYPE_NUMBER16_NO_ZERO:
475
97.2k
            pPropHdl.reset(new XMLNumberWithoutZeroPropHdl( 2 ));
476
97.2k
            break;
477
97.2k
        case XML_TYPE_NUMBER16_AUTO:
478
97.2k
            pPropHdl.reset(new XMLNumberWithAutoForVoidPropHdl);
479
97.2k
            break;
480
50.7k
        case XML_TYPE_TEXT_VERTICAL_POS:
481
50.7k
            pPropHdl.reset(new XMLConstantsPropertyHandler( pXML_VertPos_Enum, XML_TOKEN_INVALID ));
482
50.7k
        break;
483
37.1k
        case XML_TYPE_TEXT_OVERFLOW_BEHAVIOR:
484
            // auto-create-new-frame isn't properly implemented yet. It just means don't clip.
485
37.1k
            pPropHdl.reset(new XMLNamedBoolPropertyHdl(GetXMLToken(XML_CLIP),
486
37.1k
                                                       GetXMLToken(XML_AUTO_CREATE_NEW_FRAME)));
487
37.1k
            break;
488
213k
        case XML_TYPE_COMPLEX_COLOR:
489
213k
            pPropHdl.reset(new XMLComplexColorHandler);
490
213k
            break;
491
131k
        case XML_TYPE_TEXT_SCRIPT_TYPE:
492
131k
            pPropHdl = std::make_unique<XMLConstantsPropertyHandler>(pXML_ScriptType_Enum,
493
131k
                                                                     XML_TOKEN_INVALID);
494
131k
            break;
495
19.0M
    }
496
497
19.0M
    return pPropHdl;
498
19.0M
}
499
500
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */