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/style/HatchStyle.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/style/HatchStyle.cxx')
-rw-r--r-- | xmloff/source/style/HatchStyle.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx index 99dddb2e692c..81a27084de93 100644 --- a/xmloff/source/style/HatchStyle.cxx +++ b/xmloff/source/style/HatchStyle.cxx @@ -49,12 +49,12 @@ enum SvXMLTokenMapAttrs XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN }; -SvXMLEnumMapEntry const pXML_HatchStyle_Enum[] = +SvXMLEnumMapEntry<drawing::HatchStyle> const pXML_HatchStyle_Enum[] = { { XML_HATCHSTYLE_SINGLE, drawing::HatchStyle_SINGLE }, { XML_HATCHSTYLE_DOUBLE, drawing::HatchStyle_DOUBLE }, { XML_HATCHSTYLE_TRIPLE, drawing::HatchStyle_TRIPLE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::HatchStyle)0 } }; // Import @@ -86,7 +86,6 @@ void XMLHatchStyleImport::importXML( XML_TOKEN_MAP_END }; - bool bHasStyle = false; OUString aDisplayName; drawing::Hatch aHatch; @@ -116,12 +115,7 @@ void XMLHatchStyleImport::importXML( aDisplayName = rStrValue; break; case XML_TOK_HATCH_STYLE: - { - sal_uInt16 eValue; - bHasStyle = SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_HatchStyle_Enum ); - if( bHasStyle ) - aHatch.Style = (drawing::HatchStyle) eValue; - } + SvXMLUnitConverter::convertEnum( aHatch.Style, rStrValue, pXML_HatchStyle_Enum ); break; case XML_TOK_HATCH_COLOR: ::sax::Converter::convertColor(aHatch.Color, rStrValue); |