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 | |
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')
-rw-r--r-- | xmloff/source/draw/animationexport.cxx | 76 | ||||
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 34 | ||||
-rw-r--r-- | xmloff/source/draw/animexp.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/animimp.cxx | 24 | ||||
-rw-r--r-- | xmloff/source/draw/eventimp.cxx | 20 | ||||
-rw-r--r-- | xmloff/source/draw/sdpropls.cxx | 191 | ||||
-rw-r--r-- | xmloff/source/draw/sdpropls.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/ximpcustomshape.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.hxx | 15 |
11 files changed, 193 insertions, 217 deletions
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 11d474617744..db2720ffd8eb 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -96,7 +96,7 @@ using ::com::sun::star::container::XEnumeration; namespace xmloff { -const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Fill[] = { { XML_DEFAULT, AnimationFill::DEFAULT }, { XML_REMOVE, AnimationFill::REMOVE }, @@ -106,7 +106,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[] = { XML_AUTO, AnimationFill::AUTO }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_FillDefault[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_FillDefault[] = { { XML_INHERIT, AnimationFill::INHERIT }, { XML_REMOVE, AnimationFill::REMOVE }, @@ -116,7 +116,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_FillDefault[] = { XML_AUTO, AnimationFill::AUTO }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Restart[] = { { XML_DEFAULT, AnimationRestart::DEFAULT }, { XML_ALWAYS, AnimationRestart::ALWAYS }, @@ -124,7 +124,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[] = { XML_NEVER, AnimationRestart::NEVER }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_RestartDefault[] = { { XML_INHERIT, AnimationRestart::INHERIT }, { XML_ALWAYS, AnimationRestart::ALWAYS }, @@ -132,7 +132,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[] = { XML_NEVER, AnimationRestart::NEVER }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Endsync[] = { { XML_FIRST, AnimationEndSync::FIRST }, { XML_LAST, AnimationEndSync::LAST }, @@ -140,7 +140,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[] = { XML_MEDIA, AnimationEndSync::MEDIA }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_CalcMode[] = { { XML_DISCRETE, AnimationCalcMode::DISCRETE }, { XML_LINEAR, AnimationCalcMode::LINEAR }, @@ -148,7 +148,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[] = { XML_SPLINE, AnimationCalcMode::SPLINE }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_AdditiveMode[] = { { XML_BASE, AnimationAdditiveMode::BASE }, { XML_SUM, AnimationAdditiveMode::SUM }, @@ -157,7 +157,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[] = { XML_NONE, AnimationAdditiveMode::NONE }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransformType[] = { { XML_TRANSLATE, AnimationTransformType::TRANSLATE }, { XML_SCALE, AnimationTransformType::SCALE }, @@ -166,7 +166,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[] = { XML_SKEWY, AnimationTransformType::SKEWY }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionType[] = { { XML_BARWIPE, TransitionType::BARWIPE }, { XML_BOXWIPE, TransitionType::BOXWIPE }, @@ -213,7 +213,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[] = { XML_ZOOM, TransitionType::ZOOM }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionSubType[] = { { XML_DEFAULT, TransitionSubType::DEFAULT }, { XML_LEFTTORIGHT, TransitionSubType::LEFTTORIGHT }, @@ -334,7 +334,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[] = { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EventTrigger[] = { { XML_ONBEGIN, EventTrigger::ON_BEGIN }, { XML_ONEND, EventTrigger::ON_END }, @@ -350,7 +350,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[] = { XML_REPEAT, EventTrigger::REPEAT }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectPresetClass[] = { { XML_CUSTOM, EffectPresetClass::CUSTOM }, { XML_ENTRANCE, EffectPresetClass::ENTRANCE }, @@ -361,7 +361,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[] = { XML_MEDIA_CALL, EffectPresetClass::MEDIACALL }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectNodeType[] = { { XML_DEFAULT, EffectNodeType::DEFAULT }, { XML_ON_CLICK, EffectNodeType::ON_CLICK }, @@ -372,21 +372,21 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[] = { XML_INTERACTIVE_SEQUENCE, EffectNodeType::INTERACTIVE_SEQUENCE }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_SubItem[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_SubItem[] = { { XML_WHOLE, ShapeAnimationSubType::AS_WHOLE }, { XML_BACKGROUND, ShapeAnimationSubType::ONLY_BACKGROUND }, { XML_TEXT, ShapeAnimationSubType::ONLY_TEXT }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_IterateType[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_IterateType[] = { { XML_BY_PARAGRAPH, TextAnimationType::BY_PARAGRAPH }, { XML_BY_WORD, TextAnimationType::BY_WORD }, { XML_BY_LETTER, TextAnimationType::BY_LETTER }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aAnimations_EnumMap_Command[] = +const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Command[] = { { XML_CUSTOM, EffectCommands::CUSTOM }, { XML_VERB, EffectCommands::VERB }, @@ -601,12 +601,12 @@ void AnimationsExporterImpl::exportTransitionNode() sTmp.append( 's'); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() ); - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, aAnimations_EnumMap_TransitionType ); + SvXMLUnitConverter::convertEnum( sTmp, nTransition, aAnimations_EnumMap_TransitionType ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() ); if( nSubtype != TransitionSubType::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, aAnimations_EnumMap_TransitionSubType ); + SvXMLUnitConverter::convertEnum( sTmp, nSubtype, aAnimations_EnumMap_TransitionSubType ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() ); } @@ -775,7 +775,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod } double fTemp = 0; - sal_Int32 nTemp; + sal_Int16 nTemp; aTemp = xNode->getDuration(); if( aTemp.hasValue() ) @@ -804,28 +804,28 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod nTemp = xNode->getFill(); if( nTemp != AnimationFill::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_Fill ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Fill ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILL, sTmp.makeStringAndClear() ); } nTemp = xNode->getFillDefault(); if( nTemp != AnimationFill::INHERIT ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_FillDefault ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_FillDefault ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILLDEFAULT, sTmp.makeStringAndClear() ); } nTemp = xNode->getRestart(); if( nTemp != AnimationRestart::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_Restart ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Restart ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTART, sTmp.makeStringAndClear() ); } nTemp = xNode->getRestartDefault(); if( nTemp != AnimationRestart::INHERIT ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_RestartDefault ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_RestartDefault ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTARTDEFAULT, sTmp.makeStringAndClear() ); } @@ -883,7 +883,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod { if( aTemp >>= nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_Endsync ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Endsync ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ENDSYNC, sTmp.makeStringAndClear() ); } } @@ -902,7 +902,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod { if( (pValue->Value >>= nContainerNodeType) && (nContainerNodeType != EffectNodeType::DEFAULT) ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nContainerNodeType, aAnimations_EnumMap_EffectNodeType ); + SvXMLUnitConverter::convertEnum( sTmp, nContainerNodeType, aAnimations_EnumMap_EffectNodeType ); mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NODE_TYPE, sTmp.makeStringAndClear() ); } } @@ -923,10 +923,10 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod } else if( IsXMLToken( pValue->Name, XML_PRESET_CLASS ) ) { - sal_Int16 nEffectPresetClass = sal_Int16(); + sal_Int16 nEffectPresetClass = sal_uInt16(); if( pValue->Value >>= nEffectPresetClass ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nEffectPresetClass, aAnimations_EnumMap_EffectPresetClass ); + SvXMLUnitConverter::convertEnum( sTmp, nEffectPresetClass, aAnimations_EnumMap_EffectPresetClass ); mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PRESET_CLASS, sTmp.makeStringAndClear() ); } } @@ -1025,14 +1025,14 @@ void AnimationsExporterImpl::exportContainer( const Reference< XTimeContainer >& sal_Int16 nTemp = xIter->getSubItem(); if( nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_SubItem ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_SubItem ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() ); } nTemp = xIter->getIterateType(); if( nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_IterateType ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_IterateType ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, sTmp.makeStringAndClear() ); } @@ -1092,7 +1092,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat const sal_Int16 nNodeType = xAnimate->getType(); OUStringBuffer sTmp; - sal_Int32 nTemp; + sal_Int16 nTemp; bool bTemp; Any aTemp( xAnimate->getTarget() ); @@ -1105,7 +1105,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat nTemp = xAnimate->getSubItem(); if( nTemp ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_SubItem ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_SubItem ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() ); } @@ -1211,7 +1211,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if( ((nNodeType == AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::PACED)) || ((nNodeType != AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::LINEAR)) ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_CalcMode ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_CalcMode ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_CALCMODE, sTmp.makeStringAndClear() ); } @@ -1222,7 +1222,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat nTemp = xAnimate->getAdditive(); if( nTemp != AnimationAdditiveMode::REPLACE ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_AdditiveMode ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_AdditiveMode ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ADDITIVE, sTmp.makeStringAndClear() ); } } @@ -1299,7 +1299,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat Reference< XAnimateTransform > xTransform( xAnimate, UNO_QUERY_THROW ); nTemp = xTransform->getTransformType(); - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_TransformType ); + SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_TransformType ); mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_TYPE, sTmp.makeStringAndClear() ); } break; @@ -1310,13 +1310,13 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat eElementToken = XML_TRANSITIONFILTER; sal_Int16 nTransition = xTransitionFilter->getTransition(); - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, aAnimations_EnumMap_TransitionType ); + SvXMLUnitConverter::convertEnum( sTmp, nTransition, aAnimations_EnumMap_TransitionType ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() ); sal_Int16 nSubtype = xTransitionFilter->getSubtype(); if( nSubtype != TransitionSubType::DEFAULT ) { - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, aAnimations_EnumMap_TransitionSubType ); + SvXMLUnitConverter::convertEnum( sTmp, nSubtype, aAnimations_EnumMap_TransitionSubType ); mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() ); } @@ -1392,7 +1392,7 @@ void AnimationsExporterImpl::exportCommand( const Reference< XCommand >& xComman } sal_Int16 nCommand = xCommand->getCommand(); - SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nCommand, aAnimations_EnumMap_Command ); + SvXMLUnitConverter::convertEnum( sTmp, nCommand, aAnimations_EnumMap_Command ); mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COMMAND, sTmp.makeStringAndClear() ); // todo virtual css::uno::Any SAL_CALL getParameter() throw (css::uno::RuntimeException) = 0; @@ -1570,7 +1570,7 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa sTmp.append( '.' ); } - SvXMLUnitConverter::convertEnum( sTmp2, (sal_uInt16)pEvent->Trigger, aAnimations_EnumMap_EventTrigger ); + SvXMLUnitConverter::convertEnum( sTmp2, pEvent->Trigger, aAnimations_EnumMap_EventTrigger ); sTmp.append( sTmp2.makeStringAndClear() ); } diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index d7c57f0c4da4..74f967560ef8 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -540,10 +540,10 @@ Any AnimationsImportHelperImpl::convertTiming( const OUString& rValue ) aEventTrigger = aEventTrigger.copy( nPos + 1 ); } - sal_uInt16 nEnum; + sal_Int16 nEnum; if( SvXMLUnitConverter::convertEnum( nEnum, aEventTrigger, aAnimations_EnumMap_EventTrigger ) ) { - aEvent.Trigger = (sal_Int16)nEnum; + aEvent.Trigger = nEnum; } else { @@ -750,7 +750,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: OUString sXmlId; const sal_Int16 nCount = xAttrList.is() ? xAttrList->getLength() : 0; - sal_uInt16 nEnum; + sal_Int16 nEnum; sal_Int16 nAttribute; for( nAttribute = 0; nAttribute < nCount; nAttribute++ ) { @@ -779,25 +779,25 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case ANA_Fill: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Fill ) ) - mxNode->setFill( (sal_Int16)nEnum ); + mxNode->setFill( nEnum ); } break; case ANA_FillDefault: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_FillDefault ) ) - mxNode->setFillDefault( (sal_Int16)nEnum ); + mxNode->setFillDefault( nEnum ); } break; case ANA_Restart: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Restart ) ) - mxNode->setRestart( (sal_Int16)nEnum ); + mxNode->setRestart( nEnum ); } break; case ANA_RestartDefault: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_RestartDefault ) ) - mxNode->setRestartDefault( (sal_Int16)nEnum ); + mxNode->setRestartDefault( nEnum ); } break; case ANA_Accelerate: @@ -832,13 +832,13 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case ANA_EndSync: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Endsync ) ) - mxNode->setEndSync( makeAny( (sal_Int16)nEnum ) ); + mxNode->setEndSync( makeAny( nEnum ) ); } break; case ANA_Node_Type: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_EffectNodeType ) ) - aUserData.push_back( NamedValue( GetXMLToken( XML_NODE_TYPE ), makeAny( (sal_Int16)nEnum ) ) ); + aUserData.push_back( NamedValue( GetXMLToken( XML_NODE_TYPE ), makeAny( nEnum ) ) ); } break; case ANA_Preset_ID: @@ -854,7 +854,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: case ANA_Preset_Class: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_EffectPresetClass ) ) - aUserData.push_back( NamedValue( GetXMLToken( XML_PRESET_CLASS ), makeAny( (sal_Int16)nEnum ) ) ); + aUserData.push_back( NamedValue( GetXMLToken( XML_PRESET_CLASS ), makeAny( nEnum ) ) ); } break; case ANA_After_Effect: @@ -921,11 +921,11 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( xAnimate.is() ) { - xAnimate->setSubItem( (sal_Int16)nEnum ); + xAnimate->setSubItem( nEnum ); } else if( xIter.is() ) { - xIter->setSubItem( (sal_Int16)nEnum ); + xIter->setSubItem( nEnum ); } } } @@ -1010,7 +1010,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: if( xAnimate.is() ) { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_CalcMode ) ) - xAnimate->setCalcMode( (sal_Int16)nEnum ); + xAnimate->setCalcMode( nEnum ); } } break; @@ -1027,7 +1027,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: if( xAnimate.is() ) { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_AdditiveMode ) ) - xAnimate->setAdditive( (sal_Int16)nEnum ); + xAnimate->setAdditive( nEnum ); } } break; @@ -1070,7 +1070,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_TransformType ) ) { - xTransform->setTransformType( (sal_Int16)nEnum ); + xTransform->setTransformType( nEnum ); switch( nEnum ) { case AnimationTransformType::SCALE: meAttributeName = XML_SCALE; break; @@ -1136,7 +1136,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_IterateType ) ) { if( xIter.is() ) - xIter->setIterateType( (sal_Int16)nEnum ); + xIter->setIterateType( nEnum ); } } break; @@ -1178,7 +1178,7 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax: { if( SvXMLUnitConverter::convertEnum( nEnum, rValue, aAnimations_EnumMap_Command ) ) { - xCommand->setCommand( (sal_Int16)nEnum ); + xCommand->setCommand( nEnum ); } } } diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx index 3517cef3df99..a5d8f0ba8e58 100644 --- a/xmloff/source/draw/animexp.cxx +++ b/xmloff/source/draw/animexp.cxx @@ -179,7 +179,7 @@ void SdXMLImplSetEffect( AnimationEffect eEffect, XMLEffect& eKind, XMLEffectDir eEffect = AnimationEffect_NONE; } - const Effect& rEffect = AnimationEffectMap[eEffect]; + const Effect& rEffect = AnimationEffectMap[(int)eEffect]; eKind = rEffect.meKind; eDirection = rEffect.meDirection; nStartScale = rEffect.mnStartScale; 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 ) ) { diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index f9ec6082a452..9385887652ea 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -51,7 +51,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::presentation; using namespace ::xmloff::token; -SvXMLEnumMapEntry const aXML_EventActions_EnumMap[] = +SvXMLEnumMapEntry<ClickAction> const aXML_EventActions_EnumMap[] = { { XML_NONE, ClickAction_NONE }, { XML_PREVIOUS_PAGE, ClickAction_PREVPAGE }, @@ -67,7 +67,7 @@ SvXMLEnumMapEntry const aXML_EventActions_EnumMap[] = { XML_VERB, ClickAction_VERB }, { XML_FADE_OUT, ClickAction_VANISH }, { XML_SOUND, ClickAction_SOUND }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (ClickAction)0 } }; class SdXMLEventContext : public SvXMLImportContext @@ -174,21 +174,15 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons case XML_NAMESPACE_PRESENTATION: if( IsXMLToken( aAttrLocalName, XML_ACTION ) ) { - sal_uInt16 eEnum; - if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_EventActions_EnumMap ) ) - meClickAction = (ClickAction)eEnum; + SvXMLUnitConverter::convertEnum( meClickAction, sValue, aXML_EventActions_EnumMap ); } if( IsXMLToken( aAttrLocalName, 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( aAttrLocalName, 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( aAttrLocalName, XML_START_SCALE ) ) { @@ -198,9 +192,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons } else if( IsXMLToken( aAttrLocalName, 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( aAttrLocalName, XML_VERB ) ) { diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 79967afc9dd5..b32204d11e52 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -23,14 +23,9 @@ #include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/LineJoint.hpp> #include <com/sun/star/drawing/LineCap.hpp> -#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/presentation/AnimationSpeed.hpp> #include <com/sun/star/presentation/FadeEffect.hpp> -#include <com/sun/star/drawing/ConnectorType.hpp> -#include <com/sun/star/drawing/RectanglePoint.hpp> -#include <com/sun/star/drawing/CircleKind.hpp> -#include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/text/WritingMode.hpp> #include <xmloff/EnumPropertyHdl.hxx> #include <xmloff/NamedBoolPropertyHdl.hxx> @@ -366,60 +361,60 @@ const XMLPropertyMapEntry aXMLTableShapeAttributes[] = // implementation of factory for own graphic properties -static SvXMLEnumMapEntry const aXML_LineStyle_EnumMap[] = +static SvXMLEnumMapEntry<drawing::LineStyle> const aXML_LineStyle_EnumMap[] = { { XML_NONE, drawing::LineStyle_NONE }, { XML_SOLID, drawing::LineStyle_SOLID }, { XML_DASH, drawing::LineStyle_DASH }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::LineStyle)0 } }; -static SvXMLEnumMapEntry const aXML_LineJoint_EnumMap[] = +static SvXMLEnumMapEntry<drawing::LineJoint> const aXML_LineJoint_EnumMap[] = { { XML_NONE, drawing::LineJoint_NONE }, { XML_MITER, drawing::LineJoint_MITER }, { XML_ROUND, drawing::LineJoint_ROUND }, { XML_BEVEL, drawing::LineJoint_BEVEL }, { XML_MIDDLE, drawing::LineJoint_MIDDLE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::LineJoint)0 } }; -static SvXMLEnumMapEntry const aXML_LineCap_EnumMap[] = +static SvXMLEnumMapEntry<drawing::LineCap> const aXML_LineCap_EnumMap[] = { { XML_BUTT, drawing::LineCap_BUTT }, { XML_ROUND, drawing::LineCap_ROUND }, // use XML_GRADIENTSTYLE_SQUARE as XML_SQUARE, is defined as "square" already { XML_GRADIENTSTYLE_SQUARE, drawing::LineCap_SQUARE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::LineCap)0 } }; -SvXMLEnumMapEntry const aXML_FillStyle_EnumMap[] = +SvXMLEnumMapEntry<drawing::FillStyle> const aXML_FillStyle_EnumMap[] = { { XML_NONE, drawing::FillStyle_NONE }, { XML_SOLID, drawing::FillStyle_SOLID }, { XML_BITMAP, drawing::FillStyle_BITMAP }, { XML_GRADIENT, drawing::FillStyle_GRADIENT }, { XML_HATCH, drawing::FillStyle_HATCH }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::FillStyle)0 } }; -static SvXMLEnumMapEntry const aXML_PresChange_EnumMap[] = +static SvXMLEnumMapEntry<sal_Int32> const aXML_PresChange_EnumMap[] = { { XML_MANUAL, 0 }, { XML_AUTOMATIC, 1 }, { XML_SEMI_AUTOMATIC, 2 }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const aXML_TransSpeed_EnumMap[] = +static SvXMLEnumMapEntry<presentation::AnimationSpeed> const aXML_TransSpeed_EnumMap[] = { { XML_FAST, presentation::AnimationSpeed_FAST }, { XML_MEDIUM, presentation::AnimationSpeed_MEDIUM }, { XML_SLOW, presentation::AnimationSpeed_SLOW }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (presentation::AnimationSpeed)0 } }; -static SvXMLEnumMapEntry const aXML_FadeEffect_EnumMap[] = +static SvXMLEnumMapEntry<presentation::FadeEffect> const aXML_FadeEffect_EnumMap[] = { { XML_NONE, presentation::FadeEffect_NONE }, { XML_FADE_FROM_LEFT, presentation::FadeEffect_FADE_FROM_LEFT }, @@ -478,68 +473,68 @@ static SvXMLEnumMapEntry const aXML_FadeEffect_EnumMap[] = { XML_UNCOVER_TO_LOWERLEFT, presentation::FadeEffect_UNCOVER_TO_LOWERLEFT }, { XML_VERTICAL_CHECKERBOARD,presentation::FadeEffect_VERTICAL_CHECKERBOARD }, { XML_HORIZONTAL_CHECKERBOARD,presentation::FadeEffect_HORIZONTAL_CHECKERBOARD }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (presentation::FadeEffect)0 } }; -SvXMLEnumMapEntry const aXML_ConnectionKind_EnumMap[] = +SvXMLEnumMapEntry<drawing::ConnectorType> const aXML_ConnectionKind_EnumMap[] = { { XML_STANDARD, drawing::ConnectorType_STANDARD }, { XML_CURVE, drawing::ConnectorType_CURVE }, { XML_LINE, drawing::ConnectorType_LINE }, { XML_LINES, drawing::ConnectorType_LINES }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::ConnectorType)0 } }; -SvXMLEnumMapEntry const aXML_BitmapMode_EnumMap[] = +SvXMLEnumMapEntry<drawing::BitmapMode> const aXML_BitmapMode_EnumMap[] = { { XML_REPEAT, drawing::BitmapMode_REPEAT }, { XML_STRETCH, drawing::BitmapMode_STRETCH }, { XML_BACKGROUND_NO_REPEAT, drawing::BitmapMode_NO_REPEAT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::BitmapMode)0 } }; // 3D EnumMaps -static SvXMLEnumMapEntry const aXML_NormalsKind_EnumMap[] = +static SvXMLEnumMapEntry<drawing::NormalsKind> const aXML_NormalsKind_EnumMap[] = { { XML_OBJECT, drawing::NormalsKind_SPECIFIC }, { XML_FLAT, drawing::NormalsKind_FLAT }, { XML_SPHERE, drawing::NormalsKind_SPHERE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::NormalsKind)0 } }; -static SvXMLEnumMapEntry const aXML_TexGenerationX_EnumMap[] = +static SvXMLEnumMapEntry<drawing::TextureProjectionMode> const aXML_TexGenerationX_EnumMap[] = { { XML_OBJECT, drawing::TextureProjectionMode_OBJECTSPECIFIC }, { XML_PARALLEL, drawing::TextureProjectionMode_PARALLEL }, { XML_SPHERE, drawing::TextureProjectionMode_SPHERE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextureProjectionMode)0 } }; -static SvXMLEnumMapEntry const aXML_TexGenerationY_EnumMap[] = +static SvXMLEnumMapEntry<drawing::TextureProjectionMode> const aXML_TexGenerationY_EnumMap[] = { { XML_OBJECT, drawing::TextureProjectionMode_OBJECTSPECIFIC }, { XML_PARALLEL, drawing::TextureProjectionMode_PARALLEL }, { XML_SPHERE, drawing::TextureProjectionMode_SPHERE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextureProjectionMode)0 } }; -static SvXMLEnumMapEntry const aXML_TexKind_EnumMap[] = +static SvXMLEnumMapEntry<drawing::TextureKind> const aXML_TexKind_EnumMap[] = { { XML_LUMINANCE, drawing::TextureKind_LUMINANCE }, { XML_COLOR, drawing::TextureKind_COLOR }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextureKind)0 } }; -static SvXMLEnumMapEntry const aXML_TexMode_EnumMap[] = +static SvXMLEnumMapEntry<drawing::TextureMode> const aXML_TexMode_EnumMap[] = { { XML_REPLACE, drawing::TextureMode_REPLACE }, { XML_MODULATE, drawing::TextureMode_MODULATE }, { XML_BLEND, drawing::TextureMode_BLEND }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextureMode)0 } }; -SvXMLEnumMapEntry const aXML_RefPoint_EnumMap[] = +SvXMLEnumMapEntry<drawing::RectanglePoint> const aXML_RefPoint_EnumMap[] = { { XML_TOP_LEFT, drawing::RectanglePoint_LEFT_TOP }, { XML_TOP, drawing::RectanglePoint_MIDDLE_TOP }, @@ -550,91 +545,91 @@ SvXMLEnumMapEntry const aXML_RefPoint_EnumMap[] = { XML_BOTTOM_LEFT, drawing::RectanglePoint_LEFT_BOTTOM }, { XML_BOTTOM, drawing::RectanglePoint_MIDDLE_BOTTOM }, { XML_BOTTOM_RIGHT, drawing::RectanglePoint_RIGHT_BOTTOM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::RectanglePoint)0 } }; -SvXMLEnumMapEntry const aXML_CircleKind_EnumMap[] = +SvXMLEnumMapEntry<drawing::CircleKind> const aXML_CircleKind_EnumMap[] = { { XML_FULL, drawing::CircleKind_FULL }, { XML_SECTION, drawing::CircleKind_SECTION }, { XML_CUT, drawing::CircleKind_CUT }, { XML_ARC, drawing::CircleKind_ARC }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::CircleKind)0 } }; -static SvXMLEnumMapEntry const aXML_WritingMode_EnumMap[] = +static SvXMLEnumMapEntry<text::WritingMode> const aXML_WritingMode_EnumMap[] = { { XML_TB_RL, text::WritingMode_TB_RL }, { XML_LR_TB, text::WritingMode_LR_TB }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (text::WritingMode)0 } }; -static SvXMLEnumMapEntry const pXML_TextAnimation_Enum[] = +static SvXMLEnumMapEntry<drawing::TextAnimationKind> const pXML_TextAnimation_Enum[] = { { XML_NONE, drawing::TextAnimationKind_NONE }, { XML_BLINKING, drawing::TextAnimationKind_BLINK }, // will be filtered { XML_SCROLL, drawing::TextAnimationKind_SCROLL }, { XML_ALTERNATE, drawing::TextAnimationKind_ALTERNATE }, { XML_SLIDE, drawing::TextAnimationKind_SLIDE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextAnimationKind)0 } }; -static SvXMLEnumMapEntry const pXML_TextAnimation_Blinking_Enum[] = +static SvXMLEnumMapEntry<drawing::TextAnimationKind> const pXML_TextAnimation_Blinking_Enum[] = { { XML_FALSE, drawing::TextAnimationKind_NONE }, { XML_TRUE, drawing::TextAnimationKind_BLINK }, { XML_FALSE, drawing::TextAnimationKind_SCROLL }, { XML_FALSE, drawing::TextAnimationKind_ALTERNATE }, { XML_FALSE, drawing::TextAnimationKind_SLIDE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextAnimationKind)0 } }; -static SvXMLEnumMapEntry const pXML_TextAnimationDirection_Enum[] = +static SvXMLEnumMapEntry<drawing::TextAnimationDirection> const pXML_TextAnimationDirection_Enum[] = { { XML_LEFT, drawing::TextAnimationDirection_LEFT }, { XML_RIGHT, drawing::TextAnimationDirection_RIGHT }, // will be filtered { XML_UP, drawing::TextAnimationDirection_UP }, { XML_DOWN, drawing::TextAnimationDirection_DOWN }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextAnimationDirection)0 } }; -static SvXMLEnumMapEntry const pXML_TextAlign_Enum[] = +static SvXMLEnumMapEntry<drawing::TextHorizontalAdjust> const pXML_TextAlign_Enum[] = { { XML_LEFT, drawing::TextHorizontalAdjust_LEFT }, { XML_CENTER, drawing::TextHorizontalAdjust_CENTER }, { XML_RIGHT, drawing::TextHorizontalAdjust_RIGHT }, { XML_JUSTIFY, drawing::TextHorizontalAdjust_BLOCK }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextHorizontalAdjust)0 } }; -static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] = +static SvXMLEnumMapEntry<drawing::TextVerticalAdjust> const pXML_VerticalAlign_Enum[] = { { XML_TOP, drawing::TextVerticalAdjust_TOP }, { XML_MIDDLE, drawing::TextVerticalAdjust_CENTER }, { XML_BOTTOM, drawing::TextVerticalAdjust_BOTTOM }, { XML_JUSTIFY, drawing::TextVerticalAdjust_BLOCK }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextVerticalAdjust)0 } }; -static SvXMLEnumMapEntry const pXML_FitToSize_Enum_Odf12[] = +static SvXMLEnumMapEntry<drawing::TextFitToSizeType> const pXML_FitToSize_Enum_Odf12[] = { { XML_FALSE, drawing::TextFitToSizeType_NONE }, { XML_TRUE, drawing::TextFitToSizeType_PROPORTIONAL }, { XML_TRUE, drawing::TextFitToSizeType_ALLLINES }, { XML_TRUE, drawing::TextFitToSizeType_AUTOFIT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextFitToSizeType)0 } }; -static SvXMLEnumMapEntry const pXML_FitToSize_Enum[] = +static SvXMLEnumMapEntry<drawing::TextFitToSizeType> const pXML_FitToSize_Enum[] = { { XML_FALSE, drawing::TextFitToSizeType_NONE }, { XML_TRUE, drawing::TextFitToSizeType_PROPORTIONAL }, { XML_ALL, drawing::TextFitToSizeType_ALLLINES }, { XML_SHRINK_TO_FIT,drawing::TextFitToSizeType_AUTOFIT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::TextFitToSizeType)0 } }; -static SvXMLEnumMapEntry const pXML_MeasureUnit_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_MeasureUnit_Enum[] = { { XML_AUTOMATIC, 0 }, { XML_UNIT_MM, 1 }, @@ -649,26 +644,26 @@ static SvXMLEnumMapEntry const pXML_MeasureUnit_Enum[] = { XML_TOKEN_INVALID,0 } }; -static SvXMLEnumMapEntry const pXML_Measure_HAlign_Enum[] = +static SvXMLEnumMapEntry<drawing::MeasureTextHorzPos> const pXML_Measure_HAlign_Enum[] = { { XML_AUTOMATIC, drawing::MeasureTextHorzPos_AUTO }, { XML_LEFT_OUTSIDE, drawing::MeasureTextHorzPos_LEFTOUTSIDE }, { XML_INSIDE, drawing::MeasureTextHorzPos_INSIDE }, { XML_RIGHT_OUTSIDE, drawing::MeasureTextHorzPos_RIGHTOUTSIDE}, - { XML_TOKEN_INVALID,0 } + { XML_TOKEN_INVALID, (drawing::MeasureTextHorzPos)0 } }; -static SvXMLEnumMapEntry const pXML_Measure_VAlign_Enum[] = +static SvXMLEnumMapEntry<drawing::MeasureTextVertPos> const pXML_Measure_VAlign_Enum[] = { { XML_AUTOMATIC, drawing::MeasureTextVertPos_AUTO }, { XML_ABOVE, drawing::MeasureTextVertPos_EAST }, { XML_BELOW, drawing::MeasureTextVertPos_WEST }, { XML_CENTER, drawing::MeasureTextVertPos_CENTERED }, - { XML_TOKEN_INVALID,0 } + { XML_TOKEN_INVALID, (drawing::MeasureTextVertPos)0 } }; // #FontWork# -static SvXMLEnumMapEntry const pXML_Fontwork_Style_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_Fontwork_Style_Enum[] = { { XML_ROTATE, 0 }, //XFormTextStyle::Rotate, { XML_UPRIGHT, 1 }, //XFormTextStyle::Upright, @@ -678,7 +673,7 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Style_Enum[] = { XML_TOKEN_INVALID,0 } }; -static SvXMLEnumMapEntry const pXML_Fontwork_Adjust_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_Fontwork_Adjust_Enum[] = { { XML_LEFT, 0 }, //XFormTextAdjust::Left, { XML_RIGHT, 1 }, //XFormTextAdjust::Right, @@ -687,7 +682,7 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Adjust_Enum[] = { XML_TOKEN_INVALID,0 } }; -static SvXMLEnumMapEntry const pXML_Fontwork_Shadow_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_Fontwork_Shadow_Enum[] = { { XML_NORMAL, 0 }, //XFormTextShadow::Normal, { XML_SLANT, 1 }, //XFormTextShadow::Slant, @@ -695,7 +690,7 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Shadow_Enum[] = { XML_TOKEN_INVALID,0 } }; -static SvXMLEnumMapEntry const pXML_Fontwork_Form_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_Fontwork_Form_Enum[] = { { XML_NONE, 0 }, //XFTFORM_NONE, { XML_TOPCIRCLE, 1 }, //XFTFORM_TOPCIRC, @@ -713,7 +708,7 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Form_Enum[] = { XML_TOKEN_INVALID,0 } }; -static SvXMLEnumMapEntry const pXML_Caption_Esc_Dir_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_Caption_Esc_Dir_Enum[] = { { XML_HORIZONTAL, 0 }, //SdrCaptionEscDir::Horizontal, { XML_VERTICAL, 1 }, //SdrCaptionEscDir::Vertical, @@ -721,7 +716,7 @@ static SvXMLEnumMapEntry const pXML_Caption_Esc_Dir_Enum[] = { XML_TOKEN_INVALID,0 } }; -static SvXMLEnumMapEntry const pXML_Caption_Type_Enum[] = +static SvXMLEnumMapEntry<sal_Int32> const pXML_Caption_Type_Enum[] = { { XML_STRAIGHT_LINE, 0 }, //SdrCaptionType::Type1, { XML_ANGLED_LINE, 1 }, //SdrCaptionType::Type2, @@ -871,27 +866,27 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy { case XML_SD_TYPE_STROKE : { - pHdl = new XMLEnumPropertyHdl( aXML_LineStyle_EnumMap, cppu::UnoType<drawing::LineStyle>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_LineStyle_EnumMap); break; } case XML_SD_TYPE_LINEJOIN : { - pHdl = new XMLEnumPropertyHdl( aXML_LineJoint_EnumMap, cppu::UnoType<drawing::LineJoint>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_LineJoint_EnumMap); break; } case XML_SD_TYPE_LINECAP : { - pHdl = new XMLEnumPropertyHdl( aXML_LineCap_EnumMap, ::cppu::UnoType<drawing::LineCap>::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_LineCap_EnumMap ); break; } case XML_SD_TYPE_FILLSTYLE : { - pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, cppu::UnoType<drawing::FillStyle>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap ); break; } case XML_SD_TYPE_PRESPAGE_TYPE : { - pHdl = new XMLEnumPropertyHdl( aXML_PresChange_EnumMap, ::cppu::UnoType<sal_Int32>::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_PresChange_EnumMap ); break; } case XML_SD_TYPE_SHADOW : @@ -906,12 +901,12 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy } case XML_SD_TYPE_PRESPAGE_STYLE : { - pHdl = new XMLEnumPropertyHdl( aXML_FadeEffect_EnumMap, ::cppu::UnoType<presentation::FadeEffect>::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_FadeEffect_EnumMap ); break; } case XML_SD_TYPE_PRESPAGE_SPEED : { - pHdl = new XMLEnumPropertyHdl( aXML_TransSpeed_EnumMap, cppu::UnoType<presentation::AnimationSpeed>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TransSpeed_EnumMap ); break; } case XML_SD_TYPE_PRESPAGE_DURATION : @@ -931,7 +926,7 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy } case XML_SD_TYPE_WRITINGMODE : { - pHdl = new XMLEnumPropertyHdl( aXML_WritingMode_EnumMap, cppu::UnoType<text::WritingMode>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_WritingMode_EnumMap ); break; } case XML_SD_TYPE_PRESPAGE_VISIBILITY : @@ -958,7 +953,7 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy case XML_SD_TYPE_NORMALS_KIND: { - pHdl = new XMLEnumPropertyHdl( aXML_NormalsKind_EnumMap, cppu::UnoType<drawing::NormalsKind>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_NormalsKind_EnumMap ); break; } case XML_SD_TYPE_NORMALS_DIRECTION: @@ -968,22 +963,22 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy } case XML_SD_TYPE_TEX_GENERATION_MODE_X: { - pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationX_EnumMap, cppu::UnoType<drawing::TextureProjectionMode>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationX_EnumMap ); break; } case XML_SD_TYPE_TEX_GENERATION_MODE_Y: { - pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationY_EnumMap, cppu::UnoType<drawing::TextureProjectionMode>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationY_EnumMap ); break; } case XML_SD_TYPE_TEX_KIND: { - pHdl = new XMLEnumPropertyHdl( aXML_TexKind_EnumMap, cppu::UnoType<drawing::TextureKind>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexKind_EnumMap ); break; } case XML_SD_TYPE_TEX_MODE: { - pHdl = new XMLEnumPropertyHdl( aXML_TexMode_EnumMap, cppu::UnoType<drawing::TextureMode>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexMode_EnumMap ); break; } case XML_SD_TYPE_NUMBULLET: @@ -998,7 +993,7 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy } case XML_SD_TYPE_BITMAP_MODE: { - pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, cppu::UnoType<drawing::BitmapMode>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap ); break; } case XML_SD_TYPE_BITMAPREPOFFSETX: @@ -1019,50 +1014,48 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy } case XML_SD_TYPE_BITMAP_REFPOINT: { - pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, cppu::UnoType<css::drawing::RectanglePoint>::get()); + pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap); break; } case XML_TYPE_TEXT_ANIMATION: - pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Enum, cppu::UnoType<css::drawing::TextAnimationKind>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Enum); break; case XML_TYPE_TEXT_ANIMATION_BLINKING: - pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Blinking_Enum, cppu::UnoType<css::drawing::TextAnimationKind>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Blinking_Enum); break; case XML_TYPE_TEXT_ANIMATION_DIRECTION: - pHdl = new XMLEnumPropertyHdl( pXML_TextAnimationDirection_Enum, cppu::UnoType<css::drawing::TextAnimationDirection>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAnimationDirection_Enum); break; case XML_TYPE_TEXT_ANIMATION_STEPS: pHdl = new XMLTextAnimationStepPropertyHdl; break; case XML_SD_TYPE_TEXT_ALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_TextAlign_Enum, cppu::UnoType<css::drawing::TextHorizontalAdjust>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAlign_Enum); break; case XML_SD_TYPE_VERTICAL_ALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, cppu::UnoType<css::drawing::TextVerticalAdjust>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum); break; case XML_SD_TYPE_FITTOSIZE: { if (mpExport && (mpExport->getDefaultVersion() <= SvtSaveOptions::ODFVER_012)) { - pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum_Odf12, - cppu::UnoType<css::drawing::TextFitToSizeType>::get()); + pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum_Odf12); } else { - pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum, - cppu::UnoType<css::drawing::TextFitToSizeType>::get()); + pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum); } } break; case XML_SD_TYPE_MEASURE_UNIT: - pHdl = new XMLEnumPropertyHdl( pXML_MeasureUnit_Enum, ::cppu::UnoType<sal_Int32>::get() ); + pHdl = new XMLEnumPropertyHdl( pXML_MeasureUnit_Enum ); break; case XML_SD_TYPE_MEASURE_HALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_Measure_HAlign_Enum, cppu::UnoType<css::drawing::MeasureTextHorzPos>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Measure_HAlign_Enum); break; case XML_SD_TYPE_MEASURE_VALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_Measure_VAlign_Enum, cppu::UnoType<css::drawing::MeasureTextVertPos>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Measure_VAlign_Enum); break; case XML_SD_TYPE_MEASURE_PLACING: { @@ -1078,16 +1071,16 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy // #FontWork# case XML_SD_TYPE_FONTWORK_STYLE : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Style_Enum , ::cppu::UnoType<sal_Int32>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Style_Enum ); break; case XML_SD_TYPE_FONTWORK_ADJUST : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Adjust_Enum , ::cppu::UnoType<sal_Int32>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Adjust_Enum ); break; case XML_SD_TYPE_FONTWORK_SHADOW : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Shadow_Enum , ::cppu::UnoType<sal_Int32>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Shadow_Enum ); break; case XML_SD_TYPE_FONTWORK_FORM : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Form_Enum , ::cppu::UnoType<sal_Int32>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Form_Enum ); break; case XML_SD_TYPE_CONTROL_BORDER: @@ -1118,10 +1111,10 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy pHdl = new XMLPercentOrMeasurePropertyHandler; break; case XML_SD_TYPE_CAPTION_ESC_DIR: - pHdl = new XMLEnumPropertyHdl( pXML_Caption_Esc_Dir_Enum , ::cppu::UnoType<sal_Int32>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Caption_Esc_Dir_Enum ); break; case XML_SD_TYPE_CAPTION_TYPE: - pHdl = new XMLEnumPropertyHdl( pXML_Caption_Type_Enum , ::cppu::UnoType<sal_Int32>::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Caption_Type_Enum ); break; case XML_SD_TYPE_DATETIMEUPDATE: pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_FIXED), GetXMLToken(XML_VARIABLE) ); @@ -1130,10 +1123,10 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy pHdl = new XMLDateTimeFormatHdl( mpExport ); break; case XML_SD_TYPE_TRANSITION_TYPE: - pHdl = new XMLEnumPropertyHdl( xmloff::aAnimations_EnumMap_TransitionType, ::cppu::UnoType<sal_Int16>::get()); + pHdl = new XMLEnumPropertyHdl( xmloff::aAnimations_EnumMap_TransitionType ); break; case XML_SD_TYPE_TRANSTIION_SUBTYPE: - pHdl = new XMLEnumPropertyHdl( xmloff::aAnimations_EnumMap_TransitionSubType, ::cppu::UnoType<sal_Int16>::get()); + pHdl = new XMLEnumPropertyHdl( xmloff::aAnimations_EnumMap_TransitionSubType ); break; case XML_SD_TYPE_TRANSTIION_DIRECTION: pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken(XML_FORWARD), GetXMLToken(XML_REVERSE) ); diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx index 5db630c0c870..75c6c0d90096 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -21,6 +21,8 @@ #define INCLUDED_XMLOFF_SOURCE_DRAW_SDPROPLS_HXX #include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/drawing/ConnectorType.hpp> +#include <com/sun/star/drawing/CircleKind.hpp> #include <xmloff/xmlnume.hxx> #include <xmloff/maptype.hxx> #include <xmloff/xmltypes.hxx> @@ -41,8 +43,8 @@ extern const XMLPropertyMapEntry aXMLSDPresPageProps_onlyHeadersFooter[]; // enum maps for attributes -extern SvXMLEnumMapEntry const aXML_ConnectionKind_EnumMap[]; -extern SvXMLEnumMapEntry const aXML_CircleKind_EnumMap[]; +extern SvXMLEnumMapEntry<css::drawing::ConnectorType> const aXML_ConnectionKind_EnumMap[]; +extern SvXMLEnumMapEntry<css::drawing::CircleKind> const aXML_CircleKind_EnumMap[]; /** contains the attribute to property mapping for a drawing layer table */ extern const XMLPropertyMapEntry aXMLTableShapeAttributes[]; diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 8cf9e1caaeee..882e0890f9a6 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2120,7 +2120,7 @@ void XMLShapeExport::ImpExportEllipseShape( const double dEndAngle = nEndAngle / 100.0; // export circle kind - SvXMLUnitConverter::convertEnum( sStringBuffer, (sal_uInt16)eKind, aXML_CircleKind_EnumMap ); + SvXMLUnitConverter::convertEnum( sStringBuffer, eKind, aXML_CircleKind_EnumMap ); mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_KIND, sStringBuffer.makeStringAndClear() ); // export start angle @@ -2447,7 +2447,7 @@ void XMLShapeExport::ImpExportConnectorShape( if( eType != drawing::ConnectorType_STANDARD ) { - SvXMLUnitConverter::convertEnum( sStringBuffer, (sal_uInt16)eType, aXML_ConnectionKind_EnumMap ); + SvXMLUnitConverter::convertEnum( sStringBuffer, eType, aXML_ConnectionKind_EnumMap ); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_TYPE, aStr); } diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index fbb5822c919e..68eba5a5bf62 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -67,7 +67,7 @@ XMLEnhancedCustomShapeContext::XMLEnhancedCustomShapeContext( SvXMLImport& rImpo { } -const SvXMLEnumMapEntry aXML_GluePointEnumMap[] = +const SvXMLEnumMapEntry<sal_uInt16> aXML_GluePointEnumMap[] = { { XML_NONE, 0 }, { XML_SEGMENTS, 1 }, @@ -123,17 +123,17 @@ void GetString( std::vector< css::beans::PropertyValue >& rDest, rDest.push_back( aProp ); } +template<typename EnumT> void GetEnum( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp, - const SvXMLEnumMapEntry& rMap ) + const SvXMLEnumMapEntry<EnumT>& rMap ) { - sal_uInt16 eKind; + EnumT eKind; if( SvXMLUnitConverter::convertEnum( eKind, rValue, &rMap ) ) { - sal_Int16 nEnum = (sal_Int16)eKind; beans::PropertyValue aProp; aProp.Name = EASGet( eDestProp ); - aProp.Value <<= nEnum; + aProp.Value <<= static_cast<sal_Int16>(eKind); rDest.push_back( aProp ); } } diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 48928069d36f..0eb5f9b38e8b 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -41,7 +41,6 @@ #include <xmloff/XMLShapeStyleContext.hxx> #include <xmloff/xmluconv.hxx> #include <com/sun/star/container/XNamed.hpp> -#include <com/sun/star/drawing/CircleKind.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XControlModel.hpp> #include <com/sun/star/drawing/XControlShape.hpp> @@ -54,7 +53,6 @@ #include "xexptran.hxx" #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> -#include <com/sun/star/drawing/ConnectorType.hpp> #include <com/sun/star/drawing/HomogenMatrix3.hpp> #include <sax/tools/converter.hxx> @@ -97,7 +95,7 @@ using namespace ::com::sun::star::document; using namespace ::xmloff::token; using namespace ::xmloff::EnhancedCustomShapeToken; -SvXMLEnumMapEntry const aXML_GlueAlignment_EnumMap[] = +SvXMLEnumMapEntry<drawing::Alignment> const aXML_GlueAlignment_EnumMap[] = { { XML_TOP_LEFT, drawing::Alignment_TOP_LEFT }, { XML_TOP, drawing::Alignment_TOP }, @@ -108,10 +106,10 @@ SvXMLEnumMapEntry const aXML_GlueAlignment_EnumMap[] = { XML_BOTTOM_LEFT, drawing::Alignment_BOTTOM_LEFT }, { XML_BOTTOM, drawing::Alignment_BOTTOM }, { XML_BOTTOM_RIGHT, drawing::Alignment_BOTTOM_RIGHT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::Alignment)0 } }; -SvXMLEnumMapEntry const aXML_GlueEscapeDirection_EnumMap[] = +SvXMLEnumMapEntry<drawing::EscapeDirection> const aXML_GlueEscapeDirection_EnumMap[] = { { XML_AUTO, drawing::EscapeDirection_SMART }, { XML_LEFT, drawing::EscapeDirection_LEFT }, @@ -120,7 +118,7 @@ SvXMLEnumMapEntry const aXML_GlueEscapeDirection_EnumMap[] = { XML_DOWN, drawing::EscapeDirection_DOWN }, { XML_HORIZONTAL, drawing::EscapeDirection_HORIZONTAL }, { XML_VERTICAL, drawing::EscapeDirection_VERTICAL }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::EscapeDirection)0 } }; static bool ImpIsEmptyURL( const OUString& rURL ) @@ -304,20 +302,16 @@ void SdXMLShapeContext::addGluePoint( const uno::Reference< xml::sax::XAttribute } else if( IsXMLToken( aLocalName, XML_ALIGN ) ) { - sal_uInt16 eKind; + drawing::Alignment eKind; if( SvXMLUnitConverter::convertEnum( eKind, sValue, aXML_GlueAlignment_EnumMap ) ) { - aGluePoint.PositionAlignment = (drawing::Alignment)eKind; + aGluePoint.PositionAlignment = eKind; aGluePoint.IsRelative = false; } } else if( IsXMLToken( aLocalName, XML_ESCAPE_DIRECTION ) ) { - sal_uInt16 eKind; - if( SvXMLUnitConverter::convertEnum( eKind, sValue, aXML_GlueEscapeDirection_EnumMap ) ) - { - aGluePoint.Escape = (drawing::EscapeDirection)eKind; - } + SvXMLUnitConverter::convertEnum( aGluePoint.Escape, sValue, aXML_GlueEscapeDirection_EnumMap ); } } } @@ -1173,11 +1167,7 @@ void SdXMLEllipseShapeContext::processAttribute( sal_uInt16 nPrefix, const OUStr { if( IsXMLToken( rLocalName, XML_KIND ) ) { - sal_uInt16 eKind; - if( SvXMLUnitConverter::convertEnum( eKind, rValue, aXML_CircleKind_EnumMap ) ) - { - meKind = eKind; - } + SvXMLUnitConverter::convertEnum( meKind, rValue, aXML_CircleKind_EnumMap ); return; } if( IsXMLToken( rLocalName, XML_START_ANGLE ) ) @@ -1754,7 +1744,7 @@ SdXMLConnectorShapeContext::SdXMLConnectorShapeContext( : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maStart(0,0), maEnd(1,1), - mnType( (sal_uInt16)drawing::ConnectorType_STANDARD ), + mnType( drawing::ConnectorType_STANDARD ), mnStartGlueId(-1), mnEndGlueId(-1), mnDelta1(0), diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index dc8e219d6344..6fa574c9e3d9 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -24,6 +24,10 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/document/XActionLockable.hpp> +#include <com/sun/star/drawing/Alignment.hpp> +#include <com/sun/star/drawing/CircleKind.hpp> +#include <com/sun/star/drawing/ConnectorType.hpp> +#include <com/sun/star/drawing/EscapeDirection.hpp> #include <com/sun/star/container/XIdentifierContainer.hpp> #include <xmloff/xmlictxt.hxx> #include "sdxmlimp_impl.hxx" @@ -37,7 +41,7 @@ #include <xmloff/xmlmultiimagehelper.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> -struct SvXMLEnumMapEntry; +template<typename EnumT> struct SvXMLEnumMapEntry; // common shape context @@ -173,7 +177,7 @@ class SdXMLEllipseShapeContext : public SdXMLShapeContext sal_Int32 mnRX; sal_Int32 mnRY; - sal_uInt16 meKind; + css::drawing::CircleKind meKind; sal_Int32 mnStartAngle; sal_Int32 mnEndAngle; public: @@ -281,7 +285,8 @@ private: css::awt::Point maStart; css::awt::Point maEnd; - sal_uInt16 mnType; + css::drawing::ConnectorType + mnType; OUString maStartShapeId; sal_Int32 mnStartGlueId; @@ -619,8 +624,8 @@ private: bool maTemplateStylesUsed[6]; }; -extern SvXMLEnumMapEntry const aXML_GlueAlignment_EnumMap[]; -extern SvXMLEnumMapEntry const aXML_GlueEscapeDirection_EnumMap[]; +extern SvXMLEnumMapEntry<css::drawing::Alignment> const aXML_GlueAlignment_EnumMap[]; +extern SvXMLEnumMapEntry<css::drawing::EscapeDirection> const aXML_GlueEscapeDirection_EnumMap[]; #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSHAP_HXX |