summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-05-21 19:26:41 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-23 07:31:31 +0000
commit4a98af674c90de499909174af409d0e29cc155e2 (patch)
tree1b30c08b36349a937cd137c31189840cf9f587d1
parent72ffb6f590293fb8d3ba428f1700dc05703b014f (diff)
Convert HatchStyle to scoped enum
Change-Id: I27878a67457d32e6922dfb6da73f896ff6ab1d01 Reviewed-on: https://gerrit.libreoffice.org/25271 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--drawinglayer/source/attribute/fillhatchattribute.cxx2
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx8
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx10
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
-rw-r--r--drawinglayer/source/texture/texture3d.cxx4
-rw-r--r--include/drawinglayer/attribute/fillhatchattribute.hxx8
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx2
-rw-r--r--svx/source/sdr/overlay/overlaytools.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx6
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx8
12 files changed, 34 insertions, 34 deletions
diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx b/drawinglayer/source/attribute/fillhatchattribute.cxx
index e3dd831bf35a..e55e1f71f55c 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 a253c5fbfb85..5e4a7cc4ae8c 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 ea58a15fb73f..3f118a9e435c 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 a54c9dfeb328..43ae92607d0a 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 29a40e4be214..beed1caa8ec4 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 70d0ffbae530..2e6bc257b337 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 70939b8ec6a1..a3915d5f290d 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 58c643b54283..40e350a003f0 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 e6ba36506944..b7c642a246d3 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 0ecaa301f5b8..75bcee0de02b 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 808bb9e176d7..97ee4c0175e5 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 37a24dbd366d..bb66f709ed75 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;
}
}