Kaydet (Commit) df3168e8 authored tarafından Mark Hung's avatar Mark Hung

oox: enum MS_AttributeNames -> enum class AnimationAttributeEnum

It's the attribute enum for the target animation. Remove
MS_ prefix since it is in oox::ppt namespace and prepend
Animation to make the purpose more clear.

Change-Id: I0b6bbaf30ae4e2cf1cb0f6d5d24ba9f31e0b0773
Reviewed-on: https://gerrit.libreoffice.org/57353
Tested-by: Jenkins
Reviewed-by: 's avatarMark Hung <marklh9@gmail.com>
üst 311131fc
...@@ -33,17 +33,17 @@ namespace com { namespace sun { namespace star { ...@@ -33,17 +33,17 @@ namespace com { namespace sun { namespace star {
namespace oox { namespace ppt { namespace oox { namespace ppt {
// conversion of MS to OOo attributes. // conversion of MS to OOo attributes.
enum MS_AttributeNames enum class AnimationAttributeEnum
{ {
MS_PPT_X, MS_PPT_Y, MS_PPT_W, MS_PPT_H, MS_PPT_C, MS_R, MS_XSHEAR, MS_FILLCOLOR, MS_FILLTYPE, PPT_X, PPT_Y, PPT_W, PPT_H, PPT_C, R, XSHEAR, FILLCOLOR, FILLTYPE,
MS_STROKECOLOR, MS_STROKEON, MS_STYLECOLOR, MS_STYLEROTATION, MS_FONTWEIGHT, STROKECOLOR, STROKEON, STYLECOLOR, STYLEROTATION, FONTWEIGHT,
MS_STYLEUNDERLINE, MS_STYLEFONTFAMILY, MS_STYLEFONTSIZE, MS_STYLEFONTSTYLE, STYLEUNDERLINE, STYLEFONTFAMILY, STYLEFONTSIZE, STYLEFONTSTYLE,
MS_STYLEVISIBILITY, MS_STYLEOPACITY, MS_UNKNOWN STYLEVISIBILITY, STYLEOPACITY, UNKNOWN
}; };
struct ImplAttributeNameConversion struct ImplAttributeNameConversion
{ {
MS_AttributeNames meAttribute; AnimationAttributeEnum meAttribute;
const char* mpMSName; const char* mpMSName;
const char* mpAPIName; const char* mpAPIName;
}; };
...@@ -86,7 +86,7 @@ namespace oox { namespace ppt { ...@@ -86,7 +86,7 @@ namespace oox { namespace ppt {
/** convert attribute values of the animation target so that LibreOffice understand. /** convert attribute values of the animation target so that LibreOffice understand.
*/ */
OOX_DLLPUBLIC bool convertAnimationValue(MS_AttributeNames eAttribute, css::uno::Any& rValue); OOX_DLLPUBLIC bool convertAnimationValue(AnimationAttributeEnum eAttribute, css::uno::Any& rValue);
/** convert the measure string to LibreOffice format. /** convert the measure string to LibreOffice format.
* i.e. convert occurence of #{0,1}ppt_[xywh] to x,y, width, height. * i.e. convert occurence of #{0,1}ppt_[xywh] to x,y, width, height.
......
...@@ -31,7 +31,7 @@ namespace oox { namespace ppt { ...@@ -31,7 +31,7 @@ namespace oox { namespace ppt {
struct Attribute struct Attribute
{ {
OUString name; OUString name;
MS_AttributeNames type; AnimationAttributeEnum type;
}; };
/** CT_TLCommonBehaviorData */ /** CT_TLCommonBehaviorData */
......
...@@ -50,29 +50,29 @@ namespace oox { namespace ppt { ...@@ -50,29 +50,29 @@ namespace oox { namespace ppt {
{ {
static const ImplAttributeNameConversion aList[] = static const ImplAttributeNameConversion aList[] =
{ {
{ MS_PPT_X, "ppt_x", "X" }, { AnimationAttributeEnum::PPT_X, "ppt_x", "X" },
{ MS_PPT_Y, "ppt_y", "Y" }, { AnimationAttributeEnum::PPT_Y, "ppt_y", "Y" },
{ MS_PPT_W, "ppt_w", "Width" }, { AnimationAttributeEnum::PPT_W, "ppt_w", "Width" },
{ MS_PPT_H, "ppt_h", "Height" }, { AnimationAttributeEnum::PPT_H, "ppt_h", "Height" },
{ MS_PPT_C, "ppt_c", "DimColor" }, { AnimationAttributeEnum::PPT_C, "ppt_c", "DimColor" },
{ MS_R, "r", "Rotate" }, { AnimationAttributeEnum::R, "r", "Rotate" },
{ MS_XSHEAR, "xshear", "SkewX" }, { AnimationAttributeEnum::XSHEAR, "xshear", "SkewX" },
{ MS_FILLCOLOR, "fillColor", "FillColor" }, { AnimationAttributeEnum::FILLCOLOR, "fillColor", "FillColor" },
{ MS_FILLCOLOR, "fillcolor", "FillColor" }, { AnimationAttributeEnum::FILLCOLOR, "fillcolor", "FillColor" },
{ MS_FILLTYPE, "fill.type", "FillStyle" }, { AnimationAttributeEnum::FILLTYPE, "fill.type", "FillStyle" },
{ MS_FILLTYPE, "fill.on", "FillOn" }, { AnimationAttributeEnum::FILLTYPE, "fill.on", "FillOn" },
{ MS_STROKECOLOR, "stroke.color", "LineColor" }, { AnimationAttributeEnum::STROKECOLOR, "stroke.color", "LineColor" },
{ MS_STROKEON, "stroke.on", "LineStyle" }, { AnimationAttributeEnum::STROKEON, "stroke.on", "LineStyle" },
{ MS_STYLECOLOR, "style.color", "CharColor" }, { AnimationAttributeEnum::STYLECOLOR, "style.color", "CharColor" },
{ MS_STYLEROTATION, "style.rotation", "Rotate" }, { AnimationAttributeEnum::STYLEROTATION, "style.rotation", "Rotate" },
{ MS_FONTWEIGHT, "style.fontWeight", "CharWeight" }, { AnimationAttributeEnum::FONTWEIGHT, "style.fontWeight", "CharWeight" },
{ MS_STYLEUNDERLINE, "style.textDecorationUnderline","CharUnderline" }, { AnimationAttributeEnum::STYLEUNDERLINE, "style.textDecorationUnderline","CharUnderline" },
{ MS_STYLEFONTFAMILY, "style.fontFamily", "CharFontName" }, { AnimationAttributeEnum::STYLEFONTFAMILY, "style.fontFamily", "CharFontName" },
{ MS_STYLEFONTSIZE, "style.fontSize", "CharHeight" }, { AnimationAttributeEnum::STYLEFONTSIZE, "style.fontSize", "CharHeight" },
{ MS_STYLEFONTSTYLE, "style.fontStyle", "CharPosture" }, { AnimationAttributeEnum::STYLEFONTSTYLE, "style.fontStyle", "CharPosture" },
{ MS_STYLEVISIBILITY, "style.visibility", "Visibility" }, { AnimationAttributeEnum::STYLEVISIBILITY, "style.visibility", "Visibility" },
{ MS_STYLEOPACITY, "style.opacity", "Opacity" }, { AnimationAttributeEnum::STYLEOPACITY, "style.opacity", "Opacity" },
{ MS_UNKNOWN, nullptr, nullptr } { AnimationAttributeEnum::UNKNOWN, nullptr, nullptr }
}; };
return aList; return aList;
...@@ -182,16 +182,16 @@ namespace oox { namespace ppt { ...@@ -182,16 +182,16 @@ namespace oox { namespace ppt {
return bRet; return bRet;
} }
bool convertAnimationValue(MS_AttributeNames eAttribute, css::uno::Any& rValue) bool convertAnimationValue(AnimationAttributeEnum eAttribute, css::uno::Any& rValue)
{ {
using css::animations::ValuePair; using css::animations::ValuePair;
bool bRet = false; bool bRet = false;
switch (eAttribute) switch (eAttribute)
{ {
case MS_PPT_X: case AnimationAttributeEnum::PPT_X:
case MS_PPT_Y: case AnimationAttributeEnum::PPT_Y:
case MS_PPT_W: case AnimationAttributeEnum::PPT_W:
case MS_PPT_H: case AnimationAttributeEnum::PPT_H:
{ {
OUString aString; OUString aString;
...@@ -232,8 +232,8 @@ namespace oox { namespace ppt { ...@@ -232,8 +232,8 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_XSHEAR: case AnimationAttributeEnum::XSHEAR:
case MS_R: case AnimationAttributeEnum::R:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -244,7 +244,7 @@ namespace oox { namespace ppt { ...@@ -244,7 +244,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_STYLEROTATION: case AnimationAttributeEnum::STYLEROTATION:
{ {
if (rValue.getValueType() == cppu::UnoType<OUString>::get()) if (rValue.getValueType() == cppu::UnoType<OUString>::get())
{ {
...@@ -263,10 +263,10 @@ namespace oox { namespace ppt { ...@@ -263,10 +263,10 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_FILLCOLOR: case AnimationAttributeEnum::FILLCOLOR:
case MS_STROKECOLOR: case AnimationAttributeEnum::STROKECOLOR:
case MS_STYLECOLOR: case AnimationAttributeEnum::STYLECOLOR:
case MS_PPT_C: case AnimationAttributeEnum::PPT_C:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -314,7 +314,7 @@ namespace oox { namespace ppt { ...@@ -314,7 +314,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_FILLTYPE: case AnimationAttributeEnum::FILLTYPE:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -326,7 +326,7 @@ namespace oox { namespace ppt { ...@@ -326,7 +326,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_STROKEON: case AnimationAttributeEnum::STROKEON:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -338,7 +338,7 @@ namespace oox { namespace ppt { ...@@ -338,7 +338,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_FONTWEIGHT: case AnimationAttributeEnum::FONTWEIGHT:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -350,7 +350,7 @@ namespace oox { namespace ppt { ...@@ -350,7 +350,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_STYLEFONTSTYLE: case AnimationAttributeEnum::STYLEFONTSTYLE:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -362,7 +362,7 @@ namespace oox { namespace ppt { ...@@ -362,7 +362,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_STYLEUNDERLINE: case AnimationAttributeEnum::STYLEUNDERLINE:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -374,8 +374,8 @@ namespace oox { namespace ppt { ...@@ -374,8 +374,8 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_STYLEOPACITY: case AnimationAttributeEnum::STYLEOPACITY:
case MS_STYLEFONTSIZE: case AnimationAttributeEnum::STYLEFONTSIZE:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
...@@ -386,7 +386,7 @@ namespace oox { namespace ppt { ...@@ -386,7 +386,7 @@ namespace oox { namespace ppt {
} }
break; break;
case MS_STYLEVISIBILITY: case AnimationAttributeEnum::STYLEVISIBILITY:
{ {
OUString aString; OUString aString;
if (rValue >>= aString) if (rValue >>= aString)
......
...@@ -481,7 +481,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >& ...@@ -481,7 +481,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >&
const oox::ppt::ImplAttributeNameConversion* p = oox::ppt::getAttributeConversionList(); const oox::ppt::ImplAttributeNameConversion* p = oox::ppt::getAttributeConversionList();
oox::ppt::MS_AttributeNames eAttribute = oox::ppt::MS_UNKNOWN; oox::ppt::AnimationAttributeEnum eAttribute = oox::ppt::AnimationAttributeEnum::UNKNOWN;
if( (nNodeType == AnimationNodeType::ANIMATEMOTION) || if( (nNodeType == AnimationNodeType::ANIMATEMOTION) ||
(nNodeType == AnimationNodeType::ANIMATETRANSFORM) ) (nNodeType == AnimationNodeType::ANIMATETRANSFORM) )
...@@ -511,7 +511,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >& ...@@ -511,7 +511,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >&
xAnimate->setAttributeName( aAttributeName ); xAnimate->setAttributeName( aAttributeName );
if( eAttribute != oox::ppt::MS_UNKNOWN ) if(eAttribute != oox::ppt::AnimationAttributeEnum::UNKNOWN)
{ {
Any aAny( xAnimate->getFrom() ); Any aAny( xAnimate->getFrom() );
if( aAny.hasValue() ) if( aAny.hasValue() )
......
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