[Libreoffice-commits] core.git: dbaccess/source include/xmloff reportdesign/source sw/source xmloff/inc xmloff/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Mar 13 09:03:14 UTC 2017


 dbaccess/source/filter/xml/xmlHelper.cxx                     |    8 
 include/xmloff/EnumPropertyHdl.hxx                           |    7 
 include/xmloff/XMLConstantsPropertyHandler.hxx               |   10 
 include/xmloff/controlpropertyhdl.hxx                        |    2 
 include/xmloff/xmlement.hxx                                  |   41 +
 include/xmloff/xmluconv.hxx                                  |   53 +
 reportdesign/source/filter/xml/xmlExport.cxx                 |   22 
 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx  |    2 
 reportdesign/source/filter/xml/xmlGroup.cxx                  |    6 
 reportdesign/source/filter/xml/xmlHelper.cxx                 |   32 -
 reportdesign/source/filter/xml/xmlHelper.hxx                 |   10 
 reportdesign/source/filter/xml/xmlImage.cxx                  |    4 
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx  |    4 
 reportdesign/source/filter/xml/xmlReport.cxx                 |    4 
 reportdesign/source/filter/xml/xmlSection.cxx                |    6 
 reportdesign/source/filter/xml/xmlTable.cxx                  |    6 
 sw/source/filter/xml/xmlexpit.cxx                            |    4 
 sw/source/filter/xml/xmlimpit.cxx                            |   18 
 sw/source/filter/xml/xmlithlp.cxx                            |   50 -
 sw/source/filter/xml/xmlithlp.hxx                            |   20 
 xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx           |    2 
 xmloff/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 
 xmloff/source/chart/XMLErrorBarStylePropertyHdl.cxx          |    4 
 xmloff/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 -
 xmloff/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 
 xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx |   10 
 xmloff/source/text/XMLIndexBibliographyEntryContext.cxx      |    2 
 xmloff/source/text/XMLIndexBibliographyEntryContext.hxx      |    4 
 xmloff/source/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 
 xmloff/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 
 96 files changed, 1027 insertions(+), 1032 deletions(-)

New commits:
commit 7e9857c2935bb2533806db4e71c6cd1e171c3478
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Mar 9 09:04:15 2017 +0200

    templatize SvXMLEnumMapEntry
    
    in preparation for "scoped UNO enums".
    
    This is a little hacky: In order to limit the scope of this change,
    the templated SvXMLEnumMapEntry struct actually has a fixed size field,
    and we cast it to SvXMLEnumMapEntry<sal_uInt16>* in various
    places, to avoid carrying the type param around.
    
    Change-Id: Idfbc5561303c557598dd5564b7a7259ae5261d83
    Reviewed-on: https://gerrit.libreoffice.org/34987
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/source/filter/xml/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx
index de5844b..fb6794a 100644
--- a/dbaccess/source/filter/xml/xmlHelper.cxx
+++ b/dbaccess/source/filter/xml/xmlHelper.cxx
@@ -54,11 +54,11 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32
         case XML_DB_TYPE_EQUAL:
             if ( !m_pDisplayHandler.get() )
             {
-                static const SvXMLEnumMapEntry aDisplayMap[] =
+                static const SvXMLEnumMapEntry<bool> aDisplayMap[] =
                 {
-                    { XML_VISIBLE,      sal_uInt16(true) },
-                    { XML_COLLAPSE,     sal_uInt16(false) },
-                    { XML_TOKEN_INVALID, 0 }
+                    { XML_VISIBLE,       true },
+                    { XML_COLLAPSE,      false },
+                    { XML_TOKEN_INVALID, false }
                 };
                 m_pDisplayHandler.reset(new XMLConstantsPropertyHandler(aDisplayMap, XML_TOKEN_INVALID ));
             }
diff --git a/include/xmloff/EnumPropertyHdl.hxx b/include/xmloff/EnumPropertyHdl.hxx
index 71519b8..4d3e8c5 100644
--- a/include/xmloff/EnumPropertyHdl.hxx
+++ b/include/xmloff/EnumPropertyHdl.hxx
@@ -22,6 +22,7 @@
 
 #include <xmloff/xmlprhdl.hxx>
 #include <com/sun/star/uno/Type.h>
+#include <cppu/unotype.hxx>
 #include <xmloff/xmlement.hxx>
 
 /**
@@ -30,11 +31,13 @@
 class XMLOFF_DLLPUBLIC XMLEnumPropertyHdl : public XMLPropertyHandler
 {
 private:
-    const SvXMLEnumMapEntry* mpEnumMap;
+    const SvXMLEnumMapEntry<sal_uInt16>* mpEnumMap;
     const css::uno::Type & mrType;
 
 public:
-    XMLEnumPropertyHdl( const SvXMLEnumMapEntry* pEnumMap, const css::uno::Type & rType ) : mpEnumMap( pEnumMap ), mrType( rType ) {}
+    template<typename EnumT>
+    XMLEnumPropertyHdl( const SvXMLEnumMapEntry<EnumT>* pEnumMap)
+        : mpEnumMap( reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pEnumMap) ), mrType( ::cppu::UnoType<EnumT>::get() ) {}
     virtual ~XMLEnumPropertyHdl() override;
 
     virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
diff --git a/include/xmloff/XMLConstantsPropertyHandler.hxx b/include/xmloff/XMLConstantsPropertyHandler.hxx
index b31f7d6..1341507 100644
--- a/include/xmloff/XMLConstantsPropertyHandler.hxx
+++ b/include/xmloff/XMLConstantsPropertyHandler.hxx
@@ -25,6 +25,7 @@
 #include <xmloff/xmlprhdl.hxx>
 #include <xmloff/xmltoken.hxx>
 
+template<typename EnumT>
 struct SvXMLEnumMapEntry;
 
 
@@ -33,13 +34,14 @@ struct SvXMLEnumMapEntry;
 */
 class XMLOFF_DLLPUBLIC XMLConstantsPropertyHandler: public XMLPropertyHandler
 {
-    const SvXMLEnumMapEntry *pMap;
+    const SvXMLEnumMapEntry<sal_uInt16> *pMap;
     const enum ::xmloff::token::XMLTokenEnum eDefault;
 
 public:
-
-    XMLConstantsPropertyHandler( const SvXMLEnumMapEntry *pM,
-                                 enum ::xmloff::token::XMLTokenEnum eDflt);
+    template<typename EnumT>
+    XMLConstantsPropertyHandler( const SvXMLEnumMapEntry<EnumT> *pM,
+                                 enum ::xmloff::token::XMLTokenEnum eDflt)
+     : pMap(reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pM)), eDefault(eDflt) {}
 
     // Just needed for virtual destruction
     virtual ~XMLConstantsPropertyHandler() override;
diff --git a/include/xmloff/controlpropertyhdl.hxx b/include/xmloff/controlpropertyhdl.hxx
index 39d5f73..edcbd47 100644
--- a/include/xmloff/controlpropertyhdl.hxx
+++ b/include/xmloff/controlpropertyhdl.hxx
@@ -31,7 +31,7 @@
 #include <xmloff/xmlexppr.hxx>
 #include <xmloff/XMLConstantsPropertyHandler.hxx>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> struct SvXMLEnumMapEntry;
 class Color;
 
 namespace xmloff
diff --git a/include/xmloff/xmlement.hxx b/include/xmloff/xmlement.hxx
index 3300a93..d3aaba3 100644
--- a/include/xmloff/xmlement.hxx
+++ b/include/xmloff/xmlement.hxx
@@ -23,13 +23,38 @@
 #include <sal/types.h>
 #include <xmloff/xmltoken.hxx>
 
-/** Map an XMLTokenEnum to a sal_uInt16 value.
+/** Map an XMLTokenEnum to an enum value.
  * To be used with SvXMLUnitConverter::convertEnum(...)
+ * We store the enum internally as a fixed size field, since there are
+ * places where we want to store a generic pointer to an array of SvXMLEnumMapEntry
+ * and we don't want to templatize the class.
  */
+template<typename EnumT>
 struct SvXMLEnumMapEntry
 {
+private:
     ::xmloff::token::XMLTokenEnum   eToken;
     sal_uInt16                      nValue;
+public:
+    SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_)
+        : eToken(eToken_), nValue(nValue_) {}
+    ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
+    EnumT                           GetValue() const { return static_cast<EnumT>(nValue); }
+};
+
+// specialisation to avoid lots of "C2398: conversion from 'const sal_Int16' to 'sal_uInt16' requires a narrowing conversion"
+// errors when compiling on MSVC
+template<>
+struct SvXMLEnumMapEntry<sal_uInt16>
+{
+private:
+    ::xmloff::token::XMLTokenEnum   eToken;
+    sal_uInt16                      nValue;
+public:
+    SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, sal_Int32 nValue_)
+        : eToken(eToken_), nValue(nValue_) {}
+    ::xmloff::token::XMLTokenEnum   GetToken() const { return eToken; }
+    sal_uInt16                      GetValue() const { return nValue; }
 };
 
 #define ENUM_STRING_MAP_ENTRY(name,tok) { name, sizeof(name)-1, tok }
@@ -39,11 +64,19 @@ struct SvXMLEnumMapEntry
 /** Map a const sal_Char* (with length) to a sal_uInt16 value.
  * To be used with SvXMLUnitConverter::convertEnum(...)
  */
+template<typename EnumT>
 struct SvXMLEnumStringMapEntry
 {
-    const sal_Char *    pName;
-    sal_Int32           nNameLength;
-    sal_uInt16          nValue;
+private:
+    const char *    pName;
+    sal_Int32       nNameLength;
+    sal_uInt16      nValue;
+public:
+    SvXMLEnumStringMapEntry(const char * pName_, sal_Int32 nNameLength_, EnumT nValue_)
+        : pName(pName_), nNameLength(nNameLength_), nValue(nValue_) {}
+    const char * GetName() const { return pName; }
+    sal_Int32    GetNameLength() const { return nNameLength; }
+    EnumT        GetValue() const { return static_cast<EnumT>(nValue); }
 };
 
 #endif // INCLUDED_XMLOFF_XMLEMENT_HXX
diff --git a/include/xmloff/xmluconv.hxx b/include/xmloff/xmluconv.hxx
index 8c11ca4..e71880b 100644
--- a/include/xmloff/xmluconv.hxx
+++ b/include/xmloff/xmluconv.hxx
@@ -122,25 +122,48 @@ public:
 
     /** convert string to enum using given enum map, if the enum is
         not found in the map, this method will return false */
-    static bool convertEnum( sal_uInt16& rEnum,
+    template<typename EnumT>
+    static bool convertEnum( EnumT& rEnum,
                              const OUString& rValue,
-                             const SvXMLEnumMapEntry *pMap );
+                             const SvXMLEnumMapEntry<EnumT> *pMap )
+    {
+        sal_uInt16 nTmp;
+        bool bRet = convertEnumImpl(nTmp, rValue,
+                        reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap));
+        if (bRet)
+            rEnum = static_cast<EnumT>(nTmp);
+        return bRet;
+    }
 
     /** convert string to enum using given token map, if the enum is
         not found in the map, this method will return false */
-    static bool convertEnum( sal_uInt16& rEnum,
+    template<typename EnumT>
+    static bool convertEnum( EnumT& rEnum,
                              const OUString& rValue,
-                             const SvXMLEnumStringMapEntry *pMap );
+                             const SvXMLEnumStringMapEntry<EnumT> *pMap )
+    {
+        sal_uInt16 nTmp;
+        bool bRet = convertEnumImpl(nTmp, rValue,
+                        reinterpret_cast<const SvXMLEnumStringMapEntry<sal_uInt16>*>(pMap));
+        if (bRet)
+            rEnum = static_cast<EnumT>(nTmp);
+        return bRet;
+    }
 
     /** convert enum to string using given enum map with an optional
         default token. If the enum is not found in the map,
         this method will either use the given default or return
         false if not default is set */
+    template<typename EnumT>
     static bool convertEnum( OUStringBuffer& rBuffer,
-                                 unsigned int nValue,
-                                 const SvXMLEnumMapEntry *pMap,
-                                 enum ::xmloff::token::XMLTokenEnum eDefault =
-                                         ::xmloff::token::XML_TOKEN_INVALID );
+                             EnumT nValue,
+                             const SvXMLEnumMapEntry<EnumT> *pMap,
+                             enum ::xmloff::token::XMLTokenEnum eDefault =
+                                         ::xmloff::token::XML_TOKEN_INVALID )
+    {
+        return convertEnumImpl(rBuffer, nValue,
+                   reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap), eDefault);
+    }
 
     /** convert double number to string (using ::rtl::math) and DO
         convert to export MapUnit using meCoreMeasureUnit/meXMLMeasureUnit */
@@ -219,6 +242,20 @@ public:
     /** convert number (sal_uInt32) to string (hex) */
     static void convertHex( OUStringBuffer& rBuffer,
                                sal_uInt32 nVal );
+
+private:
+    static bool convertEnumImpl( sal_uInt16& rEnum,
+                             const OUString& rValue,
+                             const SvXMLEnumMapEntry<sal_uInt16> *pMap );
+
+    static bool convertEnumImpl( sal_uInt16& rEnum,
+                             const OUString& rValue,
+                             const SvXMLEnumStringMapEntry<sal_uInt16> *pMap );
+
+    static bool convertEnumImpl( OUStringBuffer& rBuffer,
+                             sal_uInt16 nValue,
+                             const SvXMLEnumMapEntry<sal_uInt16> *pMap,
+                             enum ::xmloff::token::XMLTokenEnum eDefault );
 };
 
 #endif // INCLUDED_XMLOFF_XMLUCONV_HXX
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index cc5fe5f..6d8707c 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -388,8 +388,8 @@ void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefini
         if ( _xReportDefinition->getPageHeaderOn() )
         {
             OUStringBuffer sValue;
-            sal_uInt16 nRet = _xReportDefinition->getPageHeaderOption();
-            const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
+            sal_Int16 nRet = _xReportDefinition->getPageHeaderOption();
+            const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
             if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
                 AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear());
 
@@ -402,8 +402,8 @@ void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefini
         if ( _xReportDefinition->getPageFooterOn() )
         {
             OUStringBuffer sValue;
-            sal_uInt16 nRet = _xReportDefinition->getPageFooterOption();
-            const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
+            sal_Int16 nRet = _xReportDefinition->getPageFooterOption();
+            const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
             if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
                 AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear());
             SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_FOOTER, true, true);
@@ -707,8 +707,8 @@ void ORptExport::exportSection(const Reference<XSection>& _xSection,bool bHeader
 
     if ( !bHeader )
     {
-        sal_uInt16 nRet = _xSection->getForceNewPage();
-        const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
+        sal_Int16 nRet = _xSection->getForceNewPage();
+        const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
         if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
             AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_PAGE,sValue.makeStringAndClear());
 
@@ -886,7 +886,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection)
                                 }
                                 bExportData = true;
                                 OUStringBuffer sValue;
-                                const SvXMLEnumMapEntry* aXML_ImageScaleEnumMap = OXMLHelper::GetImageScaleOptions();
+                                const SvXMLEnumMapEntry<sal_Int16>* aXML_ImageScaleEnumMap = OXMLHelper::GetImageScaleOptions();
                                 if ( SvXMLUnitConverter::convertEnum( sValue, xImage->getScaleMode(),aXML_ImageScaleEnumMap ) )
                                     AddAttribute(XML_NAMESPACE_REPORT, XML_SCALE, sValue.makeStringAndClear() );
                             }
@@ -1073,8 +1073,8 @@ void ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDefinit
                     AddAttribute(XML_NAMESPACE_REPORT, XML_GROUP_EXPRESSION,sExpression);
                     sal_Int16 nRet = xGroup->getKeepTogether();
                     OUStringBuffer sValue;
-                    const SvXMLEnumMapEntry* aXML_KeepTogetherEnumMap = OXMLHelper::GetKeepTogetherOptions();
-                    if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_KeepTogetherEnumMap ) )
+                    const SvXMLEnumMapEntry<sal_Int16>* aXML_KeepTogetherEnumMap = OXMLHelper::GetKeepTogetherOptions();
+                    if ( SvXMLUnitConverter::convertEnum( sValue, nRet, aXML_KeepTogetherEnumMap ) )
                         AddAttribute(XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER,sValue.makeStringAndClear());
 
                     SvXMLElementExport aGroup(*this,XML_NAMESPACE_REPORT, XML_GROUP, true, true);
@@ -1254,8 +1254,8 @@ void ORptExport::exportReportAttributes(const Reference<XReportDefinition>& _xRe
     if ( _xReport.is() )
     {
         OUStringBuffer sValue;
-        const SvXMLEnumMapEntry* aXML_CommnadTypeEnumMap = OXMLHelper::GetCommandTypeOptions();
-        if ( SvXMLUnitConverter::convertEnum( sValue, static_cast<sal_uInt16>(_xReport->getCommandType()),aXML_CommnadTypeEnumMap ) )
+        const SvXMLEnumMapEntry<sal_Int32>* aXML_CommnadTypeEnumMap = OXMLHelper::GetCommandTypeOptions();
+        if ( SvXMLUnitConverter::convertEnum( sValue, _xReport->getCommandType(), aXML_CommnadTypeEnumMap ) )
             AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND_TYPE,sValue.makeStringAndClear());
 
         OUString sComamnd = _xReport->getCommand();
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index d736f52..bbbb39b 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -143,7 +143,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const
         SvXMLAttributeList* pList = new SvXMLAttributeList();
         uno::Reference< xml::sax::XAttributeList > xNewAttribs = pList;
         OUStringBuffer sValue;
-        static const SvXMLEnumMapEntry aXML_CommnadTypeEnumMap[] =
+        static const SvXMLEnumMapEntry<sal_uInt16> aXML_CommnadTypeEnumMap[] =
         {
             { XML_TABLE, sdb::CommandType::TABLE },
             { XML_QUERY, sdb::CommandType::QUERY },
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index 79b30a8..8b6830f 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -39,10 +39,10 @@ namespace rptxml
     using namespace ::com::sun::star::report;
     using namespace ::com::sun::star::xml::sax;
 
-    sal_uInt16 lcl_getKeepTogetherOption(const OUString& _sValue)
+    sal_Int16 lcl_getKeepTogetherOption(const OUString& _sValue)
     {
-        sal_uInt16 nRet = report::KeepTogether::NO;
-        const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions();
+        sal_Int16 nRet = report::KeepTogether::NO;
+        const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions();
         (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
         return nRet;
     }
diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx
index f11c01e..50c9e46 100644
--- a/reportdesign/source/filter/xml/xmlHelper.cxx
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -78,15 +78,15 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32
     {
         case XML_RPT_ALGINMENT:
             {
-                static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] =
+                static SvXMLEnumMapEntry<style::VerticalAlignment> const pXML_VerticalAlign_Enum[] =
                 {
                     { XML_TOP,          style::VerticalAlignment_TOP },
                     { XML_MIDDLE,       style::VerticalAlignment_MIDDLE },
                     { XML_BOTTOM,       style::VerticalAlignment_BOTTOM },
-                    { XML_TOKEN_INVALID, 0 }
+                    { XML_TOKEN_INVALID, (style::VerticalAlignment)0 }
                 };
 
-                pHandler = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, cppu::UnoType<css::style::VerticalAlignment>::get());
+                pHandler = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum );
             }
             break;
         case (XML_SD_TYPES_START+34):
@@ -187,21 +187,21 @@ const XMLPropertyMapEntry* OXMLHelper::GetColumnStyleProps()
     return aXMLColumnStylesProperties;
 }
 
-const SvXMLEnumMapEntry* OXMLHelper::GetReportPrintOptions()
+const SvXMLEnumMapEntry<sal_Int16>* OXMLHelper::GetReportPrintOptions()
 {
-    static const SvXMLEnumMapEntry s_aXML_EnumMap[] =
+    static const SvXMLEnumMapEntry<sal_Int16> s_aXML_EnumMap[] =
     {
-        { XML_NOT_WITH_REPORT_HEADER,               report::ReportPrintOption::NOT_WITH_REPORT_HEADER },
-        { XML_NOT_WITH_REPORT_FOOTER,               report::ReportPrintOption::NOT_WITH_REPORT_FOOTER },
-        { XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER,    report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER },
+        { XML_NOT_WITH_REPORT_HEADER,            report::ReportPrintOption::NOT_WITH_REPORT_HEADER },
+        { XML_NOT_WITH_REPORT_FOOTER,            report::ReportPrintOption::NOT_WITH_REPORT_FOOTER },
+        { XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER, report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER },
         { XML_TOKEN_INVALID, 0 }
     };
     return s_aXML_EnumMap;
 }
 
-const SvXMLEnumMapEntry* OXMLHelper::GetForceNewPageOptions()
+const SvXMLEnumMapEntry<sal_Int16>* OXMLHelper::GetForceNewPageOptions()
 {
-    static const SvXMLEnumMapEntry s_aXML_EnumMap[] =
+    static const SvXMLEnumMapEntry<sal_Int16> s_aXML_EnumMap[] =
     {
         { XML_BEFORE_SECTION,       report::ForceNewPage::BEFORE_SECTION },
         { XML_AFTER_SECTION,        report::ForceNewPage::AFTER_SECTION },
@@ -211,9 +211,9 @@ const SvXMLEnumMapEntry* OXMLHelper::GetForceNewPageOptions()
     return s_aXML_EnumMap;
 }
 
-const SvXMLEnumMapEntry* OXMLHelper::GetKeepTogetherOptions()
+const SvXMLEnumMapEntry<sal_Int16>* OXMLHelper::GetKeepTogetherOptions()
 {
-    static const SvXMLEnumMapEntry s_aXML_EnumMap[] =
+    static const SvXMLEnumMapEntry<sal_Int16> s_aXML_EnumMap[] =
     {
         { XML_WHOLE_GROUP,          report::KeepTogether::WHOLE_GROUP },
         { XML_WITH_FIRST_DETAIL,    report::KeepTogether::WITH_FIRST_DETAIL },
@@ -222,9 +222,9 @@ const SvXMLEnumMapEntry* OXMLHelper::GetKeepTogetherOptions()
     return s_aXML_EnumMap;
 }
 
-const SvXMLEnumMapEntry* OXMLHelper::GetCommandTypeOptions()
+const SvXMLEnumMapEntry<sal_Int32>* OXMLHelper::GetCommandTypeOptions()
 {
-    static const SvXMLEnumMapEntry s_aXML_EnumMap[] =
+    static const SvXMLEnumMapEntry<sal_Int32> s_aXML_EnumMap[] =
     {
         { XML_TABLE, CommandType::TABLE },
         { XML_QUERY, CommandType::QUERY },
@@ -370,9 +370,9 @@ SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap()
     return new SvXMLTokenMap( aElemTokenMap );
 }
 
-const SvXMLEnumMapEntry* OXMLHelper::GetImageScaleOptions()
+const SvXMLEnumMapEntry<sal_Int16>* OXMLHelper::GetImageScaleOptions()
 {
-       static const SvXMLEnumMapEntry s_aXML_EnumMap[] =
+       static const SvXMLEnumMapEntry<sal_Int16> s_aXML_EnumMap[] =
        {
                { XML_ISOTROPIC,        awt::ImageScaleMode::ISOTROPIC },
                { XML_ANISOTROPIC,      awt::ImageScaleMode::ANISOTROPIC },
diff --git a/reportdesign/source/filter/xml/xmlHelper.hxx b/reportdesign/source/filter/xml/xmlHelper.hxx
index 7ed59b2..739be57 100644
--- a/reportdesign/source/filter/xml/xmlHelper.hxx
+++ b/reportdesign/source/filter/xml/xmlHelper.hxx
@@ -51,11 +51,11 @@ namespace rptxml
     public:
         static rtl::Reference < XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat, bool bForExport);
 
-        static const SvXMLEnumMapEntry* GetReportPrintOptions();
-        static const SvXMLEnumMapEntry* GetForceNewPageOptions();
-        static const SvXMLEnumMapEntry* GetKeepTogetherOptions();
-        static const SvXMLEnumMapEntry* GetCommandTypeOptions();
-        static const SvXMLEnumMapEntry* GetImageScaleOptions();
+        static const SvXMLEnumMapEntry<sal_Int16>* GetReportPrintOptions();
+        static const SvXMLEnumMapEntry<sal_Int16>* GetForceNewPageOptions();
+        static const SvXMLEnumMapEntry<sal_Int16>* GetKeepTogetherOptions();
+        static const SvXMLEnumMapEntry<sal_Int32>* GetCommandTypeOptions();
+        static const SvXMLEnumMapEntry<sal_Int16>* GetImageScaleOptions();
 
         static const XMLPropertyMapEntry* GetTableStyleProps();
         static const XMLPropertyMapEntry* GetColumnStyleProps();
diff --git a/reportdesign/source/filter/xml/xmlImage.cxx b/reportdesign/source/filter/xml/xmlImage.cxx
index 818524e..6e1a59e 100644
--- a/reportdesign/source/filter/xml/xmlImage.cxx
+++ b/reportdesign/source/filter/xml/xmlImage.cxx
@@ -76,14 +76,14 @@ OXMLImage::OXMLImage( ORptFilter& rImport,
                     break;
                 case XML_TOK_SCALE:
                 {
-                    sal_uInt16 nRet = awt::ImageScaleMode::NONE;
+                    sal_Int16 nRet = awt::ImageScaleMode::NONE;
                     if ( s_sTRUE == sValue )
                     {
                         nRet = awt::ImageScaleMode::ANISOTROPIC;
                     }
                     else
                     {
-                        const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetImageScaleOptions();
+                        const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetImageScaleOptions();
                         bool bConvertOk = SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
                         SAL_WARN_IF(!bConvertOk, "reportdesign", "convertEnum failed");
                     }
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 488fcea..0cb121a 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -178,8 +178,8 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
                 {
                     case XML_TOK_COMMAND_TYPE:
                         {
-                            sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND);
-                            const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
+                            sal_Int32 nRet = sdb::CommandType::COMMAND;
+                            const SvXMLEnumMapEntry<sal_Int32>* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
                             (void)SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
                             m_xDatabaseDataProvider->setCommandType(nRet);
                         }
diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx
index 67fa765..4c2ed00 100644
--- a/reportdesign/source/filter/xml/xmlReport.cxx
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -67,8 +67,8 @@ OXMLReport::OXMLReport( ORptFilter& rImport,
             {
                 case XML_TOK_COMMAND_TYPE:
                     {
-                        sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND);
-                        const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
+                        sal_Int32 nRet = sdb::CommandType::COMMAND;
+                        const SvXMLEnumMapEntry<sal_Int32>* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
                         bool bConvertOk = SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
                         SAL_WARN_IF(!bConvertOk, "reportdesign", "convertEnum failed");
                         m_xReportDefinition->setCommandType(nRet);
diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx
index 9c8e41d..29714f7 100644
--- a/reportdesign/source/filter/xml/xmlSection.cxx
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -41,10 +41,10 @@ namespace rptxml
     using namespace ::com::sun::star::uno;
     using namespace ::com::sun::star::xml::sax;
 
-    sal_uInt16 lcl_getReportPrintOption(const OUString& _sValue)
+    sal_Int16 lcl_getReportPrintOption(const OUString& _sValue)
     {
-        sal_uInt16 nRet = report::ReportPrintOption::ALL_PAGES;
-        const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
+        sal_Int16 nRet = report::ReportPrintOption::ALL_PAGES;
+        const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
         (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
         return nRet;
     }
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index f211e01..a1d9c58 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -46,10 +46,10 @@ namespace rptxml
     using namespace ::com::sun::star::xml::sax;
     using ::com::sun::star::xml::sax::XAttributeList;
 
-    sal_uInt16 lcl_getForceNewPageOption(const OUString& _sValue)
+    sal_Int16 lcl_getForceNewPageOption(const OUString& _sValue)
     {
-        sal_uInt16 nRet = report::ForceNewPage::NONE;
-        const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
+        sal_Int16 nRet = report::ForceNewPage::NONE;
+        const SvXMLEnumMapEntry<sal_Int16>* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
         (void)SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap );
         return nRet;
     }
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 59be80a..df55562 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -136,7 +136,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
                 OUStringBuffer aOut;
                 const SfxBoolItem* pSplit = dynamic_cast<const SfxBoolItem*>( &rItem );
                 assert(pSplit && "Wrong Which-ID");
-                const unsigned int eEnum = (pSplit && pSplit->GetValue()) ? 1 : 0;
+                const sal_uInt16 eEnum = (pSplit && pSplit->GetValue()) ? 1 : 0;
                 SvXMLUnitConverter::convertEnum( aOut, eEnum, aXML_KeepTogetherType );
                 aValue = aOut.makeStringAndClear();
             }
@@ -839,7 +839,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
         {
             const SvxFormatBreakItem& rFormatBreak = dynamic_cast<const SvxFormatBreakItem&>(rItem);
 
-            unsigned int eEnum = 0;
+            sal_uInt16 eEnum = 0;
 
             switch( nMemberId )
             {
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index e9af97b..6b90a66 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -673,13 +673,13 @@ bool SvXMLImportItemMapper::PutXMLValue(
                 case MID_GRAPHIC_REPEAT:
                 {
                     SvxGraphicPosition eGraphicPos = rBrush.GetGraphicPos();
-                    sal_uInt16 nPos = GPOS_NONE;
+                    SvxGraphicPosition nPos = GPOS_NONE;
                     if( SvXMLUnitConverter::convertEnum( nPos, rValue,
                                                     psXML_BrushRepeat ) )
                     {
                         if( GPOS_MM != nPos || GPOS_NONE == eGraphicPos ||
                             GPOS_AREA == eGraphicPos || GPOS_TILED == eGraphicPos )
-                            rBrush.SetGraphicPos( (SvxGraphicPosition)nPos );
+                            rBrush.SetGraphicPos( nPos );
                         bOk = true;
                     }
                 }
@@ -688,7 +688,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
                 case MID_GRAPHIC_POSITION:
                 {
                     SvxGraphicPosition ePos = GPOS_NONE, eTmp;
-                    sal_uInt16 nTmp;
+                    SvxGraphicPosition nTmp;
                     SvXMLTokenEnumerator aTokenEnum( rValue );
                     OUString aToken;
                     bool bHori = false, bVert = false;
@@ -738,9 +738,9 @@ bool SvXMLImportItemMapper::PutXMLValue(
                         {
                             if( bVert )
                                 sw_frmitems_MergeXMLHoriPos(
-                                    ePos, (SvxGraphicPosition)nTmp );
+                                    ePos, nTmp );
                             else if( !bHori )
-                                ePos = (SvxGraphicPosition)nTmp;
+                                ePos = nTmp;
                             else
                                 bOk = false;
                             bHori = true;
@@ -750,9 +750,9 @@ bool SvXMLImportItemMapper::PutXMLValue(
                         {
                             if( bHori )
                                 sw_frmitems_MergeXMLVertPos(
-                                    ePos, (SvxGraphicPosition)nTmp );
+                                    ePos, nTmp );
                             else if( !bVert )
-                                ePos = (SvxGraphicPosition)nTmp;
+                                ePos = nTmp;
                             else
                                 bOk = false;
                             bVert = true;
@@ -819,7 +819,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
         {
             SwFormatHoriOrient& rHoriOrient = dynamic_cast<SwFormatHoriOrient&>(rItem);
 
-            sal_uInt16 nValue;
+            sal_Int16 nValue;
             bOk = SvXMLUnitConverter::convertEnum( nValue, rValue,
                                               aXMLTableAlignMap );
             if( bOk )
@@ -831,7 +831,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
         {
             SwFormatVertOrient& rVertOrient = dynamic_cast<SwFormatVertOrient&>(rItem);
 
-            sal_uInt16 nValue;
+            sal_Int16 nValue;
             bOk = SvXMLUnitConverter::convertEnum( nValue, rValue,
                                               aXMLTableVAlignMap );
             if( bOk )
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 9d57fb6..ea3922e 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -58,28 +58,28 @@ using namespace ::com::sun::star;
 #define SVX_XML_BORDER_WIDTH_MIDDLE 1
 #define SVX_XML_BORDER_WIDTH_THICK 2
 
-const struct SvXMLEnumMapEntry psXML_BorderStyles[] =
+const struct SvXMLEnumMapEntry<sal_uInt16> psXML_BorderStyles[] =
 {
-    { XML_NONE,       API_LINE_NONE },
-    { XML_HIDDEN,     API_LINE_NONE },
-    { XML_SOLID,      API_LINE_SOLID },
-    { XML_DOUBLE,     API_LINE_DOUBLE },
-    { XML_DOUBLE_THIN, API_LINE_DOUBLE_THIN },
-    { XML_DOTTED,     API_LINE_DOTTED },
-    { XML_DASHED,     API_LINE_DASHED },
-    { XML_FINE_DASHED, API_LINE_FINE_DASHED },
+    { XML_NONE,         API_LINE_NONE },
+    { XML_HIDDEN,       API_LINE_NONE },
+    { XML_SOLID,        API_LINE_SOLID },
+    { XML_DOUBLE,       API_LINE_DOUBLE },
+    { XML_DOUBLE_THIN,  API_LINE_DOUBLE_THIN },
+    { XML_DOTTED,       API_LINE_DOTTED },
+    { XML_DASHED,       API_LINE_DASHED },
+    { XML_FINE_DASHED,  API_LINE_FINE_DASHED },
     { XML_DASH_DOT,     API_LINE_DASH_DOT },
     { XML_DASH_DOT_DOT, API_LINE_DASH_DOT_DOT },
-    { XML_GROOVE, API_LINE_ENGRAVED },
-    { XML_RIDGE,      API_LINE_EMBOSSED },
-    { XML_INSET,      API_LINE_INSET },
-    { XML_OUTSET,     API_LINE_OUTSET },
+    { XML_GROOVE,       API_LINE_ENGRAVED },
+    { XML_RIDGE,        API_LINE_EMBOSSED },
+    { XML_INSET,        API_LINE_INSET },
+    { XML_OUTSET,       API_LINE_OUTSET },
     { XML_TOKEN_INVALID, 0 }
 };
 
-const struct SvXMLEnumMapEntry psXML_NamedBorderWidths[] =
+const struct SvXMLEnumMapEntry<sal_uInt16> psXML_NamedBorderWidths[] =
 {
-        { XML_THIN,         SVX_XML_BORDER_WIDTH_THIN   },
+        { XML_THIN,     SVX_XML_BORDER_WIDTH_THIN   },
         { XML_MIDDLE,   SVX_XML_BORDER_WIDTH_MIDDLE     },
         { XML_THICK,    SVX_XML_BORDER_WIDTH_THICK      },
         { XML_TOKEN_INVALID, 0 }
@@ -237,26 +237,26 @@ void sw_frmitems_setXMLBorder( SvxBorderLine*& rpLine,
                 nOutWidth, nInWidth, nDistance);
 }
 
-const struct SvXMLEnumMapEntry psXML_BrushRepeat[] =
+const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushRepeat[] =
 {
     { XML_BACKGROUND_REPEAT,        GPOS_TILED  },
     { XML_BACKGROUND_NO_REPEAT,     GPOS_MM     },
     { XML_BACKGROUND_STRETCH,       GPOS_AREA   },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (SvxGraphicPosition)0 }
 };
 
-const struct SvXMLEnumMapEntry psXML_BrushHoriPos[] =
+const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushHoriPos[] =
 {
     { XML_LEFT,         GPOS_LM },
     { XML_RIGHT,        GPOS_RM },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (SvxGraphicPosition)0 }
 };
 
-const struct SvXMLEnumMapEntry psXML_BrushVertPos[] =
+const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushVertPos[] =
 {
     { XML_TOP,          GPOS_MT },
     { XML_BOTTOM,       GPOS_MB },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (SvxGraphicPosition)0 }
 };
 
 void sw_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
@@ -319,7 +319,7 @@ void sw_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
     }
 }
 
-const struct SvXMLEnumMapEntry psXML_BreakType[] =
+const struct SvXMLEnumMapEntry<sal_uInt16> psXML_BreakType[] =
 {
         { XML_AUTO,         0 },
         { XML_COLUMN,       1 },
@@ -329,7 +329,7 @@ const struct SvXMLEnumMapEntry psXML_BreakType[] =
         { XML_TOKEN_INVALID, 0}
 };
 
-const struct  SvXMLEnumMapEntry aXMLTableAlignMap[] =
+const struct SvXMLEnumMapEntry<sal_Int16> aXMLTableAlignMap[] =
 {
     { XML_LEFT,             text::HoriOrientation::LEFT           },
     { XML_LEFT,             text::HoriOrientation::LEFT_AND_WIDTH },
@@ -340,7 +340,7 @@ const struct  SvXMLEnumMapEntry aXMLTableAlignMap[] =
     { XML_TOKEN_INVALID, 0 }
 };
 
-const struct  SvXMLEnumMapEntry aXMLTableVAlignMap[] =
+const struct SvXMLEnumMapEntry<sal_Int16> aXMLTableVAlignMap[] =
 {
     { XML_TOP,                  text::VertOrientation::TOP        },
     { XML_MIDDLE,               text::VertOrientation::CENTER     },
@@ -348,7 +348,7 @@ const struct  SvXMLEnumMapEntry aXMLTableVAlignMap[] =
     { XML_TOKEN_INVALID, 0 }
 };
 
-const struct SvXMLEnumMapEntry aXML_KeepTogetherType[] =
+const struct SvXMLEnumMapEntry<sal_uInt16> aXML_KeepTogetherType[] =
 {
         { XML_ALWAYS,       0 },
         { XML_AUTO,         1 },
diff --git a/sw/source/filter/xml/xmlithlp.hxx b/sw/source/filter/xml/xmlithlp.hxx
index 5388fa0..e2728bc 100644
--- a/sw/source/filter/xml/xmlithlp.hxx
+++ b/sw/source/filter/xml/xmlithlp.hxx
@@ -27,7 +27,7 @@
 
 namespace editeng { class SvxBorderLine; }
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> struct SvXMLEnumMapEntry;
 class SvXMLUnitConverter;
 class Color;
 
@@ -56,15 +56,15 @@ void sw_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
 void sw_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
                                      SvxGraphicPosition eVert );
 
-extern const struct SvXMLEnumMapEntry psXML_BorderStyles[];
-extern const struct SvXMLEnumMapEntry psXML_NamedBorderWidths[];
-extern const struct SvXMLEnumMapEntry psXML_BrushRepeat[];
-extern const struct SvXMLEnumMapEntry psXML_BrushHoriPos[];
-extern const struct SvXMLEnumMapEntry psXML_BrushVertPos[];
-extern const struct SvXMLEnumMapEntry psXML_BreakType[];
-extern const struct SvXMLEnumMapEntry aXMLTableAlignMap[];
-extern const struct SvXMLEnumMapEntry aXMLTableVAlignMap[];
-extern const struct SvXMLEnumMapEntry aXML_KeepTogetherType[];
+extern const struct SvXMLEnumMapEntry<sal_uInt16> psXML_BorderStyles[];
+extern const struct SvXMLEnumMapEntry<sal_uInt16> psXML_NamedBorderWidths[];
+extern const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushRepeat[];
+extern const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushHoriPos[];
+extern const struct SvXMLEnumMapEntry<SvxGraphicPosition> psXML_BrushVertPos[];
+extern const struct SvXMLEnumMapEntry<sal_uInt16> psXML_BreakType[];
+extern const struct SvXMLEnumMapEntry<sal_Int16> aXMLTableAlignMap[];
+extern const struct SvXMLEnumMapEntry<sal_Int16> aXMLTableVAlignMap[];
+extern const struct SvXMLEnumMapEntry<sal_uInt16> aXML_KeepTogetherType[];
 
 #endif
 
diff --git a/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx b/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx
index ced08e4..6550c42 100644
--- a/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx
+++ b/xmloff/inc/XMLBitmapLogicalSizePropertyHandler.hxx
@@ -22,7 +22,7 @@
 
 #include <xmloff/xmlprhdl.hxx>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> 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 393cd47..c7739a5 100644
--- a/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx
+++ b/xmloff/inc/XMLBitmapRepeatOffsetPropertyHandler.hxx
@@ -22,7 +22,7 @@
 
 #include <xmloff/xmlprhdl.hxx>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> 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 8fc2159..276face 100644
--- a/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx
+++ b/xmloff/inc/XMLFillBitmapSizePropertyHandler.hxx
@@ -22,7 +22,7 @@
 
 #include <xmloff/xmlprhdl.hxx>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> 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 965aa3c..db6209e 100644
--- a/xmloff/inc/XMLRectangleMembersHandler.hxx
+++ b/xmloff/inc/XMLRectangleMembersHandler.hxx
@@ -22,7 +22,7 @@
 
 #include <xmloff/xmlprhdl.hxx>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> 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 809273f..6a91237 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<XMLEffect> aXML_AnimationEffect_EnumMap[];
 
 enum XMLEffectDirection
 {
@@ -84,9 +84,9 @@ enum XMLEffectDirection
     ED_cclockwise
 };
 
-extern const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[];
+extern const SvXMLEnumMapEntry<XMLEffectDirection> aXML_AnimationDirection_EnumMap[];
 
-extern const SvXMLEnumMapEntry aXML_AnimationSpeed_EnumMap[];
+extern const SvXMLEnumMapEntry<css::presentation::AnimationSpeed> 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 417a213..e00e694 100644
--- a/xmloff/inc/animations.hxx
+++ b/xmloff/inc/animations.hxx
@@ -22,26 +22,26 @@
 
 #include <xmloff/xmltoken.hxx>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> 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<sal_Int16> aAnimations_EnumMap_Fill[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_FillDefault[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Restart[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_RestartDefault[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Endsync[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_CalcMode[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_AdditiveMode[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransformType[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionType[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionSubType[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EventTrigger[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectPresetClass[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectNodeType[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_SubItem[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_IterateType[];
+extern const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Command[];
 
 struct ImplAttributeNameConversion
 {
diff --git a/xmloff/inc/enummaps.hxx b/xmloff/inc/enummaps.hxx
index 5f543ed..525620b 100644
--- a/xmloff/inc/enummaps.hxx
+++ b/xmloff/inc/enummaps.hxx
@@ -11,12 +11,15 @@
 #define INCLUDED_XMLOFF_INC_ENUMMAPS_HXX
 
 #include <sal/config.h>
+#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/RectanglePoint.hpp>
 
-struct SvXMLEnumMapEntry;
+template<typename EnumT> struct SvXMLEnumMapEntry;
 
-extern SvXMLEnumMapEntry const aXML_FillStyle_EnumMap[];
-extern SvXMLEnumMapEntry const aXML_RefPoint_EnumMap[];
-extern SvXMLEnumMapEntry const aXML_BitmapMode_EnumMap[];
+extern SvXMLEnumMapEntry<css::drawing::FillStyle> const aXML_FillStyle_EnumMap[];
+extern SvXMLEnumMapEntry<css::drawing::RectanglePoint> const aXML_RefPoint_EnumMap[];
+extern SvXMLEnumMapEntry<css::drawing::BitmapMode> const aXML_BitmapMode_EnumMap[];
 
 #endif
 
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index fc919ea..8c5158e 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<css::chart::ChartAxisLabelPosition> 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<css::chart::ChartAxisMarkPosition> 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<css::chart::ChartAxisArrangeOrderType> 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<sal_Int32> 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<sal_Int32> 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<css::chart::ChartDataRowSource> 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<sal_Int32> 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<sal_Int32> 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<sal_Int32> 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 9bb864b..70127be 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<drawing::LineStyle> 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<chart::ChartAxisLabelPosition>::get());
+                pHdl = new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap);
                 break;
 
             case XML_SCH_TYPE_TICK_MARK_POSITION:
-                pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap,
-                                               cppu::UnoType<chart::ChartAxisMarkPosition>::get());
+                pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap);
                 break;
 
             case XML_SCH_TYPE_AXIS_ARRANGEMENT:
-                pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap,
-                                               cppu::UnoType<chart::ChartAxisArrangeOrderType>::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<sal_Int32>::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<sal_Int32>::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<sal_Int32>::get() );
+                pHdl = new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap );
                 break;
             case XML_SCH_TYPE_DATAROWSOURCE:
-                pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap,
-                                               cppu::UnoType<chart::ChartDataRowSource>::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<sal_Int32>::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<sal_Int32>::get() );
+                pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap );
                 break;
             case XML_SCH_TYPE_LABEL_BORDER_STYLE:
-                pHdl = new XMLEnumPropertyHdl(aLineStyleMap, cppu::UnoType<drawing::LineStyle>::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 3c72187..7a291d1 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<SchXMLAxisDimension> 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<sal_uInt16> 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 1e661d3..fcaf78a 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 <com/sun/star/chart/ChartLegendPosition.hpp>
 #include <com/sun/star/chart/ChartLegendExpansion.hpp>
-
+#include "SchXMLEnumConverter.hxx"
 #include <rtl/instance.hxx>
 
 using namespace ::xmloff::token;
@@ -30,40 +28,40 @@ using namespace ::com::sun::star;
 namespace
 {
 
-const SvXMLEnumMapEntry aXMLLegendPositionEnumMap[] =
+const SvXMLEnumMapEntry<chart::ChartLegendPosition> 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<chart::ChartLegendPosition>::get()) {}
+        : XMLEnumPropertyHdl( aXMLLegendPositionEnumMap) {}
 };
 
 struct TheLegendPositionPropertyHdl : public rtl::Static< XMLLegendPositionPropertyHdl, TheLegendPositionPropertyHdl >
 {
 };
 
-const SvXMLEnumMapEntry aXMLLegendExpansionEnumMap[] =
+const SvXMLEnumMapEntry<chart::ChartLegendExpansion> 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<chart::ChartLegendExpansion>::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 34b1a3e..31c1ac1 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<SchXMLChartTypeEnum> 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 12abe33..59fbc83 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<sal_Int32>* pEnumMap )
+        : XMLEnumPropertyHdl( pEnumMap )
 {
 }
 
diff --git a/xmloff/source/chart/XMLErrorBarStylePropertyHdl.hxx b/xmloff/source/chart/XMLErrorBarStylePropertyHdl.hxx
index b7c0c01..dfe6354 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<sal_Int32>* 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 fa34a30..78d5760 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<sal_uInt16> *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<sal_uInt16> *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<sal_uInt16> *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 11d4746..db2720f 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -96,7 +96,7 @@ using ::com::sun::star::container::XEnumeration;
 namespace xmloff
 {
 
-const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Fill[] =
 {
     { XML_DEFAULT,      AnimationFill::DEFAULT },
     { XML_REMOVE,       AnimationFill::REMOVE },
@@ -106,7 +106,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_Fill[] =
     { XML_AUTO,         AnimationFill::AUTO },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_FillDefault[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_FillDefault[] =
 {
     { XML_INHERIT,      AnimationFill::INHERIT },
     { XML_REMOVE,       AnimationFill::REMOVE },
@@ -116,7 +116,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_FillDefault[] =
     { XML_AUTO,         AnimationFill::AUTO },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Restart[] =
 {
     { XML_DEFAULT,      AnimationRestart::DEFAULT },
     { XML_ALWAYS,       AnimationRestart::ALWAYS },
@@ -124,7 +124,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_Restart[] =
     { XML_NEVER,        AnimationRestart::NEVER },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_RestartDefault[] =
 {
     { XML_INHERIT,      AnimationRestart::INHERIT },
     { XML_ALWAYS,       AnimationRestart::ALWAYS },
@@ -132,7 +132,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_RestartDefault[] =
     { XML_NEVER,        AnimationRestart::NEVER },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Endsync[] =
 {
     { XML_FIRST,        AnimationEndSync::FIRST },
     { XML_LAST,         AnimationEndSync::LAST },
@@ -140,7 +140,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_Endsync[] =
     { XML_MEDIA,        AnimationEndSync::MEDIA },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_CalcMode[] =
 {
     { XML_DISCRETE,     AnimationCalcMode::DISCRETE },
     { XML_LINEAR,       AnimationCalcMode::LINEAR },
@@ -148,7 +148,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_CalcMode[] =
     { XML_SPLINE,       AnimationCalcMode::SPLINE },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_AdditiveMode[] =
 {
     { XML_BASE,         AnimationAdditiveMode::BASE },
     { XML_SUM,          AnimationAdditiveMode::SUM },
@@ -157,7 +157,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_AdditiveMode[] =
     { XML_NONE,         AnimationAdditiveMode::NONE },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransformType[] =
 {
     { XML_TRANSLATE,    AnimationTransformType::TRANSLATE },
     { XML_SCALE,        AnimationTransformType::SCALE },
@@ -166,7 +166,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_TransformType[] =
     { XML_SKEWY,        AnimationTransformType::SKEWY },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionType[] =
 {
     { XML_BARWIPE,          TransitionType::BARWIPE },
     { XML_BOXWIPE,          TransitionType::BOXWIPE },
@@ -213,7 +213,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionType[] =
     { XML_ZOOM,             TransitionType::ZOOM },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_TransitionSubType[] =
 {
     { XML_DEFAULT,              TransitionSubType::DEFAULT },
     { XML_LEFTTORIGHT,          TransitionSubType::LEFTTORIGHT },
@@ -334,7 +334,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_TransitionSubType[] =
 
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EventTrigger[] =
 {
     { XML_ONBEGIN,          EventTrigger::ON_BEGIN },
     { XML_ONEND,            EventTrigger::ON_END },
@@ -350,7 +350,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_EventTrigger[] =
     { XML_REPEAT,           EventTrigger::REPEAT },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectPresetClass[] =
 {
     { XML_CUSTOM,       EffectPresetClass::CUSTOM },
     { XML_ENTRANCE,     EffectPresetClass::ENTRANCE },
@@ -361,7 +361,7 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_EffectPresetClass[] =
     { XML_MEDIA_CALL,   EffectPresetClass::MEDIACALL },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_EffectNodeType[] =
 {
     { XML_DEFAULT,                  EffectNodeType::DEFAULT },
     { XML_ON_CLICK,                 EffectNodeType::ON_CLICK },
@@ -372,21 +372,21 @@ const SvXMLEnumMapEntry aAnimations_EnumMap_EffectNodeType[] =
     { XML_INTERACTIVE_SEQUENCE,     EffectNodeType::INTERACTIVE_SEQUENCE },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_SubItem[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_SubItem[] =
 {
     { XML_WHOLE,                    ShapeAnimationSubType::AS_WHOLE },
     { XML_BACKGROUND,               ShapeAnimationSubType::ONLY_BACKGROUND },
     { XML_TEXT,                     ShapeAnimationSubType::ONLY_TEXT },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_IterateType[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_IterateType[] =
 {
     { XML_BY_PARAGRAPH,             TextAnimationType::BY_PARAGRAPH },
     { XML_BY_WORD,                  TextAnimationType::BY_WORD },
     { XML_BY_LETTER,                TextAnimationType::BY_LETTER },
     { XML_TOKEN_INVALID, 0 }
 };
-const SvXMLEnumMapEntry aAnimations_EnumMap_Command[] =
+const SvXMLEnumMapEntry<sal_Int16> aAnimations_EnumMap_Command[] =
 {
     { XML_CUSTOM,                   EffectCommands::CUSTOM },
     { XML_VERB,                     EffectCommands::VERB },
@@ -601,12 +601,12 @@ void AnimationsExporterImpl::exportTransitionNode()
             sTmp.append( 's');
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_DUR, sTmp.makeStringAndClear() );
 
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, aAnimations_EnumMap_TransitionType );
+            SvXMLUnitConverter::convertEnum( sTmp, nTransition, aAnimations_EnumMap_TransitionType );
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() );
 
             if( nSubtype != TransitionSubType::DEFAULT )
             {
-                SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, aAnimations_EnumMap_TransitionSubType );
+                SvXMLUnitConverter::convertEnum( sTmp, nSubtype, aAnimations_EnumMap_TransitionSubType );
                 mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() );
             }
 
@@ -775,7 +775,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
         }
 
         double fTemp = 0;
-        sal_Int32 nTemp;
+        sal_Int16 nTemp;
 
         aTemp = xNode->getDuration();
         if( aTemp.hasValue() )
@@ -804,28 +804,28 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
         nTemp = xNode->getFill();
         if( nTemp != AnimationFill::DEFAULT )
         {
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_Fill );
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Fill );
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILL, sTmp.makeStringAndClear() );
         }
 
         nTemp = xNode->getFillDefault();
         if( nTemp != AnimationFill::INHERIT )
         {
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_FillDefault );
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_FillDefault );
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_FILLDEFAULT, sTmp.makeStringAndClear() );
         }
 
         nTemp = xNode->getRestart();
         if( nTemp != AnimationRestart::DEFAULT )
         {
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_Restart );
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Restart );
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTART, sTmp.makeStringAndClear() );
         }
 
         nTemp = xNode->getRestartDefault();
         if( nTemp != AnimationRestart::INHERIT )
         {
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_RestartDefault );
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_RestartDefault );
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_RESTARTDEFAULT, sTmp.makeStringAndClear() );
         }
 
@@ -883,7 +883,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
         {
             if( aTemp >>= nTemp )
             {
-                SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_Endsync );
+                SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_Endsync );
                 mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ENDSYNC, sTmp.makeStringAndClear() );
             }
         }
@@ -902,7 +902,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
                 {
                     if( (pValue->Value >>= nContainerNodeType) && (nContainerNodeType != EffectNodeType::DEFAULT) )
                     {
-                        SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nContainerNodeType, aAnimations_EnumMap_EffectNodeType );
+                        SvXMLUnitConverter::convertEnum( sTmp, nContainerNodeType, aAnimations_EnumMap_EffectNodeType );
                         mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NODE_TYPE, sTmp.makeStringAndClear() );
                     }
                 }
@@ -923,10 +923,10 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod
                 }
                 else if( IsXMLToken( pValue->Name, XML_PRESET_CLASS ) )
                 {
-                    sal_Int16 nEffectPresetClass = sal_Int16();
+                    sal_Int16 nEffectPresetClass = sal_uInt16();
                     if( pValue->Value >>= nEffectPresetClass )
                     {
-                        SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nEffectPresetClass, aAnimations_EnumMap_EffectPresetClass );
+                        SvXMLUnitConverter::convertEnum( sTmp, nEffectPresetClass, aAnimations_EnumMap_EffectPresetClass );
                         mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PRESET_CLASS, sTmp.makeStringAndClear() );
                     }
                 }
@@ -1025,14 +1025,14 @@ void AnimationsExporterImpl::exportContainer( const Reference< XTimeContainer >&
             sal_Int16 nTemp = xIter->getSubItem();
             if( nTemp )
             {
-                SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_SubItem );
+                SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_SubItem );
                 mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() );
             }
 
             nTemp = xIter->getIterateType();
             if( nTemp )
             {
-                SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_IterateType );
+                SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_IterateType );
                 mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, sTmp.makeStringAndClear() );
             }
 
@@ -1092,7 +1092,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
         const sal_Int16 nNodeType = xAnimate->getType();
 
         OUStringBuffer sTmp;
-        sal_Int32 nTemp;
+        sal_Int16 nTemp;
         bool bTemp;
 
         Any aTemp( xAnimate->getTarget() );
@@ -1105,7 +1105,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
         nTemp = xAnimate->getSubItem();
         if( nTemp )
         {
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_SubItem );
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_SubItem );
             mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sTmp.makeStringAndClear() );
         }
 
@@ -1211,7 +1211,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
                 if( ((nNodeType == AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::PACED)) ||
                     ((nNodeType != AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::LINEAR)) )
                 {
-                    SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_CalcMode );
+                    SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_CalcMode );
                     mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_CALCMODE, sTmp.makeStringAndClear() );
                 }
 
@@ -1222,7 +1222,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
                 nTemp = xAnimate->getAdditive();
                 if( nTemp != AnimationAdditiveMode::REPLACE )
                 {
-                    SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_AdditiveMode );
+                    SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_AdditiveMode );
                     mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ADDITIVE, sTmp.makeStringAndClear() );
                 }
             }
@@ -1299,7 +1299,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
 
             Reference< XAnimateTransform > xTransform( xAnimate, UNO_QUERY_THROW );
             nTemp = xTransform->getTransformType();
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTemp, aAnimations_EnumMap_TransformType );
+            SvXMLUnitConverter::convertEnum( sTmp, nTemp, aAnimations_EnumMap_TransformType );
             mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_TYPE, sTmp.makeStringAndClear() );
         }
         break;
@@ -1310,13 +1310,13 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
             eElementToken = XML_TRANSITIONFILTER;
 
             sal_Int16 nTransition = xTransitionFilter->getTransition();
-            SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nTransition, aAnimations_EnumMap_TransitionType );
+            SvXMLUnitConverter::convertEnum( sTmp, nTransition, aAnimations_EnumMap_TransitionType );
             mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_TYPE, sTmp.makeStringAndClear() );
 
             sal_Int16 nSubtype = xTransitionFilter->getSubtype();
             if( nSubtype != TransitionSubType::DEFAULT )
             {
-                SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nSubtype, aAnimations_EnumMap_TransitionSubType );
+                SvXMLUnitConverter::convertEnum( sTmp, nSubtype, aAnimations_EnumMap_TransitionSubType );
                 mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_SUBTYPE, sTmp.makeStringAndClear() );
             }
 
@@ -1392,7 +1392,7 @@ void AnimationsExporterImpl::exportCommand( const Reference< XCommand >& xComman
         }
 
         sal_Int16 nCommand = xCommand->getCommand();
-        SvXMLUnitConverter::convertEnum( sTmp, (sal_uInt16)nCommand, aAnimations_EnumMap_Command );
+        SvXMLUnitConverter::convertEnum( sTmp, nCommand, aAnimations_EnumMap_Command );
         mrExport.AddAttribute( XML_NAMESPACE_ANIMATION, XML_COMMAND, sTmp.makeStringAndClear() );
 
 // todo virtual css::uno::Any SAL_CALL getParameter() throw (css::uno::RuntimeException) = 0;
@@ -1570,7 +1570,7 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa
                 sTmp.append( '.' );
             }
 
-            SvXMLUnitConverter::convertEnum( sTmp2, (sal_uInt16)pEvent->Trigger, aAnimations_EnumMap_EventTrigger );
+            SvXMLUnitConverter::convertEnum( sTmp2, pEvent->Trigger, aAnimations_EnumMap_EventTrigger );
 
             sTmp.append( sTmp2.makeStringAndClear() );
         }
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index d7c57f0..74f9675 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 3517cef..a5d8f0b 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 3b6ce8d..fb520bb 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -48,7 +48,7 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::presentation;
 using namespace ::xmloff::token;
 
-const SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[] =
+const SvXMLEnumMapEntry<XMLEffect> aXML_AnimationEffect_EnumMap[] =
 {
     { XML_NONE,         EK_none },
     { XML_FADE,         EK_fade },
@@ -67,10 +67,10 @@ const SvXMLEnumMapEntry aXML_AnimationEffect_EnumMap[] =
     { XML_CHECKERBOARD, EK_checkerboard },
     { XML_ROTATE,       EK_rotate },
     { XML_STRETCH,      EK_stretch },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (XMLEffect)0 }
 };
 
-const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[] =
+const SvXMLEnumMapEntry<XMLEffectDirection> aXML_AnimationDirection_EnumMap[] =
 {
     { XML_NONE,             ED_none },
     { XML_FROM_LEFT,        ED_from_left },
@@ -100,15 +100,15 @@ const SvXMLEnumMapEntry aXML_AnimationDirection_EnumMap[] =
     { XML_TO_CENTER,        ED_to_center },
     { XML_CLOCKWISE,        ED_clockwise },
     { XML_COUNTER_CLOCKWISE,ED_cclockwise },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (XMLEffectDirection)0 }
 };
 
-const SvXMLEnumMapEntry aXML_AnimationSpeed_EnumMap[] =
+const SvXMLEnumMapEntry<AnimationSpeed> aXML_AnimationSpeed_EnumMap[] =
 {
     { XML_SLOW,     AnimationSpeed_SLOW },
     { XML_MEDIUM,   AnimationSpeed_MEDIUM },
     { XML_FAST,     AnimationSpeed_FAST },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (AnimationSpeed)0 }
 };
 
 AnimationEffect ImplSdXMLgetEffect( XMLEffect eKind, XMLEffectDirection eDirection, sal_Int16 nStartScale, bool /*bIn*/ )
@@ -496,15 +496,11 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport,  s
         case XML_NAMESPACE_PRESENTATION:
             if( IsXMLToken( aLocalName, XML_EFFECT ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) )
-                    meEffect = (XMLEffect)eEnum;
+                SvXMLUnitConverter::convertEnum( meEffect, sValue, aXML_AnimationEffect_EnumMap );
             }
             else if( IsXMLToken(aLocalName, XML_DIRECTION ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) )
-                    meDirection = (XMLEffectDirection)eEnum;
+                SvXMLUnitConverter::convertEnum( meDirection, sValue, aXML_AnimationDirection_EnumMap );
             }
             else if( IsXMLToken( aLocalName, XML_START_SCALE ) )
             {
@@ -514,9 +510,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport,  s
             }
             else if( IsXMLToken( aLocalName, XML_SPEED ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) )
-                    meSpeed = (AnimationSpeed)eEnum;
+                SvXMLUnitConverter::convertEnum( meSpeed, sValue, aXML_AnimationSpeed_EnumMap );
             }
             else if( IsXMLToken( aLocalName, XML_PATH_ID ) )
             {
diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx
index f9ec608..9385887 100644
--- a/xmloff/source/draw/eventimp.cxx
+++ b/xmloff/source/draw/eventimp.cxx
@@ -51,7 +51,7 @@ using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::presentation;
 using namespace ::xmloff::token;
 
-SvXMLEnumMapEntry const aXML_EventActions_EnumMap[] =
+SvXMLEnumMapEntry<ClickAction> const aXML_EventActions_EnumMap[] =
 {
     { XML_NONE,             ClickAction_NONE    },
     { XML_PREVIOUS_PAGE,    ClickAction_PREVPAGE },
@@ -67,7 +67,7 @@ SvXMLEnumMapEntry const aXML_EventActions_EnumMap[] =
     { XML_VERB,             ClickAction_VERB },
     { XML_FADE_OUT,         ClickAction_VANISH },
     { XML_SOUND,            ClickAction_SOUND },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (ClickAction)0 }
 };
 
 class SdXMLEventContext : public SvXMLImportContext
@@ -174,21 +174,15 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp,  sal_uInt16 nPrfx, cons
         case XML_NAMESPACE_PRESENTATION:
             if( IsXMLToken( aAttrLocalName, XML_ACTION ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_EventActions_EnumMap ) )
-                    meClickAction = (ClickAction)eEnum;
+                SvXMLUnitConverter::convertEnum( meClickAction, sValue, aXML_EventActions_EnumMap );
             }
             if( IsXMLToken( aAttrLocalName, XML_EFFECT ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) )
-                    meEffect = (XMLEffect)eEnum;
+                SvXMLUnitConverter::convertEnum( meEffect, sValue, aXML_AnimationEffect_EnumMap );
             }
             else if( IsXMLToken( aAttrLocalName, XML_DIRECTION ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) )
-                    meDirection = (XMLEffectDirection)eEnum;
+                SvXMLUnitConverter::convertEnum( meDirection, sValue, aXML_AnimationDirection_EnumMap );
             }
             else if( IsXMLToken( aAttrLocalName, XML_START_SCALE ) )
             {
@@ -198,9 +192,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp,  sal_uInt16 nPrfx, cons
             }
             else if( IsXMLToken( aAttrLocalName, XML_SPEED ) )
             {
-                sal_uInt16 eEnum;
-                if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) )
-                    meSpeed = (AnimationSpeed)eEnum;
+                SvXMLUnitConverter::convertEnum( meSpeed, sValue, aXML_AnimationSpeed_EnumMap );
             }
             else if( IsXMLToken( aAttrLocalName, XML_VERB ) )
             {
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 79967af..b32204d 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -23,14 +23,9 @@
 #include <com/sun/star/drawing/LineStyle.hpp>
 #include <com/sun/star/drawing/LineJoint.hpp>
 #include <com/sun/star/drawing/LineCap.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/presentation/AnimationSpeed.hpp>
 #include <com/sun/star/presentation/FadeEffect.hpp>
-#include <com/sun/star/drawing/ConnectorType.hpp>
-#include <com/sun/star/drawing/RectanglePoint.hpp>
-#include <com/sun/star/drawing/CircleKind.hpp>
 
-#include <com/sun/star/drawing/BitmapMode.hpp>
 #include <com/sun/star/text/WritingMode.hpp>
 #include <xmloff/EnumPropertyHdl.hxx>
 #include <xmloff/NamedBoolPropertyHdl.hxx>
@@ -366,60 +361,60 @@ const XMLPropertyMapEntry aXMLTableShapeAttributes[] =
 
 // implementation of factory for own graphic properties
 
-static SvXMLEnumMapEntry const aXML_LineStyle_EnumMap[] =
+static SvXMLEnumMapEntry<drawing::LineStyle> const aXML_LineStyle_EnumMap[] =
 {
     { XML_NONE,     drawing::LineStyle_NONE },
     { XML_SOLID,    drawing::LineStyle_SOLID },
     { XML_DASH,     drawing::LineStyle_DASH },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (drawing::LineStyle)0 }
 };
 
-static SvXMLEnumMapEntry const aXML_LineJoint_EnumMap[] =
+static SvXMLEnumMapEntry<drawing::LineJoint> const aXML_LineJoint_EnumMap[] =
 {
     { XML_NONE,     drawing::LineJoint_NONE },
     { XML_MITER,    drawing::LineJoint_MITER },
     { XML_ROUND,    drawing::LineJoint_ROUND },
     { XML_BEVEL,    drawing::LineJoint_BEVEL },
     { XML_MIDDLE,   drawing::LineJoint_MIDDLE },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (drawing::LineJoint)0 }
 };
 
-static SvXMLEnumMapEntry const aXML_LineCap_EnumMap[] =
+static SvXMLEnumMapEntry<drawing::LineCap> const aXML_LineCap_EnumMap[] =
 {
     { XML_BUTT, drawing::LineCap_BUTT },
     { XML_ROUND, drawing::LineCap_ROUND },
     // use XML_GRADIENTSTYLE_SQUARE as XML_SQUARE, is defined as "square" already
     { XML_GRADIENTSTYLE_SQUARE, drawing::LineCap_SQUARE },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (drawing::LineCap)0 }
 };
 
-SvXMLEnumMapEntry const aXML_FillStyle_EnumMap[] =
+SvXMLEnumMapEntry<drawing::FillStyle> const aXML_FillStyle_EnumMap[] =
 {
     { XML_NONE,     drawing::FillStyle_NONE },
     { XML_SOLID,    drawing::FillStyle_SOLID },
     { XML_BITMAP,   drawing::FillStyle_BITMAP },
     { XML_GRADIENT, drawing::FillStyle_GRADIENT },
     { XML_HATCH,    drawing::FillStyle_HATCH },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (drawing::FillStyle)0 }
 };
 
-static SvXMLEnumMapEntry const aXML_PresChange_EnumMap[] =
+static SvXMLEnumMapEntry<sal_Int32> const aXML_PresChange_EnumMap[] =
 {
     { XML_MANUAL,           0 },
     { XML_AUTOMATIC,        1 },
     { XML_SEMI_AUTOMATIC,   2 },
-    { XML_TOKEN_INVALID,                    0 }
+    { XML_TOKEN_INVALID,    0 }
 };
 
-static SvXMLEnumMapEntry const aXML_TransSpeed_EnumMap[] =
+static SvXMLEnumMapEntry<presentation::AnimationSpeed> const aXML_TransSpeed_EnumMap[] =
 {
     { XML_FAST,     presentation::AnimationSpeed_FAST },
     { XML_MEDIUM,   presentation::AnimationSpeed_MEDIUM },
     { XML_SLOW,     presentation::AnimationSpeed_SLOW },
-    { XML_TOKEN_INVALID, 0 }
+    { XML_TOKEN_INVALID, (presentation::AnimationSpeed)0 }
 };
 
-static SvXMLEnumMapEntry const aXML_FadeEffect_EnumMap[] =
+static SvXMLEnumMapEntry<presentation::FadeEffect> const aXML_FadeEffect_EnumMap[] =
 {
     { XML_NONE,                 presentation::FadeEffect_NONE },
     { XML_FADE_FROM_LEFT,       presentation::FadeEffect_FADE_FROM_LEFT },
@@ -478,68 +473,68 @@ static SvXMLEnumMapEntry const aXML_FadeEffect_EnumMap[] =
     { XML_UNCOVER_TO_LOWERLEFT, presentation::FadeEffect_UNCOVER_TO_LOWERLEFT },
     { XML_VERTICAL_CHECKERBOARD,presentation::FadeEffect_VERTICAL_CHECKERBOARD },
     { XML_HORIZONTAL_CHECKERBOARD,presentation::FadeEffect_HORIZONTAL_CHECKERBOARD },
-    { XML_TOKEN_INVALID, 0 }

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list