Coverage Report

Created: 2026-09-28 10:59

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
25
namespace xmloff::token { enum XMLTokenEnum : sal_Int16; }
26
27
/** Map an XMLTokenEnum to an enum value.
28
 * To be used with SvXMLUnitConverter::convertEnum(...)
29
 * We store the enum internally as a fixed size field, since there are
30
 * places where we want to store a generic pointer to an array of SvXMLEnumMapEntry
31
 * and we don't want to templatize the class.
32
 */
33
template<typename EnumT>
34
struct SvXMLEnumMapEntry
35
{
36
private:
37
    ::xmloff::token::XMLTokenEnum   eToken;
38
    sal_uInt16                      nValue;
39
public:
40
    SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_)
41
71.6k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<SchXMLTools::SchXMLChartTypeEnum>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, SchXMLTools::SchXMLChartTypeEnum)
Line
Count
Source
41
765
        : 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
41
510
        : 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
41
408
        : 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
41
255
        : 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
41
714
        : 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
41
204
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<FontFamily>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, FontFamily)
Line
Count
Source
41
21
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<FontPitch>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, FontPitch)
Line
Count
Source
41
153
        : 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
41
255
        : 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
41
212
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<unsigned short>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, unsigned short)
Line
Count
Source
41
22.8k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<bool>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, bool)
Line
Count
Source
41
714
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<short>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, short)
Line
Count
Source
41
18.4k
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
XMLIndexTemplateContext.cxx:SvXMLEnumMapEntry<(anonymous namespace)::TemplateTokenType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, (anonymous namespace)::TemplateTokenType)
Line
Count
Source
41
459
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<signed char>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, signed char)
Line
Count
Source
41
265
        : 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
41
204
        : 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
41
306
        : 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
41
510
        : 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
41
357
        : 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
41
306
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
txtvfldi.cxx:SvXMLEnumMapEntry<(anonymous namespace)::ValueType>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, (anonymous namespace)::ValueType)
Line
Count
Source
41
40
        : 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
41
357
        : 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
41
204
        : 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
41
204
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<int>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, int)
Line
Count
Source
41
5.45k
        : 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
41
153
        : 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
41
408
        : 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
41
459
        : 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
41
255
        : 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
41
255
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<XMLEffect>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, XMLEffect)
Line
Count
Source
41
918
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<XMLEffectDirection>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, XMLEffectDirection)
Line
Count
Source
41
1.47k
        : 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
41
408
        : 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
41
765
        : 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
41
306
        : 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
41
204
        : 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
41
2.95k
        : 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
41
255
        : 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
41
204
        : 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
41
204
        : 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
41
408
        : 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
41
204
        : 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
41
204
        : 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
41
510
        : 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
41
255
        : 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
41
153
        : 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
41
612
        : 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
41
255
        : 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
41
255
        : 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
41
765
        : 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
41
255
        : 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
41
255
        : 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
41
204
        : 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
41
153
        : 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
41
204
        : 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
41
204
        : 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
41
255
        : 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
41
357
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<TriState>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, TriState)
Line
Count
Source
41
204
        : 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
41
306
        : 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
41
663
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<FontItalic>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, FontItalic)
Line
Count
Source
41
204
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<IndexTypeEnum>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, IndexTypeEnum)
Line
Count
Source
41
408
        : 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
41
55
        : 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
41
204
        : 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
41
306
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<SchXMLAxisDimension>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, SchXMLAxisDimension)
Line
Count
Source
41
204
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
SvXMLEnumMapEntry<SvxGraphicPosition>::SvXMLEnumMapEntry(xmloff::token::XMLTokenEnum, SvxGraphicPosition)
Line
Count
Source
41
100
        : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
42
2.36M
    ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
43
217k
    sal_uInt16                      GetValue() const { return nValue; }
44
};
45
46
#if defined(_MSC_VER)
47
// specialisation to avoid lots of "C2398: conversion from 'const sal_Int16' to 'sal_uInt16' requires a narrowing conversion"
48
// errors when compiling on MSVC
49
template<>
50
struct SvXMLEnumMapEntry<sal_uInt16>
51
{
52
private:
53
    ::xmloff::token::XMLTokenEnum   eToken;
54
    sal_uInt16                      nValue;
55
public:
56
    SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, sal_Int32 nValue_)
57
        : eToken(eToken_), nValue(nValue_) {}
58
    ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
59
    sal_uInt16                      GetValue() const { return nValue; }
60
};
61
#endif
62
63
#define ENUM_STRING_MAP_ENTRY(name,tok) { name, sizeof(name)-1, tok }
64
65
#define ENUM_STRING_MAP_END()           { nullptr, 0, 0 }
66
67
/** Map a const char* (with length) to a sal_uInt16 value.
68
 * To be used with SvXMLUnitConverter::convertEnum(...)
69
 */
70
template<typename EnumT>
71
struct SvXMLEnumStringMapEntry
72
{
73
private:
74
    const char *    pName;
75
    sal_Int32       nNameLength;
76
    sal_uInt16      nValue;
77
public:
78
    SvXMLEnumStringMapEntry(const char * pName_, sal_Int32 nNameLength_, EnumT nValue_)
79
5.20k
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
SvXMLEnumStringMapEntry<SectionTypeEnum>::SvXMLEnumStringMapEntry(char const*, int, SectionTypeEnum)
Line
Count
Source
79
408
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
XMLSectionExport.cxx:SvXMLEnumStringMapEntry<(anonymous namespace)::TemplateTypeEnum>::SvXMLEnumStringMapEntry(char const*, int, (anonymous namespace)::TemplateTypeEnum)
Line
Count
Source
79
510
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
XMLSectionExport.cxx:SvXMLEnumStringMapEntry<(anonymous namespace)::TemplateParamEnum>::SvXMLEnumStringMapEntry(char const*, int, (anonymous namespace)::TemplateParamEnum)
Line
Count
Source
79
561
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
SvXMLEnumStringMapEntry<FieldIdEnum>::SvXMLEnumStringMapEntry(char const*, int, FieldIdEnum)
Line
Count
Source
79
3.72k
        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
80
0
    const char * GetName() const { return pName; }
81
0
    sal_Int32    GetNameLength() const { return nNameLength; }
82
0
    EnumT        GetValue() const { return static_cast<EnumT>(nValue); }
83
};
84
85
#endif // INCLUDED_XMLOFF_XMLEMENT_HXX
86
87
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */