Kaydet (Commit) 9a165a86 authored tarafından Noel Grandin's avatar Noel Grandin

use actual UNO enums in xmloff

Change-Id: I585825ad3faf972acde548817187183029856971
Reviewed-on: https://gerrit.libreoffice.org/35914Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst dcffc218
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
sal_uInt16 nValue; sal_uInt16 nValue;
public: public:
SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_) SvXMLEnumMapEntry(::xmloff::token::XMLTokenEnum eToken_, EnumT nValue_)
: eToken(eToken_), nValue(nValue_) {} : eToken(eToken_), nValue(static_cast<sal_uInt16>(nValue_)) {}
::xmloff::token::XMLTokenEnum GetToken() const { return eToken; } ::xmloff::token::XMLTokenEnum GetToken() const { return eToken; }
}; };
......
...@@ -161,7 +161,7 @@ public: ...@@ -161,7 +161,7 @@ public:
enum ::xmloff::token::XMLTokenEnum eDefault = enum ::xmloff::token::XMLTokenEnum eDefault =
::xmloff::token::XML_TOKEN_INVALID ) ::xmloff::token::XML_TOKEN_INVALID )
{ {
return convertEnumImpl(rBuffer, nValue, return convertEnumImpl(rBuffer, static_cast<sal_uInt16>(nValue),
reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap), eDefault); reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pMap), eDefault);
} }
......
...@@ -663,7 +663,7 @@ namespace xmloff ...@@ -663,7 +663,7 @@ namespace xmloff
OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ), OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ),
PROPERTY_ORIENTATION, PROPERTY_ORIENTATION,
aOrientationMap, aOrientationMap,
(sal_uInt16)ScrollBarOrientation::HORIZONTAL ScrollBarOrientation::HORIZONTAL
); );
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking // reset the bit for later checking
......
...@@ -378,10 +378,10 @@ namespace xmloff ...@@ -378,10 +378,10 @@ namespace xmloff
template<typename EnumT> template<typename EnumT>
void addEnumProperty( void addEnumProperty(
const sal_Char* _pAttributeName, const OUString& _rPropertyName, const sal_Char* _pAttributeName, const OUString& _rPropertyName,
const sal_uInt16 _nAttributeDefault, const SvXMLEnumMapEntry<EnumT>* _pValueMap, const EnumT _nAttributeDefault, const SvXMLEnumMapEntry<EnumT>* _pValueMap,
const css::uno::Type* _pType = nullptr) const css::uno::Type* _pType = nullptr)
{ {
addEnumPropertyImpl(_pAttributeName, _rPropertyName, _nAttributeDefault, addEnumPropertyImpl(_pAttributeName, _rPropertyName, static_cast<sal_uInt16>(_nAttributeDefault),
reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(_pValueMap), _pType); reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(_pValueMap), _pType);
} }
......
...@@ -150,7 +150,7 @@ const SvXMLEnumMapEntry<sal_Int16> aListLinkageMap[] = ...@@ -150,7 +150,7 @@ const SvXMLEnumMapEntry<sal_Int16> aListLinkageMap[] =
{ XML_SELECTION_INDEXES, 1 }, { XML_SELECTION_INDEXES, 1 },
{ XML_TOKEN_INVALID, 0 } { XML_TOKEN_INVALID, 0 }
}; };
const SvXMLEnumMapEntry<sal_uInt16> aOrientationMap[] = const SvXMLEnumMapEntry<sal_Int32> aOrientationMap[] =
{ {
{ XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL }, { XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL },
{ XML_VERTICAL, ScrollBarOrientation::VERTICAL }, { XML_VERTICAL, ScrollBarOrientation::VERTICAL },
......
...@@ -45,7 +45,7 @@ extern const SvXMLEnumMapEntry<sal_uInt16> aBorderTypeMap[]; ...@@ -45,7 +45,7 @@ extern const SvXMLEnumMapEntry<sal_uInt16> aBorderTypeMap[];
extern const SvXMLEnumMapEntry<sal_uInt16> aFontEmphasisMap[]; extern const SvXMLEnumMapEntry<sal_uInt16> aFontEmphasisMap[];
extern const SvXMLEnumMapEntry<sal_uInt16> aFontReliefMap[]; extern const SvXMLEnumMapEntry<sal_uInt16> aFontReliefMap[];
extern const SvXMLEnumMapEntry<sal_Int16> aListLinkageMap[]; extern const SvXMLEnumMapEntry<sal_Int16> aListLinkageMap[];
extern const SvXMLEnumMapEntry<sal_uInt16> aOrientationMap[]; extern const SvXMLEnumMapEntry<sal_Int32> aOrientationMap[];
extern const SvXMLEnumMapEntry<sal_Int16> aVisualEffectMap[]; extern const SvXMLEnumMapEntry<sal_Int16> aVisualEffectMap[];
extern const SvXMLEnumMapEntry<sal_Int16> aImagePositionMap[]; extern const SvXMLEnumMapEntry<sal_Int16> aImagePositionMap[];
extern const SvXMLEnumMapEntry<sal_uInt16> aImageAlignMap[]; extern const SvXMLEnumMapEntry<sal_uInt16> aImageAlignMap[];
......
...@@ -74,8 +74,8 @@ namespace xmloff ...@@ -74,8 +74,8 @@ namespace xmloff
{ ParagraphAdjust_RIGHT, awt::TextAlign::RIGHT }, { ParagraphAdjust_RIGHT, awt::TextAlign::RIGHT },
{ ParagraphAdjust_BLOCK, awt::TextAlign::RIGHT }, { ParagraphAdjust_BLOCK, awt::TextAlign::RIGHT },
{ ParagraphAdjust_STRETCH, awt::TextAlign::LEFT }, { ParagraphAdjust_STRETCH, awt::TextAlign::LEFT },
{ ParagraphAdjust_MAKE_FIXED_SIZE, awt::TextAlign::LEFT }, { ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE, awt::TextAlign::LEFT },
{ ParagraphAdjust_MAKE_FIXED_SIZE, -1 } { ParagraphAdjust::ParagraphAdjust_MAKE_FIXED_SIZE, -1 }
}; };
void valueAlignToParaAdjust(Any& rValue) void valueAlignToParaAdjust(Any& rValue)
...@@ -100,9 +100,9 @@ namespace xmloff ...@@ -100,9 +100,9 @@ namespace xmloff
sal_Int32 nValue = 0; sal_Int32 nValue = 0;
rValue >>= nValue; rValue >>= nValue;
const AlignmentTranslationEntry* pTranslation = AlignmentTranslations; 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; rValue <<= pTranslation->nControlValue;
return; return;
......
...@@ -111,7 +111,7 @@ bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any ...@@ -111,7 +111,7 @@ bool XMLLastLineAdjustPropHdl::exportXML( OUString& rStrExpValue, const uno::Any
rValue >>= nVal; 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 ); bRet = SvXMLUnitConverter::convertEnum( aOut, (style::ParagraphAdjust)nVal, pXML_Para_Align_Last_Enum, XML_START );
rStrExpValue = aOut.makeStringAndClear(); rStrExpValue = aOut.makeStringAndClear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment