From 7e9857c2935bb2533806db4e71c6cd1e171c3478 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 9 Mar 2017 09:04:15 +0200 Subject: 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* in various places, to avoid carrying the type param around. Change-Id: Idfbc5561303c557598dd5564b7a7259ae5261d83 Reviewed-on: https://gerrit.libreoffice.org/34987 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx | 2 +- .../inc/XMLBitmapRepeatOffsetPropertyHandler.hxx | 2 +- xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx | 2 +- xmloff/inc/XMLRectangleMembersHandler.hxx | 2 +- xmloff/inc/anim.hxx | 6 +- xmloff/inc/animations.hxx | 34 +-- xmloff/inc/enummaps.hxx | 11 +- xmloff/source/chart/PropertyMap.hxx | 34 +-- xmloff/source/chart/PropertyMaps.cxx | 33 +-- xmloff/source/chart/SchXMLAxisContext.cxx | 10 +- xmloff/source/chart/SchXMLEnumConverter.cxx | 16 +- xmloff/source/chart/SchXMLTools.cxx | 10 +- .../source/chart/XMLErrorBarStylePropertyHdl.cxx | 4 +- .../source/chart/XMLErrorBarStylePropertyHdl.hxx | 2 +- xmloff/source/core/xmluconv.cxx | 32 +-- xmloff/source/draw/animationexport.cxx | 76 +++--- xmloff/source/draw/animationimport.cxx | 34 +-- xmloff/source/draw/animexp.cxx | 2 +- xmloff/source/draw/animimp.cxx | 24 +- xmloff/source/draw/eventimp.cxx | 20 +- xmloff/source/draw/sdpropls.cxx | 191 +++++++------ xmloff/source/draw/sdpropls.hxx | 6 +- xmloff/source/draw/shapeexport.cxx | 4 +- xmloff/source/draw/ximpcustomshape.cxx | 10 +- xmloff/source/draw/ximpshap.cxx | 28 +- xmloff/source/draw/ximpshap.hxx | 15 +- xmloff/source/forms/controlpropertyhdl.cxx | 6 +- xmloff/source/forms/elementexport.cxx | 4 +- xmloff/source/forms/formattributes.cxx | 4 +- xmloff/source/forms/formattributes.hxx | 19 +- xmloff/source/forms/formenums.cxx | 302 ++++++++++----------- xmloff/source/forms/formenums.hxx | 43 +-- xmloff/source/forms/propertyexport.cxx | 8 +- xmloff/source/forms/propertyexport.hxx | 19 +- xmloff/source/forms/propertyimport.cxx | 2 +- xmloff/source/forms/propertyimport.hxx | 13 +- xmloff/source/style/DashStyle.cxx | 10 +- xmloff/source/style/EnumPropertyHdl.cxx | 3 +- xmloff/source/style/GradientStyle.cxx | 12 +- xmloff/source/style/HatchStyle.cxx | 12 +- xmloff/source/style/PageMasterPropHdlFactory.cxx | 8 +- xmloff/source/style/TransGradientStyle.cxx | 10 +- xmloff/source/style/XMLBackgroundImageContext.cxx | 38 ++- .../source/style/XMLConstantsPropertyHandler.cxx | 8 - xmloff/source/style/XMLFootnoteSeparatorExport.cxx | 8 +- xmloff/source/style/XMLFootnoteSeparatorImport.cxx | 20 +- xmloff/source/style/adjushdl.cxx | 16 +- xmloff/source/style/backhdl.cxx | 22 +- xmloff/source/style/bordrhdl.cxx | 4 +- xmloff/source/style/breakhdl.cxx | 2 +- xmloff/source/style/cdouthdl.cxx | 54 ++-- xmloff/source/style/csmaphdl.cxx | 2 +- xmloff/source/style/fonthdl.cxx | 14 +- xmloff/source/style/postuhdl.cxx | 8 +- xmloff/source/style/prhdlfac.cxx | 19 +- xmloff/source/style/undlihdl.cxx | 82 +++--- xmloff/source/style/xmlnumfi.cxx | 24 +- xmloff/source/style/xmltabe.cxx | 4 +- .../text/XMLFootnoteConfigurationImportContext.cxx | 10 +- .../text/XMLIndexBibliographyEntryContext.cxx | 2 +- .../text/XMLIndexBibliographyEntryContext.hxx | 4 +- .../text/XMLIndexChapterInfoEntryContext.cxx | 2 +- xmloff/source/text/XMLIndexTOCContext.cxx | 11 +- xmloff/source/text/XMLIndexTableSourceContext.cxx | 2 +- xmloff/source/text/XMLIndexTemplateContext.cxx | 18 +- xmloff/source/text/XMLIndexTemplateContext.hxx | 30 +- xmloff/source/text/XMLLineNumberingExport.cxx | 4 +- .../source/text/XMLLineNumberingImportContext.cxx | 10 +- xmloff/source/text/XMLSectionExport.cxx | 29 +- xmloff/source/text/XMLTextColumnsContext.cxx | 32 +-- xmloff/source/text/XMLTextMarkImportContext.cxx | 26 +- xmloff/source/text/txtflde.cxx | 20 +- xmloff/source/text/txtfldi.cxx | 34 +-- xmloff/source/text/txtprhdl.cxx | 94 +++---- xmloff/source/text/txtstyli.cxx | 2 +- xmloff/source/text/txtvfldi.cxx | 10 +- 76 files changed, 835 insertions(+), 915 deletions(-) (limited to 'xmloff') diff --git a/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx b/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx index ced08e4cab80..6550c42ea25c 100644 --- a/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx +++ b/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx @@ -22,7 +22,7 @@ #include -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; /** Abstract base-class for different XML-types. Derivations of this class diff --git a/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx b/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx index 393cd4761825..c7739a5c7206 100644 --- a/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx +++ b/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx @@ -22,7 +22,7 @@ #include -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; /** Abstract base-class for different XML-types. Derivations of this class knows how to compare, im/export a special XML-type diff --git a/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx b/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx index 8fc21596b272..276faced29d0 100644 --- a/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx +++ b/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx @@ -22,7 +22,7 @@ #include -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; /** Abstract base-class for different XML-types. Derivations of this class diff --git a/xmloff/inc/XMLRectangleMembersHandler.hxx b/xmloff/inc/XMLRectangleMembersHandler.hxx index 965aa3c2939f..db6209e1a984 100644 --- a/xmloff/inc/XMLRectangleMembersHandler.hxx +++ b/xmloff/inc/XMLRectangleMembersHandler.hxx @@ -22,7 +22,7 @@ #include -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; /** Abstract base-class for different XML-types. Derivations of this class diff --git a/xmloff/inc/anim.hxx b/xmloff/inc/anim.hxx index 809273f0a87d..6a91237e5e36 100644 --- a/xmloff/inc/anim.hxx +++ b/xmloff/inc/anim.hxx @@ -45,7 +45,7 @@ enum XMLEffect EK_stretch }; -extern const SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[]; +extern const SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[]; enum XMLEffectDirection { @@ -84,9 +84,9 @@ enum XMLEffectDirection ED_cclockwise }; -extern const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[]; +extern const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[]; -extern const SvXMLEnumMapEntry aXML_AnimationSpeed_EnumMap[]; +extern const SvXMLEnumMapEntry aXML_AnimationSpeed_EnumMap[]; void SdXMLImplSetEffect( css::presentation::AnimationEffect eEffect, XMLEffect& eKind, XMLEffectDirection& eDirection, sal_Int16& nStartScale, bool& bIn ); css::presentation::AnimationEffect ImplSdXMLgetEffect( XMLEffect eKind, XMLEffectDirection eDirection, sal_Int16 nStartScale, bool bIn ); diff --git a/xmloff/inc/animations.hxx b/xmloff/inc/animations.hxx index 417a213e03b7..e00e6948aed1 100644 --- a/xmloff/inc/animations.hxx +++ b/xmloff/inc/animations.hxx @@ -22,26 +22,26 @@ #include -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; namespace xmloff { -extern const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_FillDefault[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_SubItem[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_IterateType[]; -extern const SvXMLEnumMapEntry aAnimations_EnumMap_Command[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_FillDefault[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_SubItem[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_IterateType[]; +extern const SvXMLEnumMapEntry aAnimations_EnumMap_Command[]; struct ImplAttributeNameConversion { diff --git a/xmloff/inc/enummaps.hxx b/xmloff/inc/enummaps.hxx index 5f543eda2355..525620b72239 100644 --- a/xmloff/inc/enummaps.hxx +++ b/xmloff/inc/enummaps.hxx @@ -11,12 +11,15 @@ #define INCLUDED_XMLOFF_INC_ENUMMAPS_HXX #include +#include +#include +#include -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; -extern SvXMLEnumMapEntry const aXML_FillStyle_EnumMap[]; -extern SvXMLEnumMapEntry const aXML_RefPoint_EnumMap[]; -extern SvXMLEnumMapEntry const aXML_BitmapMode_EnumMap[]; +extern SvXMLEnumMapEntry const aXML_FillStyle_EnumMap[]; +extern SvXMLEnumMapEntry const aXML_RefPoint_EnumMap[]; +extern SvXMLEnumMapEntry const aXML_BitmapMode_EnumMap[]; #endif diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index fc919ea30e36..8c5158e9f138 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -260,7 +260,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] = // maps for enums to XML attributes -const SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] = +const SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] = { { ::xmloff::token::XML_NEAR_AXIS, css::chart::ChartAxisLabelPosition_NEAR_AXIS }, { ::xmloff::token::XML_NEAR_AXIS_OTHER_SIDE, css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE }, @@ -268,26 +268,26 @@ const SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] = { ::xmloff::token::XML_OUTSIDE_END, css::chart::ChartAxisLabelPosition_OUTSIDE_END }, { ::xmloff::token::XML_OUTSIDE_MINIMUM, css::chart::ChartAxisLabelPosition_OUTSIDE_START },//#i114142# { ::xmloff::token::XML_OUTSIDE_MAXIMUM, css::chart::ChartAxisLabelPosition_OUTSIDE_END },//#i114142# - { ::xmloff::token::XML_TOKEN_INVALID, 0 } + { ::xmloff::token::XML_TOKEN_INVALID, (css::chart::ChartAxisLabelPosition)0 } }; -const SvXMLEnumMapEntry aXMLChartAxisMarkPositionEnumMap[] = +const SvXMLEnumMapEntry aXMLChartAxisMarkPositionEnumMap[] = { { ::xmloff::token::XML_AT_LABELS, css::chart::ChartAxisMarkPosition_AT_LABELS }, { ::xmloff::token::XML_AT_AXIS, css::chart::ChartAxisMarkPosition_AT_AXIS }, { ::xmloff::token::XML_AT_LABELS_AND_AXIS, css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS }, - { ::xmloff::token::XML_TOKEN_INVALID, 0 } + { ::xmloff::token::XML_TOKEN_INVALID, (css::chart::ChartAxisMarkPosition)0 } }; -const SvXMLEnumMapEntry aXMLChartAxisArrangementEnumMap[] = +const SvXMLEnumMapEntry aXMLChartAxisArrangementEnumMap[] = { - { ::xmloff::token::XML_SIDE_BY_SIDE, css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE }, - { ::xmloff::token::XML_STAGGER_EVEN, css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN }, - { ::xmloff::token::XML_STAGGER_ODD, css::chart::ChartAxisArrangeOrderType_STAGGER_ODD }, - { ::xmloff::token::XML_TOKEN_INVALID, 0 } + { ::xmloff::token::XML_SIDE_BY_SIDE, css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE }, + { ::xmloff::token::XML_STAGGER_EVEN, css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN }, + { ::xmloff::token::XML_STAGGER_ODD, css::chart::ChartAxisArrangeOrderType_STAGGER_ODD }, + { ::xmloff::token::XML_TOKEN_INVALID, (css::chart::ChartAxisArrangeOrderType)0 } }; -const SvXMLEnumMapEntry aXMLChartErrorBarStyleEnumMap[] = +const SvXMLEnumMapEntry aXMLChartErrorBarStyleEnumMap[] = { { ::xmloff::token::XML_NONE, css::chart::ErrorBarStyle::NONE }, { ::xmloff::token::XML_VARIANCE, css::chart::ErrorBarStyle::VARIANCE }, @@ -300,23 +300,23 @@ const SvXMLEnumMapEntry aXMLChartErrorBarStyleEnumMap[] = { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aXMLChartSolidTypeEnumMap[] = +const SvXMLEnumMapEntry aXMLChartSolidTypeEnumMap[] = { { ::xmloff::token::XML_CUBOID, css::chart::ChartSolidType::RECTANGULAR_SOLID }, { ::xmloff::token::XML_CYLINDER, css::chart::ChartSolidType::CYLINDER }, - { ::xmloff::token::XML_CONE, css::chart::ChartSolidType::CONE }, + { ::xmloff::token::XML_CONE, css::chart::ChartSolidType::CONE }, { ::xmloff::token::XML_PYRAMID, css::chart::ChartSolidType::PYRAMID }, { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aXMLChartDataRowSourceTypeEnumMap[] = +const SvXMLEnumMapEntry aXMLChartDataRowSourceTypeEnumMap[] = { { ::xmloff::token::XML_COLUMNS, css::chart::ChartDataRowSource_COLUMNS }, { ::xmloff::token::XML_ROWS, css::chart::ChartDataRowSource_ROWS }, - { ::xmloff::token::XML_TOKEN_INVALID, 0 } + { ::xmloff::token::XML_TOKEN_INVALID, (css::chart::ChartDataRowSource)0 } }; -const SvXMLEnumMapEntry aXMLChartInterpolationTypeEnumMap[] = +const SvXMLEnumMapEntry aXMLChartInterpolationTypeEnumMap[] = { // this is neither an enum nor a constants group, but just a // documented long property @@ -336,7 +336,7 @@ const SvXMLEnumMapEntry aXMLChartInterpolationTypeEnumMap[] = { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aXMLChartDataLabelPlacementEnumMap[] = +const SvXMLEnumMapEntry aXMLChartDataLabelPlacementEnumMap[] = { { ::xmloff::token::XML_AVOID_OVERLAP, css::chart::DataLabelPlacement::AVOID_OVERLAP }, { ::xmloff::token::XML_CENTER, css::chart::DataLabelPlacement::CENTER }, @@ -354,7 +354,7 @@ const SvXMLEnumMapEntry aXMLChartDataLabelPlacementEnumMap[] = { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aXMLChartMissingValueTreatmentEnumMap[] = +const SvXMLEnumMapEntry aXMLChartMissingValueTreatmentEnumMap[] = { { ::xmloff::token::XML_LEAVE_GAP, css::chart::MissingValueTreatment::LEAVE_GAP }, { ::xmloff::token::XML_USE_ZERO, css::chart::MissingValueTreatment::USE_ZERO }, diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 9bb864bc986e..70127bed872c 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -69,12 +69,12 @@ using namespace ::xmloff::token; namespace { -SvXMLEnumMapEntry const aLineStyleMap[] = +SvXMLEnumMapEntry const aLineStyleMap[] = { { 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 } }; } @@ -106,24 +106,20 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 break; case XML_SCH_TYPE_AXIS_LABEL_POSITION: - pHdl = new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap, - cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap); break; case XML_SCH_TYPE_TICK_MARK_POSITION: - pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap, - cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap); break; case XML_SCH_TYPE_AXIS_ARRANGEMENT: - pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap, - cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap); break; case XML_SCH_TYPE_ERROR_BAR_STYLE: // here we have a constant rather than an enum - pHdl = new XMLErrorBarStylePropertyHdl( aXMLChartErrorBarStyleEnumMap, - ::cppu::UnoType::get() ); + pHdl = new XMLErrorBarStylePropertyHdl( aXMLChartErrorBarStyleEnumMap ); break; case XML_SCH_TYPE_ERROR_INDICATOR_LOWER: @@ -135,25 +131,21 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 case XML_SCH_TYPE_SOLID_TYPE: // here we have a constant rather than an enum - pHdl = new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap, - ::cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap ); break; case XML_SCH_TYPE_LABEL_PLACEMENT_TYPE: // here we have a constant rather than an enum - pHdl = new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap, - ::cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap ); break; case XML_SCH_TYPE_DATAROWSOURCE: - pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap, - cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap); break; case XML_SCH_TYPE_TEXT_ORIENTATION: pHdl = new XMLTextOrientationHdl; break; case XML_SCH_TYPE_INTERPOLATION: - pHdl = new XMLEnumPropertyHdl( aXMLChartInterpolationTypeEnumMap, - ::cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXMLChartInterpolationTypeEnumMap ); break; case XML_SCH_TYPE_SYMBOL_TYPE: pHdl = new XMLSymbolTypePropertyHdl( false ); @@ -164,11 +156,10 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 break; case XML_SCH_TYPE_MISSING_VALUE_TREATMENT: - pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap, - ::cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap ); break; case XML_SCH_TYPE_LABEL_BORDER_STYLE: - pHdl = new XMLEnumPropertyHdl(aLineStyleMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aLineStyleMap ); break; case XML_SCH_TYPE_LABEL_BORDER_OPACITY: pHdl = new XMLOpacityPropertyHdl(nullptr); diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 3c72187bc5a1..7a291d1e98eb 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -51,15 +51,15 @@ using namespace com::sun::star; using com::sun::star::uno::Reference; -static const SvXMLEnumMapEntry aXMLAxisDimensionMap[] = +static const SvXMLEnumMapEntry aXMLAxisDimensionMap[] = { { XML_X, SCH_XML_AXIS_X }, { XML_Y, SCH_XML_AXIS_Y }, { XML_Z, SCH_XML_AXIS_Z }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (SchXMLAxisDimension)0 } }; -static const SvXMLEnumMapEntry aXMLAxisTypeMap[] = +static const SvXMLEnumMapEntry aXMLAxisTypeMap[] = { { XML_AUTO, css::chart::ChartAxisType::AUTOMATIC }, { XML_TEXT, css::chart::ChartAxisType::CATEGORY }, @@ -271,9 +271,9 @@ void SchXMLAxisContext::StartElement( const Reference< xml::sax::XAttributeList { case XML_TOK_AXIS_DIMENSION: { - sal_uInt16 nEnumVal; + SchXMLAxisDimension nEnumVal; if( SvXMLUnitConverter::convertEnum( nEnumVal, aValue, aXMLAxisDimensionMap )) - m_aCurrentAxis.eDimension = ( SchXMLAxisDimension )nEnumVal; + m_aCurrentAxis.eDimension = nEnumVal; } break; case XML_TOK_AXIS_NAME: diff --git a/xmloff/source/chart/SchXMLEnumConverter.cxx b/xmloff/source/chart/SchXMLEnumConverter.cxx index 1e661d3a44ca..fcaf78a0a386 100644 --- a/xmloff/source/chart/SchXMLEnumConverter.cxx +++ b/xmloff/source/chart/SchXMLEnumConverter.cxx @@ -17,11 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "SchXMLEnumConverter.hxx" - #include #include - +#include "SchXMLEnumConverter.hxx" #include using namespace ::xmloff::token; @@ -30,40 +28,40 @@ using namespace ::com::sun::star; namespace { -const SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] = +const SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] = { { XML_START, chart::ChartLegendPosition_LEFT }, { XML_TOP, chart::ChartLegendPosition_TOP }, { XML_END, chart::ChartLegendPosition_RIGHT }, { XML_BOTTOM, chart::ChartLegendPosition_BOTTOM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (chart::ChartLegendPosition)0 } }; class XMLLegendPositionPropertyHdl : public XMLEnumPropertyHdl { public: XMLLegendPositionPropertyHdl() - : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap, cppu::UnoType::get()) {} + : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap) {} }; struct TheLegendPositionPropertyHdl : public rtl::Static< XMLLegendPositionPropertyHdl, TheLegendPositionPropertyHdl > { }; -const SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] = +const SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] = { { XML_WIDE, chart::ChartLegendExpansion_WIDE }, { XML_HIGH, chart::ChartLegendExpansion_HIGH }, { XML_BALANCED, chart::ChartLegendExpansion_BALANCED }, { XML_CUSTOM, chart::ChartLegendExpansion_CUSTOM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (chart::ChartLegendExpansion)0 } }; class XMLLegendExpansionPropertyHdl : public XMLEnumPropertyHdl { public: XMLLegendExpansionPropertyHdl() - : XMLEnumPropertyHdl( aXMLLegendExpansionEnumMap, cppu::UnoType::get()) {} + : XMLEnumPropertyHdl( aXMLLegendExpansionEnumMap) {} }; struct TheLegendExpansionPropertyHdl : public rtl::Static< XMLLegendExpansionPropertyHdl, TheLegendExpansionPropertyHdl > diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 34b1a3e6b3b5..31c1ac161b1a 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -126,7 +126,7 @@ Reference< chart2::data::XDataSequence > lcl_createNewSequenceFromCachedXMLRange namespace SchXMLTools { -static const SvXMLEnumMapEntry aXMLChartClassMap[] = +static const SvXMLEnumMapEntry aXMLChartClassMap[] = { { XML_LINE, XML_CHART_CLASS_LINE }, { XML_AREA, XML_CHART_CLASS_AREA }, @@ -146,11 +146,9 @@ static const SvXMLEnumMapEntry aXMLChartClassMap[] = SchXMLChartTypeEnum GetChartTypeEnum( const OUString& rClassName ) { - sal_uInt16 nEnumVal = XML_CHART_CLASS_UNKNOWN; - if( !SvXMLUnitConverter::convertEnum( - nEnumVal, rClassName, aXMLChartClassMap ) ) - nEnumVal = XML_CHART_CLASS_UNKNOWN; - return SchXMLChartTypeEnum(nEnumVal); + SchXMLChartTypeEnum nEnumVal = XML_CHART_CLASS_UNKNOWN; + SvXMLUnitConverter::convertEnum( nEnumVal, rClassName, aXMLChartClassMap ); + return nEnumVal; } typedef std::map< OUString, OUString > tMakeStringStringMap; diff --git a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx index 12abe339db8c..59fbc83c689a 100644 --- a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx +++ b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx @@ -25,8 +25,8 @@ using namespace com::sun::star; -XMLErrorBarStylePropertyHdl::XMLErrorBarStylePropertyHdl( const SvXMLEnumMapEntry* pEnumMap, const css::uno::Type & rType ) - : XMLEnumPropertyHdl( pEnumMap, rType ) +XMLErrorBarStylePropertyHdl::XMLErrorBarStylePropertyHdl( const SvXMLEnumMapEntry* pEnumMap ) + : XMLEnumPropertyHdl( pEnumMap ) { } diff --git a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.hxx b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.hxx index b7c0c01ece7c..dfe6354c716f 100644 --- a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.hxx +++ b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.hxx @@ -24,7 +24,7 @@ class XMLErrorBarStylePropertyHdl : public XMLEnumPropertyHdl { public: - XMLErrorBarStylePropertyHdl( const SvXMLEnumMapEntry* pEnumMap, const css::uno::Type & rType ); + XMLErrorBarStylePropertyHdl( const SvXMLEnumMapEntry* pEnumMap ); virtual ~XMLErrorBarStylePropertyHdl() override; virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index fa34a3006f6b..78d576091e13 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -185,15 +185,15 @@ void SvXMLUnitConverter::convertMeasureToXML( OUStringBuffer& rString, /** convert string to enum using given enum map, if the enum is not found in the map, this method will return false */ -bool SvXMLUnitConverter::convertEnum( sal_uInt16& rEnum, +bool SvXMLUnitConverter::convertEnumImpl( sal_uInt16& rEnum, const OUString& rValue, - const SvXMLEnumStringMapEntry *pMap ) + const SvXMLEnumStringMapEntry *pMap ) { - while( pMap->pName ) + while( pMap->GetName() ) { - if( rValue.equalsAsciiL( pMap->pName, pMap->nNameLength ) ) + if( rValue.equalsAsciiL( pMap->GetName(), pMap->GetNameLength() ) ) { - rEnum = pMap->nValue; + rEnum = pMap->GetValue(); return true; } ++pMap; @@ -204,16 +204,16 @@ bool SvXMLUnitConverter::convertEnum( sal_uInt16& rEnum, /** convert string to enum using given token map, if the enum is not found in the map, this method will return false */ -bool SvXMLUnitConverter::convertEnum( +bool SvXMLUnitConverter::convertEnumImpl( sal_uInt16& rEnum, const OUString& rValue, - const SvXMLEnumMapEntry *pMap ) + const SvXMLEnumMapEntry *pMap ) { - while( pMap->eToken != XML_TOKEN_INVALID ) + while( pMap->GetToken() != XML_TOKEN_INVALID ) { - if( IsXMLToken( rValue, pMap->eToken ) ) + if( IsXMLToken( rValue, pMap->GetToken() ) ) { - rEnum = pMap->nValue; + rEnum = pMap->GetValue(); return true; } ++pMap; @@ -225,19 +225,19 @@ bool SvXMLUnitConverter::convertEnum( default token. If the enum is not found in the map, this method will either use the given default or return false if no default is set */ -bool SvXMLUnitConverter::convertEnum( +bool SvXMLUnitConverter::convertEnumImpl( OUStringBuffer& rBuffer, - unsigned int nValue, - const SvXMLEnumMapEntry *pMap, + sal_uInt16 nValue, + const SvXMLEnumMapEntry *pMap, enum XMLTokenEnum eDefault) { enum XMLTokenEnum eTok = eDefault; - while( pMap->eToken != XML_TOKEN_INVALID ) + while( pMap->GetToken() != XML_TOKEN_INVALID ) { - if( pMap->nValue == nValue ) + if( pMap->GetValue() == nValue ) { - eTok = pMap->eToken; + eTok = pMap->GetToken(); break; } ++pMap; 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 #include #include -#include #include #include -#include -#include -#include -#include #include #include #include @@ -366,60 +361,60 @@ const XMLPropertyMapEntry aXMLTableShapeAttributes[] = // implementation of factory for own graphic properties -static SvXMLEnumMapEntry const aXML_LineStyle_EnumMap[] = +static SvXMLEnumMapEntry 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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::get()); + pHdl = new XMLEnumPropertyHdl( aXML_LineStyle_EnumMap); break; } case XML_SD_TYPE_LINEJOIN : { - pHdl = new XMLEnumPropertyHdl( aXML_LineJoint_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_LineJoint_EnumMap); break; } case XML_SD_TYPE_LINECAP : { - pHdl = new XMLEnumPropertyHdl( aXML_LineCap_EnumMap, ::cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_LineCap_EnumMap ); break; } case XML_SD_TYPE_FILLSTYLE : { - pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap ); break; } case XML_SD_TYPE_PRESPAGE_TYPE : { - pHdl = new XMLEnumPropertyHdl( aXML_PresChange_EnumMap, ::cppu::UnoType::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::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_FadeEffect_EnumMap ); break; } case XML_SD_TYPE_PRESPAGE_SPEED : { - pHdl = new XMLEnumPropertyHdl( aXML_TransSpeed_EnumMap, cppu::UnoType::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::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::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::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationX_EnumMap ); break; } case XML_SD_TYPE_TEX_GENERATION_MODE_Y: { - pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationY_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexGenerationY_EnumMap ); break; } case XML_SD_TYPE_TEX_KIND: { - pHdl = new XMLEnumPropertyHdl( aXML_TexKind_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_TexKind_EnumMap ); break; } case XML_SD_TYPE_TEX_MODE: { - pHdl = new XMLEnumPropertyHdl( aXML_TexMode_EnumMap, cppu::UnoType::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::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::get()); + pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap); break; } case XML_TYPE_TEXT_ANIMATION: - pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Enum, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Enum); break; case XML_TYPE_TEXT_ANIMATION_BLINKING: - pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Blinking_Enum, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAnimation_Blinking_Enum); break; case XML_TYPE_TEXT_ANIMATION_DIRECTION: - pHdl = new XMLEnumPropertyHdl( pXML_TextAnimationDirection_Enum, cppu::UnoType::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::get()); + pHdl = new XMLEnumPropertyHdl( pXML_TextAlign_Enum); break; case XML_SD_TYPE_VERTICAL_ALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, cppu::UnoType::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::get()); + pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum_Odf12); } else { - pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum, - cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl(pXML_FitToSize_Enum); } } break; case XML_SD_TYPE_MEASURE_UNIT: - pHdl = new XMLEnumPropertyHdl( pXML_MeasureUnit_Enum, ::cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( pXML_MeasureUnit_Enum ); break; case XML_SD_TYPE_MEASURE_HALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_Measure_HAlign_Enum, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Measure_HAlign_Enum); break; case XML_SD_TYPE_MEASURE_VALIGN: - pHdl = new XMLEnumPropertyHdl( pXML_Measure_VAlign_Enum, cppu::UnoType::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::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Style_Enum ); break; case XML_SD_TYPE_FONTWORK_ADJUST : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Adjust_Enum , ::cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Adjust_Enum ); break; case XML_SD_TYPE_FONTWORK_SHADOW : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Shadow_Enum , ::cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Shadow_Enum ); break; case XML_SD_TYPE_FONTWORK_FORM : - pHdl = new XMLEnumPropertyHdl( pXML_Fontwork_Form_Enum , ::cppu::UnoType::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::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::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::get()); + pHdl = new XMLEnumPropertyHdl( xmloff::aAnimations_EnumMap_TransitionType ); break; case XML_SD_TYPE_TRANSTIION_SUBTYPE: - pHdl = new XMLEnumPropertyHdl( xmloff::aAnimations_EnumMap_TransitionSubType, ::cppu::UnoType::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 +#include +#include #include #include #include @@ -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 const aXML_ConnectionKind_EnumMap[]; +extern SvXMLEnumMapEntry 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 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 void GetEnum( std::vector< css::beans::PropertyValue >& rDest, const OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp, - const SvXMLEnumMapEntry& rMap ) + const SvXMLEnumMapEntry& 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(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 #include #include -#include #include #include #include @@ -54,7 +53,6 @@ #include "xexptran.hxx" #include #include -#include #include #include @@ -97,7 +95,7 @@ using namespace ::com::sun::star::document; using namespace ::xmloff::token; using namespace ::xmloff::EnhancedCustomShapeToken; -SvXMLEnumMapEntry const aXML_GlueAlignment_EnumMap[] = +SvXMLEnumMapEntry 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 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 #include +#include +#include +#include +#include #include #include #include "sdxmlimp_impl.hxx" @@ -37,7 +41,7 @@ #include #include -struct SvXMLEnumMapEntry; +template 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 const aXML_GlueAlignment_EnumMap[]; +extern SvXMLEnumMapEntry const aXML_GlueEscapeDirection_EnumMap[]; #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSHAP_HXX diff --git a/xmloff/source/forms/controlpropertyhdl.cxx b/xmloff/source/forms/controlpropertyhdl.cxx index 43e9d8760b6f..2b657689635d 100644 --- a/xmloff/source/forms/controlpropertyhdl.cxx +++ b/xmloff/source/forms/controlpropertyhdl.cxx @@ -124,7 +124,7 @@ namespace xmloff if (_rValue >>= nFontEmphasis) { // the type - sal_Int16 nType = nFontEmphasis & ~(awt::FontEmphasisMark::ABOVE | awt::FontEmphasisMark::BELOW); + sal_uInt16 nType = nFontEmphasis & ~(awt::FontEmphasisMark::ABOVE | awt::FontEmphasisMark::BELOW); // the position of the mark bool bBelow = 0 != (nFontEmphasis & awt::FontEmphasisMark::BELOW); @@ -184,7 +184,7 @@ namespace xmloff if (bSuccess) { nEmphasis |= bBelow ? awt::FontEmphasisMark::BELOW : awt::FontEmphasisMark::ABOVE; - _rValue <<= (sal_Int16)nEmphasis; + _rValue <<= nEmphasis; } return bSuccess; @@ -242,7 +242,7 @@ namespace xmloff { case STYLE: { - sal_Int16 nBorder = 0; + sal_uInt16 nBorder = 0; bSuccess = (_rValue >>= nBorder) && SvXMLUnitConverter::convertEnum( aOut, nBorder, aBorderTypeMap ); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 29d837bb347b..a2a1b10fc580 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -663,7 +663,7 @@ namespace xmloff OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ), PROPERTY_ORIENTATION, aOrientationMap, - ScrollBarOrientation::HORIZONTAL + (sal_uInt16)ScrollBarOrientation::HORIZONTAL ); #if OSL_DEBUG_LEVEL > 0 // reset the bit for later checking @@ -1784,7 +1784,7 @@ namespace xmloff OUStringBuffer sBuffer; SvXMLUnitConverter::convertEnum( sBuffer, - (sal_uInt16)nLinkageType, + nLinkageType, aListLinkageMap ); diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index fb04f93b9708..e69f984806de 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -247,9 +247,9 @@ namespace xmloff implAdd( _pAttributeName, _rPropertyName, ::cppu::UnoType::get(), OUString::number( _nAttributeDefault ) ); } - void OAttribute2Property::addEnumProperty( + void OAttribute2Property::addEnumPropertyImpl( const sal_Char* _pAttributeName, const OUString& _rPropertyName, - const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, + const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, const css::uno::Type* _pType) { OUStringBuffer aDefault; diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx index fcfab79fbde7..a5dd78959604 100644 --- a/xmloff/source/forms/formattributes.hxx +++ b/xmloff/source/forms/formattributes.hxx @@ -30,6 +30,7 @@ #include #include +template struct SvXMLEnumMapEntry; // flags for common control attributes @@ -280,8 +281,9 @@ namespace xmloff css::uno::Type aPropertyType; // the property type // entries which are special to some value types - const SvXMLEnumMapEntry* pEnumMap; // the enum map, if appliable - bool bInverseSemantics; // for booleans: attribute and property value have the same or an inverse semantics? + const SvXMLEnumMapEntry* + pEnumMap; // the enum map, if applicable + bool bInverseSemantics; // for booleans: attribute and property value have the same or an inverse semantics? AttributeAssignment() : pEnumMap(nullptr), bInverseSemantics(false) { } }; @@ -373,12 +375,21 @@ namespace xmloff @param _pType the type of the property. May be NULL, in this case 32bit integer is assumed. */ + template void addEnumProperty( const sal_Char* _pAttributeName, const OUString& _rPropertyName, - const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, - const css::uno::Type* _pType = nullptr); + const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, + const css::uno::Type* _pType = nullptr) + { + addEnumPropertyImpl(_pAttributeName, _rPropertyName, _nAttributeDefault, + reinterpret_cast*>(_pValueMap), _pType); + } private: + void addEnumPropertyImpl( + const sal_Char* _pAttributeName, const OUString& _rPropertyName, + const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, + const css::uno::Type* _pType = nullptr); /// some common code for the various add*Property methods AttributeAssignment& implAdd( const sal_Char* _pAttributeName, const OUString& _rPropertyName, diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx index fd5dc8384f42..30b13cdb82e9 100644 --- a/xmloff/source/forms/formenums.cxx +++ b/xmloff/source/forms/formenums.cxx @@ -39,162 +39,154 @@ namespace xmloff { - using namespace ::com::sun::star::form; - using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::awt; - using namespace ::com::sun::star; - using namespace ::xmloff::token; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::sdb; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star; +using namespace ::xmloff::token; - // FormSubmitEncoding - const SvXMLEnumMapEntry aSubmitEncodingMap[] = - { - { XML_APPLICATION_X_WWW_FORM_URLENCODED, FormSubmitEncoding_URL }, - { XML_MULTIPART_FORMDATA, FormSubmitEncoding_MULTIPART }, - { XML_APPLICATION_TEXT, FormSubmitEncoding_TEXT }, - { XML_TOKEN_INVALID, 0 } - }; - // FormSubmitMethod - const SvXMLEnumMapEntry aSubmitMethodMap[] = - { - { XML_GET, FormSubmitMethod_GET }, - { XML_POST, FormSubmitMethod_POST }, - { XML_TOKEN_INVALID, 0 } - }; - - // CommandType - const SvXMLEnumMapEntry aCommandTypeMap[] = - { - { XML_TABLE, CommandType::TABLE }, - { XML_QUERY, CommandType::QUERY }, - { XML_COMMAND, CommandType::COMMAND }, - { XML_TOKEN_INVALID, 0 } - }; - // NavigationBarMode - const SvXMLEnumMapEntry aNavigationTypeMap[] = - { - { XML_NONE, NavigationBarMode_NONE }, - { XML_CURRENT, NavigationBarMode_CURRENT }, - { XML_PARENT, NavigationBarMode_PARENT }, - { XML_TOKEN_INVALID, 0 } - }; - // TabulatorCycle - const SvXMLEnumMapEntry aTabulatorCycleMap[] = - { - { XML_RECORDS, TabulatorCycle_RECORDS }, - { XML_CURRENT, TabulatorCycle_CURRENT }, - { XML_PAGE, TabulatorCycle_PAGE }, - { XML_TOKEN_INVALID, 0 } - }; - // FormButtonType - const SvXMLEnumMapEntry aFormButtonTypeMap[] = - { - { XML_PUSH, FormButtonType_PUSH }, - { XML_SUBMIT, FormButtonType_SUBMIT }, - { XML_RESET, FormButtonType_RESET }, - { XML_URL, FormButtonType_URL }, - { XML_TOKEN_INVALID, 0 } - }; - // ListSourceType - const SvXMLEnumMapEntry aListSourceTypeMap[] = - { - { XML_VALUE_LIST, ListSourceType_VALUELIST }, - { XML_TABLE, ListSourceType_TABLE }, - { XML_QUERY, ListSourceType_QUERY }, - { XML_SQL, ListSourceType_SQL }, - { XML_SQL_PASS_THROUGH, ListSourceType_SQLPASSTHROUGH }, - { XML_TABLE_FIELDS, ListSourceType_TABLEFIELDS }, - { XML_TOKEN_INVALID, 0 } - }; - // check state of a checkbox - const SvXMLEnumMapEntry aCheckStateMap[] = - { - { XML_UNCHECKED, TRISTATE_FALSE }, - { XML_CHECKED, TRISTATE_TRUE }, - { XML_UNKNOWN, TRISTATE_INDET }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aTextAlignMap[] = - { - { XML_START, awt::TextAlign::LEFT }, - { XML_CENTER, awt::TextAlign::CENTER }, - { XML_END, awt::TextAlign::RIGHT }, - { XML_JUSTIFY, (sal_uInt16)-1 }, - { XML_JUSTIFIED, (sal_uInt16)-1 }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aBorderTypeMap[] = - { - { XML_NONE, 0 }, - { XML_HIDDEN, 0 }, - { XML_SOLID, 2 }, - { XML_DOUBLE, 2 }, - { XML_DOTTED, 2 }, - { XML_DASHED, 2 }, - { XML_GROOVE, 1 }, - { XML_RIDGE, 1 }, - { XML_INSET, 1 }, - { XML_OUTSET, 1 }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aFontEmphasisMap[] = - { - { XML_NONE, awt::FontEmphasisMark::NONE }, - { XML_DOT, awt::FontEmphasisMark::DOT }, - { XML_CIRCLE, awt::FontEmphasisMark::CIRCLE }, - { XML_DISC, awt::FontEmphasisMark::DISC }, - { XML_ACCENT, awt::FontEmphasisMark::ACCENT }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aFontReliefMap[] = - { - { XML_NONE, FontRelief::NONE }, - { XML_ENGRAVED, FontRelief::ENGRAVED }, - { XML_EMBOSSED, FontRelief::EMBOSSED }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aListLinkageMap[] = - { - { XML_SELECTION, 0 }, - { XML_SELECTION_INDEXES, 1 }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aOrientationMap[] = - { - { XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL }, - { XML_VERTICAL, ScrollBarOrientation::VERTICAL }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aVisualEffectMap[] = - { - { XML_NONE, VisualEffect::NONE }, - { XML_3D, VisualEffect::LOOK3D }, - { XML_FLAT, VisualEffect::FLAT }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aImagePositionMap[] = - { - { XML_START, 0 }, - { XML_END, 1 }, - { XML_TOP, 2 }, - { XML_BOTTOM, 3 }, - { XML_CENTER, (sal_uInt16)-1 }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aImageAlignMap[] = - { - { XML_START, 0 }, - { XML_CENTER, 1 }, - { XML_END, 2 }, - { XML_TOKEN_INVALID, 0 } - }; - const SvXMLEnumMapEntry aScaleModeMap[] = - { - { XML_BACKGROUND_NO_REPEAT, ImageScaleMode::NONE }, - { XML_REPEAT, ImageScaleMode::NONE }, // repeating the image is not supported - { XML_STRETCH, ImageScaleMode::ANISOTROPIC }, - { XML_SCALE, ImageScaleMode::ISOTROPIC }, - { XML_TOKEN_INVALID, ImageScaleMode::NONE } - }; +const SvXMLEnumMapEntry aSubmitEncodingMap[] = +{ + { XML_APPLICATION_X_WWW_FORM_URLENCODED, FormSubmitEncoding_URL }, + { XML_MULTIPART_FORMDATA, FormSubmitEncoding_MULTIPART }, + { XML_APPLICATION_TEXT, FormSubmitEncoding_TEXT }, + { XML_TOKEN_INVALID, (FormSubmitEncoding)0 } +}; +const SvXMLEnumMapEntry aSubmitMethodMap[] = +{ + { XML_GET, FormSubmitMethod_GET }, + { XML_POST, FormSubmitMethod_POST }, + { XML_TOKEN_INVALID, (FormSubmitMethod)0 } +}; +const SvXMLEnumMapEntry aCommandTypeMap[] = +{ + { XML_TABLE, CommandType::TABLE }, + { XML_QUERY, CommandType::QUERY }, + { XML_COMMAND, CommandType::COMMAND }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aNavigationTypeMap[] = +{ + { XML_NONE, NavigationBarMode_NONE }, + { XML_CURRENT, NavigationBarMode_CURRENT }, + { XML_PARENT, NavigationBarMode_PARENT }, + { XML_TOKEN_INVALID, (NavigationBarMode)0 } +}; +const SvXMLEnumMapEntry aTabulatorCycleMap[] = +{ + { XML_RECORDS, TabulatorCycle_RECORDS }, + { XML_CURRENT, TabulatorCycle_CURRENT }, + { XML_PAGE, TabulatorCycle_PAGE }, + { XML_TOKEN_INVALID, (TabulatorCycle)0 } +}; +const SvXMLEnumMapEntry aFormButtonTypeMap[] = +{ + { XML_PUSH, FormButtonType_PUSH }, + { XML_SUBMIT, FormButtonType_SUBMIT }, + { XML_RESET, FormButtonType_RESET }, + { XML_URL, FormButtonType_URL }, + { XML_TOKEN_INVALID, (FormButtonType)0 } +}; +const SvXMLEnumMapEntry aListSourceTypeMap[] = +{ + { XML_VALUE_LIST, ListSourceType_VALUELIST }, + { XML_TABLE, ListSourceType_TABLE }, + { XML_QUERY, ListSourceType_QUERY }, + { XML_SQL, ListSourceType_SQL }, + { XML_SQL_PASS_THROUGH, ListSourceType_SQLPASSTHROUGH }, + { XML_TABLE_FIELDS, ListSourceType_TABLEFIELDS }, + { XML_TOKEN_INVALID, (ListSourceType)0 } +}; +// check state of a checkbox +const SvXMLEnumMapEntry aCheckStateMap[] = +{ + { XML_UNCHECKED, TRISTATE_FALSE }, + { XML_CHECKED, TRISTATE_TRUE }, + { XML_UNKNOWN, TRISTATE_INDET }, + { XML_TOKEN_INVALID, (TriState)0 } +}; +const SvXMLEnumMapEntry aTextAlignMap[] = +{ + { XML_START, (sal_uInt16)awt::TextAlign::LEFT }, + { XML_CENTER, (sal_uInt16)awt::TextAlign::CENTER }, + { XML_END, (sal_uInt16)awt::TextAlign::RIGHT }, + { XML_JUSTIFY, -1 }, + { XML_JUSTIFIED, -1 }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aBorderTypeMap[] = +{ + { XML_NONE, 0 }, + { XML_HIDDEN, 0 }, + { XML_SOLID, 2 }, + { XML_DOUBLE, 2 }, + { XML_DOTTED, 2 }, + { XML_DASHED, 2 }, + { XML_GROOVE, 1 }, + { XML_RIDGE, 1 }, + { XML_INSET, 1 }, + { XML_OUTSET, 1 }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aFontEmphasisMap[] = +{ + { XML_NONE, awt::FontEmphasisMark::NONE }, + { XML_DOT, awt::FontEmphasisMark::DOT }, + { XML_CIRCLE, awt::FontEmphasisMark::CIRCLE }, + { XML_DISC, awt::FontEmphasisMark::DISC }, + { XML_ACCENT, awt::FontEmphasisMark::ACCENT }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aFontReliefMap[] = +{ + { XML_NONE, FontRelief::NONE }, + { XML_ENGRAVED, FontRelief::ENGRAVED }, + { XML_EMBOSSED, FontRelief::EMBOSSED }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aListLinkageMap[] = +{ + { XML_SELECTION, 0 }, + { XML_SELECTION_INDEXES, 1 }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aOrientationMap[] = +{ + { XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL }, + { XML_VERTICAL, ScrollBarOrientation::VERTICAL }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aVisualEffectMap[] = +{ + { XML_NONE, VisualEffect::NONE }, + { XML_3D, VisualEffect::LOOK3D }, + { XML_FLAT, VisualEffect::FLAT }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aImagePositionMap[] = +{ + { XML_START, 0 }, + { XML_END, 1 }, + { XML_TOP, 2 }, + { XML_BOTTOM, 3 }, + { XML_CENTER, -1 }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aImageAlignMap[] = +{ + { XML_START, 0 }, + { XML_CENTER, 1 }, + { XML_END, 2 }, + { XML_TOKEN_INVALID, 0 } +}; +const SvXMLEnumMapEntry aScaleModeMap[] = +{ + { XML_BACKGROUND_NO_REPEAT, ImageScaleMode::NONE }, + { XML_REPEAT, ImageScaleMode::NONE }, // repeating the image is not supported + { XML_STRETCH, ImageScaleMode::ANISOTROPIC }, + { XML_SCALE, ImageScaleMode::ISOTROPIC }, + { XML_TOKEN_INVALID, 0 } +}; } // namespace xmloff diff --git a/xmloff/source/forms/formenums.hxx b/xmloff/source/forms/formenums.hxx index 6550c8ec90c5..7ed7dcf8acac 100644 --- a/xmloff/source/forms/formenums.hxx +++ b/xmloff/source/forms/formenums.hxx @@ -21,28 +21,35 @@ #define INCLUDED_XMLOFF_SOURCE_FORMS_FORMENUMS_HXX #include +#include +#include +#include +#include +#include +#include +#include namespace xmloff { -extern const SvXMLEnumMapEntry aSubmitEncodingMap[]; -extern const SvXMLEnumMapEntry aSubmitMethodMap[]; -extern const SvXMLEnumMapEntry aCommandTypeMap[]; -extern const SvXMLEnumMapEntry aNavigationTypeMap[]; -extern const SvXMLEnumMapEntry aTabulatorCycleMap[]; -extern const SvXMLEnumMapEntry aFormButtonTypeMap[]; -extern const SvXMLEnumMapEntry aListSourceTypeMap[]; -extern const SvXMLEnumMapEntry aCheckStateMap[]; -extern const SvXMLEnumMapEntry aTextAlignMap[]; -extern const SvXMLEnumMapEntry aBorderTypeMap[]; -extern const SvXMLEnumMapEntry aFontEmphasisMap[]; -extern const SvXMLEnumMapEntry aFontReliefMap[]; -extern const SvXMLEnumMapEntry aListLinkageMap[]; -extern const SvXMLEnumMapEntry aOrientationMap[]; -extern const SvXMLEnumMapEntry aVisualEffectMap[]; -extern const SvXMLEnumMapEntry aImagePositionMap[]; -extern const SvXMLEnumMapEntry aImageAlignMap[]; -extern const SvXMLEnumMapEntry aScaleModeMap[]; +extern const SvXMLEnumMapEntry aSubmitEncodingMap[]; +extern const SvXMLEnumMapEntry aSubmitMethodMap[]; +extern const SvXMLEnumMapEntry aCommandTypeMap[]; +extern const SvXMLEnumMapEntry aNavigationTypeMap[]; +extern const SvXMLEnumMapEntry aTabulatorCycleMap[]; +extern const SvXMLEnumMapEntry aFormButtonTypeMap[]; +extern const SvXMLEnumMapEntry aListSourceTypeMap[]; +extern const SvXMLEnumMapEntry aCheckStateMap[]; +extern const SvXMLEnumMapEntry aTextAlignMap[]; +extern const SvXMLEnumMapEntry aBorderTypeMap[]; +extern const SvXMLEnumMapEntry aFontEmphasisMap[]; +extern const SvXMLEnumMapEntry aFontReliefMap[]; +extern const SvXMLEnumMapEntry aListLinkageMap[]; +extern const SvXMLEnumMapEntry aOrientationMap[]; +extern const SvXMLEnumMapEntry aVisualEffectMap[]; +extern const SvXMLEnumMapEntry aImagePositionMap[]; +extern const SvXMLEnumMapEntry aImageAlignMap[]; +extern const SvXMLEnumMapEntry aScaleModeMap[]; } // namespace xmloff diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index b365d66f40e0..11b40dfc7c0c 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -341,17 +341,17 @@ namespace xmloff exportedProperty( _rPropertyName ); } - void OPropertyExport::exportEnumPropertyAttribute( + void OPropertyExport::exportEnumPropertyAttributeImpl( const sal_uInt16 _nNamespaceKey, const sal_Char* _pAttributeName, - const OUString &rPropertyName, const SvXMLEnumMapEntry* _pValueMap, - const sal_Int32 _nDefault, const bool _bVoidDefault) + const OUString &rPropertyName, const SvXMLEnumMapEntry* _pValueMap, + const sal_uInt16 _nDefault, const bool _bVoidDefault) { // get the value - sal_Int32 nCurrentValue(_nDefault); Any aValue = m_xProps->getPropertyValue(rPropertyName); if (aValue.hasValue()) { // we have a non-void current value + sal_Int32 nCurrentValue(_nDefault); ::cppu::enum2int(nCurrentValue, aValue); // add the attribute diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx index ff2efadb3a41..779423272c9d 100644 --- a/xmloff/source/forms/propertyexport.hxx +++ b/xmloff/source/forms/propertyexport.hxx @@ -211,13 +211,26 @@ namespace xmloff the default of the attribute. If the current property value equals this default, no attribute is added. */ + template void exportEnumPropertyAttribute( const sal_uInt16 _nNamespaceKey, const sal_Char* _pAttributeName, const OUString& _rPropertyName, - const SvXMLEnumMapEntry* _pValueMap, - const sal_Int32 _nDefault, - const bool _bVoidDefault = false); + const SvXMLEnumMapEntry* _pValueMap, + const EnumT _nDefault, + const bool _bVoidDefault = false) + { + exportEnumPropertyAttributeImpl(_nNamespaceKey, _pAttributeName, _rPropertyName, + reinterpret_cast*>(_pValueMap), + static_cast(_nDefault), _bVoidDefault); + } + void exportEnumPropertyAttributeImpl( + const sal_uInt16 _nNamespaceKey, + const sal_Char* _pAttributeName, + const OUString& _rPropertyName, + const SvXMLEnumMapEntry* _pValueMap, + const sal_uInt16 _nDefault, + const bool _bVoidDefault); // some very special methods for some very special attribute/property pairs diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index 6ad41b0e59b9..16b1e36de110 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -84,7 +84,7 @@ namespace } Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType, - const OUString& _rReadCharacters, const SvXMLEnumMapEntry* _pEnumMap, const bool _bInvertBoolean ) + const OUString& _rReadCharacters, const SvXMLEnumMapEntry* _pEnumMap, const bool _bInvertBoolean ) { Any aReturn; bool bEnumAsInt = false; diff --git a/xmloff/source/forms/propertyimport.hxx b/xmloff/source/forms/propertyimport.hxx index 8cb81595f04e..70b1dd71ec84 100644 --- a/xmloff/source/forms/propertyimport.hxx +++ b/xmloff/source/forms/propertyimport.hxx @@ -42,10 +42,21 @@ namespace xmloff class PropertyConversion { public: + template static css::uno::Any convertString( const css::uno::Type& _rExpectedType, const OUString& _rReadCharacters, - const SvXMLEnumMapEntry* _pEnumMap = nullptr, + const SvXMLEnumMapEntry* _pEnumMap = nullptr, + const bool _bInvertBoolean = false + ) + { + return convertString(_rExpectedType, _rReadCharacters, + reinterpret_cast*>(_pEnumMap), _bInvertBoolean); + } + static css::uno::Any convertString( + const css::uno::Type& _rExpectedType, + const OUString& _rReadCharacters, + const SvXMLEnumMapEntry* _pEnumMap = nullptr, const bool _bInvertBoolean = false ); diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx index 24b0e0e09d7a..6e6884b7ae5a 100644 --- a/xmloff/source/style/DashStyle.cxx +++ b/xmloff/source/style/DashStyle.cxx @@ -64,13 +64,13 @@ static SvXMLTokenMapEntry aDashStyleAttrTokenMap[] = XML_TOKEN_MAP_END }; -SvXMLEnumMapEntry const pXML_DashStyle_Enum[] = +SvXMLEnumMapEntry const pXML_DashStyle_Enum[] = { { XML_RECT, drawing::DashStyle_RECT }, { XML_ROUND, drawing::DashStyle_ROUND }, { XML_RECT, drawing::DashStyle_RECTRELATIVE }, { XML_ROUND, drawing::DashStyle_ROUNDRELATIVE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::DashStyle)0 } }; // Import @@ -127,11 +127,7 @@ void XMLDashStyleImport::importXML( break; case XML_TOK_DASH_STYLE: { - sal_uInt16 eValue; - if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_DashStyle_Enum ) ) - { - aLineDash.Style = (drawing::DashStyle) eValue; - } + SvXMLUnitConverter::convertEnum( aLineDash.Style, rStrValue, pXML_DashStyle_Enum ); } break; case XML_TOK_DASH_DOTS1: diff --git a/xmloff/source/style/EnumPropertyHdl.cxx b/xmloff/source/style/EnumPropertyHdl.cxx index fcfe449f5758..c20fd050676c 100644 --- a/xmloff/source/style/EnumPropertyHdl.cxx +++ b/xmloff/source/style/EnumPropertyHdl.cxx @@ -30,7 +30,6 @@ using namespace ::com::sun::star::uno; // class XMLEnumPropertyHdl - XMLEnumPropertyHdl::~XMLEnumPropertyHdl() { // Nothing to do @@ -75,7 +74,7 @@ bool XMLEnumPropertyHdl::exportXML( OUString& rStrExpValue, const Any& rValue, c OUStringBuffer aOut; - if(!SvXMLUnitConverter::convertEnum( aOut, nValue, mpEnumMap )) + if(!SvXMLUnitConverter::convertEnum( aOut, (sal_uInt16)nValue, mpEnumMap )) return false; rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index ac05a0dbacee..45353f1a73fe 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -55,7 +55,7 @@ enum SvXMLTokenMapAttrs XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN }; -SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = +SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = { { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR }, { XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL }, @@ -63,7 +63,7 @@ SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = { XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL }, { XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE }, { XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (awt::GradientStyle)0 } }; // Import @@ -132,13 +132,7 @@ void XMLGradientStyleImport::importXML( aDisplayName = rStrValue; break; case XML_TOK_GRADIENT_STYLE: - { - sal_uInt16 eValue; - if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) ) - { - aGradient.Style = (awt::GradientStyle) eValue; - } - } + SvXMLUnitConverter::convertEnum( aGradient.Style, rStrValue, pXML_GradientStyle_Enum ); break; case XML_TOK_GRADIENT_CX: ::sax::Converter::convertPercent( nTmpValue, rStrValue ); 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 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); diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 719b420ec0c6..e216566a8c0c 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -44,7 +44,7 @@ using namespace ::com::sun::star; //UUUU using namespace ::com::sun::star::drawing; -static SvXMLEnumMapEntry const aXML_TextGridMode_ConstantMap[] = +static SvXMLEnumMapEntry const aXML_TextGridMode_ConstantMap[] = { { XML_NONE, text::TextGridMode::NONE }, { XML_LINE, text::TextGridMode::LINES }, @@ -134,7 +134,7 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I //UUUU case XML_SW_TYPE_FILLSTYLE: - pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap ); break; case XML_SW_TYPE_FILLBITMAPSIZE: pHdl = new XMLFillBitmapSizePropertyHandler(); @@ -143,10 +143,10 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I pHdl = new XMLBitmapLogicalSizePropertyHandler(); break; case XML_SW_TYPE_BITMAP_REFPOINT: - pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap ); break; case XML_SW_TYPE_BITMAP_MODE: - pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, cppu::UnoType::get() ); + pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap ); break; case XML_SW_TYPE_BITMAPREPOFFSETX: case XML_SW_TYPE_BITMAPREPOFFSETY: diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index ebd2b08e1125..d1be6cef0ff9 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -52,7 +52,7 @@ enum SvXMLTokenMapAttrs XML_TOK_GRADIENT_BORDER }; -SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = +SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = { { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR }, { XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL }, @@ -60,7 +60,7 @@ SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] = { XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL }, { XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE }, { XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (awt::GradientStyle)0 } }; // Import @@ -132,11 +132,7 @@ void XMLTransGradientStyleImport::importXML( break; case XML_TOK_GRADIENT_STYLE: { - sal_uInt16 eValue; - if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) ) - { - aGradient.Style = (awt::GradientStyle) eValue; - } + SvXMLUnitConverter::convertEnum( aGradient.Style, rStrValue, pXML_GradientStyle_Enum ); } break; case XML_TOK_GRADIENT_CX: diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx index c281fb750e79..e9981daed89e 100644 --- a/xmloff/source/style/XMLBackgroundImageContext.cxx +++ b/xmloff/source/style/XMLBackgroundImageContext.cxx @@ -70,18 +70,18 @@ static const SvXMLTokenMapEntry* lcl_getBGImgAttributesAttrTokenMap() } -static const SvXMLEnumMapEntry psXML_BrushHoriPos[] = +static const SvXMLEnumMapEntry psXML_BrushHoriPos[] = { { XML_LEFT, GraphicLocation_LEFT_MIDDLE }, { XML_RIGHT, GraphicLocation_RIGHT_MIDDLE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (GraphicLocation)0 } }; -static const SvXMLEnumMapEntry psXML_BrushVertPos[] = +static const SvXMLEnumMapEntry psXML_BrushVertPos[] = { { XML_TOP, GraphicLocation_MIDDLE_TOP }, { XML_BOTTOM, GraphicLocation_MIDDLE_BOTTOM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (GraphicLocation)0 } }; static void lcl_xmlbic_MergeHoriPos( GraphicLocation& ePos, @@ -196,13 +196,13 @@ void XMLBackgroundImageContext::ProcessAttrs( case XML_TOK_BGIMG_POSITION: { GraphicLocation eNewPos = GraphicLocation_NONE, eTmp; - sal_uInt16 nTmp; SvXMLTokenEnumerator aTokenEnum( rValue ); OUString aToken; bool bHori = false, bVert = false; bool bOK = true; while( bOK && aTokenEnum.getNextToken( aToken ) ) { + GraphicLocation nTmpGraphicLocation; if( bHori && bVert ) { bOK = false; @@ -247,26 +247,24 @@ void XMLBackgroundImageContext::ProcessAttrs( else eNewPos = GraphicLocation_MIDDLE_MIDDLE; } - else if( SvXMLUnitConverter::convertEnum( nTmp, aToken, + else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken, psXML_BrushHoriPos ) ) { if( bVert ) - lcl_xmlbic_MergeHoriPos( eNewPos, - (GraphicLocation)nTmp ); + lcl_xmlbic_MergeHoriPos( eNewPos, nTmpGraphicLocation ); else if( !bHori ) - eNewPos = (GraphicLocation)nTmp; + eNewPos = nTmpGraphicLocation; else bOK = false; bHori = true; } - else if( SvXMLUnitConverter::convertEnum( nTmp, aToken, + else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken, psXML_BrushVertPos ) ) { if( bHori ) - lcl_xmlbic_MergeVertPos( eNewPos, - (GraphicLocation)nTmp ); + lcl_xmlbic_MergeVertPos( eNewPos, nTmpGraphicLocation ); else if( !bVert ) - eNewPos = (GraphicLocation)nTmp; + eNewPos = nTmpGraphicLocation; else bOK = false; bVert = true; @@ -284,13 +282,13 @@ void XMLBackgroundImageContext::ProcessAttrs( break; case XML_TOK_BGIMG_REPEAT: { - sal_uInt16 nPos = GraphicLocation_NONE; - static const SvXMLEnumMapEntry psXML_BrushRepeat[] = + GraphicLocation nPos = GraphicLocation_NONE; + static const SvXMLEnumMapEntry psXML_BrushRepeat[] = { - { XML_BACKGROUND_REPEAT, GraphicLocation_TILED }, - { XML_BACKGROUND_NO_REPEAT, GraphicLocation_MIDDLE_MIDDLE }, - { XML_BACKGROUND_STRETCH, GraphicLocation_AREA }, - { XML_TOKEN_INVALID, 0 } + { XML_BACKGROUND_REPEAT, GraphicLocation_TILED }, + { XML_BACKGROUND_NO_REPEAT, GraphicLocation_MIDDLE_MIDDLE }, + { XML_BACKGROUND_STRETCH, GraphicLocation_AREA }, + { XML_TOKEN_INVALID, (GraphicLocation)0 } }; if( SvXMLUnitConverter::convertEnum( nPos, rValue, psXML_BrushRepeat ) ) @@ -299,7 +297,7 @@ void XMLBackgroundImageContext::ProcessAttrs( GraphicLocation_NONE == ePos || GraphicLocation_AREA == ePos || GraphicLocation_TILED == ePos ) - ePos = (GraphicLocation)nPos; + ePos = nPos; } } break; diff --git a/xmloff/source/style/XMLConstantsPropertyHandler.cxx b/xmloff/source/style/XMLConstantsPropertyHandler.cxx index ca3843f25fe1..0e86ec7722c8 100644 --- a/xmloff/source/style/XMLConstantsPropertyHandler.cxx +++ b/xmloff/source/style/XMLConstantsPropertyHandler.cxx @@ -27,14 +27,6 @@ using namespace ::com::sun::star::uno; using ::xmloff::token::XMLTokenEnum; -XMLConstantsPropertyHandler::XMLConstantsPropertyHandler( - const SvXMLEnumMapEntry *pM, - enum XMLTokenEnum eDflt ) : - pMap( pM ), - eDefault( eDflt ) -{ -} - XMLConstantsPropertyHandler::~XMLConstantsPropertyHandler() { } diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx index 610f700cd05b..74ca184edcfc 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx @@ -55,7 +55,7 @@ void XMLFootnoteSeparatorExport::exportXML( assert(pProperties); // initialize values - sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT; + text::HorizontalAdjust eLineAdjust = text::HorizontalAdjust_LEFT; sal_Int32 nLineColor = 0; sal_Int32 nLineDistance = 0; sal_Int8 nLineRelWidth = 0; @@ -129,7 +129,7 @@ void XMLFootnoteSeparatorExport::exportXML( } // line style - static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] = + static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] = { { XML_NONE, 0 }, { XML_SOLID, 1 }, @@ -145,12 +145,12 @@ void XMLFootnoteSeparatorExport::exportXML( } // adjustment - static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] = + static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] = { { XML_LEFT, text::HorizontalAdjust_LEFT }, { XML_CENTER, text::HorizontalAdjust_CENTER }, { XML_RIGHT, text::HorizontalAdjust_RIGHT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (text::HorizontalAdjust)0 } }; if (SvXMLUnitConverter::convertEnum( diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx index 86ee5249f9d0..88791e0f70a9 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx @@ -77,7 +77,7 @@ void XMLFootnoteSeparatorImport::StartElement( sal_Int16 nLineWeight = 0; sal_Int32 nLineColor = 0; sal_Int8 nLineRelWidth = 0; - sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT; // enum text::HorizontalAdjust + text::HorizontalAdjust eLineAdjust = text::HorizontalAdjust_LEFT; sal_Int32 nLineTextDistance = 0; sal_Int32 nLineDistance = 0; sal_Int8 nLineStyle = 0; @@ -117,18 +117,16 @@ void XMLFootnoteSeparatorImport::StartElement( } else if (IsXMLToken( sLocalName, XML_ADJUSTMENT )) { - sal_uInt16 nTmpU; - static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] = + static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] = { { XML_LEFT, text::HorizontalAdjust_LEFT }, { XML_CENTER, text::HorizontalAdjust_CENTER }, { XML_RIGHT, text::HorizontalAdjust_RIGHT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (text::HorizontalAdjust)0 } }; - if (SvXMLUnitConverter::convertEnum( - nTmpU, sAttrValue, aXML_HorizontalAdjust_Enum)) - eLineAdjust = (sal_Int16)nTmpU; + SvXMLUnitConverter::convertEnum( + eLineAdjust, sAttrValue, aXML_HorizontalAdjust_Enum); } else if (IsXMLToken( sLocalName, XML_REL_WIDTH )) { @@ -144,8 +142,7 @@ void XMLFootnoteSeparatorImport::StartElement( } else if (IsXMLToken( sLocalName, XML_LINE_STYLE )) { - sal_uInt16 nTmpU; - static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] = + static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] = { { XML_NONE, 0 }, { XML_SOLID, 1 }, @@ -154,10 +151,7 @@ void XMLFootnoteSeparatorImport::StartElement( { XML_TOKEN_INVALID, 0 } }; - if (SvXMLUnitConverter::convertEnum( - nTmpU, sAttrValue, aXML_LineStyle_Enum)) - nLineStyle = (sal_Int8)nTmpU; - + SvXMLUnitConverter::convertEnum(nLineStyle, sAttrValue, aXML_LineStyle_Enum); } } } diff --git a/xmloff/source/style/adjushdl.cxx b/xmloff/source/style/adjushdl.cxx index 3abb34e2b3b3..bb2e36590612 100644 --- a/xmloff/source/style/adjushdl.cxx +++ b/xmloff/source/style/adjushdl.cxx @@ -28,7 +28,7 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -SvXMLEnumMapEntry const pXML_Para_Adjust_Enum[] = +SvXMLEnumMapEntry const pXML_Para_Adjust_Enum[] = { { XML_START, style::ParagraphAdjust_LEFT }, { XML_END, style::ParagraphAdjust_RIGHT }, @@ -37,16 +37,16 @@ SvXMLEnumMapEntry const pXML_Para_Adjust_Enum[] = { XML_JUSTIFIED, style::ParagraphAdjust_BLOCK }, // obsolete { XML_LEFT, style::ParagraphAdjust_LEFT }, { XML_RIGHT, style::ParagraphAdjust_RIGHT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (style::ParagraphAdjust)0 } }; -SvXMLEnumMapEntry const pXML_Para_Align_Last_Enum[] = +SvXMLEnumMapEntry const pXML_Para_Align_Last_Enum[] = { { XML_START, style::ParagraphAdjust_LEFT }, { XML_CENTER, style::ParagraphAdjust_CENTER }, { XML_JUSTIFY, style::ParagraphAdjust_BLOCK }, { XML_JUSTIFIED, style::ParagraphAdjust_BLOCK }, // obsolete - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (style::ParagraphAdjust)0 } }; @@ -60,7 +60,7 @@ XMLParaAdjustPropHdl::~XMLParaAdjustPropHdl() bool XMLParaAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 eAdjust; + style::ParagraphAdjust eAdjust; bool bRet = SvXMLUnitConverter::convertEnum( eAdjust, rStrImpValue, pXML_Para_Adjust_Enum ); if( bRet ) rValue <<= (sal_Int16)eAdjust; @@ -77,7 +77,7 @@ bool XMLParaAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV rValue >>= nVal; - bool bRet = SvXMLUnitConverter::convertEnum( aOut, nVal, pXML_Para_Adjust_Enum, XML_START ); + bool bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Adjust_Enum, XML_START ); rStrExpValue = aOut.makeStringAndClear(); @@ -95,7 +95,7 @@ XMLLastLineAdjustPropHdl::~XMLLastLineAdjustPropHdl() bool XMLLastLineAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 eAdjust; + style::ParagraphAdjust eAdjust; bool bRet = SvXMLUnitConverter::convertEnum( eAdjust, rStrImpValue, pXML_Para_Align_Last_Enum ); if( bRet ) rValue <<= (sal_Int16)eAdjust; @@ -112,7 +112,7 @@ bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any rValue >>= nVal; if( nVal != style::ParagraphAdjust_LEFT ) - bRet = SvXMLUnitConverter::convertEnum( aOut, nVal, pXML_Para_Align_Last_Enum, XML_START ); + bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Align_Last_Enum, XML_START ); rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx index 6fce270b8d12..94872997e808 100644 --- a/xmloff/source/style/backhdl.cxx +++ b/xmloff/source/style/backhdl.cxx @@ -28,18 +28,18 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -SvXMLEnumMapEntry const pXML_BrushHorizontalPos[] = +SvXMLEnumMapEntry const pXML_BrushHorizontalPos[] = { { XML_LEFT, style::GraphicLocation_LEFT_MIDDLE }, { XML_RIGHT, style::GraphicLocation_RIGHT_MIDDLE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (style::GraphicLocation)0 } }; -SvXMLEnumMapEntry const pXML_BrushVerticalPos[] = +SvXMLEnumMapEntry const pXML_BrushVerticalPos[] = { { XML_TOP, style::GraphicLocation_MIDDLE_TOP }, { XML_BOTTOM, style::GraphicLocation_MIDDLE_BOTTOM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (style::GraphicLocation)0 } }; @@ -55,7 +55,7 @@ bool XMLBackGraphicPositionPropHdl::importXML( const OUString& rStrImpValue, uno { bool bRet = true; style::GraphicLocation ePos = style::GraphicLocation_NONE, eTmp; - sal_uInt16 nTmp; + style::GraphicLocation nTmpGraphicLocation; SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); OUString aToken; bool bHori = false, bVert = false; @@ -102,23 +102,23 @@ bool XMLBackGraphicPositionPropHdl::importXML( const OUString& rStrImpValue, uno else ePos = style::GraphicLocation_MIDDLE_MIDDLE; } - else if( SvXMLUnitConverter::convertEnum( nTmp, aToken, pXML_BrushHorizontalPos ) ) + else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken, pXML_BrushHorizontalPos ) ) { if( bVert ) - MergeXMLHoriPos( ePos, (style::GraphicLocation)nTmp ); + MergeXMLHoriPos( ePos, nTmpGraphicLocation ); else if( !bHori ) - ePos = (style::GraphicLocation)nTmp; + ePos = nTmpGraphicLocation; else bRet = false; bHori = true; } - else if( SvXMLUnitConverter::convertEnum( nTmp, aToken, pXML_BrushVerticalPos ) ) + else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken, pXML_BrushVerticalPos ) ) { if( bHori ) - MergeXMLVertPos( ePos, (style::GraphicLocation)nTmp ); + MergeXMLVertPos( ePos, nTmpGraphicLocation ); else if( !bVert ) - ePos = (style::GraphicLocation)nTmp; + ePos = nTmpGraphicLocation; else bRet = false; bVert = true; diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx index 55ae26c0203f..3efaee4a0417 100644 --- a/xmloff/source/style/bordrhdl.cxx +++ b/xmloff/source/style/bordrhdl.cxx @@ -37,7 +37,7 @@ using namespace ::xmloff::token; #define SVX_XML_BORDER_WIDTH_MIDDLE 1 #define SVX_XML_BORDER_WIDTH_THICK 2 -SvXMLEnumMapEntry const pXML_BorderStyles[] = +SvXMLEnumMapEntry const pXML_BorderStyles[] = { { XML_NONE, table::BorderLineStyle::NONE }, { XML_HIDDEN, table::BorderLineStyle::NONE }, @@ -56,7 +56,7 @@ SvXMLEnumMapEntry const pXML_BorderStyles[] = { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry const pXML_NamedBorderWidths[] = +SvXMLEnumMapEntry const pXML_NamedBorderWidths[] = { { XML_THIN, SVX_XML_BORDER_WIDTH_THIN }, { XML_MIDDLE, SVX_XML_BORDER_WIDTH_MIDDLE }, diff --git a/xmloff/source/style/breakhdl.cxx b/xmloff/source/style/breakhdl.cxx index a64bc2527a4f..56ab3e510c4d 100644 --- a/xmloff/source/style/breakhdl.cxx +++ b/xmloff/source/style/breakhdl.cxx @@ -27,7 +27,7 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -SvXMLEnumMapEntry const pXML_BreakTypes[] = +SvXMLEnumMapEntry const pXML_BreakTypes[] = { { XML_AUTO, 0 }, { XML_COLUMN, 1 }, diff --git a/xmloff/source/style/cdouthdl.cxx b/xmloff/source/style/cdouthdl.cxx index 29eba7c6cbc1..35113f3976c3 100644 --- a/xmloff/source/style/cdouthdl.cxx +++ b/xmloff/source/style/cdouthdl.cxx @@ -30,46 +30,46 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::awt; using namespace ::xmloff::token; -SvXMLEnumMapEntry const pXML_CrossedoutType_Enum[] = +SvXMLEnumMapEntry const pXML_CrossedoutType_Enum[] = { - { XML_NONE, awt::FontStrikeout::NONE }, - { XML_SINGLE, awt::FontStrikeout::SINGLE }, - { XML_DOUBLE, awt::FontStrikeout::DOUBLE }, - { XML_SINGLE, awt::FontStrikeout::BOLD }, - { XML_SINGLE, awt::FontStrikeout::SLASH }, - { XML_SINGLE, awt::FontStrikeout::X }, - { XML_TOKEN_INVALID, 0 } + { XML_NONE, awt::FontStrikeout::NONE }, + { XML_SINGLE, awt::FontStrikeout::SINGLE }, + { XML_DOUBLE, awt::FontStrikeout::DOUBLE }, + { XML_SINGLE, awt::FontStrikeout::BOLD }, + { XML_SINGLE, awt::FontStrikeout::SLASH }, + { XML_SINGLE, awt::FontStrikeout::X }, + { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry const pXML_CrossedoutStyle_Enum[] = +SvXMLEnumMapEntry const pXML_CrossedoutStyle_Enum[] = { - { XML_NONE, awt::FontStrikeout::NONE }, - { XML_SOLID, awt::FontStrikeout::SINGLE }, - { XML_SOLID, awt::FontStrikeout::DOUBLE }, - { XML_SOLID, awt::FontStrikeout::BOLD }, - { XML_SOLID, awt::FontStrikeout::SLASH }, - { XML_SOLID, awt::FontStrikeout::X }, - { XML_DOTTED, awt::FontStrikeout::SINGLE }, + { XML_NONE, awt::FontStrikeout::NONE }, + { XML_SOLID, awt::FontStrikeout::SINGLE }, + { XML_SOLID, awt::FontStrikeout::DOUBLE }, + { XML_SOLID, awt::FontStrikeout::BOLD }, + { XML_SOLID, awt::FontStrikeout::SLASH }, + { XML_SOLID, awt::FontStrikeout::X }, + { XML_DOTTED, awt::FontStrikeout::SINGLE }, { XML_DASH, awt::FontStrikeout::SINGLE }, - { XML_LONG_DASH, awt::FontStrikeout::SINGLE }, + { XML_LONG_DASH, awt::FontStrikeout::SINGLE }, { XML_DOT_DASH, awt::FontStrikeout::SINGLE }, { XML_DOT_DOT_DASH, awt::FontStrikeout::SINGLE }, { XML_WAVE, awt::FontStrikeout::SINGLE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry const pXML_CrossedoutWidth_Enum[] = +SvXMLEnumMapEntry const pXML_CrossedoutWidth_Enum[] = { { XML_AUTO, awt::FontStrikeout::NONE }, { XML_AUTO, awt::FontStrikeout::SINGLE }, { XML_AUTO, awt::FontStrikeout::DOUBLE }, - { XML_BOLD, awt::FontStrikeout::BOLD }, + { XML_BOLD, awt::FontStrikeout::BOLD }, { XML_AUTO, awt::FontStrikeout::SLASH }, { XML_AUTO, awt::FontStrikeout::X }, { XML_THIN, awt::FontStrikeout::NONE }, { XML_MEDIUM, awt::FontStrikeout::NONE }, { XML_THICK, awt::FontStrikeout::NONE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, 0 } }; // class XMLCrossedOutTypePropHdl @@ -133,13 +133,13 @@ bool XMLCrossedOutTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any bool XMLCrossedOutTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { bool bRet = false; - sal_Int16 nValue = sal_Int16(); + sal_uInt16 nValue = sal_uInt16(); OUStringBuffer aOut; if (rValue >>= nValue) { bRet = SvXMLUnitConverter::convertEnum( - aOut, (sal_uInt16)nValue, pXML_CrossedoutType_Enum ); + aOut, nValue, pXML_CrossedoutType_Enum ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); } @@ -181,13 +181,13 @@ bool XMLCrossedOutStylePropHdl::importXML( const OUString& rStrImpValue, uno::An bool XMLCrossedOutStylePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { bool bRet = false; - sal_Int16 nValue = sal_Int16(); + sal_uInt16 nValue = sal_uInt16(); OUStringBuffer aOut; if( rValue >>= nValue ) { bRet = SvXMLUnitConverter::convertEnum( - aOut, (sal_uInt16)nValue, pXML_CrossedoutStyle_Enum ); + aOut, nValue, pXML_CrossedoutStyle_Enum ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); } @@ -251,13 +251,13 @@ bool XMLCrossedOutWidthPropHdl::importXML( const OUString& rStrImpValue, uno::An bool XMLCrossedOutWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { bool bRet = false; - sal_Int16 nValue = sal_Int16(); + sal_uInt16 nValue = sal_uInt16(); OUStringBuffer aOut; if( (rValue >>= nValue) && (awt::FontStrikeout::BOLD == nValue) ) { bRet = SvXMLUnitConverter::convertEnum( - aOut, (sal_uInt16)nValue, pXML_CrossedoutWidth_Enum ); + aOut, nValue, pXML_CrossedoutWidth_Enum ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); } diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx index b701f68714c7..c583802b4806 100644 --- a/xmloff/source/style/csmaphdl.cxx +++ b/xmloff/source/style/csmaphdl.cxx @@ -27,7 +27,7 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -static SvXMLEnumMapEntry pXML_Casemap_Enum[] = +static SvXMLEnumMapEntry pXML_Casemap_Enum[] = { { XML_NONE, style::CaseMap::NONE }, { XML_CASEMAP_LOWERCASE, style::CaseMap::LOWERCASE }, diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index a5aa39b826e5..8e4884fd0579 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -30,9 +30,9 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -static const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping() +static const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping() { - static SvXMLEnumMapEntry const aFontFamilyGenericMapping[] = + static SvXMLEnumMapEntry const aFontFamilyGenericMapping[] = { { XML_DECORATIVE, FAMILY_DECORATIVE }, @@ -41,16 +41,16 @@ static const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping() { XML_SCRIPT, FAMILY_SCRIPT }, { XML_SWISS, FAMILY_SWISS }, { XML_SYSTEM, FAMILY_SYSTEM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (FontFamily)0 } }; return aFontFamilyGenericMapping; } -static SvXMLEnumMapEntry const aFontPitchMapping[] = +static SvXMLEnumMapEntry const aFontPitchMapping[] = { { XML_FIXED, PITCH_FIXED }, { XML_VARIABLE, PITCH_VARIABLE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (FontPitch)0 } }; // class XMLFontFamilyNamePropHdl @@ -193,7 +193,7 @@ XMLFontFamilyPropHdl::~XMLFontFamilyPropHdl() bool XMLFontFamilyPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 eNewFamily; + FontFamily eNewFamily; bool bRet = SvXMLUnitConverter::convertEnum( eNewFamily, rStrImpValue, lcl_getFontFamilyGenericMapping() ); if( bRet ) rValue <<= (sal_Int16)eNewFamily; @@ -264,7 +264,7 @@ XMLFontPitchPropHdl::~XMLFontPitchPropHdl() bool XMLFontPitchPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 eNewPitch; + FontPitch eNewPitch; bool bRet = SvXMLUnitConverter::convertEnum( eNewPitch, rStrImpValue, aFontPitchMapping ); if( bRet ) rValue <<= (sal_Int16)eNewPitch; diff --git a/xmloff/source/style/postuhdl.cxx b/xmloff/source/style/postuhdl.cxx index 25d6b364bad1..a40a9ceeb578 100644 --- a/xmloff/source/style/postuhdl.cxx +++ b/xmloff/source/style/postuhdl.cxx @@ -28,12 +28,12 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -SvXMLEnumMapEntry const aPostureGenericMapping[] = +SvXMLEnumMapEntry const aPostureGenericMapping[] = { { XML_POSTURE_NORMAL, ITALIC_NONE }, { XML_POSTURE_ITALIC, ITALIC_NORMAL }, { XML_POSTURE_OBLIQUE, ITALIC_OBLIQUE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (FontItalic)0 } }; @@ -47,7 +47,7 @@ XMLPosturePropHdl::~XMLPosturePropHdl() bool XMLPosturePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 ePosture; + FontItalic ePosture; bool bRet = SvXMLUnitConverter::convertEnum( ePosture, rStrImpValue, aPostureGenericMapping ); if( bRet ) rValue <<= (awt::FontSlant)ePosture; @@ -70,7 +70,7 @@ bool XMLPosturePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValu } OUStringBuffer aOut; - bool bRet = SvXMLUnitConverter::convertEnum( aOut, (sal_Int32)eSlant, aPostureGenericMapping ); + bool bRet = SvXMLUnitConverter::convertEnum( aOut, (FontItalic)eSlant, aPostureGenericMapping ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx index 559ab4c112df..f53e3663b527 100644 --- a/xmloff/source/style/prhdlfac.cxx +++ b/xmloff/source/style/prhdlfac.cxx @@ -60,27 +60,27 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -static SvXMLEnumMapEntry const aXML_ColorMode_EnumMap[] = +static SvXMLEnumMapEntry const aXML_ColorMode_EnumMap[] = { { XML_GREYSCALE, drawing::ColorMode_GREYS }, { XML_MONO, drawing::ColorMode_MONO }, { XML_WATERMARK, drawing::ColorMode_WATERMARK }, { XML_STANDARD, drawing::ColorMode_STANDARD }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (drawing::ColorMode)0 } }; -static SvXMLEnumMapEntry const aXML_HorizontalAdjust_Enum[] = +static SvXMLEnumMapEntry const aXML_HorizontalAdjust_Enum[] = { { XML_LEFT, text::HorizontalAdjust_LEFT }, { XML_CENTER, text::HorizontalAdjust_CENTER }, { XML_RIGHT, text::HorizontalAdjust_RIGHT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (text::HorizontalAdjust)0 } }; // aXML_WritingDirection_Enum is used with and without 'page' // attribute, so you'll find uses of aXML_WritingDirection_Enum // directly, as well as &(aXML_WritingDirection_Enum[1]) -static SvXMLEnumMapEntry const aXML_WritingDirection_Enum[] = +static SvXMLEnumMapEntry const aXML_WritingDirection_Enum[] = { // aXML_WritingDirection_Enum { XML_PAGE, text::WritingMode2::PAGE }, @@ -99,7 +99,7 @@ static SvXMLEnumMapEntry const aXML_WritingDirection_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VertPos_Enum[] = +static SvXMLEnumMapEntry const pXML_VertPos_Enum[] = { { XML_FROM_TOP, text::VertOrientation::NONE }, { XML_TOP, text::VertOrientation::TOP }, @@ -419,16 +419,13 @@ const XMLPropertyHandler* XMLPropertyHandlerFactory::CreatePropertyHandler( sal_ pPropHdl = new XMLAttributeContainerHandler; break; case XML_TYPE_COLOR_MODE: - pPropHdl = new XMLEnumPropertyHdl( aXML_ColorMode_EnumMap, - cppu::UnoType::get()); + pPropHdl = new XMLEnumPropertyHdl(aXML_ColorMode_EnumMap); break; case XML_TYPE_DURATION16_MS: pPropHdl = new XMLDurationMS16PropHdl_Impl; break; case XML_TYPE_TEXT_HORIZONTAL_ADJUST: - pPropHdl = new XMLEnumPropertyHdl( - aXML_HorizontalAdjust_Enum, - cppu::UnoType::get()); + pPropHdl = new XMLEnumPropertyHdl(aXML_HorizontalAdjust_Enum); break; case XML_TYPE_TEXT_DRAW_ASPECT: pPropHdl = new DrawAspectHdl; diff --git a/xmloff/source/style/undlihdl.cxx b/xmloff/source/style/undlihdl.cxx index a5b7d2788164..90e731bb7ad3 100644 --- a/xmloff/source/style/undlihdl.cxx +++ b/xmloff/source/style/undlihdl.cxx @@ -30,11 +30,11 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::awt; using namespace ::xmloff::token; -SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] = +SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] = { - { XML_NONE, awt::FontUnderline::NONE }, + { XML_NONE, awt::FontUnderline::NONE }, { XML_SINGLE, awt::FontUnderline::SINGLE }, - { XML_DOUBLE, awt::FontUnderline::DOUBLE }, + { XML_DOUBLE, awt::FontUnderline::DOUBLE }, { XML_SINGLE, awt::FontUnderline::DOTTED }, { XML_SINGLE, awt::FontUnderline::DASH }, { XML_SINGLE, awt::FontUnderline::LONGDASH }, @@ -46,59 +46,59 @@ SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] = { XML_SINGLE, awt::FontUnderline::BOLDDASH }, { XML_SINGLE, awt::FontUnderline::BOLDLONGDASH }, { XML_SINGLE, awt::FontUnderline::BOLDDASHDOT }, - { XML_SINGLE, awt::FontUnderline::BOLDDASHDOTDOT }, + { XML_SINGLE, awt::FontUnderline::BOLDDASHDOTDOT }, { XML_SINGLE, awt::FontUnderline::BOLDWAVE }, - { XML_DOUBLE, awt::FontUnderline::DOUBLEWAVE }, + { XML_DOUBLE, awt::FontUnderline::DOUBLEWAVE }, { XML_SINGLE, awt::FontUnderline::SMALLWAVE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry const pXML_UnderlineStyle_Enum[] = +SvXMLEnumMapEntry const pXML_UnderlineStyle_Enum[] = { - { XML_NONE, awt::FontUnderline::NONE }, - { XML_SOLID, awt::FontUnderline::SINGLE }, - { XML_SOLID, awt::FontUnderline::DOUBLE }, + { XML_NONE, awt::FontUnderline::NONE }, + { XML_SOLID, awt::FontUnderline::SINGLE }, + { XML_SOLID, awt::FontUnderline::DOUBLE }, { XML_DOTTED, awt::FontUnderline::DOTTED }, - { XML_DASH, awt::FontUnderline::DASH }, + { XML_DASH, awt::FontUnderline::DASH }, { XML_LONG_DASH, awt::FontUnderline::LONGDASH }, - { XML_DOT_DASH, awt::FontUnderline::DASHDOT }, - { XML_DOT_DOT_DASH, awt::FontUnderline::DASHDOTDOT }, - { XML_WAVE, awt::FontUnderline::WAVE }, - { XML_SOLID, awt::FontUnderline::BOLD }, + { XML_DOT_DASH, awt::FontUnderline::DASHDOT }, + { XML_DOT_DOT_DASH, awt::FontUnderline::DASHDOTDOT }, + { XML_WAVE, awt::FontUnderline::WAVE }, + { XML_SOLID, awt::FontUnderline::BOLD }, { XML_DOTTED, awt::FontUnderline::BOLDDOTTED }, - { XML_DASH, awt::FontUnderline::BOLDDASH }, + { XML_DASH, awt::FontUnderline::BOLDDASH }, { XML_LONG_DASH, awt::FontUnderline::BOLDLONGDASH }, - { XML_DOT_DASH, awt::FontUnderline::BOLDDASHDOT }, + { XML_DOT_DASH, awt::FontUnderline::BOLDDASHDOT }, { XML_DOT_DOT_DASH, awt::FontUnderline::BOLDDASHDOTDOT }, - { XML_WAVE, awt::FontUnderline::BOLDWAVE }, + { XML_WAVE, awt::FontUnderline::BOLDWAVE }, { XML_WAVE, awt::FontUnderline::DOUBLEWAVE }, { XML_SMALL_WAVE, awt::FontUnderline::SMALLWAVE }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, 0 } }; -SvXMLEnumMapEntry const pXML_UnderlineWidth_Enum[] = +SvXMLEnumMapEntry const pXML_UnderlineWidth_Enum[] = { - { XML_AUTO, awt::FontUnderline::NONE }, - { XML_AUTO, awt::FontUnderline::SINGLE }, - { XML_AUTO, awt::FontUnderline::DOUBLE }, - { XML_AUTO, awt::FontUnderline::DOTTED }, - { XML_AUTO, awt::FontUnderline::DASH }, - { XML_AUTO, awt::FontUnderline::LONGDASH }, - { XML_AUTO, awt::FontUnderline::DASHDOT }, - { XML_AUTO, awt::FontUnderline::DASHDOTDOT }, - { XML_AUTO, awt::FontUnderline::WAVE }, + { XML_AUTO, awt::FontUnderline::NONE }, + { XML_AUTO, awt::FontUnderline::SINGLE }, + { XML_AUTO, awt::FontUnderline::DOUBLE }, + { XML_AUTO, awt::FontUnderline::DOTTED }, + { XML_AUTO, awt::FontUnderline::DASH }, + { XML_AUTO, awt::FontUnderline::LONGDASH }, + { XML_AUTO, awt::FontUnderline::DASHDOT }, + { XML_AUTO, awt::FontUnderline::DASHDOTDOT }, + { XML_AUTO, awt::FontUnderline::WAVE }, { XML_BOLD, awt::FontUnderline::BOLD }, { XML_BOLD, awt::FontUnderline::BOLDDOTTED }, { XML_BOLD, awt::FontUnderline::BOLDDASH }, { XML_BOLD, awt::FontUnderline::BOLDLONGDASH }, { XML_BOLD, awt::FontUnderline::BOLDDASHDOT }, - { XML_BOLD, awt::FontUnderline::BOLDDASHDOTDOT }, + { XML_BOLD, awt::FontUnderline::BOLDDASHDOTDOT }, { XML_BOLD, awt::FontUnderline::BOLDWAVE }, - { XML_AUTO, awt::FontUnderline::DOUBLEWAVE }, - { XML_THIN, awt::FontUnderline::NONE }, - { XML_MEDIUM, awt::FontUnderline::NONE }, - { XML_THICK, awt::FontUnderline::BOLD}, - { XML_TOKEN_INVALID, 0 } + { XML_AUTO, awt::FontUnderline::DOUBLEWAVE }, + { XML_THIN, awt::FontUnderline::NONE }, + { XML_MEDIUM, awt::FontUnderline::NONE }, + { XML_THICK, awt::FontUnderline::BOLD}, + { XML_TOKEN_INVALID, 0 } }; @@ -167,7 +167,7 @@ bool XMLUnderlineTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any& bool XMLUnderlineTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { bool bRet = false; - sal_Int16 nValue = sal_Int16(); + sal_uInt16 nValue = sal_uInt16(); OUStringBuffer aOut; if( (rValue >>= nValue) && @@ -175,7 +175,7 @@ bool XMLUnderlineTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& awt::FontUnderline::DOUBLEWAVE == nValue) ) { bRet = SvXMLUnitConverter::convertEnum( - aOut, (sal_uInt16)nValue, pXML_UnderlineType_Enum ); + aOut, nValue, pXML_UnderlineType_Enum ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); } @@ -259,13 +259,13 @@ bool XMLUnderlineStylePropHdl::importXML( const OUString& rStrImpValue, uno::Any bool XMLUnderlineStylePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { bool bRet = false; - sal_Int16 nValue = sal_Int16(); + sal_uInt16 nValue = sal_uInt16(); OUStringBuffer aOut; if( rValue >>= nValue ) { bRet = SvXMLUnitConverter::convertEnum( - aOut, (sal_uInt16)nValue, pXML_UnderlineStyle_Enum ); + aOut, nValue, pXML_UnderlineStyle_Enum ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); } @@ -350,13 +350,13 @@ bool XMLUnderlineWidthPropHdl::importXML( const OUString& rStrImpValue, uno::Any bool XMLUnderlineWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const { bool bRet = false; - sal_Int16 nValue = sal_Int16(); + sal_uInt16 nValue = sal_uInt16(); OUStringBuffer aOut; if( (rValue >>= nValue) && (awt::FontUnderline::NONE != nValue) ) { bRet = SvXMLUnitConverter::convertEnum( - aOut, (sal_uInt16)nValue, pXML_UnderlineWidth_Enum ); + aOut, nValue, pXML_UnderlineWidth_Enum ); if( bRet ) rStrExpValue = aOut.makeStringAndClear(); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index b48dfc6cb2d3..9194ba6ca8f6 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -303,18 +303,18 @@ static const ColorData aNumFmtStdColors[XML_NUMF_COLORCOUNT] = // maps for SvXMLUnitConverter::convertEnum -static const SvXMLEnumMapEntry aStyleValueMap[] = +static const SvXMLEnumMapEntry aStyleValueMap[] = { - { XML_SHORT, sal_uInt16(false) }, - { XML_LONG, sal_uInt16(true) }, - { XML_TOKEN_INVALID, 0 } + { XML_SHORT, false }, + { XML_LONG, true }, + { XML_TOKEN_INVALID, false } }; -static const SvXMLEnumMapEntry aFormatSourceMap[] = +static const SvXMLEnumMapEntry aFormatSourceMap[] = { - { XML_FIXED, sal_uInt16(false) }, - { XML_LANGUAGE, sal_uInt16(true) }, - { XML_TOKEN_INVALID, 0 } + { XML_FIXED, false }, + { XML_LANGUAGE, true }, + { XML_TOKEN_INVALID, false } }; struct SvXMLDefaultDateFormat @@ -902,7 +902,6 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, bool bAttrBool(false); bool bVarDecimals = false; bool bIsMaxDenominator = false; - sal_uInt16 nAttrEnum; double fAttrDouble; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -1012,8 +1011,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, aLanguageTagODF.maCountry = sValue; break; case XML_TOK_ELEM_ATTR_STYLE: - if ( SvXMLUnitConverter::convertEnum( nAttrEnum, sValue, aStyleValueMap ) ) - bLong = (bool) nAttrEnum; + SvXMLUnitConverter::convertEnum( bLong, sValue, aStyleValueMap ); break; case XML_TOK_ELEM_ATTR_TEXTUAL: if (::sax::Converter::convertBool( bAttrBool, sValue )) @@ -1398,7 +1396,6 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, OUString sNatNumAttrScript, sNatNumAttrRfcLanguageTag; css::i18n::NativeNumberXmlAttributes aNatNumAttr; bool bAttrBool(false); - sal_uInt16 nAttrEnum; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for( sal_Int16 i=0; i < nAttrCount; i++ ) @@ -1434,8 +1431,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, bAutoOrder = bAttrBool; break; case XML_TOK_STYLE_ATTR_FORMAT_SOURCE: - if ( SvXMLUnitConverter::convertEnum( nAttrEnum, sValue, aFormatSourceMap ) ) - bFromSystem = (bool) nAttrEnum; + SvXMLUnitConverter::convertEnum( bFromSystem, sValue, aFormatSourceMap ); break; case XML_TOK_STYLE_ATTR_TRUNCATE_ON_OVERFLOW: if (::sax::Converter::convertBool( bAttrBool, sValue )) diff --git a/xmloff/source/style/xmltabe.cxx b/xmloff/source/style/xmltabe.cxx index c566dfa13592..c63c47d78df2 100644 --- a/xmloff/source/style/xmltabe.cxx +++ b/xmloff/source/style/xmltabe.cxx @@ -32,14 +32,14 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -SvXMLEnumMapEntry const pXML_tabstop_style[] = +SvXMLEnumMapEntry const pXML_tabstop_style[] = { { XML_LEFT, style::TabAlign_LEFT }, { XML_CENTER, style::TabAlign_CENTER }, { XML_RIGHT, style::TabAlign_RIGHT }, { XML_CHAR, style::TabAlign_DECIMAL }, { XML_DEFAULT, style::TabAlign_DEFAULT }, // ????????????????????????????????????? - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (style::TabAlign)0 } }; void SvxXMLTabStopExport::exportTabStop( const css::style::TabStop* pTabStop ) diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 55f76951023f..3ea9582dc344 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -208,7 +208,7 @@ const SvXMLTokenMap& return *pAttrTokenMap; } -static SvXMLEnumMapEntry const aFootnoteNumberingMap[] = +static SvXMLEnumMapEntry const aFootnoteNumberingMap[] = { { XML_PAGE, FootnoteNumbering::PER_PAGE }, { XML_CHAPTER, FootnoteNumbering::PER_CHAPTER }, @@ -264,12 +264,8 @@ void XMLFootnoteConfigurationImportContext::StartElement( break; case XML_TOK_FTNCONFIG_START_AT: { - sal_uInt16 nTmp; - if (SvXMLUnitConverter::convertEnum(nTmp, sValue, - aFootnoteNumberingMap)) - { - nNumbering = nTmp; - } + SvXMLUnitConverter::convertEnum(nNumbering, sValue, + aFootnoteNumberingMap); break; } case XML_TOK_FTNCONFIG_POSITION: diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx index 32ff795e6680..ef4037a5a6eb 100644 --- a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx @@ -57,7 +57,7 @@ XMLIndexBibliographyEntryContext::~XMLIndexBibliographyEntryContext() { } -const SvXMLEnumMapEntry aBibliographyDataFieldMap[] = +const SvXMLEnumMapEntry aBibliographyDataFieldMap[] = { { XML_ADDRESS, BibliographyDataField::ADDRESS }, { XML_ANNOTE, BibliographyDataField::ANNOTE }, diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx index 21a07168ace4..3be35668f814 100644 --- a/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx +++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.hxx @@ -30,9 +30,9 @@ namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XAttributeList; } } } } } class XMLIndexTemplateContext; -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; -extern const SvXMLEnumMapEntry aBibliographyDataFieldMap[]; +extern const SvXMLEnumMapEntry aBibliographyDataFieldMap[]; /** * Import bibliography index entry templates diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx index f7db32e331bb..ac1226fd7c8e 100644 --- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx +++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx @@ -66,7 +66,7 @@ XMLIndexChapterInfoEntryContext::~XMLIndexChapterInfoEntryContext() { } -static const SvXMLEnumMapEntry aChapterDisplayMap[] = +static const SvXMLEnumMapEntry aChapterDisplayMap[] = { { XML_NAME, ChapterFormat::NAME }, { XML_NUMBER, ChapterFormat::NUMBER }, diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index b9c6215c07a4..0f741002a713 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -80,7 +80,7 @@ static const XMLTokenEnum aIndexSourceElementMap[] = XML_ILLUSTRATION_INDEX_SOURCE }; -SvXMLEnumMapEntry const aIndexTypeMap[] = +SvXMLEnumMapEntry const aIndexTypeMap[] = { { XML_TABLE_OF_CONTENT, TEXT_INDEX_TOC }, { XML_ALPHABETICAL_INDEX, TEXT_INDEX_ALPHABETICAL }, @@ -89,7 +89,7 @@ SvXMLEnumMapEntry const aIndexTypeMap[] = { XML_BIBLIOGRAPHY, TEXT_INDEX_BIBLIOGRAPHY }, { XML_USER_INDEX, TEXT_INDEX_USER }, { XML_ILLUSTRATION_INDEX, TEXT_INDEX_ILLUSTRATION }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (IndexTypeEnum)0 } }; @@ -101,16 +101,13 @@ XMLIndexTOCContext::XMLIndexTOCContext(SvXMLImport& rImport, { if (XML_NAMESPACE_TEXT == nPrfx) { - sal_uInt16 nTmp; - if (SvXMLUnitConverter::convertEnum(nTmp, rLocalName, aIndexTypeMap)) + if (SvXMLUnitConverter::convertEnum(eIndexType, rLocalName, aIndexTypeMap)) { // check for array index: - OSL_ENSURE(nTmp < (SAL_N_ELEMENTS(aIndexServiceMap)), "index out of range"); + OSL_ENSURE(eIndexType < (SAL_N_ELEMENTS(aIndexServiceMap)), "index out of range"); OSL_ENSURE(SAL_N_ELEMENTS(aIndexServiceMap) == SAL_N_ELEMENTS(aIndexSourceElementMap), "service and source element maps must be same size"); - - eIndexType = static_cast(nTmp); bValid = true; } } diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx index 8c5f01e2d819..cb44feb858e8 100644 --- a/xmloff/source/text/XMLIndexTableSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx @@ -63,7 +63,7 @@ XMLIndexTableSourceContext::~XMLIndexTableSourceContext() { } -static SvXMLEnumMapEntry const lcl_aReferenceTypeTokenMap[] = +static SvXMLEnumMapEntry const lcl_aReferenceTypeTokenMap[] = { { XML_TEXT, ReferenceFieldPart::TEXT }, diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index d1c2859d6253..1498c5be39ba 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -52,7 +52,7 @@ XMLIndexTemplateContext::XMLIndexTemplateContext( Reference & rPropSet, sal_uInt16 nPrfx, const OUString& rLocalName, - const SvXMLEnumMapEntry* pLevelNameMap, + const SvXMLEnumMapEntry* pLevelNameMap, enum XMLTokenEnum eLevelAttrName, const sal_Char** pLevelStylePropMap, const bool* pAllowedTokenTypes, @@ -197,7 +197,7 @@ enum TemplateTokenType }; -SvXMLEnumMapEntry const aTemplateTokenTypeMap[] = +SvXMLEnumMapEntry const aTemplateTokenTypeMap[] = { { XML_INDEX_ENTRY_TEXT, XML_TOK_INDEX_TYPE_ENTRY_TEXT }, { XML_INDEX_ENTRY_TAB_STOP, XML_TOK_INDEX_TYPE_TAB_STOP }, @@ -207,7 +207,7 @@ SvXMLEnumMapEntry const aTemplateTokenTypeMap[] = { XML_INDEX_ENTRY_LINK_START, XML_TOK_INDEX_TYPE_LINK_START }, { XML_INDEX_ENTRY_LINK_END, XML_TOK_INDEX_TYPE_LINK_END }, { XML_INDEX_ENTRY_BIBLIOGRAPHY, XML_TOK_INDEX_TYPE_BIBLIOGRAPHY }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (TemplateTokenType)0 } }; SvXMLImportContext *XMLIndexTemplateContext::CreateChildContext( @@ -219,14 +219,14 @@ SvXMLImportContext *XMLIndexTemplateContext::CreateChildContext( if (XML_NAMESPACE_TEXT == nPrefix) { - sal_uInt16 nToken; + TemplateTokenType nToken; if (SvXMLUnitConverter::convertEnum(nToken, rLocalName, aTemplateTokenTypeMap)) { // can this index accept this kind of token? if (pAllowedTokenTypesMap[nToken]) { - switch ((TemplateTokenType)nToken) + switch (nToken) { case XML_TOK_INDEX_TYPE_ENTRY_TEXT: pContext = new XMLIndexSimpleEntryContext( @@ -296,7 +296,7 @@ SvXMLImportContext *XMLIndexTemplateContext::CreateChildContext( // table of content and user defined index: -const SvXMLEnumMapEntry aSvLevelNameTOCMap[] = +const SvXMLEnumMapEntry aSvLevelNameTOCMap[] = { { XML_1, 1 }, { XML_2, 2 }, @@ -344,7 +344,7 @@ const bool aAllowedTokenTypesUser[] = // alphabetical index -const SvXMLEnumMapEntry aLevelNameAlphaMap[] = +const SvXMLEnumMapEntry aLevelNameAlphaMap[] = { { XML_SEPARATOR, 1 }, { XML_1, 2 }, @@ -372,7 +372,7 @@ const bool aAllowedTokenTypesAlpha[] = // bibliography index: -const SvXMLEnumMapEntry aLevelNameBibliographyMap[] = +const SvXMLEnumMapEntry aLevelNameBibliographyMap[] = { { XML_ARTICLE, 1 }, { XML_BOOK, 2 }, @@ -427,7 +427,7 @@ const bool aAllowedTokenTypesBibliography[] = // table, illustration and object index // no name map -const SvXMLEnumMapEntry* aLevelNameTableMap = nullptr; +const SvXMLEnumMapEntry* aLevelNameTableMap = nullptr; const sal_Char* aLevelStylePropNameTableMap[] = { nullptr, "ParaStyleLevel1", nullptr }; diff --git a/xmloff/source/text/XMLIndexTemplateContext.hxx b/xmloff/source/text/XMLIndexTemplateContext.hxx index 084e86516247..09e141105b41 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.hxx +++ b/xmloff/source/text/XMLIndexTemplateContext.hxx @@ -32,29 +32,29 @@ namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XAttributeList; } } namespace beans { class XPropertySet; } } } } -struct SvXMLEnumMapEntry; +template struct SvXMLEnumMapEntry; // constants for the XMLIndexTemplateContext constructor // TOC and user defined index: -extern const SvXMLEnumMapEntry aSvLevelNameTOCMap[]; +extern const SvXMLEnumMapEntry aSvLevelNameTOCMap[]; extern const sal_Char* aLevelStylePropNameTOCMap[]; extern const bool aAllowedTokenTypesTOC[]; extern const bool aAllowedTokenTypesUser[]; // alphabetical index: -extern const SvXMLEnumMapEntry aLevelNameAlphaMap[]; +extern const SvXMLEnumMapEntry aLevelNameAlphaMap[]; extern const sal_Char* aLevelStylePropNameAlphaMap[]; extern const bool aAllowedTokenTypesAlpha[]; // bibliography: -extern const SvXMLEnumMapEntry aLevelNameBibliographyMap[]; +extern const SvXMLEnumMapEntry aLevelNameBibliographyMap[]; extern const sal_Char* aLevelStylePropNameBibliographyMap[]; extern const bool aAllowedTokenTypesBibliography[]; // table, illustration and object tables: -extern const SvXMLEnumMapEntry* aLevelNameTableMap; // NULL: no outline-level +extern const SvXMLEnumMapEntry* aLevelNameTableMap; // NULL: no outline-level extern const sal_Char* aLevelStylePropNameTableMap[]; extern const bool aAllowedTokenTypesTable[]; @@ -69,7 +69,7 @@ class XMLIndexTemplateContext : public SvXMLImportContext OUString sStyleName; - const SvXMLEnumMapEntry* pOutlineLevelNameMap; + const SvXMLEnumMapEntry* pOutlineLevelNameMap; enum ::xmloff::token::XMLTokenEnum eOutlineLevelAttrName; const sal_Char** pOutlineLevelStylePropMap; const bool* pAllowedTokenTypesMap; @@ -83,16 +83,30 @@ class XMLIndexTemplateContext : public SvXMLImportContext css::uno::Reference & rPropertySet; public: + template XMLIndexTemplateContext( SvXMLImport& rImport, css::uno::Reference & rPropSet, sal_uInt16 nPrfx, const OUString& rLocalName, - const SvXMLEnumMapEntry* aLevelNameMap, + const SvXMLEnumMapEntry* aLevelNameMap, enum ::xmloff::token::XMLTokenEnum eLevelAttrName, const sal_Char** aLevelStylePropNameMap, const bool* aAllowedTokenTypes, - bool bTOC=false); + bool bTOC_=false) + : XMLIndexTemplateContext(rImport,rPropSet,nPrfx,rLocalName, + reinterpret_cast*>(aLevelNameMap), + eLevelAttrName, aLevelStylePropNameMap, aAllowedTokenTypes, bTOC_) {} + XMLIndexTemplateContext( + SvXMLImport& rImport, + css::uno::Reference & rPropSet, + sal_uInt16 nPrfx, + const OUString& rLocalName, + const SvXMLEnumMapEntry* aLevelNameMap, + enum ::xmloff::token::XMLTokenEnum eLevelAttrName, + const sal_Char** aLevelStylePropNameMap, + const bool* aAllowedTokenTypes, + bool bTOC); virtual ~XMLIndexTemplateContext() override; diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index b0d0435213b4..8d9e4fb22d0f 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -43,7 +43,7 @@ XMLLineNumberingExport::XMLLineNumberingExport(SvXMLExport& rExp) { } -SvXMLEnumMapEntry const aLineNumberPositionMap[] = +SvXMLEnumMapEntry const aLineNumberPositionMap[] = { { XML_LEFT, style::LineNumberPosition::LEFT }, { XML_RIGHT, style::LineNumberPosition::RIGHT }, @@ -140,7 +140,7 @@ void XMLLineNumberingExport::Export() // number position aAny = xLineNumbering->getPropertyValue("NumberPosition"); - sal_Int16 nPosition = 0; + sal_uInt16 nPosition = 0; aAny >>= nPosition; if (SvXMLUnitConverter::convertEnum(sNumPosBuf, nPosition, aLineNumberPositionMap)) diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index d182f74b76d2..ce2d059dc4f9 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -181,7 +181,7 @@ void XMLLineNumberingImportContext::ProcessAttribute( case XML_TOK_LINENUMBERING_NUMBER_POSITION: { - static const SvXMLEnumMapEntry aLineNumberPositionMap[] = + static const SvXMLEnumMapEntry aLineNumberPositionMap[] = { { XML_LEFT, style::LineNumberPosition::LEFT }, { XML_RIGHT, style::LineNumberPosition::RIGHT }, @@ -190,12 +190,8 @@ void XMLLineNumberingImportContext::ProcessAttribute( { XML_TOKEN_INVALID, 0 } }; - sal_uInt16 nTmp16; - if (SvXMLUnitConverter::convertEnum(nTmp16, sValue, - aLineNumberPositionMap)) - { - nNumberPosition = nTmp16; - } + SvXMLUnitConverter::convertEnum(nNumberPosition, sValue, + aLineNumberPositionMap); break; } diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index b61732701f7b..f276db392811 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -319,7 +319,7 @@ void XMLSectionExport::ExportIndexHeaderStart( } -SvXMLEnumStringMapEntry const aIndexTypeMap[] = +SvXMLEnumStringMapEntry const aIndexTypeMap[] = { ENUM_STRING_MAP_ENTRY( "com.sun.star.text.ContentIndex", TEXT_SECTION_TYPE_TOC ), ENUM_STRING_MAP_ENTRY( "com.sun.star.text.DocumentIndex", TEXT_SECTION_TYPE_ALPHABETICAL ), @@ -328,7 +328,7 @@ SvXMLEnumStringMapEntry const aIndexTypeMap[] = ENUM_STRING_MAP_ENTRY( "com.sun.star.text.Bibliography", TEXT_SECTION_TYPE_BIBLIOGRAPHY ), ENUM_STRING_MAP_ENTRY( "com.sun.star.text.UserIndex", TEXT_SECTION_TYPE_USER ), ENUM_STRING_MAP_ENTRY( "com.sun.star.text.IllustrationsIndex", TEXT_SECTION_TYPE_ILLUSTRATION ), - ENUM_STRING_MAP_END() + { nullptr, 0, (SectionTypeEnum)0 } }; enum SectionTypeEnum XMLSectionExport::MapSectionType( @@ -336,11 +336,7 @@ enum SectionTypeEnum XMLSectionExport::MapSectionType( { enum SectionTypeEnum eType = TEXT_SECTION_TYPE_UNKNOWN; - sal_uInt16 nTmp; - if (SvXMLUnitConverter::convertEnum(nTmp, rServiceName, aIndexTypeMap)) - { - eType = (enum SectionTypeEnum)nTmp; - } + SvXMLUnitConverter::convertEnum(eType, rServiceName, aIndexTypeMap); // TODO: index header section types, etc. @@ -1073,7 +1069,7 @@ enum TemplateParamEnum TOK_TPARAM_BIBLIOGRAPHY_DATA }; -SvXMLEnumStringMapEntry const aTemplateTypeMap[] = +SvXMLEnumStringMapEntry const aTemplateTypeMap[] = { ENUM_STRING_MAP_ENTRY( "TokenEntryNumber", TOK_TTYPE_ENTRY_NUMBER ), ENUM_STRING_MAP_ENTRY( "TokenEntryText", TOK_TTYPE_ENTRY_TEXT ), @@ -1084,10 +1080,10 @@ SvXMLEnumStringMapEntry const aTemplateTypeMap[] = ENUM_STRING_MAP_ENTRY( "TokenHyperlinkStart", TOK_TTYPE_HYPERLINK_START ), ENUM_STRING_MAP_ENTRY( "TokenHyperlinkEnd", TOK_TTYPE_HYPERLINK_END ), ENUM_STRING_MAP_ENTRY( "TokenBibliographyDataField", TOK_TTYPE_BIBLIOGRAPHY ), - ENUM_STRING_MAP_END() + { nullptr, 0, (TemplateTypeEnum)0} }; -SvXMLEnumStringMapEntry const aTemplateParamMap[] = +SvXMLEnumStringMapEntry const aTemplateParamMap[] = { ENUM_STRING_MAP_ENTRY( "TokenType", TOK_TPARAM_TOKEN_TYPE ), ENUM_STRING_MAP_ENTRY( "CharacterStyleName", TOK_TPARAM_CHAR_STYLE ), @@ -1100,10 +1096,10 @@ SvXMLEnumStringMapEntry const aTemplateParamMap[] = ENUM_STRING_MAP_ENTRY( "ChapterFormat", TOK_TPARAM_CHAPTER_FORMAT ), ENUM_STRING_MAP_ENTRY( "ChapterLevel", TOK_TPARAM_CHAPTER_LEVEL ),//i53420 ENUM_STRING_MAP_ENTRY( "BibliographyDataField", TOK_TPARAM_BIBLIOGRAPHY_DATA ), - ENUM_STRING_MAP_END() + { nullptr, 0, (TemplateParamEnum)0} }; -SvXMLEnumMapEntry const aBibliographyDataFieldMap[] = +SvXMLEnumMapEntry const aBibliographyDataFieldMap[] = { { XML_ADDRESS, BibliographyDataField::ADDRESS }, { XML_ANNOTE, BibliographyDataField::ANNOTE }, @@ -1190,7 +1186,7 @@ void XMLSectionExport::ExportIndexTemplateElement( sal_Int32 nCount = rValues.getLength(); for(sal_Int32 i = 0; i>= sVal; - if (SvXMLUnitConverter::convertEnum( nTmp, sVal, - aTemplateTypeMap)) - { - nTokenType = (enum TemplateTypeEnum)nTmp; - } + SvXMLUnitConverter::convertEnum( nTokenType, sVal, aTemplateTypeMap); break; } diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index 6efd165787df..74321b4a0aa1 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -74,7 +74,7 @@ static const SvXMLTokenMapEntry aColSepAttrTokenMap[] = XML_TOKEN_MAP_END }; -static SvXMLEnumMapEntry const pXML_Sep_Style_Enum[] = +static SvXMLEnumMapEntry const pXML_Sep_Style_Enum[] = { { XML_NONE, 0 }, { XML_SOLID, 1 }, @@ -83,12 +83,12 @@ static SvXMLEnumMapEntry const pXML_Sep_Style_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_Sep_Align_Enum[] = +static SvXMLEnumMapEntry const pXML_Sep_Align_Enum[] = { - { XML_TOP, VerticalAlignment_TOP }, - { XML_MIDDLE, VerticalAlignment_MIDDLE }, - { XML_BOTTOM, VerticalAlignment_BOTTOM }, - { XML_TOKEN_INVALID, 0 } + { XML_TOP, VerticalAlignment_TOP }, + { XML_MIDDLE, VerticalAlignment_MIDDLE }, + { XML_BOTTOM, VerticalAlignment_BOTTOM }, + { XML_TOKEN_INVALID, (VerticalAlignment)0 } }; class XMLTextColumnContext_Impl: public SvXMLImportContext @@ -222,25 +222,15 @@ XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl( nHeight = (sal_Int8)nVal; break; case XML_TOK_COLUMN_SEP_COLOR: - { - ::sax::Converter::convertColor( nColor, rValue ); - } + ::sax::Converter::convertColor( nColor, rValue ); break; case XML_TOK_COLUMN_SEP_ALIGN: - { - sal_uInt16 nAlign; - if( SvXMLUnitConverter::convertEnum( nAlign, rValue, - pXML_Sep_Align_Enum ) ) - eVertAlign = (VerticalAlignment)nAlign; - } + SvXMLUnitConverter::convertEnum( eVertAlign, rValue, + pXML_Sep_Align_Enum ); break; case XML_TOK_COLUMN_SEP_STYLE: - { - sal_uInt16 nStyleVal; - if( SvXMLUnitConverter::convertEnum( nStyleVal, rValue, - pXML_Sep_Style_Enum ) ) - nStyle = (sal_Int8)nStyleVal; - } + SvXMLUnitConverter::convertEnum( nStyle, rValue, + pXML_Sep_Style_Enum ); break; } } 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 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 diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 72dc79a828b8..91dba974616d 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -156,7 +156,7 @@ static sal_Char const FIELD_SERVICE_MEASURE[] = "Measure"; static sal_Char const FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula"; static sal_Char const FIELD_SERVICE_DROP_DOWN[] = "DropDown"; -SvXMLEnumStringMapEntry const aFieldServiceNameMapping[] = +SvXMLEnumStringMapEntry const aFieldServiceNameMapping[] = { ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SENDER, FIELD_ID_SENDER ), ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_AUTHOR, FIELD_ID_AUTHOR ), @@ -244,7 +244,7 @@ SvXMLEnumStringMapEntry const aFieldServiceNameMapping[] = ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_TABLE_FORMULA, FIELD_ID_TABLE_FORMULA ), ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_DROP_DOWN, FIELD_ID_DROP_DOWN ), - ENUM_STRING_MAP_END() + { nullptr, 0, (FieldIdEnum)0 } }; @@ -441,23 +441,11 @@ enum FieldIdEnum XMLTextFieldExport::MapFieldName( if (!sFieldName.isEmpty()) { // map name to prelim. ID - sal_uInt16 nTmp; bool bRet = SvXMLUnitConverter::convertEnum( - nTmp, sFieldName, aFieldServiceNameMapping); + nToken, sFieldName, aFieldServiceNameMapping); // check return DBG_ASSERT(bRet, "Unknown field service name encountered!"); - if (! bRet) - { - nToken = FIELD_ID_UNKNOWN; - } - else - { - nToken = (enum FieldIdEnum)nTmp; - } - } else { - // invalid service name - nToken = FIELD_ID_UNKNOWN; } // b) map prelim. to final FIELD_IDs @@ -2674,7 +2662,7 @@ void XMLTextFieldExport::ProcessTimeOrDateTime(enum XMLTokenEnum eName, } -SvXMLEnumMapEntry const aBibliographyDataTypeMap[] = +SvXMLEnumMapEntry const aBibliographyDataTypeMap[] = { { XML_ARTICLE, BibliographyDataType::ARTICLE }, { XML_BOOK, BibliographyDataType::BOOK }, diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 0e5c2f6bbc82..e521e19eb982 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -720,12 +720,12 @@ void XMLAuthorFieldImportContext::PrepareField( // page continuation string -static SvXMLEnumMapEntry const lcl_aSelectPageAttrMap[] = +static SvXMLEnumMapEntry const lcl_aSelectPageAttrMap[] = { - { XML_PREVIOUS, PageNumberType_PREV }, - { XML_CURRENT, PageNumberType_CURRENT }, - { XML_NEXT, PageNumberType_NEXT }, - { XML_TOKEN_INVALID, 0 }, + { XML_PREVIOUS, PageNumberType_PREV }, + { XML_CURRENT, PageNumberType_CURRENT }, + { XML_NEXT, PageNumberType_NEXT }, + { XML_TOKEN_INVALID, (PageNumberType)0 }, }; XMLPageContinuationImportContext::XMLPageContinuationImportContext( @@ -748,12 +748,12 @@ void XMLPageContinuationImportContext::ProcessAttribute( { case XML_TOK_TEXTFIELD_SELECT_PAGE: { - sal_uInt16 nTmp; + PageNumberType nTmp; if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue, lcl_aSelectPageAttrMap) && (PageNumberType_CURRENT != nTmp) ) { - eSelectPage = (PageNumberType)nTmp; + eSelectPage = nTmp; } break; } @@ -811,15 +811,9 @@ void XMLPageNumberImportContext::ProcessAttribute( sNumberSync = sAttrValue; break; case XML_TOK_TEXTFIELD_SELECT_PAGE: - { - sal_uInt16 nTmp; - if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue, - lcl_aSelectPageAttrMap)) - { - eSelectPage = (PageNumberType)nTmp; - } + SvXMLUnitConverter::convertEnum(eSelectPage, sAttrValue, + lcl_aSelectPageAttrMap); break; - } case XML_TOK_TEXTFIELD_PAGE_ADJUST: { sal_Int32 nTmp; @@ -2017,7 +2011,7 @@ void XMLHiddenTextImportContext::PrepareField( // file name fields -static const SvXMLEnumMapEntry aFilenameDisplayMap[] = +static const SvXMLEnumMapEntry aFilenameDisplayMap[] = { { XML_PATH, FilenameDisplayFormat::PATH }, { XML_NAME, FilenameDisplayFormat::NAME }, @@ -2099,7 +2093,7 @@ void XMLFileNameImportContext::PrepareField( // template name field -static const SvXMLEnumMapEntry aTemplateDisplayMap[] = +static const SvXMLEnumMapEntry aTemplateDisplayMap[] = { { XML_FULL, TemplateDisplayFormat::FULL }, { XML_PATH, TemplateDisplayFormat::PATH }, @@ -2154,7 +2148,7 @@ void XMLTemplateNameImportContext::PrepareField( // import chapter fields -static const SvXMLEnumMapEntry aChapterDisplayMap[] = +static const SvXMLEnumMapEntry aChapterDisplayMap[] = { { XML_NAME, ChapterFormat::NAME }, { XML_NUMBER, ChapterFormat::NUMBER }, @@ -2560,7 +2554,7 @@ XMLReferenceFieldImportContext::XMLReferenceFieldImportContext( { } -static SvXMLEnumMapEntry const lcl_aReferenceTypeTokenMap[] = +static SvXMLEnumMapEntry const lcl_aReferenceTypeTokenMap[] = { { XML_PAGE, ReferenceFieldPart::PAGE}, { XML_CHAPTER, ReferenceFieldPart::CHAPTER }, @@ -3040,7 +3034,7 @@ XMLBibliographyFieldImportContext::XMLBibliographyFieldImportContext( } // TODO: this is the same map as is used in the text field export -static SvXMLEnumMapEntry const aBibliographyDataTypeMap[] = +static SvXMLEnumMapEntry const aBibliographyDataTypeMap[] = { { XML_ARTICLE, BibliographyDataType::ARTICLE }, { XML_BOOK, BibliographyDataType::BOOK }, diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index d29452b7de3a..b3712ea3fb7f 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -68,7 +68,7 @@ using namespace ::xmloff::token; //UUUU using namespace ::com::sun::star::drawing; -static SvXMLEnumMapEntry const pXML_HoriPos_Enum[] = +static SvXMLEnumMapEntry const pXML_HoriPos_Enum[] = { { XML_FROM_LEFT, HoriOrientation::NONE }, { XML_FROM_INSIDE, HoriOrientation::NONE }, // import only @@ -80,7 +80,7 @@ static SvXMLEnumMapEntry const pXML_HoriPos_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_HoriPosMirrored_Enum[] = +static SvXMLEnumMapEntry const pXML_HoriPosMirrored_Enum[] = { { XML_FROM_INSIDE, HoriOrientation::NONE }, { XML_INSIDE, HoriOrientation::LEFT }, @@ -89,7 +89,7 @@ static SvXMLEnumMapEntry const pXML_HoriPosMirrored_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_HoriRel_Enum[] = +static SvXMLEnumMapEntry const pXML_HoriRel_Enum[] = { { XML_PARAGRAPH, RelOrientation::FRAME }, { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA }, @@ -107,7 +107,7 @@ static SvXMLEnumMapEntry const pXML_HoriRel_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_HoriRelFrame_Enum[] = +static SvXMLEnumMapEntry const pXML_HoriRelFrame_Enum[] = { { XML_FRAME, RelOrientation::FRAME }, { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, @@ -121,19 +121,19 @@ static SvXMLEnumMapEntry const pXML_HoriRelFrame_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_HoriMirror_Enum[] = +static SvXMLEnumMapEntry const pXML_HoriMirror_Enum[] = { - { XML_FROM_LEFT, sal_uInt16(false) }, - { XML_FROM_INSIDE, sal_uInt16(true) }, - { XML_LEFT, sal_uInt16(false) }, - { XML_INSIDE, sal_uInt16(true) }, - { XML_CENTER, sal_uInt16(false) }, - { XML_RIGHT, sal_uInt16(false) }, - { XML_OUTSIDE, sal_uInt16(true) }, - { XML_TOKEN_INVALID, 0 } + { XML_FROM_LEFT, false }, + { XML_FROM_INSIDE, true }, + { XML_LEFT, false }, + { XML_INSIDE, true }, + { XML_CENTER, false }, + { XML_RIGHT, false }, + { XML_OUTSIDE, true }, + { XML_TOKEN_INVALID, false } }; -static SvXMLEnumMapEntry const pXML_VertPosAtChar_Enum[] = +static SvXMLEnumMapEntry const pXML_VertPosAtChar_Enum[] = { { XML_FROM_TOP, VertOrientation::NONE }, { XML_TOP, VertOrientation::TOP }, @@ -148,7 +148,7 @@ static SvXMLEnumMapEntry const pXML_VertPosAtChar_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VertRel_Enum[] = +static SvXMLEnumMapEntry const pXML_VertRel_Enum[] = { { XML_PARAGRAPH, RelOrientation::FRAME }, { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA }, @@ -163,7 +163,7 @@ static SvXMLEnumMapEntry const pXML_VertRel_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VertRelPage_Enum[] = +static SvXMLEnumMapEntry const pXML_VertRelPage_Enum[] = { { XML_PAGE, RelOrientation::FRAME }, { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA }, @@ -172,14 +172,14 @@ static SvXMLEnumMapEntry const pXML_VertRelPage_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VertRelFrame_Enum[] = +static SvXMLEnumMapEntry const pXML_VertRelFrame_Enum[] = { { XML_FRAME, RelOrientation::FRAME }, { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VertRelAsChar_Enum[] = +static SvXMLEnumMapEntry const pXML_VertRelAsChar_Enum[] = { { XML_BASELINE, VertOrientation::TOP }, { XML_BASELINE, VertOrientation::CENTER }, // export only @@ -193,17 +193,17 @@ static SvXMLEnumMapEntry const pXML_VertRelAsChar_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_RubyAdjust_Enum[] = +static SvXMLEnumMapEntry const pXML_RubyAdjust_Enum[] = { { XML_LEFT, RubyAdjust_LEFT }, { XML_CENTER, RubyAdjust_CENTER }, { XML_RIGHT, RubyAdjust_RIGHT }, { XML_DISTRIBUTE_LETTER, RubyAdjust_BLOCK }, { XML_DISTRIBUTE_SPACE, RubyAdjust_INDENT_BLOCK }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (RubyAdjust)0 } }; -static SvXMLEnumMapEntry const pXML_FontRelief_Enum[] = +static SvXMLEnumMapEntry const pXML_FontRelief_Enum[] = { { XML_NONE, FontRelief::NONE }, { XML_ENGRAVED, FontRelief::ENGRAVED }, @@ -211,7 +211,7 @@ static SvXMLEnumMapEntry const pXML_FontRelief_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_ParaVerticalAlign_Enum[] = +static SvXMLEnumMapEntry const pXML_ParaVerticalAlign_Enum[] = { { XML_TOP, ParagraphVertAlign::TOP }, { XML_MIDDLE, ParagraphVertAlign::CENTER }, @@ -222,7 +222,7 @@ static SvXMLEnumMapEntry const pXML_ParaVerticalAlign_Enum[] = }; // OD 2004-05-05 #i28701# -static SvXMLEnumMapEntry const pXML_WrapInfluenceOnPosition_Enum[] = +static SvXMLEnumMapEntry const pXML_WrapInfluenceOnPosition_Enum[] = { // Tokens have been renamed and has been added (#i35017#) { XML_ONCE_SUCCESSIVE, WrapInfluenceOnPosition::ONCE_SUCCESSIVE }, @@ -231,13 +231,13 @@ static SvXMLEnumMapEntry const pXML_WrapInfluenceOnPosition_Enum[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] = +static SvXMLEnumMapEntry 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 } }; class XMLDropCapPropHdl_Impl : public XMLPropertyHandler @@ -425,7 +425,7 @@ bool XMLParagraphOnlyPropHdl_Impl::exportXML( return true; } -SvXMLEnumMapEntry const pXML_Wrap_Enum[] = +SvXMLEnumMapEntry const pXML_Wrap_Enum[] = { { XML_NONE, WrapTextMode_NONE }, { XML_RUN_THROUGH, WrapTextMode_THROUGHT }, @@ -433,7 +433,7 @@ SvXMLEnumMapEntry const pXML_Wrap_Enum[] = { XML_DYNAMIC, WrapTextMode_DYNAMIC }, { XML_LEFT, WrapTextMode_LEFT }, { XML_RIGHT, WrapTextMode_RIGHT }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (WrapTextMode)0 } }; class XMLWrapPropHdl_Impl : public XMLPropertyHandler @@ -454,12 +454,12 @@ bool XMLWrapPropHdl_Impl::importXML( Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 nWrap; + WrapTextMode nWrap; bool bRet = SvXMLUnitConverter::convertEnum( nWrap, rStrImpValue, pXML_Wrap_Enum ); if( bRet ) - rValue <<= (WrapTextMode)nWrap; + rValue <<= nWrap; return bRet; } @@ -552,14 +552,14 @@ bool XMLFrameProtectPropHdl_Impl::exportXML( return true; } -SvXMLEnumMapEntry const pXML_Anchor_Enum[] = +SvXMLEnumMapEntry const pXML_Anchor_Enum[] = { - { XML_CHAR, TextContentAnchorType_AT_CHARACTER }, - { XML_PAGE, TextContentAnchorType_AT_PAGE }, - { XML_FRAME, TextContentAnchorType_AT_FRAME }, - { XML_PARAGRAPH, TextContentAnchorType_AT_PARAGRAPH }, - { XML_AS_CHAR, TextContentAnchorType_AS_CHARACTER }, - { XML_TOKEN_INVALID, 0 } + { XML_CHAR, TextContentAnchorType_AT_CHARACTER }, + { XML_PAGE, TextContentAnchorType_AT_PAGE }, + { XML_FRAME, TextContentAnchorType_AT_FRAME }, + { XML_PARAGRAPH, TextContentAnchorType_AT_PARAGRAPH }, + { XML_AS_CHAR, TextContentAnchorType_AS_CHARACTER }, + { XML_TOKEN_INVALID, (TextContentAnchorType)0 } }; bool XMLAnchorTypePropHdl::importXML( @@ -567,12 +567,12 @@ bool XMLAnchorTypePropHdl::importXML( Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 nAnchor; + TextContentAnchorType nAnchor; bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue, pXML_Anchor_Enum ); if( bRet ) - rValue <<= (TextContentAnchorType)nAnchor; + rValue <<= nAnchor; return bRet; } @@ -601,11 +601,11 @@ XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl() bool XMLAnchorTypePropHdl::convert( const OUString& rStrImpValue, TextContentAnchorType& rType ) { - sal_uInt16 nAnchor; + TextContentAnchorType nAnchor; bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue, pXML_Anchor_Enum ); if( bRet ) - rType = (TextContentAnchorType)nAnchor; + rType = nAnchor; return bRet; } @@ -686,13 +686,13 @@ bool XMLHoriMirrorPropHdl_Impl::importXML( Any& rValue, const SvXMLUnitConverter& ) const { - sal_uInt16 nHoriMirror; + bool nHoriMirror; bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue, pXML_HoriMirror_Enum ); if( bRet ) { - rValue <<= (nHoriMirror != 0); + rValue <<= nHoriMirror; } return bRet; @@ -793,7 +793,7 @@ bool XMLGrfMirrorPropHdl_Impl::exportXML( return true; } -SvXMLEnumMapEntry const pXML_Emphasize_Enum[] = +SvXMLEnumMapEntry const pXML_Emphasize_Enum[] = { { XML_NONE, FontEmphasis::NONE }, { XML_DOT, FontEmphasis::DOT_ABOVE }, @@ -871,7 +871,7 @@ bool XMLTextEmphasizePropHdl_Impl::exportXML( { OUStringBuffer aOut( 15 ); bool bRet = true; - sal_Int16 nType = sal_Int16(); + sal_uInt16 nType = sal_uInt16(); if( rValue >>= nType ) { bool bBelow = false; @@ -1297,7 +1297,7 @@ static const XMLPropertyHandler *GetPropertyHandler //UUUU case XML_SW_TYPE_FILLSTYLE: - pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap); break; case XML_SW_TYPE_FILLBITMAPSIZE: pHdl = new XMLFillBitmapSizePropertyHandler(); @@ -1306,10 +1306,10 @@ static const XMLPropertyHandler *GetPropertyHandler pHdl = new XMLBitmapLogicalSizePropertyHandler(); break; case XML_SW_TYPE_BITMAP_REFPOINT: - pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap); break; case XML_SW_TYPE_BITMAP_MODE: - pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, cppu::UnoType::get()); + pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap); break; case XML_SW_TYPE_BITMAPREPOFFSETX: case XML_SW_TYPE_BITMAPREPOFFSETY: diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 8df44e21c744..7c3a11913b19 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -67,7 +67,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::xmloff::token; -static const SvXMLEnumMapEntry aCategoryMap[] = +static const SvXMLEnumMapEntry aCategoryMap[] = { { XML_TEXT, ParagraphStyleCategory::TEXT }, { XML_CHAPTER, ParagraphStyleCategory::CHAPTER }, diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 66bd617e6762..6825a737cccf 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -1078,7 +1078,7 @@ enum ValueType XML_VALUE_TYPE_BOOLEAN }; -static SvXMLEnumMapEntry const aValueTypeMap[] = +static SvXMLEnumMapEntry const aValueTypeMap[] = { { XML_FLOAT, XML_VALUE_TYPE_FLOAT }, { XML_CURRENCY, XML_VALUE_TYPE_CURRENCY }, @@ -1087,7 +1087,7 @@ static SvXMLEnumMapEntry const aValueTypeMap[] = { XML_TIME, XML_VALUE_TYPE_TIME }, { XML_BOOLEAN, XML_VALUE_TYPE_BOOLEAN }, { XML_STRING, XML_VALUE_TYPE_STRING }, - { XML_TOKEN_INVALID, 0 } + { XML_TOKEN_INVALID, (ValueType)0 } }; XMLValueImportHelper::XMLValueImportHelper( @@ -1124,13 +1124,11 @@ void XMLValueImportHelper::ProcessAttribute( case XML_TOK_TEXTFIELD_VALUE_TYPE: { // convert enum - sal_uInt16 nTmp = 0; + ValueType eValueType = XML_VALUE_TYPE_STRING; bool bRet = SvXMLUnitConverter::convertEnum( - nTmp, sAttrValue, aValueTypeMap); + eValueType, sAttrValue, aValueTypeMap); if (bRet) { - ValueType eValueType = (ValueType)nTmp; - bTypeOK = true; switch (eValueType) -- cgit