summaryrefslogtreecommitdiff
path: root/xmloff/source/style
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
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')
-rw-r--r--xmloff/source/style/DashStyle.cxx10
-rw-r--r--xmloff/source/style/EnumPropertyHdl.cxx3
-rw-r--r--xmloff/source/style/GradientStyle.cxx12
-rw-r--r--xmloff/source/style/HatchStyle.cxx12
-rw-r--r--xmloff/source/style/PageMasterPropHdlFactory.cxx8
-rw-r--r--xmloff/source/style/TransGradientStyle.cxx10
-rw-r--r--xmloff/source/style/XMLBackgroundImageContext.cxx38
-rw-r--r--xmloff/source/style/XMLConstantsPropertyHandler.cxx8
-rw-r--r--xmloff/source/style/XMLFootnoteSeparatorExport.cxx8
-rw-r--r--xmloff/source/style/XMLFootnoteSeparatorImport.cxx20
-rw-r--r--xmloff/source/style/adjushdl.cxx16
-rw-r--r--xmloff/source/style/backhdl.cxx22
-rw-r--r--xmloff/source/style/bordrhdl.cxx4
-rw-r--r--xmloff/source/style/breakhdl.cxx2
-rw-r--r--xmloff/source/style/cdouthdl.cxx54
-rw-r--r--xmloff/source/style/csmaphdl.cxx2
-rw-r--r--xmloff/source/style/fonthdl.cxx14
-rw-r--r--xmloff/source/style/postuhdl.cxx8
-rw-r--r--xmloff/source/style/prhdlfac.cxx19
-rw-r--r--xmloff/source/style/undlihdl.cxx82
-rw-r--r--xmloff/source/style/xmlnumfi.cxx24
-rw-r--r--xmloff/source/style/xmltabe.cxx4
22 files changed, 168 insertions, 212 deletions
diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx
index 24b0e0e09d7a..6e6884b7ae5a 100644
--- a/xmloff/source/style/DashStyle.cxx
+++ b/xmloff/source/style/DashStyle.cxx
@@ -64,13 +64,13 @@ static SvXMLTokenMapEntry aDashStyleAttrTokenMap[] =
XML_TOKEN_MAP_END
};
-SvXMLEnumMapEntry const pXML_DashStyle_Enum[] =
+SvXMLEnumMapEntry<drawing::DashStyle> const pXML_DashStyle_Enum[] =
{
{ XML_RECT, drawing::DashStyle_RECT },
{ XML_ROUND, drawing::DashStyle_ROUND },
{ XML_RECT, drawing::DashStyle_RECTRELATIVE },
{ XML_ROUND, drawing::DashStyle_ROUNDRELATIVE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (drawing::DashStyle)0 }
};
// Import
@@ -127,11 +127,7 @@ void XMLDashStyleImport::importXML(
break;
case XML_TOK_DASH_STYLE:
{
- sal_uInt16 eValue;
- if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_DashStyle_Enum ) )
- {
- aLineDash.Style = (drawing::DashStyle) eValue;
- }
+ SvXMLUnitConverter::convertEnum( aLineDash.Style, rStrValue, pXML_DashStyle_Enum );
}
break;
case XML_TOK_DASH_DOTS1:
diff --git a/xmloff/source/style/EnumPropertyHdl.cxx b/xmloff/source/style/EnumPropertyHdl.cxx
index fcfe449f5758..c20fd050676c 100644
--- a/xmloff/source/style/EnumPropertyHdl.cxx
+++ b/xmloff/source/style/EnumPropertyHdl.cxx
@@ -30,7 +30,6 @@ using namespace ::com::sun::star::uno;
// class XMLEnumPropertyHdl
-
XMLEnumPropertyHdl::~XMLEnumPropertyHdl()
{
// Nothing to do
@@ -75,7 +74,7 @@ bool XMLEnumPropertyHdl::exportXML( OUString& rStrExpValue, const Any& rValue, c
OUStringBuffer aOut;
- if(!SvXMLUnitConverter::convertEnum( aOut, nValue, mpEnumMap ))
+ if(!SvXMLUnitConverter::convertEnum( aOut, (sal_uInt16)nValue, mpEnumMap ))
return false;
rStrExpValue = aOut.makeStringAndClear();
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx
index ac05a0dbacee..45353f1a73fe 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -55,7 +55,7 @@ enum SvXMLTokenMapAttrs
XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
};
-SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] =
+SvXMLEnumMapEntry<awt::GradientStyle> const pXML_GradientStyle_Enum[] =
{
{ XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR },
{ XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL },
@@ -63,7 +63,7 @@ SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] =
{ XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL },
{ XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE },
{ XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (awt::GradientStyle)0 }
};
// Import
@@ -132,13 +132,7 @@ void XMLGradientStyleImport::importXML(
aDisplayName = rStrValue;
break;
case XML_TOK_GRADIENT_STYLE:
- {
- sal_uInt16 eValue;
- if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) )
- {
- aGradient.Style = (awt::GradientStyle) eValue;
- }
- }
+ SvXMLUnitConverter::convertEnum( aGradient.Style, rStrValue, pXML_GradientStyle_Enum );
break;
case XML_TOK_GRADIENT_CX:
::sax::Converter::convertPercent( nTmpValue, rStrValue );
diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx
index 99dddb2e692c..81a27084de93 100644
--- a/xmloff/source/style/HatchStyle.cxx
+++ b/xmloff/source/style/HatchStyle.cxx
@@ -49,12 +49,12 @@ enum SvXMLTokenMapAttrs
XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN
};
-SvXMLEnumMapEntry const pXML_HatchStyle_Enum[] =
+SvXMLEnumMapEntry<drawing::HatchStyle> const pXML_HatchStyle_Enum[] =
{
{ XML_HATCHSTYLE_SINGLE, drawing::HatchStyle_SINGLE },
{ XML_HATCHSTYLE_DOUBLE, drawing::HatchStyle_DOUBLE },
{ XML_HATCHSTYLE_TRIPLE, drawing::HatchStyle_TRIPLE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (drawing::HatchStyle)0 }
};
// Import
@@ -86,7 +86,6 @@ void XMLHatchStyleImport::importXML(
XML_TOKEN_MAP_END
};
- bool bHasStyle = false;
OUString aDisplayName;
drawing::Hatch aHatch;
@@ -116,12 +115,7 @@ void XMLHatchStyleImport::importXML(
aDisplayName = rStrValue;
break;
case XML_TOK_HATCH_STYLE:
- {
- sal_uInt16 eValue;
- bHasStyle = SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_HatchStyle_Enum );
- if( bHasStyle )
- aHatch.Style = (drawing::HatchStyle) eValue;
- }
+ SvXMLUnitConverter::convertEnum( aHatch.Style, rStrValue, pXML_HatchStyle_Enum );
break;
case XML_TOK_HATCH_COLOR:
::sax::Converter::convertColor(aHatch.Color, rStrValue);
diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx
index 719b420ec0c6..e216566a8c0c 100644
--- a/xmloff/source/style/PageMasterPropHdlFactory.cxx
+++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx
@@ -44,7 +44,7 @@ using namespace ::com::sun::star;
//UUUU
using namespace ::com::sun::star::drawing;
-static SvXMLEnumMapEntry const aXML_TextGridMode_ConstantMap[] =
+static SvXMLEnumMapEntry<sal_uInt16> const aXML_TextGridMode_ConstantMap[] =
{
{ XML_NONE, text::TextGridMode::NONE },
{ XML_LINE, text::TextGridMode::LINES },
@@ -134,7 +134,7 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I
//UUUU
case XML_SW_TYPE_FILLSTYLE:
- pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, cppu::UnoType<FillStyle>::get() );
+ pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap );
break;
case XML_SW_TYPE_FILLBITMAPSIZE:
pHdl = new XMLFillBitmapSizePropertyHandler();
@@ -143,10 +143,10 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I
pHdl = new XMLBitmapLogicalSizePropertyHandler();
break;
case XML_SW_TYPE_BITMAP_REFPOINT:
- pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, cppu::UnoType<RectanglePoint>::get() );
+ pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap );
break;
case XML_SW_TYPE_BITMAP_MODE:
- pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, cppu::UnoType<BitmapMode>::get() );
+ pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap );
break;
case XML_SW_TYPE_BITMAPREPOFFSETX:
case XML_SW_TYPE_BITMAPREPOFFSETY:
diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx
index ebd2b08e1125..d1be6cef0ff9 100644
--- a/xmloff/source/style/TransGradientStyle.cxx
+++ b/xmloff/source/style/TransGradientStyle.cxx
@@ -52,7 +52,7 @@ enum SvXMLTokenMapAttrs
XML_TOK_GRADIENT_BORDER
};
-SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] =
+SvXMLEnumMapEntry<awt::GradientStyle> const pXML_GradientStyle_Enum[] =
{
{ XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR },
{ XML_GRADIENTSTYLE_AXIAL, awt::GradientStyle_AXIAL },
@@ -60,7 +60,7 @@ SvXMLEnumMapEntry const pXML_GradientStyle_Enum[] =
{ XML_GRADIENTSTYLE_ELLIPSOID, awt::GradientStyle_ELLIPTICAL },
{ XML_GRADIENTSTYLE_SQUARE, awt::GradientStyle_SQUARE },
{ XML_GRADIENTSTYLE_RECTANGULAR, awt::GradientStyle_RECT },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (awt::GradientStyle)0 }
};
// Import
@@ -132,11 +132,7 @@ void XMLTransGradientStyleImport::importXML(
break;
case XML_TOK_GRADIENT_STYLE:
{
- sal_uInt16 eValue;
- if( SvXMLUnitConverter::convertEnum( eValue, rStrValue, pXML_GradientStyle_Enum ) )
- {
- aGradient.Style = (awt::GradientStyle) eValue;
- }
+ SvXMLUnitConverter::convertEnum( aGradient.Style, rStrValue, pXML_GradientStyle_Enum );
}
break;
case XML_TOK_GRADIENT_CX:
diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx
index c281fb750e79..e9981daed89e 100644
--- a/xmloff/source/style/XMLBackgroundImageContext.cxx
+++ b/xmloff/source/style/XMLBackgroundImageContext.cxx
@@ -70,18 +70,18 @@ static const SvXMLTokenMapEntry* lcl_getBGImgAttributesAttrTokenMap()
}
-static const SvXMLEnumMapEntry psXML_BrushHoriPos[] =
+static const SvXMLEnumMapEntry<GraphicLocation> psXML_BrushHoriPos[] =
{
{ XML_LEFT, GraphicLocation_LEFT_MIDDLE },
{ XML_RIGHT, GraphicLocation_RIGHT_MIDDLE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (GraphicLocation)0 }
};
-static const SvXMLEnumMapEntry psXML_BrushVertPos[] =
+static const SvXMLEnumMapEntry<GraphicLocation> psXML_BrushVertPos[] =
{
{ XML_TOP, GraphicLocation_MIDDLE_TOP },
{ XML_BOTTOM, GraphicLocation_MIDDLE_BOTTOM },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (GraphicLocation)0 }
};
static void lcl_xmlbic_MergeHoriPos( GraphicLocation& ePos,
@@ -196,13 +196,13 @@ void XMLBackgroundImageContext::ProcessAttrs(
case XML_TOK_BGIMG_POSITION:
{
GraphicLocation eNewPos = GraphicLocation_NONE, eTmp;
- sal_uInt16 nTmp;
SvXMLTokenEnumerator aTokenEnum( rValue );
OUString aToken;
bool bHori = false, bVert = false;
bool bOK = true;
while( bOK && aTokenEnum.getNextToken( aToken ) )
{
+ GraphicLocation nTmpGraphicLocation;
if( bHori && bVert )
{
bOK = false;
@@ -247,26 +247,24 @@ void XMLBackgroundImageContext::ProcessAttrs(
else
eNewPos = GraphicLocation_MIDDLE_MIDDLE;
}
- else if( SvXMLUnitConverter::convertEnum( nTmp, aToken,
+ else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken,
psXML_BrushHoriPos ) )
{
if( bVert )
- lcl_xmlbic_MergeHoriPos( eNewPos,
- (GraphicLocation)nTmp );
+ lcl_xmlbic_MergeHoriPos( eNewPos, nTmpGraphicLocation );
else if( !bHori )
- eNewPos = (GraphicLocation)nTmp;
+ eNewPos = nTmpGraphicLocation;
else
bOK = false;
bHori = true;
}
- else if( SvXMLUnitConverter::convertEnum( nTmp, aToken,
+ else if( SvXMLUnitConverter::convertEnum( nTmpGraphicLocation, aToken,
psXML_BrushVertPos ) )
{
if( bHori )
- lcl_xmlbic_MergeVertPos( eNewPos,
- (GraphicLocation)nTmp );
+ lcl_xmlbic_MergeVertPos( eNewPos, nTmpGraphicLocation );
else if( !bVert )
- eNewPos = (GraphicLocation)nTmp;
+ eNewPos = nTmpGraphicLocation;
else
bOK = false;
bVert = true;
@@ -284,13 +282,13 @@ void XMLBackgroundImageContext::ProcessAttrs(
break;
case XML_TOK_BGIMG_REPEAT:
{
- sal_uInt16 nPos = GraphicLocation_NONE;
- static const SvXMLEnumMapEntry psXML_BrushRepeat[] =
+ GraphicLocation nPos = GraphicLocation_NONE;
+ static const SvXMLEnumMapEntry<GraphicLocation> psXML_BrushRepeat[] =
{
- { XML_BACKGROUND_REPEAT, GraphicLocation_TILED },
- { XML_BACKGROUND_NO_REPEAT, GraphicLocation_MIDDLE_MIDDLE },
- { XML_BACKGROUND_STRETCH, GraphicLocation_AREA },
- { XML_TOKEN_INVALID, 0 }
+ { XML_BACKGROUND_REPEAT, GraphicLocation_TILED },
+ { XML_BACKGROUND_NO_REPEAT, GraphicLocation_MIDDLE_MIDDLE },
+ { XML_BACKGROUND_STRETCH, GraphicLocation_AREA },
+ { XML_TOKEN_INVALID, (GraphicLocation)0 }
};
if( SvXMLUnitConverter::convertEnum( nPos, rValue,
psXML_BrushRepeat ) )
@@ -299,7 +297,7 @@ void XMLBackgroundImageContext::ProcessAttrs(
GraphicLocation_NONE == ePos ||
GraphicLocation_AREA == ePos ||
GraphicLocation_TILED == ePos )
- ePos = (GraphicLocation)nPos;
+ ePos = nPos;
}
}
break;
diff --git a/xmloff/source/style/XMLConstantsPropertyHandler.cxx b/xmloff/source/style/XMLConstantsPropertyHandler.cxx
index ca3843f25fe1..0e86ec7722c8 100644
--- a/xmloff/source/style/XMLConstantsPropertyHandler.cxx
+++ b/xmloff/source/style/XMLConstantsPropertyHandler.cxx
@@ -27,14 +27,6 @@ using namespace ::com::sun::star::uno;
using ::xmloff::token::XMLTokenEnum;
-XMLConstantsPropertyHandler::XMLConstantsPropertyHandler(
- const SvXMLEnumMapEntry *pM,
- enum XMLTokenEnum eDflt ) :
- pMap( pM ),
- eDefault( eDflt )
-{
-}
-
XMLConstantsPropertyHandler::~XMLConstantsPropertyHandler()
{
}
diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
index 610f700cd05b..74ca184edcfc 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx
@@ -55,7 +55,7 @@ void XMLFootnoteSeparatorExport::exportXML(
assert(pProperties);
// initialize values
- sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT;
+ text::HorizontalAdjust eLineAdjust = text::HorizontalAdjust_LEFT;
sal_Int32 nLineColor = 0;
sal_Int32 nLineDistance = 0;
sal_Int8 nLineRelWidth = 0;
@@ -129,7 +129,7 @@ void XMLFootnoteSeparatorExport::exportXML(
}
// line style
- static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] =
+ static const SvXMLEnumMapEntry<sal_Int8> aXML_LineStyle_Enum[] =
{
{ XML_NONE, 0 },
{ XML_SOLID, 1 },
@@ -145,12 +145,12 @@ void XMLFootnoteSeparatorExport::exportXML(
}
// adjustment
- static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] =
+ static const SvXMLEnumMapEntry<text::HorizontalAdjust> aXML_HorizontalAdjust_Enum[] =
{
{ XML_LEFT, text::HorizontalAdjust_LEFT },
{ XML_CENTER, text::HorizontalAdjust_CENTER },
{ XML_RIGHT, text::HorizontalAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (text::HorizontalAdjust)0 }
};
if (SvXMLUnitConverter::convertEnum(
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
index 86ee5249f9d0..88791e0f70a9 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
@@ -77,7 +77,7 @@ void XMLFootnoteSeparatorImport::StartElement(
sal_Int16 nLineWeight = 0;
sal_Int32 nLineColor = 0;
sal_Int8 nLineRelWidth = 0;
- sal_Int16 eLineAdjust = text::HorizontalAdjust_LEFT; // enum text::HorizontalAdjust
+ text::HorizontalAdjust eLineAdjust = text::HorizontalAdjust_LEFT;
sal_Int32 nLineTextDistance = 0;
sal_Int32 nLineDistance = 0;
sal_Int8 nLineStyle = 0;
@@ -117,18 +117,16 @@ void XMLFootnoteSeparatorImport::StartElement(
}
else if (IsXMLToken( sLocalName, XML_ADJUSTMENT ))
{
- sal_uInt16 nTmpU;
- static const SvXMLEnumMapEntry aXML_HorizontalAdjust_Enum[] =
+ static const SvXMLEnumMapEntry<text::HorizontalAdjust> aXML_HorizontalAdjust_Enum[] =
{
{ XML_LEFT, text::HorizontalAdjust_LEFT },
{ XML_CENTER, text::HorizontalAdjust_CENTER },
{ XML_RIGHT, text::HorizontalAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (text::HorizontalAdjust)0 }
};
- if (SvXMLUnitConverter::convertEnum(
- nTmpU, sAttrValue, aXML_HorizontalAdjust_Enum))
- eLineAdjust = (sal_Int16)nTmpU;
+ SvXMLUnitConverter::convertEnum(
+ eLineAdjust, sAttrValue, aXML_HorizontalAdjust_Enum);
}
else if (IsXMLToken( sLocalName, XML_REL_WIDTH ))
{
@@ -144,8 +142,7 @@ void XMLFootnoteSeparatorImport::StartElement(
}
else if (IsXMLToken( sLocalName, XML_LINE_STYLE ))
{
- sal_uInt16 nTmpU;
- static const SvXMLEnumMapEntry aXML_LineStyle_Enum[] =
+ static const SvXMLEnumMapEntry<sal_Int8> aXML_LineStyle_Enum[] =
{
{ XML_NONE, 0 },
{ XML_SOLID, 1 },
@@ -154,10 +151,7 @@ void XMLFootnoteSeparatorImport::StartElement(
{ XML_TOKEN_INVALID, 0 }
};
- if (SvXMLUnitConverter::convertEnum(
- nTmpU, sAttrValue, aXML_LineStyle_Enum))
- nLineStyle = (sal_Int8)nTmpU;
-
+ SvXMLUnitConverter::convertEnum(nLineStyle, sAttrValue, aXML_LineStyle_Enum);
}
}
}
diff --git a/xmloff/source/style/adjushdl.cxx b/xmloff/source/style/adjushdl.cxx
index 3abb34e2b3b3..bb2e36590612 100644
--- a/xmloff/source/style/adjushdl.cxx
+++ b/xmloff/source/style/adjushdl.cxx
@@ -28,7 +28,7 @@ using namespace ::com::sun::star;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_Para_Adjust_Enum[] =
+SvXMLEnumMapEntry<style::ParagraphAdjust> const pXML_Para_Adjust_Enum[] =
{
{ XML_START, style::ParagraphAdjust_LEFT },
{ XML_END, style::ParagraphAdjust_RIGHT },
@@ -37,16 +37,16 @@ SvXMLEnumMapEntry const pXML_Para_Adjust_Enum[] =
{ XML_JUSTIFIED, style::ParagraphAdjust_BLOCK }, // obsolete
{ XML_LEFT, style::ParagraphAdjust_LEFT },
{ XML_RIGHT, style::ParagraphAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (style::ParagraphAdjust)0 }
};
-SvXMLEnumMapEntry const pXML_Para_Align_Last_Enum[] =
+SvXMLEnumMapEntry<style::ParagraphAdjust> const pXML_Para_Align_Last_Enum[] =
{
{ XML_START, style::ParagraphAdjust_LEFT },
{ XML_CENTER, style::ParagraphAdjust_CENTER },
{ XML_JUSTIFY, style::ParagraphAdjust_BLOCK },
{ XML_JUSTIFIED, style::ParagraphAdjust_BLOCK }, // obsolete
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (style::ParagraphAdjust)0 }
};
@@ -60,7 +60,7 @@ XMLParaAdjustPropHdl::~XMLParaAdjustPropHdl()
bool XMLParaAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
- sal_uInt16 eAdjust;
+ style::ParagraphAdjust eAdjust;
bool bRet = SvXMLUnitConverter::convertEnum( eAdjust, rStrImpValue, pXML_Para_Adjust_Enum );
if( bRet )
rValue <<= (sal_Int16)eAdjust;
@@ -77,7 +77,7 @@ bool XMLParaAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV
rValue >>= nVal;
- bool bRet = SvXMLUnitConverter::convertEnum( aOut, nVal, pXML_Para_Adjust_Enum, XML_START );
+ bool bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Adjust_Enum, XML_START );
rStrExpValue = aOut.makeStringAndClear();
@@ -95,7 +95,7 @@ XMLLastLineAdjustPropHdl::~XMLLastLineAdjustPropHdl()
bool XMLLastLineAdjustPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
- sal_uInt16 eAdjust;
+ style::ParagraphAdjust eAdjust;
bool bRet = SvXMLUnitConverter::convertEnum( eAdjust, rStrImpValue, pXML_Para_Align_Last_Enum );
if( bRet )
rValue <<= (sal_Int16)eAdjust;
@@ -112,7 +112,7 @@ bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any
rValue >>= nVal;
if( nVal != style::ParagraphAdjust_LEFT )
- bRet = SvXMLUnitConverter::convertEnum( aOut, nVal, pXML_Para_Align_Last_Enum, XML_START );
+ bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Align_Last_Enum, XML_START );
rStrExpValue = aOut.makeStringAndClear();
diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx
index 6fce270b8d12..94872997e808 100644
--- a/xmloff/source/style/backhdl.cxx
+++ b/xmloff/source/style/backhdl.cxx
@@ -28,18 +28,18 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_BrushHorizontalPos[] =
+SvXMLEnumMapEntry<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;
diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx
index 55ae26c0203f..3efaee4a0417 100644
--- a/xmloff/source/style/bordrhdl.cxx
+++ b/xmloff/source/style/bordrhdl.cxx
@@ -37,7 +37,7 @@ using namespace ::xmloff::token;
#define SVX_XML_BORDER_WIDTH_MIDDLE 1
#define SVX_XML_BORDER_WIDTH_THICK 2
-SvXMLEnumMapEntry const pXML_BorderStyles[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_BorderStyles[] =
{
{ XML_NONE, table::BorderLineStyle::NONE },
{ XML_HIDDEN, table::BorderLineStyle::NONE },
@@ -56,7 +56,7 @@ SvXMLEnumMapEntry const pXML_BorderStyles[] =
{ XML_TOKEN_INVALID, 0 }
};
-SvXMLEnumMapEntry const pXML_NamedBorderWidths[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_NamedBorderWidths[] =
{
{ XML_THIN, SVX_XML_BORDER_WIDTH_THIN },
{ XML_MIDDLE, SVX_XML_BORDER_WIDTH_MIDDLE },
diff --git a/xmloff/source/style/breakhdl.cxx b/xmloff/source/style/breakhdl.cxx
index a64bc2527a4f..56ab3e510c4d 100644
--- a/xmloff/source/style/breakhdl.cxx
+++ b/xmloff/source/style/breakhdl.cxx
@@ -27,7 +27,7 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_BreakTypes[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_BreakTypes[] =
{
{ XML_AUTO, 0 },
{ XML_COLUMN, 1 },
diff --git a/xmloff/source/style/cdouthdl.cxx b/xmloff/source/style/cdouthdl.cxx
index 29eba7c6cbc1..35113f3976c3 100644
--- a/xmloff/source/style/cdouthdl.cxx
+++ b/xmloff/source/style/cdouthdl.cxx
@@ -30,46 +30,46 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_CrossedoutType_Enum[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_CrossedoutType_Enum[] =
{
- { XML_NONE, awt::FontStrikeout::NONE },
- { XML_SINGLE, awt::FontStrikeout::SINGLE },
- { XML_DOUBLE, awt::FontStrikeout::DOUBLE },
- { XML_SINGLE, awt::FontStrikeout::BOLD },
- { XML_SINGLE, awt::FontStrikeout::SLASH },
- { XML_SINGLE, awt::FontStrikeout::X },
- { XML_TOKEN_INVALID, 0 }
+ { XML_NONE, awt::FontStrikeout::NONE },
+ { XML_SINGLE, awt::FontStrikeout::SINGLE },
+ { XML_DOUBLE, awt::FontStrikeout::DOUBLE },
+ { XML_SINGLE, awt::FontStrikeout::BOLD },
+ { XML_SINGLE, awt::FontStrikeout::SLASH },
+ { XML_SINGLE, awt::FontStrikeout::X },
+ { XML_TOKEN_INVALID, 0 }
};
-SvXMLEnumMapEntry const pXML_CrossedoutStyle_Enum[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_CrossedoutStyle_Enum[] =
{
- { XML_NONE, awt::FontStrikeout::NONE },
- { XML_SOLID, awt::FontStrikeout::SINGLE },
- { XML_SOLID, awt::FontStrikeout::DOUBLE },
- { XML_SOLID, awt::FontStrikeout::BOLD },
- { XML_SOLID, awt::FontStrikeout::SLASH },
- { XML_SOLID, awt::FontStrikeout::X },
- { XML_DOTTED, awt::FontStrikeout::SINGLE },
+ { XML_NONE, awt::FontStrikeout::NONE },
+ { XML_SOLID, awt::FontStrikeout::SINGLE },
+ { XML_SOLID, awt::FontStrikeout::DOUBLE },
+ { XML_SOLID, awt::FontStrikeout::BOLD },
+ { XML_SOLID, awt::FontStrikeout::SLASH },
+ { XML_SOLID, awt::FontStrikeout::X },
+ { XML_DOTTED, awt::FontStrikeout::SINGLE },
{ XML_DASH, awt::FontStrikeout::SINGLE },
- { XML_LONG_DASH, awt::FontStrikeout::SINGLE },
+ { XML_LONG_DASH, awt::FontStrikeout::SINGLE },
{ XML_DOT_DASH, awt::FontStrikeout::SINGLE },
{ XML_DOT_DOT_DASH, awt::FontStrikeout::SINGLE },
{ XML_WAVE, awt::FontStrikeout::SINGLE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, 0 }
};
-SvXMLEnumMapEntry const pXML_CrossedoutWidth_Enum[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_CrossedoutWidth_Enum[] =
{
{ XML_AUTO, awt::FontStrikeout::NONE },
{ XML_AUTO, awt::FontStrikeout::SINGLE },
{ XML_AUTO, awt::FontStrikeout::DOUBLE },
- { XML_BOLD, awt::FontStrikeout::BOLD },
+ { XML_BOLD, awt::FontStrikeout::BOLD },
{ XML_AUTO, awt::FontStrikeout::SLASH },
{ XML_AUTO, awt::FontStrikeout::X },
{ XML_THIN, awt::FontStrikeout::NONE },
{ XML_MEDIUM, awt::FontStrikeout::NONE },
{ XML_THICK, awt::FontStrikeout::NONE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, 0 }
};
// class XMLCrossedOutTypePropHdl
@@ -133,13 +133,13 @@ bool XMLCrossedOutTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any
bool XMLCrossedOutTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
- sal_Int16 nValue = sal_Int16();
+ sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if (rValue >>= nValue)
{
bRet = SvXMLUnitConverter::convertEnum(
- aOut, (sal_uInt16)nValue, pXML_CrossedoutType_Enum );
+ aOut, nValue, pXML_CrossedoutType_Enum );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
}
@@ -181,13 +181,13 @@ bool XMLCrossedOutStylePropHdl::importXML( const OUString& rStrImpValue, uno::An
bool XMLCrossedOutStylePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
- sal_Int16 nValue = sal_Int16();
+ sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( rValue >>= nValue )
{
bRet = SvXMLUnitConverter::convertEnum(
- aOut, (sal_uInt16)nValue, pXML_CrossedoutStyle_Enum );
+ aOut, nValue, pXML_CrossedoutStyle_Enum );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
}
@@ -251,13 +251,13 @@ bool XMLCrossedOutWidthPropHdl::importXML( const OUString& rStrImpValue, uno::An
bool XMLCrossedOutWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
- sal_Int16 nValue = sal_Int16();
+ sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( (rValue >>= nValue) && (awt::FontStrikeout::BOLD == nValue) )
{
bRet = SvXMLUnitConverter::convertEnum(
- aOut, (sal_uInt16)nValue, pXML_CrossedoutWidth_Enum );
+ aOut, nValue, pXML_CrossedoutWidth_Enum );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
}
diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx
index b701f68714c7..c583802b4806 100644
--- a/xmloff/source/style/csmaphdl.cxx
+++ b/xmloff/source/style/csmaphdl.cxx
@@ -27,7 +27,7 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-static SvXMLEnumMapEntry pXML_Casemap_Enum[] =
+static SvXMLEnumMapEntry<sal_uInt16> pXML_Casemap_Enum[] =
{
{ XML_NONE, style::CaseMap::NONE },
{ XML_CASEMAP_LOWERCASE, style::CaseMap::LOWERCASE },
diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx
index a5aa39b826e5..8e4884fd0579 100644
--- a/xmloff/source/style/fonthdl.cxx
+++ b/xmloff/source/style/fonthdl.cxx
@@ -30,9 +30,9 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-static const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping()
+static const SvXMLEnumMapEntry<FontFamily>* lcl_getFontFamilyGenericMapping()
{
- static SvXMLEnumMapEntry const aFontFamilyGenericMapping[] =
+ static SvXMLEnumMapEntry<FontFamily> const aFontFamilyGenericMapping[] =
{
{ XML_DECORATIVE, FAMILY_DECORATIVE },
@@ -41,16 +41,16 @@ static const SvXMLEnumMapEntry* lcl_getFontFamilyGenericMapping()
{ XML_SCRIPT, FAMILY_SCRIPT },
{ XML_SWISS, FAMILY_SWISS },
{ XML_SYSTEM, FAMILY_SYSTEM },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (FontFamily)0 }
};
return aFontFamilyGenericMapping;
}
-static SvXMLEnumMapEntry const aFontPitchMapping[] =
+static SvXMLEnumMapEntry<FontPitch> const aFontPitchMapping[] =
{
{ XML_FIXED, PITCH_FIXED },
{ XML_VARIABLE, PITCH_VARIABLE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (FontPitch)0 }
};
// class XMLFontFamilyNamePropHdl
@@ -193,7 +193,7 @@ XMLFontFamilyPropHdl::~XMLFontFamilyPropHdl()
bool XMLFontFamilyPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
- sal_uInt16 eNewFamily;
+ FontFamily eNewFamily;
bool bRet = SvXMLUnitConverter::convertEnum( eNewFamily, rStrImpValue, lcl_getFontFamilyGenericMapping() );
if( bRet )
rValue <<= (sal_Int16)eNewFamily;
@@ -264,7 +264,7 @@ XMLFontPitchPropHdl::~XMLFontPitchPropHdl()
bool XMLFontPitchPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
- sal_uInt16 eNewPitch;
+ FontPitch eNewPitch;
bool bRet = SvXMLUnitConverter::convertEnum( eNewPitch, rStrImpValue, aFontPitchMapping );
if( bRet )
rValue <<= (sal_Int16)eNewPitch;
diff --git a/xmloff/source/style/postuhdl.cxx b/xmloff/source/style/postuhdl.cxx
index 25d6b364bad1..a40a9ceeb578 100644
--- a/xmloff/source/style/postuhdl.cxx
+++ b/xmloff/source/style/postuhdl.cxx
@@ -28,12 +28,12 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const aPostureGenericMapping[] =
+SvXMLEnumMapEntry<FontItalic> const aPostureGenericMapping[] =
{
{ XML_POSTURE_NORMAL, ITALIC_NONE },
{ XML_POSTURE_ITALIC, ITALIC_NORMAL },
{ XML_POSTURE_OBLIQUE, ITALIC_OBLIQUE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (FontItalic)0 }
};
@@ -47,7 +47,7 @@ XMLPosturePropHdl::~XMLPosturePropHdl()
bool XMLPosturePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
- sal_uInt16 ePosture;
+ FontItalic ePosture;
bool bRet = SvXMLUnitConverter::convertEnum( ePosture, rStrImpValue, aPostureGenericMapping );
if( bRet )
rValue <<= (awt::FontSlant)ePosture;
@@ -70,7 +70,7 @@ bool XMLPosturePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValu
}
OUStringBuffer aOut;
- bool bRet = SvXMLUnitConverter::convertEnum( aOut, (sal_Int32)eSlant, aPostureGenericMapping );
+ bool bRet = SvXMLUnitConverter::convertEnum( aOut, (FontItalic)eSlant, aPostureGenericMapping );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 559ab4c112df..f53e3663b527 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -60,27 +60,27 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-static SvXMLEnumMapEntry const aXML_ColorMode_EnumMap[] =
+static SvXMLEnumMapEntry<drawing::ColorMode> const aXML_ColorMode_EnumMap[] =
{
{ XML_GREYSCALE, drawing::ColorMode_GREYS },
{ XML_MONO, drawing::ColorMode_MONO },
{ XML_WATERMARK, drawing::ColorMode_WATERMARK },
{ XML_STANDARD, drawing::ColorMode_STANDARD },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (drawing::ColorMode)0 }
};
-static SvXMLEnumMapEntry const aXML_HorizontalAdjust_Enum[] =
+static SvXMLEnumMapEntry<text::HorizontalAdjust> const aXML_HorizontalAdjust_Enum[] =
{
{ XML_LEFT, text::HorizontalAdjust_LEFT },
{ XML_CENTER, text::HorizontalAdjust_CENTER },
{ XML_RIGHT, text::HorizontalAdjust_RIGHT },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (text::HorizontalAdjust)0 }
};
// aXML_WritingDirection_Enum is used with and without 'page'
// attribute, so you'll find uses of aXML_WritingDirection_Enum
// directly, as well as &(aXML_WritingDirection_Enum[1])
-static SvXMLEnumMapEntry const aXML_WritingDirection_Enum[] =
+static SvXMLEnumMapEntry<sal_uInt16> const aXML_WritingDirection_Enum[] =
{
// aXML_WritingDirection_Enum
{ XML_PAGE, text::WritingMode2::PAGE },
@@ -99,7 +99,7 @@ static SvXMLEnumMapEntry const aXML_WritingDirection_Enum[] =
{ XML_TOKEN_INVALID, 0 }
};
-static SvXMLEnumMapEntry const pXML_VertPos_Enum[] =
+static SvXMLEnumMapEntry<sal_uInt16> const pXML_VertPos_Enum[] =
{
{ XML_FROM_TOP, text::VertOrientation::NONE },
{ XML_TOP, text::VertOrientation::TOP },
@@ -419,16 +419,13 @@ const XMLPropertyHandler* XMLPropertyHandlerFactory::CreatePropertyHandler( sal_
pPropHdl = new XMLAttributeContainerHandler;
break;
case XML_TYPE_COLOR_MODE:
- pPropHdl = new XMLEnumPropertyHdl( aXML_ColorMode_EnumMap,
- cppu::UnoType<drawing::ColorMode>::get());
+ pPropHdl = new XMLEnumPropertyHdl(aXML_ColorMode_EnumMap);
break;
case XML_TYPE_DURATION16_MS:
pPropHdl = new XMLDurationMS16PropHdl_Impl;
break;
case XML_TYPE_TEXT_HORIZONTAL_ADJUST:
- pPropHdl = new XMLEnumPropertyHdl(
- aXML_HorizontalAdjust_Enum,
- cppu::UnoType<text::HorizontalAdjust>::get());
+ pPropHdl = new XMLEnumPropertyHdl(aXML_HorizontalAdjust_Enum);
break;
case XML_TYPE_TEXT_DRAW_ASPECT:
pPropHdl = new DrawAspectHdl;
diff --git a/xmloff/source/style/undlihdl.cxx b/xmloff/source/style/undlihdl.cxx
index a5b7d2788164..90e731bb7ad3 100644
--- a/xmloff/source/style/undlihdl.cxx
+++ b/xmloff/source/style/undlihdl.cxx
@@ -30,11 +30,11 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_UnderlineType_Enum[] =
{
- { XML_NONE, awt::FontUnderline::NONE },
+ { XML_NONE, awt::FontUnderline::NONE },
{ XML_SINGLE, awt::FontUnderline::SINGLE },
- { XML_DOUBLE, awt::FontUnderline::DOUBLE },
+ { XML_DOUBLE, awt::FontUnderline::DOUBLE },
{ XML_SINGLE, awt::FontUnderline::DOTTED },
{ XML_SINGLE, awt::FontUnderline::DASH },
{ XML_SINGLE, awt::FontUnderline::LONGDASH },
@@ -46,59 +46,59 @@ SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] =
{ XML_SINGLE, awt::FontUnderline::BOLDDASH },
{ XML_SINGLE, awt::FontUnderline::BOLDLONGDASH },
{ XML_SINGLE, awt::FontUnderline::BOLDDASHDOT },
- { XML_SINGLE, awt::FontUnderline::BOLDDASHDOTDOT },
+ { XML_SINGLE, awt::FontUnderline::BOLDDASHDOTDOT },
{ XML_SINGLE, awt::FontUnderline::BOLDWAVE },
- { XML_DOUBLE, awt::FontUnderline::DOUBLEWAVE },
+ { XML_DOUBLE, awt::FontUnderline::DOUBLEWAVE },
{ XML_SINGLE, awt::FontUnderline::SMALLWAVE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, 0 }
};
-SvXMLEnumMapEntry const pXML_UnderlineStyle_Enum[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_UnderlineStyle_Enum[] =
{
- { XML_NONE, awt::FontUnderline::NONE },
- { XML_SOLID, awt::FontUnderline::SINGLE },
- { XML_SOLID, awt::FontUnderline::DOUBLE },
+ { XML_NONE, awt::FontUnderline::NONE },
+ { XML_SOLID, awt::FontUnderline::SINGLE },
+ { XML_SOLID, awt::FontUnderline::DOUBLE },
{ XML_DOTTED, awt::FontUnderline::DOTTED },
- { XML_DASH, awt::FontUnderline::DASH },
+ { XML_DASH, awt::FontUnderline::DASH },
{ XML_LONG_DASH, awt::FontUnderline::LONGDASH },
- { XML_DOT_DASH, awt::FontUnderline::DASHDOT },
- { XML_DOT_DOT_DASH, awt::FontUnderline::DASHDOTDOT },
- { XML_WAVE, awt::FontUnderline::WAVE },
- { XML_SOLID, awt::FontUnderline::BOLD },
+ { XML_DOT_DASH, awt::FontUnderline::DASHDOT },
+ { XML_DOT_DOT_DASH, awt::FontUnderline::DASHDOTDOT },
+ { XML_WAVE, awt::FontUnderline::WAVE },
+ { XML_SOLID, awt::FontUnderline::BOLD },
{ XML_DOTTED, awt::FontUnderline::BOLDDOTTED },
- { XML_DASH, awt::FontUnderline::BOLDDASH },
+ { XML_DASH, awt::FontUnderline::BOLDDASH },
{ XML_LONG_DASH, awt::FontUnderline::BOLDLONGDASH },
- { XML_DOT_DASH, awt::FontUnderline::BOLDDASHDOT },
+ { XML_DOT_DASH, awt::FontUnderline::BOLDDASHDOT },
{ XML_DOT_DOT_DASH, awt::FontUnderline::BOLDDASHDOTDOT },
- { XML_WAVE, awt::FontUnderline::BOLDWAVE },
+ { XML_WAVE, awt::FontUnderline::BOLDWAVE },
{ XML_WAVE, awt::FontUnderline::DOUBLEWAVE },
{ XML_SMALL_WAVE, awt::FontUnderline::SMALLWAVE },
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, 0 }
};
-SvXMLEnumMapEntry const pXML_UnderlineWidth_Enum[] =
+SvXMLEnumMapEntry<sal_uInt16> const pXML_UnderlineWidth_Enum[] =
{
- { XML_AUTO, awt::FontUnderline::NONE },
- { XML_AUTO, awt::FontUnderline::SINGLE },
- { XML_AUTO, awt::FontUnderline::DOUBLE },
- { XML_AUTO, awt::FontUnderline::DOTTED },
- { XML_AUTO, awt::FontUnderline::DASH },
- { XML_AUTO, awt::FontUnderline::LONGDASH },
- { XML_AUTO, awt::FontUnderline::DASHDOT },
- { XML_AUTO, awt::FontUnderline::DASHDOTDOT },
- { XML_AUTO, awt::FontUnderline::WAVE },
+ { XML_AUTO, awt::FontUnderline::NONE },
+ { XML_AUTO, awt::FontUnderline::SINGLE },
+ { XML_AUTO, awt::FontUnderline::DOUBLE },
+ { XML_AUTO, awt::FontUnderline::DOTTED },
+ { XML_AUTO, awt::FontUnderline::DASH },
+ { XML_AUTO, awt::FontUnderline::LONGDASH },
+ { XML_AUTO, awt::FontUnderline::DASHDOT },
+ { XML_AUTO, awt::FontUnderline::DASHDOTDOT },
+ { XML_AUTO, awt::FontUnderline::WAVE },
{ XML_BOLD, awt::FontUnderline::BOLD },
{ XML_BOLD, awt::FontUnderline::BOLDDOTTED },
{ XML_BOLD, awt::FontUnderline::BOLDDASH },
{ XML_BOLD, awt::FontUnderline::BOLDLONGDASH },
{ XML_BOLD, awt::FontUnderline::BOLDDASHDOT },
- { XML_BOLD, awt::FontUnderline::BOLDDASHDOTDOT },
+ { XML_BOLD, awt::FontUnderline::BOLDDASHDOTDOT },
{ XML_BOLD, awt::FontUnderline::BOLDWAVE },
- { XML_AUTO, awt::FontUnderline::DOUBLEWAVE },
- { XML_THIN, awt::FontUnderline::NONE },
- { XML_MEDIUM, awt::FontUnderline::NONE },
- { XML_THICK, awt::FontUnderline::BOLD},
- { XML_TOKEN_INVALID, 0 }
+ { XML_AUTO, awt::FontUnderline::DOUBLEWAVE },
+ { XML_THIN, awt::FontUnderline::NONE },
+ { XML_MEDIUM, awt::FontUnderline::NONE },
+ { XML_THICK, awt::FontUnderline::BOLD},
+ { XML_TOKEN_INVALID, 0 }
};
@@ -167,7 +167,7 @@ bool XMLUnderlineTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any&
bool XMLUnderlineTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
- sal_Int16 nValue = sal_Int16();
+ sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( (rValue >>= nValue) &&
@@ -175,7 +175,7 @@ bool XMLUnderlineTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any&
awt::FontUnderline::DOUBLEWAVE == nValue) )
{
bRet = SvXMLUnitConverter::convertEnum(
- aOut, (sal_uInt16)nValue, pXML_UnderlineType_Enum );
+ aOut, nValue, pXML_UnderlineType_Enum );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
}
@@ -259,13 +259,13 @@ bool XMLUnderlineStylePropHdl::importXML( const OUString& rStrImpValue, uno::Any
bool XMLUnderlineStylePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
- sal_Int16 nValue = sal_Int16();
+ sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( rValue >>= nValue )
{
bRet = SvXMLUnitConverter::convertEnum(
- aOut, (sal_uInt16)nValue, pXML_UnderlineStyle_Enum );
+ aOut, nValue, pXML_UnderlineStyle_Enum );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
}
@@ -350,13 +350,13 @@ bool XMLUnderlineWidthPropHdl::importXML( const OUString& rStrImpValue, uno::Any
bool XMLUnderlineWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
{
bool bRet = false;
- sal_Int16 nValue = sal_Int16();
+ sal_uInt16 nValue = sal_uInt16();
OUStringBuffer aOut;
if( (rValue >>= nValue) && (awt::FontUnderline::NONE != nValue) )
{
bRet = SvXMLUnitConverter::convertEnum(
- aOut, (sal_uInt16)nValue, pXML_UnderlineWidth_Enum );
+ aOut, nValue, pXML_UnderlineWidth_Enum );
if( bRet )
rStrExpValue = aOut.makeStringAndClear();
}
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index b48dfc6cb2d3..9194ba6ca8f6 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -303,18 +303,18 @@ static const ColorData aNumFmtStdColors[XML_NUMF_COLORCOUNT] =
// maps for SvXMLUnitConverter::convertEnum
-static const SvXMLEnumMapEntry aStyleValueMap[] =
+static const SvXMLEnumMapEntry<bool> aStyleValueMap[] =
{
- { XML_SHORT, sal_uInt16(false) },
- { XML_LONG, sal_uInt16(true) },
- { XML_TOKEN_INVALID, 0 }
+ { XML_SHORT, false },
+ { XML_LONG, true },
+ { XML_TOKEN_INVALID, false }
};
-static const SvXMLEnumMapEntry aFormatSourceMap[] =
+static const SvXMLEnumMapEntry<bool> aFormatSourceMap[] =
{
- { XML_FIXED, sal_uInt16(false) },
- { XML_LANGUAGE, sal_uInt16(true) },
- { XML_TOKEN_INVALID, 0 }
+ { XML_FIXED, false },
+ { XML_LANGUAGE, true },
+ { XML_TOKEN_INVALID, false }
};
struct SvXMLDefaultDateFormat
@@ -902,7 +902,6 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
bool bAttrBool(false);
bool bVarDecimals = false;
bool bIsMaxDenominator = false;
- sal_uInt16 nAttrEnum;
double fAttrDouble;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -1012,8 +1011,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
aLanguageTagODF.maCountry = sValue;
break;
case XML_TOK_ELEM_ATTR_STYLE:
- if ( SvXMLUnitConverter::convertEnum( nAttrEnum, sValue, aStyleValueMap ) )
- bLong = (bool) nAttrEnum;
+ SvXMLUnitConverter::convertEnum( bLong, sValue, aStyleValueMap );
break;
case XML_TOK_ELEM_ATTR_TEXTUAL:
if (::sax::Converter::convertBool( bAttrBool, sValue ))
@@ -1398,7 +1396,6 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport,
OUString sNatNumAttrScript, sNatNumAttrRfcLanguageTag;
css::i18n::NativeNumberXmlAttributes aNatNumAttr;
bool bAttrBool(false);
- sal_uInt16 nAttrEnum;
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
@@ -1434,8 +1431,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport,
bAutoOrder = bAttrBool;
break;
case XML_TOK_STYLE_ATTR_FORMAT_SOURCE:
- if ( SvXMLUnitConverter::convertEnum( nAttrEnum, sValue, aFormatSourceMap ) )
- bFromSystem = (bool) nAttrEnum;
+ SvXMLUnitConverter::convertEnum( bFromSystem, sValue, aFormatSourceMap );
break;
case XML_TOK_STYLE_ATTR_TRUNCATE_ON_OVERFLOW:
if (::sax::Converter::convertBool( bAttrBool, sValue ))
diff --git a/xmloff/source/style/xmltabe.cxx b/xmloff/source/style/xmltabe.cxx
index c566dfa13592..c63c47d78df2 100644
--- a/xmloff/source/style/xmltabe.cxx
+++ b/xmloff/source/style/xmltabe.cxx
@@ -32,14 +32,14 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-SvXMLEnumMapEntry const pXML_tabstop_style[] =
+SvXMLEnumMapEntry<style::TabAlign> const pXML_tabstop_style[] =
{
{ XML_LEFT, style::TabAlign_LEFT },
{ XML_CENTER, style::TabAlign_CENTER },
{ XML_RIGHT, style::TabAlign_RIGHT },
{ XML_CHAR, style::TabAlign_DECIMAL },
{ XML_DEFAULT, style::TabAlign_DEFAULT }, // ?????????????????????????????????????
- { XML_TOKEN_INVALID, 0 }
+ { XML_TOKEN_INVALID, (style::TabAlign)0 }
};
void SvxXMLTabStopExport::exportTabStop( const css::style::TabStop* pTabStop )