Kaydet (Commit) d0e77848 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Turn SvgMarkerNode::MarkerUnits into scoped enum

...to avoid -Werror,-Wshadow from Clang trunk with
<https://reviews.llvm.org/D52400> "Improve -Wshadow warnings with enumerators",
warning about shadowing of userSpaceOnUse in enum SvgUnits in
svgio/inc/svgtools.hxx

Change-Id: Ie1438e6ad0f73c73ad643157e5f8366a6e3f6851
Reviewed-on: https://gerrit.libreoffice.org/61933
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ca341bbe
......@@ -31,7 +31,7 @@ namespace svgio
class SvgMarkerNode : public SvgNode
{
public:
enum MarkerUnits
enum class MarkerUnits
{
strokeWidth,
userSpaceOnUse
......
......@@ -32,7 +32,7 @@ namespace svgio
maSvgAspectRatio(),
maRefX(0),
maRefY(0),
maMarkerUnits(strokeWidth),
maMarkerUnits(MarkerUnits::strokeWidth),
maMarkerWidth(3),
maMarkerHeight(3),
mfAngle(0.0),
......@@ -106,11 +106,11 @@ namespace svgio
{
if(aContent.startsWith("strokeWidth"))
{
setMarkerUnits(strokeWidth);
setMarkerUnits(MarkerUnits::strokeWidth);
}
else if(aContent.match(commonStrings::aStrUserSpaceOnUse))
{
setMarkerUnits(userSpaceOnUse);
setMarkerUnits(MarkerUnits::userSpaceOnUse);
}
}
break;
......
......@@ -832,7 +832,7 @@ namespace svgio
{
double fTargetWidth(rMarker.getMarkerWidth().isSet() ? rMarker.getMarkerWidth().solve(mrOwner, xcoordinate) : 3.0);
double fTargetHeight(rMarker.getMarkerHeight().isSet() ? rMarker.getMarkerHeight().solve(mrOwner, xcoordinate) : 3.0);
const bool bStrokeWidth(SvgMarkerNode::strokeWidth == rMarker.getMarkerUnits());
const bool bStrokeWidth(SvgMarkerNode::MarkerUnits::strokeWidth == rMarker.getMarkerUnits());
const double fStrokeWidth(getStrokeWidth().isSet() ? getStrokeWidth().solve(mrOwner) : 1.0);
if(bStrokeWidth)
......
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