diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-09 09:04:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-13 09:02:22 +0000 |
commit | 7e9857c2935bb2533806db4e71c6cd1e171c3478 (patch) | |
tree | d9f8a6d4f94e19f349b67141359cc7c49130b5fc /xmloff/source/chart/SchXMLEnumConverter.cxx | |
parent | 7c0e3d0b37131b12262d0f610505b3384923c4a1 (diff) |
templatize SvXMLEnumMapEntry
in preparation for "scoped UNO enums".
This is a little hacky: In order to limit the scope of this change,
the templated SvXMLEnumMapEntry struct actually has a fixed size field,
and we cast it to SvXMLEnumMapEntry<sal_uInt16>* in various
places, to avoid carrying the type param around.
Change-Id: Idfbc5561303c557598dd5564b7a7259ae5261d83
Reviewed-on: https://gerrit.libreoffice.org/34987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/chart/SchXMLEnumConverter.cxx')
-rw-r--r-- | xmloff/source/chart/SchXMLEnumConverter.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/xmloff/source/chart/SchXMLEnumConverter.cxx b/xmloff/source/chart/SchXMLEnumConverter.cxx index 1e661d3a44ca..fcaf78a0a386 100644 --- a/xmloff/source/chart/SchXMLEnumConverter.cxx +++ b/xmloff/source/chart/SchXMLEnumConverter.cxx @@ -17,11 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "SchXMLEnumConverter.hxx" - #include <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 > |