Kaydet (Commit) 4a98af67 authored tarafından Noel Grandin's avatar Noel Grandin

Convert HatchStyle to scoped enum

Change-Id: I27878a67457d32e6922dfb6da73f896ff6ab1d01
Reviewed-on: https://gerrit.libreoffice.org/25271Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 72ffb6f5
......@@ -56,7 +56,7 @@ namespace drawinglayer
}
ImpFillHatchAttribute()
: meStyle(HATCHSTYLE_SINGLE),
: meStyle(HatchStyle::Single),
mfDistance(0.0),
mfAngle(0.0),
maColor(basegfx::BColor()),
......
......@@ -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(
......
......@@ -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;
}
}
......
......@@ -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(
......
......@@ -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,
......
......@@ -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;
......
......@@ -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,
......
......@@ -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
......
......@@ -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
......
......@@ -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,
......
......@@ -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
}
}
}
......
......@@ -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;
}
}
......
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