diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-09 09:04:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-13 09:02:22 +0000 |
commit | 7e9857c2935bb2533806db4e71c6cd1e171c3478 (patch) | |
tree | d9f8a6d4f94e19f349b67141359cc7c49130b5fc /xmloff/source/text/XMLTextMarkImportContext.cxx | |
parent | 7c0e3d0b37131b12262d0f610505b3384923c4a1 (diff) |
templatize SvXMLEnumMapEntry
in preparation for "scoped UNO enums".
This is a little hacky: In order to limit the scope of this change,
the templated SvXMLEnumMapEntry struct actually has a fixed size field,
and we cast it to SvXMLEnumMapEntry<sal_uInt16>* in various
places, to avoid carrying the type param around.
Change-Id: Idfbc5561303c557598dd5564b7a7259ae5261d83
Reviewed-on: https://gerrit.libreoffice.org/34987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/text/XMLTextMarkImportContext.cxx')
-rw-r--r-- | xmloff/source/text/XMLTextMarkImportContext.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 4f2159c3ab65..dff7c788b37c 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -111,18 +111,18 @@ enum lcl_MarkType { TypeReference, TypeReferenceStart, TypeReferenceEnd, TypeFieldmark, TypeFieldmarkStart, TypeFieldmarkEnd }; -static SvXMLEnumMapEntry const lcl_aMarkTypeMap[] = +static SvXMLEnumMapEntry<lcl_MarkType> const lcl_aMarkTypeMap[] = { - { XML_REFERENCE_MARK, TypeReference }, - { XML_REFERENCE_MARK_START, TypeReferenceStart }, - { XML_REFERENCE_MARK_END, TypeReferenceEnd }, - { XML_BOOKMARK, TypeBookmark }, - { XML_BOOKMARK_START, TypeBookmarkStart }, - { XML_BOOKMARK_END, TypeBookmarkEnd }, - { XML_FIELDMARK, TypeFieldmark }, - { XML_FIELDMARK_START, TypeFieldmarkStart }, - { XML_FIELDMARK_END, TypeFieldmarkEnd }, - { XML_TOKEN_INVALID, 0 }, + { XML_REFERENCE_MARK, TypeReference }, + { XML_REFERENCE_MARK_START, TypeReferenceStart }, + { XML_REFERENCE_MARK_END, TypeReferenceEnd }, + { XML_BOOKMARK, TypeBookmark }, + { XML_BOOKMARK_START, TypeBookmarkStart }, + { XML_BOOKMARK_END, TypeBookmarkEnd }, + { XML_FIELDMARK, TypeFieldmark }, + { XML_FIELDMARK_START, TypeFieldmarkStart }, + { XML_FIELDMARK_END, TypeFieldmarkEnd }, + { XML_TOKEN_INVALID, (lcl_MarkType)0 }, }; @@ -180,11 +180,11 @@ void XMLTextMarkImportContext::EndElement() if (!m_sBookmarkName.isEmpty()) { - sal_uInt16 nTmp; + lcl_MarkType nTmp; if (SvXMLUnitConverter::convertEnum(nTmp, GetLocalName(), lcl_aMarkTypeMap)) { - switch ((lcl_MarkType)nTmp) + switch (nTmp) { case TypeReference: // export point reference mark |