[Libreoffice-commits] core.git: include/oox oox/source sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 16 09:55:56 UTC 2018


 include/oox/ppt/pptfilterhelpers.hxx     |   14 ++---
 oox/source/ppt/commonbehaviorcontext.hxx |    2 
 oox/source/ppt/pptfilterhelpers.cxx      |   86 +++++++++++++++----------------
 sd/source/filter/ppt/pptinanimations.cxx |    4 -
 4 files changed, 53 insertions(+), 53 deletions(-)

New commits:
commit df3168e84dc30b5cbe993ec41b521486736065a7
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Thu Jul 12 23:35:44 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Mon Jul 16 11:55:32 2018 +0200

    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: Mark Hung <marklh9 at gmail.com>

diff --git a/include/oox/ppt/pptfilterhelpers.hxx b/include/oox/ppt/pptfilterhelpers.hxx
index b84fefbf94f8..94ac025cb6c9 100644
--- a/include/oox/ppt/pptfilterhelpers.hxx
+++ b/include/oox/ppt/pptfilterhelpers.hxx
@@ -33,17 +33,17 @@ namespace com { namespace sun { namespace star {
 namespace oox { namespace ppt {
 
     // 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,
-        MS_STROKECOLOR, MS_STROKEON, MS_STYLECOLOR, MS_STYLEROTATION, MS_FONTWEIGHT,
-        MS_STYLEUNDERLINE, MS_STYLEFONTFAMILY, MS_STYLEFONTSIZE, MS_STYLEFONTSTYLE,
-        MS_STYLEVISIBILITY, MS_STYLEOPACITY, MS_UNKNOWN
+        PPT_X, PPT_Y, PPT_W, PPT_H, PPT_C, R, XSHEAR, FILLCOLOR, FILLTYPE,
+        STROKECOLOR, STROKEON, STYLECOLOR, STYLEROTATION, FONTWEIGHT,
+        STYLEUNDERLINE, STYLEFONTFAMILY, STYLEFONTSIZE, STYLEFONTSTYLE,
+        STYLEVISIBILITY, STYLEOPACITY, UNKNOWN
     };
 
     struct ImplAttributeNameConversion
     {
-        MS_AttributeNames meAttribute;
+        AnimationAttributeEnum meAttribute;
         const char* mpMSName;
         const char* mpAPIName;
     };
@@ -86,7 +86,7 @@ namespace oox { namespace ppt {
 
     /** 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.
      * i.e. convert occurence of #{0,1}ppt_[xywh] to x,y, width, height.
diff --git a/oox/source/ppt/commonbehaviorcontext.hxx b/oox/source/ppt/commonbehaviorcontext.hxx
index b7fc37e38313..5cb45f1c5dbd 100644
--- a/oox/source/ppt/commonbehaviorcontext.hxx
+++ b/oox/source/ppt/commonbehaviorcontext.hxx
@@ -31,7 +31,7 @@ namespace oox { namespace ppt {
     struct Attribute
     {
         OUString   name;
-        MS_AttributeNames type;
+        AnimationAttributeEnum type;
     };
 
     /** CT_TLCommonBehaviorData */
diff --git a/oox/source/ppt/pptfilterhelpers.cxx b/oox/source/ppt/pptfilterhelpers.cxx
index f473d60a73ec..a083cc29756e 100644
--- a/oox/source/ppt/pptfilterhelpers.cxx
+++ b/oox/source/ppt/pptfilterhelpers.cxx
@@ -50,29 +50,29 @@ namespace oox { namespace ppt {
     {
         static const ImplAttributeNameConversion aList[] =
         {
-            { MS_PPT_X,             "ppt_x",                        "X" },
-            { MS_PPT_Y,             "ppt_y",                        "Y" },
-            { MS_PPT_W,             "ppt_w",                        "Width" },
-            { MS_PPT_H,             "ppt_h",                        "Height" },
-            { MS_PPT_C,             "ppt_c",                        "DimColor" },
-            { MS_R,                 "r",                            "Rotate" },
-            { MS_XSHEAR,            "xshear",                       "SkewX" },
-            { MS_FILLCOLOR,         "fillColor",                    "FillColor" },
-            { MS_FILLCOLOR,         "fillcolor",                    "FillColor" },
-            { MS_FILLTYPE,          "fill.type",                    "FillStyle" },
-            { MS_FILLTYPE,          "fill.on",                      "FillOn" },
-            { MS_STROKECOLOR,       "stroke.color",                 "LineColor" },
-            { MS_STROKEON,          "stroke.on",                    "LineStyle" },
-            { MS_STYLECOLOR,        "style.color",                  "CharColor" },
-            { MS_STYLEROTATION,     "style.rotation",               "Rotate" },
-            { MS_FONTWEIGHT,        "style.fontWeight",             "CharWeight" },
-            { MS_STYLEUNDERLINE,    "style.textDecorationUnderline","CharUnderline" },
-            { MS_STYLEFONTFAMILY,   "style.fontFamily",             "CharFontName" },
-            { MS_STYLEFONTSIZE,     "style.fontSize",               "CharHeight" },
-            { MS_STYLEFONTSTYLE,    "style.fontStyle",              "CharPosture" },
-            { MS_STYLEVISIBILITY,   "style.visibility",             "Visibility" },
-            { MS_STYLEOPACITY,      "style.opacity",                "Opacity" },
-            { MS_UNKNOWN, nullptr, nullptr }
+            { AnimationAttributeEnum::PPT_X,             "ppt_x",                        "X" },
+            { AnimationAttributeEnum::PPT_Y,             "ppt_y",                        "Y" },
+            { AnimationAttributeEnum::PPT_W,             "ppt_w",                        "Width" },
+            { AnimationAttributeEnum::PPT_H,             "ppt_h",                        "Height" },
+            { AnimationAttributeEnum::PPT_C,             "ppt_c",                        "DimColor" },
+            { AnimationAttributeEnum::R,                 "r",                            "Rotate" },
+            { AnimationAttributeEnum::XSHEAR,            "xshear",                       "SkewX" },
+            { AnimationAttributeEnum::FILLCOLOR,         "fillColor",                    "FillColor" },
+            { AnimationAttributeEnum::FILLCOLOR,         "fillcolor",                    "FillColor" },
+            { AnimationAttributeEnum::FILLTYPE,          "fill.type",                    "FillStyle" },
+            { AnimationAttributeEnum::FILLTYPE,          "fill.on",                      "FillOn" },
+            { AnimationAttributeEnum::STROKECOLOR,       "stroke.color",                 "LineColor" },
+            { AnimationAttributeEnum::STROKEON,          "stroke.on",                    "LineStyle" },
+            { AnimationAttributeEnum::STYLECOLOR,        "style.color",                  "CharColor" },
+            { AnimationAttributeEnum::STYLEROTATION,     "style.rotation",               "Rotate" },
+            { AnimationAttributeEnum::FONTWEIGHT,        "style.fontWeight",             "CharWeight" },
+            { AnimationAttributeEnum::STYLEUNDERLINE,    "style.textDecorationUnderline","CharUnderline" },
+            { AnimationAttributeEnum::STYLEFONTFAMILY,   "style.fontFamily",             "CharFontName" },
+            { AnimationAttributeEnum::STYLEFONTSIZE,     "style.fontSize",               "CharHeight" },
+            { AnimationAttributeEnum::STYLEFONTSTYLE,    "style.fontStyle",              "CharPosture" },
+            { AnimationAttributeEnum::STYLEVISIBILITY,   "style.visibility",             "Visibility" },
+            { AnimationAttributeEnum::STYLEOPACITY,      "style.opacity",                "Opacity" },
+            { AnimationAttributeEnum::UNKNOWN, nullptr, nullptr }
         };
 
         return aList;
@@ -182,16 +182,16 @@ namespace oox { namespace ppt {
         return bRet;
     }
 
-    bool convertAnimationValue(MS_AttributeNames eAttribute, css::uno::Any& rValue)
+    bool convertAnimationValue(AnimationAttributeEnum eAttribute, css::uno::Any& rValue)
     {
         using css::animations::ValuePair;
         bool bRet = false;
         switch (eAttribute)
         {
-            case MS_PPT_X:
-            case MS_PPT_Y:
-            case MS_PPT_W:
-            case MS_PPT_H:
+            case AnimationAttributeEnum::PPT_X:
+            case AnimationAttributeEnum::PPT_Y:
+            case AnimationAttributeEnum::PPT_W:
+            case AnimationAttributeEnum::PPT_H:
             {
                 OUString aString;
 
@@ -232,8 +232,8 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_XSHEAR:
-            case MS_R:
+            case AnimationAttributeEnum::XSHEAR:
+            case AnimationAttributeEnum::R:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -244,7 +244,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_STYLEROTATION:
+            case AnimationAttributeEnum::STYLEROTATION:
             {
                 if (rValue.getValueType() == cppu::UnoType<OUString>::get())
                 {
@@ -263,10 +263,10 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_FILLCOLOR:
-            case MS_STROKECOLOR:
-            case MS_STYLECOLOR:
-            case MS_PPT_C:
+            case AnimationAttributeEnum::FILLCOLOR:
+            case AnimationAttributeEnum::STROKECOLOR:
+            case AnimationAttributeEnum::STYLECOLOR:
+            case AnimationAttributeEnum::PPT_C:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -314,7 +314,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_FILLTYPE:
+            case AnimationAttributeEnum::FILLTYPE:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -326,7 +326,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_STROKEON:
+            case AnimationAttributeEnum::STROKEON:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -338,7 +338,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_FONTWEIGHT:
+            case AnimationAttributeEnum::FONTWEIGHT:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -350,7 +350,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_STYLEFONTSTYLE:
+            case AnimationAttributeEnum::STYLEFONTSTYLE:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -362,7 +362,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_STYLEUNDERLINE:
+            case AnimationAttributeEnum::STYLEUNDERLINE:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -374,8 +374,8 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_STYLEOPACITY:
-            case MS_STYLEFONTSIZE:
+            case AnimationAttributeEnum::STYLEOPACITY:
+            case AnimationAttributeEnum::STYLEFONTSIZE:
             {
                 OUString aString;
                 if (rValue >>= aString)
@@ -386,7 +386,7 @@ namespace oox { namespace ppt {
             }
             break;
 
-            case MS_STYLEVISIBILITY:
+            case AnimationAttributeEnum::STYLEVISIBILITY:
             {
                 OUString aString;
                 if (rValue >>= aString)
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index b39d1ec0b152..4b0c9b95a860 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -481,7 +481,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >&
 
     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) ||
         (nNodeType == AnimationNodeType::ANIMATETRANSFORM) )
@@ -511,7 +511,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >&
 
     xAnimate->setAttributeName( aAttributeName );
 
-    if( eAttribute != oox::ppt::MS_UNKNOWN )
+    if(eAttribute != oox::ppt::AnimationAttributeEnum::UNKNOWN)
     {
         Any aAny( xAnimate->getFrom() );
         if( aAny.hasValue() )


More information about the Libreoffice-commits mailing list