[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer svx/source sw/source

Noel Grandin noelgrandin at gmail.com
Mon May 23 09:20:57 UTC 2016


 drawinglayer/source/attribute/fillgradientattribute.cxx     |    2 -
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx |   18 ++++++------
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx     |   14 ++++-----
 drawinglayer/source/primitive3d/textureprimitive3d.cxx      |    2 -
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx  |   12 ++++----
 drawinglayer/source/processor3d/defaultprocessor3d.cxx      |   12 ++++----
 include/drawinglayer/attribute/fillgradientattribute.hxx    |   14 ++++-----
 svx/source/sdr/primitive2d/sdrattributecreator.cxx          |   12 ++++----
 svx/source/xoutdev/xtabgrdt.cxx                             |   14 ++++-----
 sw/source/uibase/docvw/HeaderFooterWin.cxx                  |    2 -
 sw/source/uibase/docvw/ShadowOverlayObject.cxx              |    6 ++--
 11 files changed, 54 insertions(+), 54 deletions(-)

New commits:
commit 5c5209c2d9f2626d2c024493a7f9cde9577e6261
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sat May 21 19:15:22 2016 +0200

    Convert GradientStyle to scoped enum
    
    Change-Id: I1da151dd25648e363ba88bf88caa3e820f0ee424
    Reviewed-on: https://gerrit.libreoffice.org/25270
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx b/drawinglayer/source/attribute/fillgradientattribute.cxx
index c91e40c..5cc76e3 100644
--- a/drawinglayer/source/attribute/fillgradientattribute.cxx
+++ b/drawinglayer/source/attribute/fillgradientattribute.cxx
@@ -60,7 +60,7 @@ namespace drawinglayer
             }
 
             ImpFillGradientAttribute()
-            :   meStyle(GRADIENTSTYLE_LINEAR),
+            :   meStyle(GradientStyle::Linear),
                 mfBorder(0.0),
                 mfOffsetX(0.0),
                 mfOffsetY(0.0),
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index b9e4132..4fba3c8 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -64,7 +64,7 @@ namespace drawinglayer
 
             switch(getFillGradient().getStyle())
             {
-                case attribute::GRADIENTSTYLE_LINEAR:
+                case attribute::GradientStyle::Linear:
                 {
                     texture::GeoTexSvxGradientLinear aGradient(
                         getDefinitionRange(),
@@ -77,7 +77,7 @@ namespace drawinglayer
                     aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_AXIAL:
+                case attribute::GradientStyle::Axial:
                 {
                     texture::GeoTexSvxGradientAxial aGradient(
                         getDefinitionRange(),
@@ -90,7 +90,7 @@ namespace drawinglayer
                     aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_RADIAL:
+                case attribute::GradientStyle::Radial:
                 {
                     texture::GeoTexSvxGradientRadial aGradient(
                         getDefinitionRange(),
@@ -103,7 +103,7 @@ namespace drawinglayer
                     aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_ELLIPTICAL:
+                case attribute::GradientStyle::Elliptical:
                 {
                     texture::GeoTexSvxGradientElliptical aGradient(
                         getDefinitionRange(),
@@ -117,7 +117,7 @@ namespace drawinglayer
                     aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_SQUARE:
+                case attribute::GradientStyle::Square:
                 {
                     texture::GeoTexSvxGradientSquare aGradient(
                         getDefinitionRange(),
@@ -131,7 +131,7 @@ namespace drawinglayer
                     aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_RECT:
+                case attribute::GradientStyle::Rect:
                 {
                     texture::GeoTexSvxGradientRect aGradient(
                         getDefinitionRange(),
@@ -252,13 +252,13 @@ namespace drawinglayer
 
             switch(getFillGradient().getStyle())
             {
-                case attribute::GRADIENTSTYLE_RADIAL:
-                case attribute::GRADIENTSTYLE_ELLIPTICAL:
+                case attribute::GradientStyle::Radial:
+                case attribute::GradientStyle::Elliptical:
                 {
                     aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0.0, 0.0), 1.0);
                     break;
                 }
-                default: // GRADIENTSTYLE_LINEAR, attribute::GRADIENTSTYLE_AXIAL, attribute::GRADIENTSTYLE_SQUARE, attribute::GRADIENTSTYLE_RECT
+                default: // GradientStyle::Linear, attribute::GradientStyle::Axial, attribute::GradientStyle::Square, attribute::GradientStyle::Rect
                 {
                     aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1.0, -1.0, 1.0, 1.0));
                     break;
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 3f118a9..70647cf 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -848,38 +848,38 @@ namespace
             aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
         }
 
-        drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GRADIENTSTYLE_RECT);
+        drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GradientStyle::Rect);
 
         switch(rGradient.GetStyle())
         {
             case GradientStyle_LINEAR :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_LINEAR;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Linear;
                 break;
             }
             case GradientStyle_AXIAL :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_AXIAL;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Axial;
                 break;
             }
             case GradientStyle_RADIAL :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RADIAL;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Radial;
                 break;
             }
             case GradientStyle_ELLIPTICAL :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_ELLIPTICAL;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Elliptical;
                 break;
             }
             case GradientStyle_SQUARE :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_SQUARE;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Square;
                 break;
             }
             default : // GradientStyle_RECT
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RECT;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Rect;
                 break;
             }
         }
diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index 61a888b..ee126a1 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -98,7 +98,7 @@ namespace drawinglayer
             {
                 // create TransparenceTexturePrimitive3D with fixed transparence as replacement
                 const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
-                const attribute::FillGradientAttribute aFillGradient(attribute::GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1);
+                const attribute::FillGradientAttribute aFillGradient(attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1);
                 const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
                 return { xRef };
             }
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index beed1ca..6d069d3 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -311,32 +311,32 @@ namespace drawinglayer
 
             switch(rFiGrAtt.getStyle())
             {
-                default : // attribute::GRADIENTSTYLE_LINEAR :
+                default : // attribute::GradientStyle::Linear :
                 {
                     o_rVCLGradient.SetStyle(GradientStyle_LINEAR);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_AXIAL :
+                case attribute::GradientStyle::Axial :
                 {
                     o_rVCLGradient.SetStyle(GradientStyle_AXIAL);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_RADIAL :
+                case attribute::GradientStyle::Radial :
                 {
                     o_rVCLGradient.SetStyle(GradientStyle_RADIAL);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_ELLIPTICAL :
+                case attribute::GradientStyle::Elliptical :
                 {
                     o_rVCLGradient.SetStyle(GradientStyle_ELLIPTICAL);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_SQUARE :
+                case attribute::GradientStyle::Square :
                 {
                     o_rVCLGradient.SetStyle(GradientStyle_SQUARE);
                     break;
                 }
-                case attribute::GRADIENTSTYLE_RECT :
+                case attribute::GradientStyle::Rect :
                 {
                     o_rVCLGradient.SetStyle(GradientStyle_RECT);
                     break;
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index f83eb1f..50830ba 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -87,7 +87,7 @@ namespace drawinglayer
 
                     switch(aGradientStyle)
                     {
-                        case attribute::GRADIENTSTYLE_LINEAR:
+                        case attribute::GradientStyle::Linear:
                         {
                             pNewTex.reset(
                                 new texture::GeoTexSvxGradientLinear(
@@ -100,7 +100,7 @@ namespace drawinglayer
                                     rFillGradient.getAngle()));
                             break;
                         }
-                        case attribute::GRADIENTSTYLE_AXIAL:
+                        case attribute::GradientStyle::Axial:
                         {
                             pNewTex.reset(
                                 new texture::GeoTexSvxGradientAxial(
@@ -113,7 +113,7 @@ namespace drawinglayer
                                     rFillGradient.getAngle()));
                             break;
                         }
-                        case attribute::GRADIENTSTYLE_RADIAL:
+                        case attribute::GradientStyle::Radial:
                         {
                             pNewTex.reset(
                                 new texture::GeoTexSvxGradientRadial(
@@ -126,7 +126,7 @@ namespace drawinglayer
                                     rFillGradient.getOffsetY()));
                             break;
                         }
-                        case attribute::GRADIENTSTYLE_ELLIPTICAL:
+                        case attribute::GradientStyle::Elliptical:
                         {
                             pNewTex.reset(
                                 new texture::GeoTexSvxGradientElliptical(
@@ -140,7 +140,7 @@ namespace drawinglayer
                                     rFillGradient.getAngle()));
                             break;
                         }
-                        case attribute::GRADIENTSTYLE_SQUARE:
+                        case attribute::GradientStyle::Square:
                         {
                             pNewTex.reset(
                                 new texture::GeoTexSvxGradientSquare(
@@ -154,7 +154,7 @@ namespace drawinglayer
                                     rFillGradient.getAngle()));
                             break;
                         }
-                        case attribute::GRADIENTSTYLE_RECT:
+                        case attribute::GradientStyle::Rect:
                         {
                             pNewTex.reset(
                                 new texture::GeoTexSvxGradientRect(
diff --git a/include/drawinglayer/attribute/fillgradientattribute.hxx b/include/drawinglayer/attribute/fillgradientattribute.hxx
index ff3d3eb..a6f98f6 100644
--- a/include/drawinglayer/attribute/fillgradientattribute.hxx
+++ b/include/drawinglayer/attribute/fillgradientattribute.hxx
@@ -39,14 +39,14 @@ namespace drawinglayer
 {
     namespace attribute
     {
-        enum GradientStyle
+        enum class GradientStyle
         {
-            GRADIENTSTYLE_LINEAR,
-            GRADIENTSTYLE_AXIAL,
-            GRADIENTSTYLE_RADIAL,
-            GRADIENTSTYLE_ELLIPTICAL,
-            GRADIENTSTYLE_SQUARE,
-            GRADIENTSTYLE_RECT
+            Linear,
+            Axial,
+            Radial,
+            Elliptical,
+            Square,
+            Rect
         };
     } // end of namespace attribute
 } // end of namespace drawinglayer
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 97ee4c0..79fdbf9 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -88,27 +88,27 @@ namespace drawinglayer
             {
                 case css::awt::GradientStyle_LINEAR :
                 {
-                    return attribute::GRADIENTSTYLE_LINEAR;
+                    return attribute::GradientStyle::Linear;
                 }
                 case css::awt::GradientStyle_AXIAL :
                 {
-                    return attribute::GRADIENTSTYLE_AXIAL;
+                    return attribute::GradientStyle::Axial;
                 }
                 case css::awt::GradientStyle_RADIAL :
                 {
-                    return attribute::GRADIENTSTYLE_RADIAL;
+                    return attribute::GradientStyle::Radial;
                 }
                 case css::awt::GradientStyle_ELLIPTICAL :
                 {
-                    return attribute::GRADIENTSTYLE_ELLIPTICAL;
+                    return attribute::GradientStyle::Elliptical;
                 }
                 case css::awt::GradientStyle_SQUARE :
                 {
-                    return attribute::GRADIENTSTYLE_SQUARE;
+                    return attribute::GradientStyle::Square;
                 }
                 default :
                 {
-                    return attribute::GRADIENTSTYLE_RECT; // css::awt::GradientStyle_RECT
+                    return attribute::GradientStyle::Rect; // css::awt::GradientStyle_RECT
                 }
             }
         }
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index 5ad61a6..4d9a8b6 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -122,38 +122,38 @@ Bitmap XGradientList::CreateBitmapForUI( long nIndex )
             aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
         }
 
-        drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GRADIENTSTYLE_RECT);
+        drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GradientStyle::Rect);
 
         switch(rGradient.GetGradientStyle())
         {
             case css::awt::GradientStyle_LINEAR :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_LINEAR;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Linear;
                 break;
             }
             case css::awt::GradientStyle_AXIAL :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_AXIAL;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Axial;
                 break;
             }
             case css::awt::GradientStyle_RADIAL :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RADIAL;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Radial;
                 break;
             }
             case css::awt::GradientStyle_ELLIPTICAL :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_ELLIPTICAL;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Elliptical;
                 break;
             }
             case css::awt::GradientStyle_SQUARE :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_SQUARE;
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Square;
                 break;
             }
             default :
             {
-                aGradientStyle = drawinglayer::attribute::GRADIENTSTYLE_RECT; // css::awt::GradientStyle_RECT
+                aGradientStyle = drawinglayer::attribute::GradientStyle::Rect; // css::awt::GradientStyle_RECT
                 break;
             }
         }
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 54ccf57..b2c33e0 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -284,7 +284,7 @@ void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const Rectangl
         double nAngle = M_PI;
         if (m_bIsHeader)
             nAngle = 0;
-        FillGradientAttribute aFillAttrs(GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor, 10);
+        FillGradientAttribute aFillAttrs(drawinglayer::attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor, 10);
         aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
                     new drawinglayer::primitive2d::FillGradientPrimitive2D(aGradientRect, aFillAttrs));
     }
diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.cxx b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
index 7dd4711..15af795 100644
--- a/sw/source/uibase/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
@@ -81,7 +81,7 @@ drawinglayer::primitive2d::Primitive2DContainer ShadowPrimitive::create2DDecompo
         {
             aRange.expand(basegfx::B2DTuple(getSecondPosition().getX(), getSecondPosition().getY() + (2.0 * getDiscreteUnit())));
             const ::drawinglayer::attribute::FillGradientAttribute aFillGradientAttribute(
-                drawinglayer::attribute::GRADIENTSTYLE_LINEAR,
+                drawinglayer::attribute::GradientStyle::Linear,
                 0.0,
                 0.5,
                 0.5,
@@ -102,7 +102,7 @@ drawinglayer::primitive2d::Primitive2DContainer ShadowPrimitive::create2DDecompo
         {
             aRange.expand(basegfx::B2DTuple(getSecondPosition().getX(), getSecondPosition().getY() + (4.0 * getDiscreteUnit())));
             const drawinglayer::attribute::FillGradientAttribute aFillGradientAttribute(
-                drawinglayer::attribute::GRADIENTSTYLE_LINEAR,
+                drawinglayer::attribute::GradientStyle::Linear,
                 0.0,
                 0.5,
                 0.5,
@@ -123,7 +123,7 @@ drawinglayer::primitive2d::Primitive2DContainer ShadowPrimitive::create2DDecompo
         {
             aRange.expand(basegfx::B2DTuple(getSecondPosition().getX(), getSecondPosition().getY() + (4.0 * getDiscreteUnit())));
             const drawinglayer::attribute::FillGradientAttribute aFillGradientAttribute(
-                drawinglayer::attribute::GRADIENTSTYLE_LINEAR,
+                drawinglayer::attribute::GradientStyle::Linear,
                 0.0,
                 0.5,
                 0.5,


More information about the Libreoffice-commits mailing list