summaryrefslogtreecommitdiffstats
path: root/include/xmloff/EnumPropertyHdl.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-09 09:04:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-13 09:02:22 +0000
commit7e9857c2935bb2533806db4e71c6cd1e171c3478 (patch)
treed9f8a6d4f94e19f349b67141359cc7c49130b5fc /include/xmloff/EnumPropertyHdl.hxx
parentconvert GraphicDrawMode to scoped enum (diff)
downloadcore-7e9857c2935bb2533806db4e71c6cd1e171c3478.tar.gz
core-7e9857c2935bb2533806db4e71c6cd1e171c3478.zip
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 'include/xmloff/EnumPropertyHdl.hxx')
-rw-r--r--include/xmloff/EnumPropertyHdl.hxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/xmloff/EnumPropertyHdl.hxx b/include/xmloff/EnumPropertyHdl.hxx
index 71519b82ed81..4d3e8c5e19fe 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;