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/draw/animimp.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/draw/animimp.cxx')
-rw-r--r-- | xmloff/source/draw/animimp.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index 3b6ce8d87c34..fb520bb9e3b7 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -48,7 +48,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::presentation; using namespace ::xmloff::token; -const SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[] = +const SvXMLEnumMapEntry<XMLEffect> aXML_AnimationEffect_EnumMap[] = { { XML_NONE, EK_none }, { XML_FADE, EK_fade }, @@ -67,10 +67,10 @@ const SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[] = { XML_CHECKERBOARD, EK_checkerboard }, { XML_ROTATE, EK_rotate }, { XML_STRETCH, EK_stretch }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (XMLEffect)0 } }; -const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[] = +const SvXMLEnumMapEntry<XMLEffectDirection> aXML_AnimationDirection_EnumMap[] = { { XML_NONE, ED_none }, { XML_FROM_LEFT, ED_from_left }, @@ -100,15 +100,15 @@ const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[] = { XML_TO_CENTER, ED_to_center }, { XML_CLOCKWISE, ED_clockwise }, { XML_COUNTER_CLOCKWISE,ED_cclockwise }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (XMLEffectDirection)0 } }; -const SvXMLEnumMapEntry aXML_AnimationSpeed_EnumMap[] = +const SvXMLEnumMapEntry<AnimationSpeed> aXML_AnimationSpeed_EnumMap[] = { { XML_SLOW, AnimationSpeed_SLOW }, { XML_MEDIUM, AnimationSpeed_MEDIUM }, { XML_FAST, AnimationSpeed_FAST }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (AnimationSpeed)0 } }; AnimationEffect ImplSdXMLgetEffect( XMLEffect eKind, XMLEffectDirection eDirection, sal_Int16 nStartScale, bool /*bIn*/ ) @@ -496,15 +496,11 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s case XML_NAMESPACE_PRESENTATION: if( IsXMLToken( aLocalName, XML_EFFECT ) ) { - sal_uInt16 eEnum; - if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) ) - meEffect = (XMLEffect)eEnum; + SvXMLUnitConverter::convertEnum( meEffect, sValue, aXML_AnimationEffect_EnumMap ); } else if( IsXMLToken(aLocalName, XML_DIRECTION ) ) { - sal_uInt16 eEnum; - if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) ) - meDirection = (XMLEffectDirection)eEnum; + SvXMLUnitConverter::convertEnum( meDirection, sValue, aXML_AnimationDirection_EnumMap ); } else if( IsXMLToken( aLocalName, XML_START_SCALE ) ) { @@ -514,9 +510,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s } else if( IsXMLToken( aLocalName, XML_SPEED ) ) { - sal_uInt16 eEnum; - if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) ) - meSpeed = (AnimationSpeed)eEnum; + SvXMLUnitConverter::convertEnum( meSpeed, sValue, aXML_AnimationSpeed_EnumMap ); } else if( IsXMLToken( aLocalName, XML_PATH_ID ) ) { |