[Libreoffice-commits] core.git: svgio/inc svgio/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 18 19:52:03 UTC 2018


 svgio/inc/svgmarkernode.hxx                   |    2 +-
 svgio/source/svgreader/svgmarkernode.cxx      |    6 +++---
 svgio/source/svgreader/svgstyleattributes.cxx |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit d0e77848853d60f01308df309d73fa2d7389d0ce
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Oct 18 13:54:54 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Oct 18 21:50:43 2018 +0200

    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: Stephan Bergmann <sbergman at redhat.com>

diff --git a/svgio/inc/svgmarkernode.hxx b/svgio/inc/svgmarkernode.hxx
index 23d768cc8f7b..61098a35b740 100644
--- a/svgio/inc/svgmarkernode.hxx
+++ b/svgio/inc/svgmarkernode.hxx
@@ -31,7 +31,7 @@ namespace svgio
         class SvgMarkerNode : public SvgNode
         {
         public:
-            enum MarkerUnits
+            enum class MarkerUnits
             {
                 strokeWidth,
                 userSpaceOnUse
diff --git a/svgio/source/svgreader/svgmarkernode.cxx b/svgio/source/svgreader/svgmarkernode.cxx
index 2e33fa640c50..35ac4fff1662 100644
--- a/svgio/source/svgreader/svgmarkernode.cxx
+++ b/svgio/source/svgreader/svgmarkernode.cxx
@@ -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;
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 3bd5dac3c483..7780d8aa4e5f 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -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)


More information about the Libreoffice-commits mailing list