expose the SvXMLEnumMapEntry arrays in OEnumMapper
preparatory change to making SvXMLEnumMapEntry a template class for the "UNO scoped enum" change. But I think its an improvement by itself, there is no need to initialise these arrays on-demand, the compiler will do that at link time. Change-Id: I842c16b3ef44b9f5e1f0325b637d3f55f8bb5ebc Reviewed-on: https://gerrit.libreoffice.org/34721 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -60,7 +60,7 @@ namespace xmloff
|
||||
{
|
||||
case XML_TYPE_TEXT_ALIGN:
|
||||
if (!m_pTextAlignHandler)
|
||||
m_pTextAlignHandler = o3tl::make_unique<XMLConstantsPropertyHandler>(OEnumMapper::getEnumMap(OEnumMapper::epTextAlign), XML_TOKEN_INVALID );
|
||||
m_pTextAlignHandler = o3tl::make_unique<XMLConstantsPropertyHandler>(aTextAlignMap, XML_TOKEN_INVALID );
|
||||
pHandler = m_pTextAlignHandler.get();
|
||||
break;
|
||||
|
||||
@@ -90,13 +90,13 @@ namespace xmloff
|
||||
|
||||
case XML_TYPE_CONTROL_TEXT_EMPHASIZE:
|
||||
if (!m_pFontEmphasisHandler)
|
||||
m_pFontEmphasisHandler = o3tl::make_unique<XMLConstantsPropertyHandler>( OEnumMapper::getEnumMap(OEnumMapper::epFontEmphasis), XML_NONE );
|
||||
m_pFontEmphasisHandler = o3tl::make_unique<XMLConstantsPropertyHandler>( aFontEmphasisMap, XML_NONE );
|
||||
pHandler = m_pFontEmphasisHandler.get();
|
||||
break;
|
||||
|
||||
case XML_TYPE_TEXT_FONT_RELIEF:
|
||||
if (!m_pFontReliefHandler)
|
||||
m_pFontReliefHandler = o3tl::make_unique<XMLConstantsPropertyHandler>( OEnumMapper::getEnumMap(OEnumMapper::epFontRelief), XML_NONE );
|
||||
m_pFontReliefHandler = o3tl::make_unique<XMLConstantsPropertyHandler>( aFontReliefMap, XML_NONE );
|
||||
pHandler = m_pFontReliefHandler.get();
|
||||
break;
|
||||
case XML_TYPE_TEXT_LINE_MODE:
|
||||
@@ -129,7 +129,7 @@ namespace xmloff
|
||||
bool bBelow = 0 != (nFontEmphasis & awt::FontEmphasisMark::BELOW);
|
||||
|
||||
// convert
|
||||
bSuccess = SvXMLUnitConverter::convertEnum(aReturn, nType, OEnumMapper::getEnumMap(OEnumMapper::epFontEmphasis), XML_NONE);
|
||||
bSuccess = SvXMLUnitConverter::convertEnum(aReturn, nType, aFontEmphasisMap, XML_NONE);
|
||||
if (bSuccess)
|
||||
{
|
||||
aReturn.append( ' ' );
|
||||
@@ -169,7 +169,7 @@ namespace xmloff
|
||||
}
|
||||
if (!bHasType)
|
||||
{
|
||||
if (SvXMLUnitConverter::convertEnum(nEmphasis, sToken, OEnumMapper::getEnumMap(OEnumMapper::epFontEmphasis)))
|
||||
if (SvXMLUnitConverter::convertEnum(nEmphasis, sToken, aFontEmphasisMap))
|
||||
{
|
||||
bHasType = true;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ namespace xmloff
|
||||
if ( m_eFacet == STYLE )
|
||||
{
|
||||
// is it a valid enum value?
|
||||
if ( SvXMLUnitConverter::convertEnum( nStyle, sToken, OEnumMapper::getEnumMap( OEnumMapper::epBorderWidth ) ) )
|
||||
if ( SvXMLUnitConverter::convertEnum( nStyle, sToken, aBorderTypeMap ) )
|
||||
{
|
||||
_rValue <<= nStyle;
|
||||
return true;
|
||||
@@ -244,7 +244,7 @@ namespace xmloff
|
||||
{
|
||||
sal_Int16 nBorder = 0;
|
||||
bSuccess = (_rValue >>= nBorder)
|
||||
&& SvXMLUnitConverter::convertEnum( aOut, nBorder, OEnumMapper::getEnumMap( OEnumMapper::epBorderWidth ) );
|
||||
&& SvXMLUnitConverter::convertEnum( aOut, nBorder, aBorderTypeMap );
|
||||
}
|
||||
break;
|
||||
case COLOR:
|
||||
@@ -335,7 +335,7 @@ namespace xmloff
|
||||
|
||||
//= ImageScaleModeHandler
|
||||
ImageScaleModeHandler::ImageScaleModeHandler()
|
||||
:XMLConstantsPropertyHandler( OEnumMapper::getEnumMap( OEnumMapper::epImageScaleMode ), XML_STRETCH )
|
||||
:XMLConstantsPropertyHandler( aScaleModeMap, XML_STRETCH )
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -649,7 +649,7 @@ namespace xmloff
|
||||
OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::ButtonType),
|
||||
OAttributeMetaData::getCommonControlAttributeName(CCAFlags::ButtonType),
|
||||
PROPERTY_BUTTONTYPE,
|
||||
OEnumMapper::getEnumMap(OEnumMapper::epButtonType),
|
||||
aFormButtonTypeMap,
|
||||
FormButtonType_PUSH);
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
// reset the bit for later checking
|
||||
@@ -662,7 +662,7 @@ namespace xmloff
|
||||
OAttributeMetaData::getCommonControlAttributeNamespace( CCAFlags::Orientation ),
|
||||
OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ),
|
||||
PROPERTY_ORIENTATION,
|
||||
OEnumMapper::getEnumMap( OEnumMapper::epOrientation ),
|
||||
aOrientationMap,
|
||||
ScrollBarOrientation::HORIZONTAL
|
||||
);
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
@@ -677,7 +677,7 @@ namespace xmloff
|
||||
OAttributeMetaData::getCommonControlAttributeNamespace( CCAFlags::VisualEffect ),
|
||||
OAttributeMetaData::getCommonControlAttributeName( CCAFlags::VisualEffect ),
|
||||
PROPERTY_VISUAL_EFFECT,
|
||||
OEnumMapper::getEnumMap( OEnumMapper::epVisualEffect ),
|
||||
aVisualEffectMap,
|
||||
VisualEffect::LOOK3D
|
||||
);
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
@@ -876,7 +876,7 @@ namespace xmloff
|
||||
OAttributeMetaData::getDatabaseAttributeNamespace(DAFlags::ListSource_TYPE),
|
||||
OAttributeMetaData::getDatabaseAttributeName(DAFlags::ListSource_TYPE),
|
||||
PROPERTY_LISTSOURCETYPE,
|
||||
OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
|
||||
aListSourceTypeMap,
|
||||
ListSourceType_VALUELIST
|
||||
);
|
||||
RESET_BIT( nIncludeDatabase, DAFlags::ListSource_TYPE );
|
||||
@@ -1072,7 +1072,7 @@ namespace xmloff
|
||||
OAttributeMetaData::getSpecialAttributeNamespace(SCAFlags::State),
|
||||
OAttributeMetaData::getSpecialAttributeName(SCAFlags::State),
|
||||
PROPERTY_DEFAULT_STATE,
|
||||
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
||||
aCheckStateMap,
|
||||
TRISTATE_FALSE);
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
// reset the bit for later checking
|
||||
@@ -1086,7 +1086,7 @@ namespace xmloff
|
||||
OAttributeMetaData::getSpecialAttributeNamespace(SCAFlags::CurrentState),
|
||||
OAttributeMetaData::getSpecialAttributeName(SCAFlags::CurrentState),
|
||||
PROPERTY_STATE,
|
||||
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
||||
aCheckStateMap,
|
||||
TRISTATE_FALSE);
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
// reset the bit for later checking
|
||||
@@ -1785,7 +1785,7 @@ namespace xmloff
|
||||
SvXMLUnitConverter::convertEnum(
|
||||
sBuffer,
|
||||
(sal_uInt16)nLinkageType,
|
||||
OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType )
|
||||
aListLinkageMap
|
||||
);
|
||||
|
||||
AddAttribute(
|
||||
@@ -2158,44 +2158,46 @@ namespace xmloff
|
||||
|
||||
// the enum properties
|
||||
{
|
||||
static const FormAttributes eEnumPropertyIds[] =
|
||||
{
|
||||
faEnctype, faMethod, faCommandType, faNavigationMode, faTabbingCycle
|
||||
};
|
||||
static const char * pEnumPropertyNames[] =
|
||||
{
|
||||
PROPERTY_SUBMIT_ENCODING, PROPERTY_SUBMIT_METHOD, PROPERTY_COMMAND_TYPE, PROPERTY_NAVIGATION, PROPERTY_CYCLE
|
||||
};
|
||||
static const OEnumMapper::EnumProperties eEnumPropertyMaps[] =
|
||||
{
|
||||
OEnumMapper::epSubmitEncoding, OEnumMapper::epSubmitMethod, OEnumMapper::epCommandType, OEnumMapper::epNavigationType, OEnumMapper::epTabCyle
|
||||
};
|
||||
static const sal_Int32 nEnumPropertyAttrDefaults[] =
|
||||
{
|
||||
FormSubmitEncoding_URL, FormSubmitMethod_GET, CommandType::COMMAND, NavigationBarMode_CURRENT, TabulatorCycle_RECORDS
|
||||
};
|
||||
static const bool nEnumPropertyAttrDefaultFlags[] =
|
||||
{
|
||||
false, false, false, false, true
|
||||
};
|
||||
static const sal_Int32 nIdCount = SAL_N_ELEMENTS(eEnumPropertyIds);
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
static const sal_Int32 nNameCount = SAL_N_ELEMENTS(pEnumPropertyNames);
|
||||
static const sal_Int32 nDefaultCount = SAL_N_ELEMENTS(nEnumPropertyAttrDefaults);
|
||||
static const sal_Int32 nDefaultFlagCount = SAL_N_ELEMENTS(nEnumPropertyAttrDefaultFlags);
|
||||
static const sal_Int32 nMapCount = SAL_N_ELEMENTS(eEnumPropertyMaps);
|
||||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount) && (nDefaultCount == nDefaultFlagCount) && (nDefaultFlagCount == nMapCount),
|
||||
"OFormExport::exportAttributes: somebody tampered with the maps (3)!");
|
||||
#endif
|
||||
for (i=0; i<nIdCount; ++i)
|
||||
exportEnumPropertyAttribute(
|
||||
OAttributeMetaData::getFormAttributeNamespace(eEnumPropertyIds[i]),
|
||||
OAttributeMetaData::getFormAttributeName(eEnumPropertyIds[i]),
|
||||
OUString::createFromAscii(pEnumPropertyNames[i]),
|
||||
OEnumMapper::getEnumMap(eEnumPropertyMaps[i]),
|
||||
nEnumPropertyAttrDefaults[i],
|
||||
nEnumPropertyAttrDefaultFlags[i]
|
||||
);
|
||||
exportEnumPropertyAttribute(
|
||||
OAttributeMetaData::getFormAttributeNamespace(faEnctype),
|
||||
OAttributeMetaData::getFormAttributeName(faEnctype),
|
||||
PROPERTY_SUBMIT_ENCODING,
|
||||
aSubmitEncodingMap,
|
||||
FormSubmitEncoding_URL,
|
||||
false
|
||||
);
|
||||
exportEnumPropertyAttribute(
|
||||
OAttributeMetaData::getFormAttributeNamespace(faMethod),
|
||||
OAttributeMetaData::getFormAttributeName(faMethod),
|
||||
PROPERTY_SUBMIT_METHOD,
|
||||
aSubmitMethodMap,
|
||||
FormSubmitMethod_GET,
|
||||
false
|
||||
);
|
||||
exportEnumPropertyAttribute(
|
||||
OAttributeMetaData::getFormAttributeNamespace(faCommandType),
|
||||
OAttributeMetaData::getFormAttributeName(faCommandType),
|
||||
PROPERTY_COMMAND_TYPE,
|
||||
aCommandTypeMap,
|
||||
CommandType::COMMAND,
|
||||
false
|
||||
);
|
||||
exportEnumPropertyAttribute(
|
||||
OAttributeMetaData::getFormAttributeNamespace(faNavigationMode),
|
||||
OAttributeMetaData::getFormAttributeName(faNavigationMode),
|
||||
PROPERTY_NAVIGATION,
|
||||
aNavigationTypeMap,
|
||||
NavigationBarMode_CURRENT,
|
||||
false
|
||||
);
|
||||
exportEnumPropertyAttribute(
|
||||
OAttributeMetaData::getFormAttributeNamespace(faTabbingCycle),
|
||||
OAttributeMetaData::getFormAttributeName(faTabbingCycle),
|
||||
PROPERTY_CYCLE,
|
||||
aTabulatorCycleMap,
|
||||
TabulatorCycle_RECORDS,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// the service name
|
||||
|
@@ -1133,7 +1133,7 @@ namespace xmloff
|
||||
{
|
||||
OSL_VERIFY( PropertyConversion::convertString(
|
||||
cppu::UnoType<decltype(m_nImagePosition)>::get(),
|
||||
_rValue, OEnumMapper::getEnumMap( OEnumMapper::epImagePosition )
|
||||
_rValue, aImagePositionMap
|
||||
) >>= m_nImagePosition );
|
||||
m_bHaveImagePosition = true;
|
||||
return true;
|
||||
@@ -1143,7 +1143,7 @@ namespace xmloff
|
||||
{
|
||||
OSL_VERIFY( PropertyConversion::convertString(
|
||||
cppu::UnoType<decltype(m_nImageAlign)>::get(),
|
||||
_rValue, OEnumMapper::getEnumMap( OEnumMapper::epImageAlign )
|
||||
_rValue, aImageAlignMap
|
||||
) >>= m_nImageAlign );
|
||||
return true;
|
||||
}
|
||||
@@ -1679,7 +1679,7 @@ namespace xmloff
|
||||
PropertyConversion::convertString(
|
||||
::cppu::UnoType<sal_Int16>::get(),
|
||||
_rValue,
|
||||
OEnumMapper::getEnumMap( OEnumMapper::epListLinkageType )
|
||||
aListLinkageMap
|
||||
) >>= nLinkageType;
|
||||
|
||||
m_bLinkWithIndexes = ( nLinkageType != 0 );
|
||||
|
@@ -45,103 +45,48 @@ namespace xmloff
|
||||
using namespace ::com::sun::star;
|
||||
using namespace ::xmloff::token;
|
||||
|
||||
const SvXMLEnumMapEntry* OEnumMapper::s_pEnumMap[OEnumMapper::KNOWN_ENUM_PROPERTIES] =
|
||||
{
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr
|
||||
};
|
||||
|
||||
const SvXMLEnumMapEntry* OEnumMapper::getEnumMap(EnumProperties _eProperty)
|
||||
{
|
||||
OSL_ENSURE(_eProperty < KNOWN_ENUM_PROPERTIES, "OEnumMapper::getEnumMap: invalid index (this will crash)!");
|
||||
|
||||
const SvXMLEnumMapEntry*& rReturn = s_pEnumMap[_eProperty];
|
||||
if (!rReturn)
|
||||
{
|
||||
// the map for this property is not initialized yet
|
||||
switch (_eProperty)
|
||||
{
|
||||
// FormSubmitEncoding
|
||||
case epSubmitEncoding:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aSubmitEncodingMap[] =
|
||||
const SvXMLEnumMapEntry aSubmitEncodingMap[] =
|
||||
{
|
||||
{ XML_APPLICATION_X_WWW_FORM_URLENCODED, FormSubmitEncoding_URL },
|
||||
{ XML_MULTIPART_FORMDATA, FormSubmitEncoding_MULTIPART },
|
||||
{ XML_APPLICATION_TEXT, FormSubmitEncoding_TEXT },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aSubmitEncodingMap;
|
||||
}
|
||||
break;
|
||||
// FormSubmitMethod
|
||||
case epSubmitMethod:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aSubmitMethodMap[] =
|
||||
// FormSubmitMethod
|
||||
const SvXMLEnumMapEntry aSubmitMethodMap[] =
|
||||
{
|
||||
{ XML_GET, FormSubmitMethod_GET },
|
||||
{ XML_POST, FormSubmitMethod_POST },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aSubmitMethodMap;
|
||||
}
|
||||
break;
|
||||
|
||||
// CommandType
|
||||
case epCommandType:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aCommandTypeMap[] =
|
||||
const SvXMLEnumMapEntry aCommandTypeMap[] =
|
||||
{
|
||||
{ XML_TABLE, CommandType::TABLE },
|
||||
{ XML_QUERY, CommandType::QUERY },
|
||||
{ XML_COMMAND, CommandType::COMMAND },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aCommandTypeMap;
|
||||
}
|
||||
break;
|
||||
// NavigationBarMode
|
||||
case epNavigationType:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aNavigationTypeMap[] =
|
||||
const SvXMLEnumMapEntry aNavigationTypeMap[] =
|
||||
{
|
||||
{ XML_NONE, NavigationBarMode_NONE },
|
||||
{ XML_CURRENT, NavigationBarMode_CURRENT },
|
||||
{ XML_PARENT, NavigationBarMode_PARENT },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aNavigationTypeMap;
|
||||
};
|
||||
break;
|
||||
// TabulatorCycle
|
||||
case epTabCyle:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aTabulytorCycleMap[] =
|
||||
const SvXMLEnumMapEntry aTabulatorCycleMap[] =
|
||||
{
|
||||
{ XML_RECORDS, TabulatorCycle_RECORDS },
|
||||
{ XML_CURRENT, TabulatorCycle_CURRENT },
|
||||
{ XML_PAGE, TabulatorCycle_PAGE },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aTabulytorCycleMap;
|
||||
};
|
||||
break;
|
||||
// FormButtonType
|
||||
case epButtonType:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aFormButtonTypeMap[] =
|
||||
const SvXMLEnumMapEntry aFormButtonTypeMap[] =
|
||||
{
|
||||
{ XML_PUSH, FormButtonType_PUSH },
|
||||
{ XML_SUBMIT, FormButtonType_SUBMIT },
|
||||
@@ -149,13 +94,8 @@ namespace xmloff
|
||||
{ XML_URL, FormButtonType_URL },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aFormButtonTypeMap;
|
||||
};
|
||||
break;
|
||||
// ListSourceType
|
||||
case epListSourceType:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aListSourceTypeMap[] =
|
||||
const SvXMLEnumMapEntry aListSourceTypeMap[] =
|
||||
{
|
||||
{ XML_VALUE_LIST, ListSourceType_VALUELIST },
|
||||
{ XML_TABLE, ListSourceType_TABLE },
|
||||
@@ -165,25 +105,15 @@ namespace xmloff
|
||||
{ XML_TABLE_FIELDS, ListSourceType_TABLEFIELDS },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aListSourceTypeMap;
|
||||
};
|
||||
break;
|
||||
// check state of a checkbox
|
||||
case epCheckState:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aCheckStateMap[] =
|
||||
const SvXMLEnumMapEntry aCheckStateMap[] =
|
||||
{
|
||||
{ XML_UNCHECKED, TRISTATE_FALSE },
|
||||
{ XML_CHECKED, TRISTATE_TRUE },
|
||||
{ XML_UNKNOWN, TRISTATE_INDET },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aCheckStateMap;
|
||||
};
|
||||
break;
|
||||
case epTextAlign:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aTextAlignMap[] =
|
||||
const SvXMLEnumMapEntry aTextAlignMap[] =
|
||||
{
|
||||
{ XML_START, awt::TextAlign::LEFT },
|
||||
{ XML_CENTER, awt::TextAlign::CENTER },
|
||||
@@ -192,12 +122,7 @@ namespace xmloff
|
||||
{ XML_JUSTIFIED, (sal_uInt16)-1 },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aTextAlignMap;
|
||||
};
|
||||
break;
|
||||
case epBorderWidth:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aBorderTypeMap[] =
|
||||
const SvXMLEnumMapEntry aBorderTypeMap[] =
|
||||
{
|
||||
{ XML_NONE, 0 },
|
||||
{ XML_HIDDEN, 0 },
|
||||
@@ -211,13 +136,7 @@ namespace xmloff
|
||||
{ XML_OUTSET, 1 },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aBorderTypeMap;
|
||||
};
|
||||
break;
|
||||
|
||||
case epFontEmphasis:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aFontEmphasisMap[] =
|
||||
const SvXMLEnumMapEntry aFontEmphasisMap[] =
|
||||
{
|
||||
{ XML_NONE, awt::FontEmphasisMark::NONE },
|
||||
{ XML_DOT, awt::FontEmphasisMark::DOT },
|
||||
@@ -226,63 +145,33 @@ namespace xmloff
|
||||
{ XML_ACCENT, awt::FontEmphasisMark::ACCENT },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aFontEmphasisMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epFontRelief:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aFontReliefMap[] =
|
||||
const SvXMLEnumMapEntry aFontReliefMap[] =
|
||||
{
|
||||
{ XML_NONE, FontRelief::NONE },
|
||||
{ XML_ENGRAVED, FontRelief::ENGRAVED },
|
||||
{ XML_EMBOSSED, FontRelief::EMBOSSED },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aFontReliefMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epListLinkageType:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aListLinkageMap[] =
|
||||
const SvXMLEnumMapEntry aListLinkageMap[] =
|
||||
{
|
||||
{ XML_SELECTION, 0 },
|
||||
{ XML_SELECTION_INDEXES, 1 },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aListLinkageMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epOrientation:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aOrientationMap[] =
|
||||
const SvXMLEnumMapEntry aOrientationMap[] =
|
||||
{
|
||||
{ XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL },
|
||||
{ XML_VERTICAL, ScrollBarOrientation::VERTICAL },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aOrientationMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epVisualEffect:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aVisualEffectMap[] =
|
||||
const SvXMLEnumMapEntry aVisualEffectMap[] =
|
||||
{
|
||||
{ XML_NONE, VisualEffect::NONE },
|
||||
{ XML_3D, VisualEffect::LOOK3D },
|
||||
{ XML_FLAT, VisualEffect::FLAT },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aVisualEffectMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epImagePosition:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aImagePositionMap[] =
|
||||
const SvXMLEnumMapEntry aImagePositionMap[] =
|
||||
{
|
||||
{ XML_START, 0 },
|
||||
{ XML_END, 1 },
|
||||
@@ -291,26 +180,14 @@ namespace xmloff
|
||||
{ XML_CENTER, (sal_uInt16)-1 },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aImagePositionMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epImageAlign:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aImageAlignMap[] =
|
||||
const SvXMLEnumMapEntry aImageAlignMap[] =
|
||||
{
|
||||
{ XML_START, 0 },
|
||||
{ XML_CENTER, 1 },
|
||||
{ XML_END, 2 },
|
||||
{ XML_TOKEN_INVALID, 0 }
|
||||
};
|
||||
rReturn = aImageAlignMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case epImageScaleMode:
|
||||
{
|
||||
static const SvXMLEnumMapEntry aScaleModeMap[] =
|
||||
const SvXMLEnumMapEntry aScaleModeMap[] =
|
||||
{
|
||||
{ XML_BACKGROUND_NO_REPEAT, ImageScaleMode::NONE },
|
||||
{ XML_REPEAT, ImageScaleMode::NONE }, // repeating the image is not supported
|
||||
@@ -318,17 +195,6 @@ namespace xmloff
|
||||
{ XML_SCALE, ImageScaleMode::ISOTROPIC },
|
||||
{ XML_TOKEN_INVALID, ImageScaleMode::NONE }
|
||||
};
|
||||
rReturn = aScaleModeMap;
|
||||
}
|
||||
break;
|
||||
|
||||
case KNOWN_ENUM_PROPERTIES:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rReturn;
|
||||
}
|
||||
|
||||
} // namespace xmloff
|
||||
|
||||
|
@@ -25,40 +25,24 @@
|
||||
namespace xmloff
|
||||
{
|
||||
|
||||
//= OEnumMapper
|
||||
class OEnumMapper
|
||||
{
|
||||
public:
|
||||
enum EnumProperties
|
||||
{
|
||||
epSubmitEncoding = 0,
|
||||
epSubmitMethod,
|
||||
epCommandType,
|
||||
epNavigationType,
|
||||
epTabCyle,
|
||||
epButtonType,
|
||||
epListSourceType,
|
||||
epCheckState,
|
||||
epTextAlign,
|
||||
epBorderWidth,
|
||||
epFontEmphasis,
|
||||
epFontRelief,
|
||||
epListLinkageType,
|
||||
epOrientation,
|
||||
epVisualEffect,
|
||||
epImagePosition,
|
||||
epImageAlign,
|
||||
epImageScaleMode,
|
||||
|
||||
KNOWN_ENUM_PROPERTIES
|
||||
};
|
||||
|
||||
private:
|
||||
static const SvXMLEnumMapEntry* s_pEnumMap[KNOWN_ENUM_PROPERTIES];
|
||||
|
||||
public:
|
||||
static const SvXMLEnumMapEntry* getEnumMap(EnumProperties _eProperty);
|
||||
};
|
||||
extern const SvXMLEnumMapEntry aSubmitEncodingMap[];
|
||||
extern const SvXMLEnumMapEntry aSubmitMethodMap[];
|
||||
extern const SvXMLEnumMapEntry aCommandTypeMap[];
|
||||
extern const SvXMLEnumMapEntry aNavigationTypeMap[];
|
||||
extern const SvXMLEnumMapEntry aTabulatorCycleMap[];
|
||||
extern const SvXMLEnumMapEntry aFormButtonTypeMap[];
|
||||
extern const SvXMLEnumMapEntry aListSourceTypeMap[];
|
||||
extern const SvXMLEnumMapEntry aCheckStateMap[];
|
||||
extern const SvXMLEnumMapEntry aTextAlignMap[];
|
||||
extern const SvXMLEnumMapEntry aBorderTypeMap[];
|
||||
extern const SvXMLEnumMapEntry aFontEmphasisMap[];
|
||||
extern const SvXMLEnumMapEntry aFontReliefMap[];
|
||||
extern const SvXMLEnumMapEntry aListLinkageMap[];
|
||||
extern const SvXMLEnumMapEntry aOrientationMap[];
|
||||
extern const SvXMLEnumMapEntry aVisualEffectMap[];
|
||||
extern const SvXMLEnumMapEntry aImagePositionMap[];
|
||||
extern const SvXMLEnumMapEntry aImageAlignMap[];
|
||||
extern const SvXMLEnumMapEntry aScaleModeMap[];
|
||||
|
||||
} // namespace xmloff
|
||||
|
||||
|
@@ -179,46 +179,46 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
|
||||
// the enum attributes
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getCommonControlAttributeName( CCAFlags::VisualEffect ), PROPERTY_VISUAL_EFFECT,
|
||||
VisualEffect::LOOK3D, OEnumMapper::getEnumMap( OEnumMapper::epVisualEffect ),
|
||||
VisualEffect::LOOK3D, aVisualEffectMap,
|
||||
&::cppu::UnoType<sal_Int16>::get() );
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getCommonControlAttributeName( CCAFlags::Orientation ), PROPERTY_ORIENTATION,
|
||||
ScrollBarOrientation::HORIZONTAL, OEnumMapper::getEnumMap( OEnumMapper::epOrientation ),
|
||||
ScrollBarOrientation::HORIZONTAL, aOrientationMap,
|
||||
&::cppu::UnoType<sal_Int32>::get() );
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getCommonControlAttributeName(CCAFlags::ButtonType), PROPERTY_BUTTONTYPE,
|
||||
FormButtonType_PUSH, OEnumMapper::getEnumMap(OEnumMapper::epButtonType),
|
||||
FormButtonType_PUSH, aFormButtonTypeMap,
|
||||
&::cppu::UnoType<FormButtonType>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getDatabaseAttributeName(DAFlags::ListSource_TYPE), PROPERTY_LISTSOURCETYPE,
|
||||
ListSourceType_VALUELIST, OEnumMapper::getEnumMap(OEnumMapper::epListSourceType),
|
||||
ListSourceType_VALUELIST, aListSourceTypeMap,
|
||||
&::cppu::UnoType<ListSourceType>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getSpecialAttributeName(SCAFlags::State), PROPERTY_DEFAULT_STATE, TRISTATE_FALSE,
|
||||
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
||||
aCheckStateMap,
|
||||
&::cppu::UnoType<sal_Int16>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getSpecialAttributeName(SCAFlags::CurrentState), PROPERTY_STATE, TRISTATE_FALSE,
|
||||
OEnumMapper::getEnumMap(OEnumMapper::epCheckState),
|
||||
aCheckStateMap,
|
||||
&::cppu::UnoType<sal_Int16>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getFormAttributeName(faEnctype), PROPERTY_SUBMIT_ENCODING,
|
||||
FormSubmitEncoding_URL, OEnumMapper::getEnumMap(OEnumMapper::epSubmitEncoding),
|
||||
FormSubmitEncoding_URL, aSubmitEncodingMap,
|
||||
&::cppu::UnoType<FormSubmitEncoding>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getFormAttributeName(faMethod), PROPERTY_SUBMIT_METHOD,
|
||||
FormSubmitMethod_GET, OEnumMapper::getEnumMap(OEnumMapper::epSubmitMethod),
|
||||
FormSubmitMethod_GET, aSubmitMethodMap,
|
||||
&::cppu::UnoType<FormSubmitMethod>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getFormAttributeName(faCommandType), PROPERTY_COMMAND_TYPE,
|
||||
CommandType::COMMAND, OEnumMapper::getEnumMap(OEnumMapper::epCommandType));
|
||||
CommandType::COMMAND, aCommandTypeMap);
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getFormAttributeName(faNavigationMode), PROPERTY_NAVIGATION,
|
||||
NavigationBarMode_NONE, OEnumMapper::getEnumMap(OEnumMapper::epNavigationType),
|
||||
NavigationBarMode_NONE, aNavigationTypeMap,
|
||||
&::cppu::UnoType<NavigationBarMode>::get());
|
||||
m_aAttributeMetaData.addEnumProperty(
|
||||
OAttributeMetaData::getFormAttributeName(faTabbingCycle), PROPERTY_CYCLE,
|
||||
TabulatorCycle_RECORDS, OEnumMapper::getEnumMap(OEnumMapper::epTabCyle),
|
||||
TabulatorCycle_RECORDS, aTabulatorCycleMap,
|
||||
&::cppu::UnoType<TabulatorCycle>::get());
|
||||
|
||||
// 'initialize'
|
||||
|
Reference in New Issue
Block a user