convert AttributeType to scoped enum

and drop unused CHAR_ROTATION enumerator

Change-Id: I9ca50aef41fa736c7f34c210844fb54f60f5bca8
This commit is contained in:
Noel Grandin 2017-02-14 15:58:33 +02:00
parent 0102b85e4e
commit 2a89b42e7d
3 changed files with 181 additions and 200 deletions

View File

@ -734,56 +734,54 @@ namespace slideshow
{
default:
// FALLTHROUGH intended
case ATTRIBUTE_INVALID:
case AttributeType::Invalid:
return CLASS_UNKNOWN_PROPERTY;
case ATTRIBUTE_CHAR_COLOR:
case AttributeType::CharColor:
// FALLTHROUGH intended
case ATTRIBUTE_COLOR:
case AttributeType::Color:
// FALLTHROUGH intended
case ATTRIBUTE_DIMCOLOR:
case AttributeType::DimColor:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_COLOR:
case AttributeType::FillColor:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_COLOR:
case AttributeType::LineColor:
return CLASS_COLOR_PROPERTY;
case ATTRIBUTE_CHAR_FONT_NAME:
case AttributeType::CharFontName:
return CLASS_STRING_PROPERTY;
case ATTRIBUTE_VISIBILITY:
case AttributeType::Visibility:
return CLASS_BOOL_PROPERTY;
case ATTRIBUTE_CHAR_HEIGHT:
case AttributeType::CharHeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_WEIGHT:
case AttributeType::CharWeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_ROTATION:
case AttributeType::Height:
// FALLTHROUGH intended
case ATTRIBUTE_HEIGHT:
case AttributeType::Opacity:
// FALLTHROUGH intended
case ATTRIBUTE_OPACITY:
case AttributeType::Rotate:
// FALLTHROUGH intended
case ATTRIBUTE_ROTATE:
case AttributeType::SkewX:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_X:
case AttributeType::SkewY:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_Y:
case AttributeType::Width:
// FALLTHROUGH intended
case ATTRIBUTE_WIDTH:
case AttributeType::PosX:
// FALLTHROUGH intended
case ATTRIBUTE_POS_X:
// FALLTHROUGH intended
case ATTRIBUTE_POS_Y:
case AttributeType::PosY:
return CLASS_NUMBER_PROPERTY;
case ATTRIBUTE_CHAR_UNDERLINE:
case AttributeType::CharUnderline:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_STYLE:
case AttributeType::FillStyle:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_STYLE:
case AttributeType::LineStyle:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_POSTURE:
case AttributeType::CharPosture:
return CLASS_ENUM_PROPERTY;
}
}
@ -800,37 +798,37 @@ namespace slideshow
{
default:
// FALLTHROUGH intended
case ATTRIBUTE_INVALID:
case AttributeType::Invalid:
ENSURE_OR_THROW( false,
"AnimationFactory::createNumberPropertyAnimation(): Unknown attribute" );
break;
case ATTRIBUTE_CHAR_COLOR:
case AttributeType::CharColor:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_FONT_NAME:
case AttributeType::CharFontName:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_POSTURE:
case AttributeType::CharPosture:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_UNDERLINE:
case AttributeType::CharUnderline:
// FALLTHROUGH intended
case ATTRIBUTE_COLOR:
case AttributeType::Color:
// FALLTHROUGH intended
case ATTRIBUTE_DIMCOLOR:
case AttributeType::DimColor:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_COLOR:
case AttributeType::FillColor:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_STYLE:
case AttributeType::FillStyle:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_COLOR:
case AttributeType::LineColor:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_STYLE:
case AttributeType::LineStyle:
// FALLTHROUGH intended
case ATTRIBUTE_VISIBILITY:
case AttributeType::Visibility:
ENSURE_OR_THROW( false,
"AnimationFactory::createNumberPropertyAnimation(): Attribute type mismatch" );
break;
case ATTRIBUTE_CHAR_HEIGHT:
case AttributeType::CharHeight:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isCharScaleValid,
@ -839,7 +837,7 @@ namespace slideshow
&ShapeAttributeLayer::getCharScale,
&ShapeAttributeLayer::setCharScale );
case ATTRIBUTE_CHAR_WEIGHT:
case AttributeType::CharWeight:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isCharWeightValid,
@ -847,15 +845,7 @@ namespace slideshow
&ShapeAttributeLayer::getCharWeight,
&ShapeAttributeLayer::setCharWeight );
case ATTRIBUTE_CHAR_ROTATION:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isCharRotationAngleValid,
getDefault<double>( rShape, rAttrName ),
&ShapeAttributeLayer::getCharRotationAngle,
&ShapeAttributeLayer::setCharRotationAngle );
case ATTRIBUTE_HEIGHT:
case AttributeType::Height:
return makeGenericAnimation( rShapeManager,
nFlags,
&ShapeAttributeLayer::isHeightValid,
@ -869,7 +859,7 @@ namespace slideshow
// convert expression parser value from relative page size
rSlideSize.getY() );
case ATTRIBUTE_OPACITY:
case AttributeType::Opacity:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isAlphaValid,
@ -878,7 +868,7 @@ namespace slideshow
&ShapeAttributeLayer::getAlpha,
&ShapeAttributeLayer::setAlpha );
case ATTRIBUTE_ROTATE:
case AttributeType::Rotate:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isRotationAngleValid,
@ -888,7 +878,7 @@ namespace slideshow
&ShapeAttributeLayer::getRotationAngle,
&ShapeAttributeLayer::setRotationAngle );
case ATTRIBUTE_SKEW_X:
case AttributeType::SkewX:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isShearXAngleValid,
@ -897,7 +887,7 @@ namespace slideshow
&ShapeAttributeLayer::getShearXAngle,
&ShapeAttributeLayer::setShearXAngle );
case ATTRIBUTE_SKEW_Y:
case AttributeType::SkewY:
return makeGenericAnimation<NumberAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isShearYAngleValid,
@ -906,7 +896,7 @@ namespace slideshow
&ShapeAttributeLayer::getShearYAngle,
&ShapeAttributeLayer::setShearYAngle );
case ATTRIBUTE_WIDTH:
case AttributeType::Width:
return makeGenericAnimation( rShapeManager,
nFlags,
&ShapeAttributeLayer::isWidthValid,
@ -920,7 +910,7 @@ namespace slideshow
// convert expression parser value from relative page size
rSlideSize.getX() );
case ATTRIBUTE_POS_X:
case AttributeType::PosX:
return makeGenericAnimation( rShapeManager,
nFlags,
&ShapeAttributeLayer::isPosXValid,
@ -934,7 +924,7 @@ namespace slideshow
// convert expression parser value from relative page size
rSlideSize.getX() );
case ATTRIBUTE_POS_Y:
case AttributeType::PosY:
return makeGenericAnimation( rShapeManager,
nFlags,
&ShapeAttributeLayer::isPosYValid,
@ -964,52 +954,50 @@ namespace slideshow
{
default:
// FALLTHROUGH intended
case ATTRIBUTE_INVALID:
case AttributeType::Invalid:
ENSURE_OR_THROW( false,
"AnimationFactory::createEnumPropertyAnimation(): Unknown attribute" );
break;
case ATTRIBUTE_CHAR_COLOR:
case AttributeType::CharColor:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_FONT_NAME:
case AttributeType::CharFontName:
// FALLTHROUGH intended
case ATTRIBUTE_COLOR:
case AttributeType::Color:
// FALLTHROUGH intended
case ATTRIBUTE_DIMCOLOR:
case AttributeType::DimColor:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_COLOR:
case AttributeType::FillColor:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_COLOR:
case AttributeType::LineColor:
// FALLTHROUGH intended
case ATTRIBUTE_VISIBILITY:
case AttributeType::Visibility:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_HEIGHT:
case AttributeType::CharHeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_WEIGHT:
case AttributeType::CharWeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_ROTATION:
case AttributeType::Height:
// FALLTHROUGH intended
case ATTRIBUTE_HEIGHT:
case AttributeType::Opacity:
// FALLTHROUGH intended
case ATTRIBUTE_OPACITY:
case AttributeType::Rotate:
// FALLTHROUGH intended
case ATTRIBUTE_ROTATE:
case AttributeType::SkewX:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_X:
case AttributeType::SkewY:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_Y:
case AttributeType::Width:
// FALLTHROUGH intended
case ATTRIBUTE_WIDTH:
case AttributeType::PosX:
// FALLTHROUGH intended
case ATTRIBUTE_POS_X:
// FALLTHROUGH intended
case ATTRIBUTE_POS_Y:
case AttributeType::PosY:
ENSURE_OR_THROW( false,
"AnimationFactory::createEnumPropertyAnimation(): Attribute type mismatch" );
break;
case ATTRIBUTE_FILL_STYLE:
case AttributeType::FillStyle:
return makeGenericAnimation<EnumAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isFillStyleValid,
@ -1018,7 +1006,7 @@ namespace slideshow
&ShapeAttributeLayer::getFillStyle,
&ShapeAttributeLayer::setFillStyle );
case ATTRIBUTE_LINE_STYLE:
case AttributeType::LineStyle:
return makeGenericAnimation<EnumAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isLineStyleValid,
@ -1027,7 +1015,7 @@ namespace slideshow
&ShapeAttributeLayer::getLineStyle,
&ShapeAttributeLayer::setLineStyle );
case ATTRIBUTE_CHAR_POSTURE:
case AttributeType::CharPosture:
return makeGenericAnimation<EnumAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isCharPostureValid,
@ -1036,7 +1024,7 @@ namespace slideshow
&ShapeAttributeLayer::getCharPosture,
&ShapeAttributeLayer::setCharPosture );
case ATTRIBUTE_CHAR_UNDERLINE:
case AttributeType::CharUnderline:
return makeGenericAnimation<EnumAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isUnderlineModeValid,
@ -1060,49 +1048,47 @@ namespace slideshow
{
default:
// FALLTHROUGH intended
case ATTRIBUTE_INVALID:
case AttributeType::Invalid:
ENSURE_OR_THROW( false,
"AnimationFactory::createColorPropertyAnimation(): Unknown attribute" );
break;
case ATTRIBUTE_CHAR_FONT_NAME:
case AttributeType::CharFontName:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_HEIGHT:
case AttributeType::CharHeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_POSTURE:
case AttributeType::CharPosture:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_ROTATION:
case AttributeType::CharUnderline:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_UNDERLINE:
case AttributeType::CharWeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_WEIGHT:
case AttributeType::FillStyle:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_STYLE:
case AttributeType::Height:
// FALLTHROUGH intended
case ATTRIBUTE_HEIGHT:
case AttributeType::LineStyle:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_STYLE:
case AttributeType::Opacity:
// FALLTHROUGH intended
case ATTRIBUTE_OPACITY:
case AttributeType::Rotate:
// FALLTHROUGH intended
case ATTRIBUTE_ROTATE:
case AttributeType::SkewX:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_X:
case AttributeType::SkewY:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_Y:
case AttributeType::Visibility:
// FALLTHROUGH intended
case ATTRIBUTE_VISIBILITY:
case AttributeType::Width:
// FALLTHROUGH intended
case ATTRIBUTE_WIDTH:
case AttributeType::PosX:
// FALLTHROUGH intended
case ATTRIBUTE_POS_X:
// FALLTHROUGH intended
case ATTRIBUTE_POS_Y:
case AttributeType::PosY:
ENSURE_OR_THROW( false,
"AnimationFactory::createColorPropertyAnimation(): Attribute type mismatch" );
break;
case ATTRIBUTE_CHAR_COLOR:
case AttributeType::CharColor:
return makeGenericAnimation<ColorAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isCharColorValid,
@ -1110,7 +1096,7 @@ namespace slideshow
&ShapeAttributeLayer::getCharColor,
&ShapeAttributeLayer::setCharColor );
case ATTRIBUTE_COLOR:
case AttributeType::Color:
// TODO(F2): This is just mapped to fill color to make it work
return makeGenericAnimation<ColorAnimation>( rShapeManager,
nFlags,
@ -1119,7 +1105,7 @@ namespace slideshow
&ShapeAttributeLayer::getFillColor,
&ShapeAttributeLayer::setFillColor );
case ATTRIBUTE_DIMCOLOR:
case AttributeType::DimColor:
return makeGenericAnimation<ColorAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isDimColorValid,
@ -1127,7 +1113,7 @@ namespace slideshow
&ShapeAttributeLayer::getDimColor,
&ShapeAttributeLayer::setDimColor );
case ATTRIBUTE_FILL_COLOR:
case AttributeType::FillColor:
return makeGenericAnimation<ColorAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isFillColorValid,
@ -1135,7 +1121,7 @@ namespace slideshow
&ShapeAttributeLayer::getFillColor,
&ShapeAttributeLayer::setFillColor );
case ATTRIBUTE_LINE_COLOR:
case AttributeType::LineColor:
return makeGenericAnimation<ColorAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isLineColorValid,
@ -1212,57 +1198,55 @@ namespace slideshow
{
default:
// FALLTHROUGH intended
case ATTRIBUTE_INVALID:
case AttributeType::Invalid:
ENSURE_OR_THROW( false,
"AnimationFactory::createStringPropertyAnimation(): Unknown attribute" );
break;
case ATTRIBUTE_CHAR_COLOR:
case AttributeType::CharColor:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_HEIGHT:
case AttributeType::CharHeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_ROTATION:
case AttributeType::CharUnderline:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_UNDERLINE:
case AttributeType::Color:
// FALLTHROUGH intended
case ATTRIBUTE_COLOR:
case AttributeType::DimColor:
// FALLTHROUGH intended
case ATTRIBUTE_DIMCOLOR:
case AttributeType::FillColor:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_COLOR:
case AttributeType::Height:
// FALLTHROUGH intended
case ATTRIBUTE_HEIGHT:
case AttributeType::LineColor:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_COLOR:
case AttributeType::Opacity:
// FALLTHROUGH intended
case ATTRIBUTE_OPACITY:
case AttributeType::Rotate:
// FALLTHROUGH intended
case ATTRIBUTE_ROTATE:
case AttributeType::SkewX:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_X:
case AttributeType::SkewY:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_Y:
case AttributeType::Visibility:
// FALLTHROUGH intended
case ATTRIBUTE_VISIBILITY:
case AttributeType::Width:
// FALLTHROUGH intended
case ATTRIBUTE_WIDTH:
case AttributeType::PosX:
// FALLTHROUGH intended
case ATTRIBUTE_POS_X:
case AttributeType::PosY:
// FALLTHROUGH intended
case ATTRIBUTE_POS_Y:
case AttributeType::CharPosture:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_POSTURE:
case AttributeType::CharWeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_WEIGHT:
case AttributeType::FillStyle:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_STYLE:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_STYLE:
case AttributeType::LineStyle:
ENSURE_OR_THROW( false,
"AnimationFactory::createStringPropertyAnimation(): Attribute type mismatch" );
break;
case ATTRIBUTE_CHAR_FONT_NAME:
case AttributeType::CharFontName:
return makeGenericAnimation<StringAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isFontFamilyValid,
@ -1286,57 +1270,55 @@ namespace slideshow
{
default:
// FALLTHROUGH intended
case ATTRIBUTE_INVALID:
case AttributeType::Invalid:
ENSURE_OR_THROW( false,
"AnimationFactory::createBoolPropertyAnimation(): Unknown attribute" );
break;
case ATTRIBUTE_CHAR_COLOR:
case AttributeType::CharColor:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_FONT_NAME:
case AttributeType::CharFontName:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_HEIGHT:
case AttributeType::CharHeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_POSTURE:
case AttributeType::CharPosture:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_ROTATION:
case AttributeType::CharWeight:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_WEIGHT:
case AttributeType::Color:
// FALLTHROUGH intended
case ATTRIBUTE_COLOR:
case AttributeType::DimColor:
// FALLTHROUGH intended
case ATTRIBUTE_DIMCOLOR:
case AttributeType::FillColor:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_COLOR:
case AttributeType::FillStyle:
// FALLTHROUGH intended
case ATTRIBUTE_FILL_STYLE:
case AttributeType::Height:
// FALLTHROUGH intended
case ATTRIBUTE_HEIGHT:
case AttributeType::LineColor:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_COLOR:
case AttributeType::LineStyle:
// FALLTHROUGH intended
case ATTRIBUTE_LINE_STYLE:
case AttributeType::Opacity:
// FALLTHROUGH intended
case ATTRIBUTE_OPACITY:
case AttributeType::Rotate:
// FALLTHROUGH intended
case ATTRIBUTE_ROTATE:
case AttributeType::SkewX:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_X:
case AttributeType::SkewY:
// FALLTHROUGH intended
case ATTRIBUTE_SKEW_Y:
case AttributeType::Width:
// FALLTHROUGH intended
case ATTRIBUTE_WIDTH:
case AttributeType::PosX:
// FALLTHROUGH intended
case ATTRIBUTE_POS_X:
case AttributeType::PosY:
// FALLTHROUGH intended
case ATTRIBUTE_POS_Y:
// FALLTHROUGH intended
case ATTRIBUTE_CHAR_UNDERLINE:
case AttributeType::CharUnderline:
ENSURE_OR_THROW( false,
"AnimationFactory::createBoolPropertyAnimation(): Attribute type mismatch" );
break;
case ATTRIBUTE_VISIBILITY:
case AttributeType::Visibility:
return makeGenericAnimation<BoolAnimation>( rShapeManager,
nFlags,
&ShapeAttributeLayer::isVisibilityValid,

View File

@ -41,44 +41,44 @@ namespace slideshow
*/
static const AnimateAttributeMap::MapEntry lcl_attributeMap[] =
{
{ "charcolor", ATTRIBUTE_CHAR_COLOR },
{ "charfontname", ATTRIBUTE_CHAR_FONT_NAME },
{ "charheight", ATTRIBUTE_CHAR_HEIGHT },
{ "charposture", ATTRIBUTE_CHAR_POSTURE },
{ "charcolor", AttributeType::CharColor },
{ "charfontname", AttributeType::CharFontName },
{ "charheight", AttributeType::CharHeight },
{ "charposture", AttributeType::CharPosture },
// TODO(Q1): This should prolly be changed in PPT import
// { "charrotation", ATTRIBUTE_CHAR_ROTATION },
{ "charrotation", ATTRIBUTE_ROTATE },
{ "charunderline", ATTRIBUTE_CHAR_UNDERLINE },
{ "charweight", ATTRIBUTE_CHAR_WEIGHT },
{ "color", ATTRIBUTE_COLOR },
{ "dimcolor", ATTRIBUTE_DIMCOLOR },
{ "fillcolor", ATTRIBUTE_FILL_COLOR },
{ "fillstyle", ATTRIBUTE_FILL_STYLE },
{ "height", ATTRIBUTE_HEIGHT },
{ "linecolor", ATTRIBUTE_LINE_COLOR },
{ "linestyle", ATTRIBUTE_LINE_STYLE },
{ "opacity", ATTRIBUTE_OPACITY },
{ "rotate", ATTRIBUTE_ROTATE },
{ "skewx", ATTRIBUTE_SKEW_X },
{ "skewy", ATTRIBUTE_SKEW_Y },
{ "visibility", ATTRIBUTE_VISIBILITY },
{ "width", ATTRIBUTE_WIDTH },
{ "x", ATTRIBUTE_POS_X },
{ "y", ATTRIBUTE_POS_Y }
// { "charrotation", AttributeType::CharRotation },
{ "charrotation", AttributeType::Rotate },
{ "charunderline", AttributeType::CharUnderline },
{ "charweight", AttributeType::CharWeight },
{ "color", AttributeType::Color },
{ "dimcolor", AttributeType::DimColor },
{ "fillcolor", AttributeType::FillColor },
{ "fillstyle", AttributeType::FillStyle },
{ "height", AttributeType::Height },
{ "linecolor", AttributeType::LineColor },
{ "linestyle", AttributeType::LineStyle },
{ "opacity", AttributeType::Opacity },
{ "rotate", AttributeType::Rotate },
{ "skewx", AttributeType::SkewX },
{ "skewy", AttributeType::SkewY },
{ "visibility", AttributeType::Visibility },
{ "width", AttributeType::Width },
{ "x", AttributeType::PosX },
{ "y", AttributeType::PosY }
};
static const AnimateAttributeMap aMap( lcl_attributeMap,
SAL_N_ELEMENTS(lcl_attributeMap),
false );
AttributeType eAttributeType = ATTRIBUTE_INVALID;
AttributeType eAttributeType = AttributeType::Invalid;
// determine the type from the attribute name
if( !aMap.lookup( rAttrName,
eAttributeType ) )
{
SAL_WARN("slideshow", "mapAttributeName(): attribute name not found in map: " << rAttrName);
return ATTRIBUTE_INVALID;
return AttributeType::Invalid;
}
return eAttributeType;

View File

@ -33,36 +33,35 @@ namespace slideshow
This enum describes the type of an animated
attribute.
*/
enum AttributeType
enum class AttributeType
{
ATTRIBUTE_INVALID,
ATTRIBUTE_CHAR_COLOR,
ATTRIBUTE_CHAR_FONT_NAME,
ATTRIBUTE_CHAR_HEIGHT,
ATTRIBUTE_CHAR_POSTURE,
ATTRIBUTE_CHAR_ROTATION,
ATTRIBUTE_CHAR_UNDERLINE,
ATTRIBUTE_CHAR_WEIGHT,
ATTRIBUTE_COLOR,
ATTRIBUTE_DIMCOLOR,
ATTRIBUTE_FILL_COLOR,
ATTRIBUTE_FILL_STYLE,
ATTRIBUTE_HEIGHT,
ATTRIBUTE_LINE_COLOR,
ATTRIBUTE_LINE_STYLE,
ATTRIBUTE_OPACITY,
ATTRIBUTE_ROTATE,
ATTRIBUTE_SKEW_X,
ATTRIBUTE_SKEW_Y,
ATTRIBUTE_VISIBILITY,
ATTRIBUTE_WIDTH,
ATTRIBUTE_POS_X,
ATTRIBUTE_POS_Y
Invalid,
CharColor,
CharFontName,
CharHeight,
CharPosture,
CharUnderline,
CharWeight,
Color,
DimColor,
FillColor,
FillStyle,
Height,
LineColor,
LineStyle,
Opacity,
Rotate,
SkewX,
SkewY,
Visibility,
Width,
PosX,
PosY
};
/** Map attribute name to AttributeType enum
@returns ATTRIBUTE_INVALID, if name was not found in the
@returns AttributeType::Invalid, if name was not found in the
mapping table.
*/
AttributeType mapAttributeName( const OUString& rAttrName );