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

Noel Grandin noelgrandin at gmail.com
Mon May 23 07:31:54 UTC 2016


 drawinglayer/source/attribute/fillhatchattribute.cxx        |    2 +-
 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx    |    6 +++---
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx     |    8 ++++----
 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx |    6 +++---
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx  |   10 +++++-----
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx     |    6 +++---
 drawinglayer/source/texture/texture3d.cxx                   |    4 ++--
 include/drawinglayer/attribute/fillhatchattribute.hxx       |    8 ++++----
 svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx    |    2 +-
 svx/source/sdr/overlay/overlaytools.cxx                     |    2 +-
 svx/source/sdr/primitive2d/sdrattributecreator.cxx          |    6 +++---
 svx/source/xoutdev/xtabhtch.cxx                             |    8 ++++----
 12 files changed, 34 insertions(+), 34 deletions(-)

New commits:
commit 4a98af674c90de499909174af409d0e29cc155e2
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sat May 21 19:26:41 2016 +0200

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

diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx b/drawinglayer/source/attribute/fillhatchattribute.cxx
index e3dd831..e55e1f7 100644
--- a/drawinglayer/source/attribute/fillhatchattribute.cxx
+++ b/drawinglayer/source/attribute/fillhatchattribute.cxx
@@ -56,7 +56,7 @@ namespace drawinglayer
             }
 
             ImpFillHatchAttribute()
-            :   meStyle(HATCHSTYLE_SINGLE),
+            :   meStyle(HatchStyle::Single),
                 mfDistance(0.0),
                 mfAngle(0.0),
                 maColor(basegfx::BColor()),
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index a253c5f..5e4a7cc 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -62,7 +62,7 @@ namespace drawinglayer
                 // get hatch transformations
                 switch(getFillHatch().getStyle())
                 {
-                    case attribute::HATCHSTYLE_TRIPLE:
+                    case attribute::HatchStyle::Triple:
                     {
                         // rotated 45 degrees
                         texture::GeoTexSvxHatch aHatch(
@@ -75,7 +75,7 @@ namespace drawinglayer
 
                         SAL_FALLTHROUGH;
                     }
-                    case attribute::HATCHSTYLE_DOUBLE:
+                    case attribute::HatchStyle::Double:
                     {
                         // rotated 90 degrees
                         texture::GeoTexSvxHatch aHatch(
@@ -88,7 +88,7 @@ namespace drawinglayer
 
                         SAL_FALLTHROUGH;
                     }
-                    case attribute::HATCHSTYLE_SINGLE:
+                    case attribute::HatchStyle::Single:
                     {
                         // angle as given
                         texture::GeoTexSvxHatch aHatch(
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index ea58a15..3f118a9 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -900,23 +900,23 @@ namespace
      */
     drawinglayer::attribute::FillHatchAttribute createFillHatchAttribute(const Hatch& rHatch)
     {
-        drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HATCHSTYLE_SINGLE);
+        drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HatchStyle::Single);
 
         switch(rHatch.GetStyle())
         {
             default : // case HATCH_SINGLE :
             {
-                aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE;
+                aHatchStyle = drawinglayer::attribute::HatchStyle::Single;
                 break;
             }
             case HATCH_DOUBLE :
             {
-                aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE;
+                aHatchStyle = drawinglayer::attribute::HatchStyle::Double;
                 break;
             }
             case HATCH_TRIPLE :
             {
-                aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE;
+                aHatchStyle = drawinglayer::attribute::HatchStyle::Triple;
                 break;
             }
         }
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index a54c9df..43ae926 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -140,7 +140,7 @@ namespace drawinglayer
                                             // get hatch transformations
                                             switch(getHatch().getStyle())
                                             {
-                                                case attribute::HATCHSTYLE_TRIPLE:
+                                                case attribute::HatchStyle::Triple:
                                                 {
                                                     // rotated 45 degrees
                                                     texture::GeoTexSvxHatch aHatch(
@@ -153,7 +153,7 @@ namespace drawinglayer
 
                                                     SAL_FALLTHROUGH;
                                                 }
-                                                case attribute::HATCHSTYLE_DOUBLE:
+                                                case attribute::HatchStyle::Double:
                                                 {
                                                     // rotated 90 degrees
                                                     texture::GeoTexSvxHatch aHatch(
@@ -166,7 +166,7 @@ namespace drawinglayer
 
                                                     SAL_FALLTHROUGH;
                                                 }
-                                                case attribute::HATCHSTYLE_SINGLE:
+                                                case attribute::HatchStyle::Single:
                                                 {
                                                     // angle as given
                                                     texture::GeoTexSvxHatch aHatch(
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 29a40e4..beed1ca 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1484,17 +1484,17 @@ namespace drawinglayer
 
                         switch(rFillHatchAttribute.getStyle())
                         {
-                            default: // attribute::HATCHSTYLE_SINGLE :
+                            default: // attribute::HatchStyle::Single :
                             {
                                 eHatch = SvtGraphicFill::hatchSingle;
                                 break;
                             }
-                            case attribute::HATCHSTYLE_DOUBLE :
+                            case attribute::HatchStyle::Double :
                             {
                                 eHatch = SvtGraphicFill::hatchDouble;
                                 break;
                             }
-                            case attribute::HATCHSTYLE_TRIPLE :
+                            case attribute::HatchStyle::Triple :
                             {
                                 eHatch = SvtGraphicFill::hatchTriple;
                                 break;
@@ -1537,8 +1537,8 @@ namespace drawinglayer
                     // process(rCandidate.get2DDecomposition(getViewInformation2D()));
                     const ::tools::PolyPolygon aToolsPolyPolygon(basegfx::tools::adaptiveSubdivideByAngle(aLocalPolyPolygon));
                     const HatchStyle aHatchStyle(
-                        attribute::HATCHSTYLE_SINGLE == rFillHatchAttribute.getStyle() ? HATCH_SINGLE :
-                        attribute::HATCHSTYLE_DOUBLE == rFillHatchAttribute.getStyle() ? HATCH_DOUBLE :
+                        attribute::HatchStyle::Single == rFillHatchAttribute.getStyle() ? HATCH_SINGLE :
+                        attribute::HatchStyle::Double == rFillHatchAttribute.getStyle() ? HATCH_DOUBLE :
                         HATCH_TRIPLE);
 
                     mpOutputDevice->DrawHatch(aToolsPolyPolygon,
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 70d0ffb..2e6bc25 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1124,16 +1124,16 @@ namespace drawinglayer
 
                         switch(rFillHatchAttributes.getStyle())
                         {
-                            default : // HATCHSTYLE_SINGLE
+                            default : // HatchStyle::Single
                             {
                                 break;
                             }
-                            case attribute::HATCHSTYLE_DOUBLE :
+                            case attribute::HatchStyle::Double :
                             {
                                 eHatchStyle = HATCH_DOUBLE;
                                 break;
                             }
-                            case attribute::HATCHSTYLE_TRIPLE :
+                            case attribute::HatchStyle::Triple :
                             {
                                 eHatchStyle = HATCH_TRIPLE;
                                 break;
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 70939b8..a3915d5 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -336,7 +336,7 @@ namespace drawinglayer
                 rHatch.getDistance(),
                 fAngleA);
 
-            if(attribute::HATCHSTYLE_DOUBLE == rHatch.getStyle() || attribute::HATCHSTYLE_TRIPLE == rHatch.getStyle())
+            if(attribute::HatchStyle::Double == rHatch.getStyle() || attribute::HatchStyle::Triple == rHatch.getStyle())
             {
                 mp1 = new GeoTexSvxHatch(
                     aOutlineRange,
@@ -345,7 +345,7 @@ namespace drawinglayer
                     fAngleA + F_PI2);
             }
 
-            if(attribute::HATCHSTYLE_TRIPLE == rHatch.getStyle())
+            if(attribute::HatchStyle::Triple == rHatch.getStyle())
             {
                 mp2 = new GeoTexSvxHatch(
                     aOutlineRange,
diff --git a/include/drawinglayer/attribute/fillhatchattribute.hxx b/include/drawinglayer/attribute/fillhatchattribute.hxx
index 58c643b..40e350a 100644
--- a/include/drawinglayer/attribute/fillhatchattribute.hxx
+++ b/include/drawinglayer/attribute/fillhatchattribute.hxx
@@ -39,11 +39,11 @@ namespace drawinglayer
 {
     namespace attribute
     {
-        enum HatchStyle
+        enum class HatchStyle
         {
-            HATCHSTYLE_SINGLE,
-            HATCHSTYLE_DOUBLE,
-            HATCHSTYLE_TRIPLE
+            Single,
+            Double,
+            Triple
         };
     } // end of namespace attribute
 } // end of namespace drawinglayer
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index e6ba365..b7c642a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -121,7 +121,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfSdrOle2Obj::c
 
                 // Use a FillHatchPrimitive2D with necessary attributes
                 const drawinglayer::attribute::FillHatchAttribute aFillHatch(
-                    drawinglayer::attribute::HATCHSTYLE_SINGLE, // single hatch
+                    drawinglayer::attribute::HatchStyle::Single, // single hatch
                     125.0, // 1.25 mm
                     45.0 * F_PI180, // 45 degree diagonal
                     Color(COL_BLACK).getBColor(), // black color
diff --git a/svx/source/sdr/overlay/overlaytools.cxx b/svx/source/sdr/overlay/overlaytools.cxx
index 0ecaa30..75bcee0 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -355,7 +355,7 @@ namespace drawinglayer
                     const double fHatchRotation(45 * F_PI180);
                     const double fDiscreteHatchDistance(3.0);
                     const drawinglayer::attribute::FillHatchAttribute aFillHatchAttribute(
-                        drawinglayer::attribute::HATCHSTYLE_SINGLE,
+                        drawinglayer::attribute::HatchStyle::Single,
                         fDiscreteHatchDistance * getDiscreteUnit(),
                         fHatchRotation - getRotation(),
                         aHighContrastLineColor,
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 808bb9e..97ee4c0 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -119,15 +119,15 @@ namespace drawinglayer
             {
                 case css::drawing::HatchStyle_SINGLE :
                 {
-                    return attribute::HATCHSTYLE_SINGLE;
+                    return attribute::HatchStyle::Single;
                 }
                 case css::drawing::HatchStyle_DOUBLE :
                 {
-                    return attribute::HATCHSTYLE_DOUBLE;
+                    return attribute::HatchStyle::Double;
                 }
                 default :
                 {
-                    return attribute::HATCHSTYLE_TRIPLE; // css::drawing::HatchStyle_TRIPLE
+                    return attribute::HatchStyle::Triple; // css::drawing::HatchStyle_TRIPLE
                 }
             }
         }
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 37a24db..bb66f70 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -96,23 +96,23 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex )
                 basegfx::B2DRange(0.0, 0.0, rSize.Width(), rSize.Height())));
 
         const XHatch& rHatch = GetHatch(nIndex)->GetHatch();
-        drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HATCHSTYLE_TRIPLE);
+        drawinglayer::attribute::HatchStyle aHatchStyle(drawinglayer::attribute::HatchStyle::Triple);
 
         switch(rHatch.GetHatchStyle())
         {
             case css::drawing::HatchStyle_SINGLE :
             {
-                aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE;
+                aHatchStyle = drawinglayer::attribute::HatchStyle::Single;
                 break;
             }
             case css::drawing::HatchStyle_DOUBLE :
             {
-                aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE;
+                aHatchStyle = drawinglayer::attribute::HatchStyle::Double;
                 break;
             }
             default :
             {
-                aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE; // css::drawing::HatchStyle_TRIPLE
+                aHatchStyle = drawinglayer::attribute::HatchStyle::Triple; // css::drawing::HatchStyle_TRIPLE
                 break;
             }
         }


More information about the Libreoffice-commits mailing list