Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/xmloff/xmlement.hxx
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
#ifndef INCLUDED_XMLOFF_XMLEMENT_HXX
21
#define INCLUDED_XMLOFF_XMLEMENT_HXX
22
23
#include <sal/types.h>
24
#include <xmloff/xmltoken.hxx>
25
26
/** Map an XMLTokenEnum to an enum value.
27
 * To be used with SvXMLUnitConverter::convertEnum(...)
28
 * We store the enum internally as a fixed size field, since there are
29
 * places where we want to store a generic pointer to an array of SvXMLEnumMapEntry
30
 * and we don't want to templatize the class.
31
 */
32
template<typename EnumT>
33
struct SvXMLEnumMapEntry
34
{
35
private:
36
    ::xmloff::token::XMLTokenEnum   eToken;
37
    sal_uInt16                      nValue;
38
public:
39
    SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_)
40
81.3k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<SchXMLTools::SchXMLChartTypeEnum>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, SchXMLTools::SchXMLChartTypeEnum)
Line
Count
Source
40
754
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::Alignment>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::Alignment)
Line
Count
Source
40
580
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::EscapeDirection>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::EscapeDirection)
Line
Count
Source
40
464
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::DashStyle>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::DashStyle)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::awt::GradientStyle>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::awt::GradientStyle)
Line
Count
Source
40
812
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::HatchStyle>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::HatchStyle)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<FontFamily>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, FontFamily)
Line
Count
Source
40
35
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<FontPitch>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, FontPitch)
Line
Count
Source
40
174
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::ColorMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::ColorMode)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::text::HorizontalAdjust>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::text::HorizontalAdjust)
Line
Count
Source
40
248
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<unsigned short>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, unsigned short)
Line
Count
Source
40
25.9k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<bool>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, bool)
Line
Count
Source
40
812
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<short>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, short)
Line
Count
Source
40
21.0k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
XMLIndexTemplateContext.cxx:SvXMLEnumMapEntry<(anonymous namespace)::TemplateTokenType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, (anonymous namespace)::TemplateTokenType)
Line
Count
Source
40
522
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<signed char>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, signed char)
Line
Count
Source
40
310
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::style::VerticalAlignment>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::style::VerticalAlignment)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::text::RubyAdjust>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::text::RubyAdjust)
Line
Count
Source
40
348
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextVerticalAdjust>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextVerticalAdjust)
Line
Count
Source
40
580
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::text::WrapTextMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::text::WrapTextMode)
Line
Count
Source
40
406
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::text::TextContentAnchorType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::text::TextContentAnchorType)
Line
Count
Source
40
348
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
txtvfldi.cxx:SvXMLEnumMapEntry<(anonymous namespace)::ValueType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, (anonymous namespace)::ValueType)
Line
Count
Source
40
48
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::chart::ChartAxisLabelPosition>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::chart::ChartAxisLabelPosition)
Line
Count
Source
40
406
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::chart::ChartAxisMarkPosition>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::chart::ChartAxisMarkPosition)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::chart::ChartAxisArrangeOrderType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::chart::ChartAxisArrangeOrderType)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<int>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, int)
Line
Count
Source
40
6.20k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::chart::ChartDataRowSource>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::chart::ChartDataRowSource)
Line
Count
Source
40
174
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::LineStyle>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::LineStyle)
Line
Count
Source
40
464
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::FillStyle>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::FillStyle)
Line
Count
Source
40
522
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::chart::ChartLegendPosition>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::chart::ChartLegendPosition)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::chart::ChartLegendExpansion>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::chart::ChartLegendExpansion)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<XMLEffect>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, XMLEffect)
Line
Count
Source
40
1.04k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<XMLEffectDirection>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, XMLEffectDirection)
Line
Count
Source
40
1.68k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::presentation::AnimationSpeed>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::presentation::AnimationSpeed)
Line
Count
Source
40
464
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::presentation::ClickAction>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::presentation::ClickAction)
Line
Count
Source
40
870
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::LineJoint>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::LineJoint)
Line
Count
Source
40
348
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::LineCap>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::LineCap)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::presentation::FadeEffect>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::presentation::FadeEffect)
Line
Count
Source
40
3.36k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::ConnectorType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::ConnectorType)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::BitmapMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::BitmapMode)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::NormalsKind>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::NormalsKind)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextureProjectionMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextureProjectionMode)
Line
Count
Source
40
464
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextureKind2>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextureKind2)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextureMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextureMode)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::RectanglePoint>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::RectanglePoint)
Line
Count
Source
40
580
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::CircleKind>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::CircleKind)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::text::WritingMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::text::WritingMode)
Line
Count
Source
40
174
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextAnimationKind>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextAnimationKind)
Line
Count
Source
40
696
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextAnimationDirection>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextAnimationDirection)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextHorizontalAdjust>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextHorizontalAdjust)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::TextFitToSizeType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::TextFitToSizeType)
Line
Count
Source
40
870
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::MeasureTextHorzPos>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::MeasureTextHorzPos)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::drawing::MeasureTextVertPos>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::drawing::MeasureTextVertPos)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::form::FormSubmitEncoding>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::form::FormSubmitEncoding)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::form::FormSubmitMethod>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::form::FormSubmitMethod)
Line
Count
Source
40
174
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::form::NavigationBarMode>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::form::NavigationBarMode)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::form::TabulatorCycle>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::form::TabulatorCycle)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::form::FormButtonType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::form::FormButtonType)
Line
Count
Source
40
290
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::form::ListSourceType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::form::ListSourceType)
Line
Count
Source
40
406
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<TriState>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, TriState)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::style::GraphicLocation>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::style::GraphicLocation)
Line
Count
Source
40
348
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::style::ParagraphAdjust>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::style::ParagraphAdjust)
Line
Count
Source
40
754
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<FontItalic>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, FontItalic)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<IndexTypeEnum>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, IndexTypeEnum)
Line
Count
Source
40
464
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
XMLTextMarkImportContext.cxx:SvXMLEnumMapEntry<(anonymous namespace)::lcl_MarkType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, (anonymous namespace)::lcl_MarkType)
Line
Count
Source
40
66
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::text::PageNumberType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::text::PageNumberType)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<com::sun::star::style::TabAlign>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, com::sun::star::style::TabAlign)
Line
Count
Source
40
348
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<SchXMLAxisDimension>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, SchXMLAxisDimension)
Line
Count
Source
40
232
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<SvxGraphicPosition>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, SvxGraphicPosition)
Line
Count
Source
40
100
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
41
2.62M
    ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
42
258k
    sal_uInt16                      GetValue() const { return nValue; }
43
};
44
45
#if defined(_MSC_VER)
46
// specialisation to avoid lots of "C2398: conversion from 'const sal_Int16' to 'sal_uInt16' requires a narrowing conversion"
47
// errors when compiling on MSVC
48
template<>
49
struct SvXMLEnumMapEntry<sal_uInt16>
50
{
51
private:
52
    ::xmloff::token::XMLTokenEnum   eToken;
53
    sal_uInt16                      nValue;
54
public:
55
    SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, sal_Int32 nValue_)
56
        : eToken(eToken_), nValue(nValue_) {}
57
    ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
58
    sal_uInt16                      GetValue() const { return nValue; }
59
};
60
#endif
61
62
#define ENUM_STRING_MAP_ENTRY(name,tok) { name, sizeof(name)-1, tok }
63
64
#define ENUM_STRING_MAP_END()           { nullptr, 0, 0 }
65
66
/** Map a const char* (with length) to a sal_uInt16 value.
67
 * To be used with SvXMLUnitConverter::convertEnum(...)
68
 */
69
template<typename EnumT>
70
struct SvXMLEnumStringMapEntry
71
{
72
private:
73
    const char *    pName;
74
    sal_Int32       nNameLength;
75
    sal_uInt16      nValue;
76
public:
77
    SvXMLEnumStringMapEntry(const char * pName_, sal_Int32 nNameLength_, EnumT nValue_)
78
5.91k
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
SvXMLEnumStringMapEntry<SectionTypeEnum>::SvXMLEnumStringMapEntry(char const*, int, SectionTypeEnum)
Line
Count
Source
78
464
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
XMLSectionExport.cxx:SvXMLEnumStringMapEntry<(anonymous namespace)::TemplateTypeEnum>::SvXMLEnumStringMapEntry(char const*, int, (anonymous namespace)::TemplateTypeEnum)
Line
Count
Source
78
580
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
XMLSectionExport.cxx:SvXMLEnumStringMapEntry<(anonymous namespace)::TemplateParamEnum>::SvXMLEnumStringMapEntry(char const*, int, (anonymous namespace)::TemplateParamEnum)
Line
Count
Source
78
638
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
SvXMLEnumStringMapEntry<FieldIdEnum>::SvXMLEnumStringMapEntry(char const*, int, FieldIdEnum)
Line
Count
Source
78
4.23k
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
79
0
    const char * GetName() const { return pName; }
80
0
    sal_Int32    GetNameLength() const { return nNameLength; }
81
0
    EnumT        GetValue() const { return static_cast<EnumT>(nValue); }
82
};
83
84
#endif // INCLUDED_XMLOFF_XMLEMENT_HXX
85
86
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */