From 9a165a86795c65c42a94bf6f7f48545c797f2db3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 30 Mar 2017 16:02:15 +0200 Subject: use actual UNO enums in xmloff Change-Id: I585825ad3faf972acde548817187183029856971 Reviewed-on: https://gerrit.libreoffice.org/35914 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/xmloff/xmlement.hxx | 2 +- include/xmloff/xmluconv.hxx | 2 +- xmloff/source/forms/elementexport.cxx | 2 +- xmloff/source/forms/formattributes.hxx | 4 ++-- xmloff/source/forms/formenums.cxx | 2 +- xmloff/source/forms/formenums.hxx | 2 +- xmloff/source/forms/gridcolumnproptranslator.cxx | 8 ++++---- xmloff/source/style/adjushdl.cxx | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/xmloff/xmlement.hxx b/include/xmloff/xmlement.hxx index 5879324701bf..5a149f6335ad 100644 --- a/include/xmloff/xmlement.hxx +++ b/include/xmloff/xmlement.hxx @@ -37,7 +37,7 @@ private: sal_uInt16 nValue; public: SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_) - : eToken(eToken_), nValue(nValue_) {} + : eToken(eToken_), nValue(static_cast(nValue_)) {} ::xmloff::token::XMLTokenEnum GetToken() const { return eToken; } }; diff --git a/include/xmloff/xmluconv.hxx b/include/xmloff/xmluconv.hxx index e71880be867e..8eb234289011 100644 --- a/include/xmloff/xmluconv.hxx +++ b/include/xmloff/xmluconv.hxx @@ -161,7 +161,7 @@ public: enum ::xmloff::token::XMLTokenEnum eDefault = ::xmloff::token::XML_TOKEN_INVALID ) { - return convertEnumImpl(rBuffer, nValue, + return convertEnumImpl(rBuffer, static_cast(nValue), reinterpret_cast*>(pMap), eDefault); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index a2a1b10fc580..0048db73e6c1 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -663,7 +663,7 @@ namespace xmloff OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ), PROPERTY_ORIENTATION, aOrientationMap, - (sal_uInt16)ScrollBarOrientation::HORIZONTAL + ScrollBarOrientation::HORIZONTAL ); #if OSL_DEBUG_LEVEL > 0 // reset the bit for later checking diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx index a5dd78959604..04575930942b 100644 --- a/xmloff/source/forms/formattributes.hxx +++ b/xmloff/source/forms/formattributes.hxx @@ -378,10 +378,10 @@ namespace xmloff template void addEnumProperty( const sal_Char* _pAttributeName, const OUString& _rPropertyName, - const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, + const EnumT _nAttributeDefault, const SvXMLEnumMapEntry* _pValueMap, const css::uno::Type* _pType = nullptr) { - addEnumPropertyImpl(_pAttributeName, _rPropertyName, _nAttributeDefault, + addEnumPropertyImpl(_pAttributeName, _rPropertyName, static_cast(_nAttributeDefault), reinterpret_cast*>(_pValueMap), _pType); } diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx index 30b13cdb82e9..b0da002e7e60 100644 --- a/xmloff/source/forms/formenums.cxx +++ b/xmloff/source/forms/formenums.cxx @@ -150,7 +150,7 @@ const SvXMLEnumMapEntry aListLinkageMap[] = { XML_SELECTION_INDEXES, 1 }, { XML_TOKEN_INVALID, 0 } }; -const SvXMLEnumMapEntry aOrientationMap[] = +const SvXMLEnumMapEntry aOrientationMap[] = { { XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL }, { XML_VERTICAL, ScrollBarOrientation::VERTICAL }, diff --git a/xmloff/source/forms/formenums.hxx b/xmloff/source/forms/formenums.hxx index 7ed7dcf8acac..cc63e961f270 100644 --- a/xmloff/source/forms/formenums.hxx +++ b/xmloff/source/forms/formenums.hxx @@ -45,7 +45,7 @@ extern const SvXMLEnumMapEntry aBorderTypeMap[]; extern const SvXMLEnumMapEntry aFontEmphasisMap[]; extern const SvXMLEnumMapEntry aFontReliefMap[]; extern const SvXMLEnumMapEntry aListLinkageMap[]; -extern const SvXMLEnumMapEntry aOrientationMap[]; +extern const SvXMLEnumMapEntry aOrientationMap[]; extern const SvXMLEnumMapEntry aVisualEffectMap[]; extern const SvXMLEnumMapEntry aImagePositionMap[]; extern const SvXMLEnumMapEntry aImageAlignMap[]; diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx index b149d4f9665c..e1241a1e600b 100644 --- a/xmloff/source/forms/gridcolumnproptranslator.cxx +++ b/xmloff/source/forms/gridcolumnproptranslator.cxx @@ -74,8 +74,8 @@ namespace xmloff { ParagraphAdjust_RIGHT, awt::TextAlign::RIGHT }, { ParagraphAdjust_BLOCK, awt::TextAlign::RIGHT }, { ParagraphAdjust_STRETCH, awt::TextAlign::LEFT }, - { ParagraphAdjust_MAKE_FIXED_SIZE, awt::TextAlign::LEFT }, - { ParagraphAdjust_MAKE_FIXED_SIZE, -1 } + { ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE, awt::TextAlign::LEFT }, + { ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE, -1 } }; void valueAlignToParaAdjust(Any& rValue) @@ -100,9 +100,9 @@ namespace xmloff sal_Int32 nValue = 0; rValue >>= nValue; const AlignmentTranslationEntry* pTranslation = AlignmentTranslations; - while ( ParagraphAdjust_MAKE_FIXED_SIZE != pTranslation->nParagraphValue) + while ( ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE != pTranslation->nParagraphValue) { - if ( nValue == pTranslation->nParagraphValue) + if ( (ParagraphAdjust)nValue == pTranslation->nParagraphValue) { rValue <<= pTranslation->nControlValue; return; diff --git a/xmloff/source/style/adjushdl.cxx b/xmloff/source/style/adjushdl.cxx index bb2e36590612..50049509bb8e 100644 --- a/xmloff/source/style/adjushdl.cxx +++ b/xmloff/source/style/adjushdl.cxx @@ -111,7 +111,7 @@ bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any rValue >>= nVal; - if( nVal != style::ParagraphAdjust_LEFT ) + if( (style::ParagraphAdjust)nVal != style::ParagraphAdjust_LEFT ) bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Align_Last_Enum, XML_START ); rStrExpValue = aOut.makeStringAndClear(); -- cgit