summaryrefslogtreecommitdiff
path: root/xmloff/source/style/backhdl.cxx
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 /xmloff/source/style/backhdl.cxx
parent7c0e3d0b37131b12262d0f610505b3384923c4a1 (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/style/backhdl.cxx')
-rw-r--r--xmloff/source/style/backhdl.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx
index 6fce270b8d12..94872997e808 100644
--- a/xmloff/source/style/backhdl.cxx
+++ b/xmloff/source/style/backhdl.cxx
@@ -28,18 +28,18 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_BrushHorizontalPos[] =
+SvXMLEnumMapEntry<style::GraphicLocation> const pXML_BrushHorizontalPos[] =
{
{ XML_LEFT, style::GraphicLocation_LEFT_MIDDLE },
{ XML_RIGHT, style::GraphicLocation_RIGHT_MIDDLE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (style::GraphicLocation)0 }
};
-SvXMLEnumMapEntry const pXML_BrushVerticalPos[] =
+SvXMLEnumMapEntry<style::GraphicLocation> const pXML_BrushVerticalPos[] =
{
{ XML_TOP, style::GraphicLocation_MIDDLE_TOP },
{ XML_BOTTOM, style::GraphicLocation_MIDDLE_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (style::GraphicLocation)0 }
};
@@ -55,7 +55,7 @@ bool XMLBackGraphicPositionPropHdl::importXML( const OUString& rStrImpValue, uno
{
bool bRet = true;
style::GraphicLocation ePos = style::GraphicLocation_NONE, eTmp;
- sal_uInt16 nTmp;
+ style::GraphicLocation nTmpGraphicLocation;
SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
OUString aToken;
bool bHori = false, bVert = false;
@@ -102,23 +102,23 @@ bool XMLBackGraphicPositionPropHdl::importXML( const OUString& rStrImpValue, uno
else
ePos = style::GraphicLocation_MIDDLE_MIDDLE;
}
- else if( SvXMLUnitConverter::convertEnum( nTmp, aToken, pXML_BrushHorizontalPos ) )
+ else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken, pXML_BrushHorizontalPos ) )
{
if( bVert )
- MergeXMLHoriPos( ePos, (style::GraphicLocation)nTmp );
+ MergeXMLHoriPos( ePos, nTmpGraphicLocation );
else if( !bHori )
- ePos = (style::GraphicLocation)nTmp;
+ ePos = nTmpGraphicLocation;
else
bRet = false;
bHori = true;
}
- else if( SvXMLUnitConverter::convertEnum( nTmp, aToken, pXML_BrushVerticalPos ) )
+ else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken, pXML_BrushVerticalPos ) )
{
if( bHori )
- MergeXMLVertPos( ePos, (style::GraphicLocation)nTmp );
+ MergeXMLVertPos( ePos, nTmpGraphicLocation );
else if( !bVert )
- ePos = (style::GraphicLocation)nTmp;
+ ePos = nTmpGraphicLocation;
else
bRet = false;
bVert = true;