]> granicus.if.org Git - graphviz/commitdiff
use C++11 in-class member initialization to remove the need for an explicit ctor
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Apr 2021 02:12:35 +0000 (19:12 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Apr 2021 04:30:38 +0000 (21:30 -0700)
This is an equivalent way of saying the same thing.

plugin/visio/VisioRender.cpp
plugin/visio/VisioRender.h

index 34cc6d4ddf9ad42d06940c546fc283422cbd99a8..387bfc5ade47aaafc5eee5bf02898e28f0dfdcc7 100644 (file)
@@ -54,14 +54,6 @@ namespace Visio
                LORouteCenterToCenter = 16
        };
        
-       Render::Render():
-               _pageId(0),
-               _shapeId(0),
-               _hyperlinkId(0),
-               _inComponent(false)
-       {
-       }
-
        void Render::BeginGraph(GVJ_t* job)
        {
                gvputs(job, "<VisioDocument xmlns='http://schemas.microsoft.com/visio/2003/core'>\n");
index d019a06cf613336dc084bee22108f742cf453493..b4e2c574062a39198839fd0c8bcc96775c093fd7 100644 (file)
@@ -31,8 +31,6 @@ namespace Visio
        class Render
        {
        public:
-               Render();
-               
                /* render hierarchy */
                void BeginGraph(GVJ_t* job);
                void EndGraph(GVJ_t* job);
@@ -73,11 +71,11 @@ namespace Visio
                /* output all the collected hyperlinks */
                void PrintHyperlinks(GVJ_t* job);
 
-               unsigned int _pageId;   /* sequential page id, starting from 1 */
-               unsigned int _shapeId;  /* sequential shape id, starting from 1 */
-               unsigned int _hyperlinkId;      /* sequential shape id, starting from 1 */
+               unsigned int _pageId = 0;       /* sequential page id, starting from 1 */
+               unsigned int _shapeId = 0;      /* sequential shape id, starting from 1 */
+               unsigned int _hyperlinkId = 0;  /* sequential shape id, starting from 1 */
                
-               bool _inComponent;              /* whether we currently inside a node/edge, or not */
+               bool _inComponent = false;              /* whether we currently inside a node/edge, or not */
                
                Graphics _graphics;             /* currently collected graphics within a component */
                Texts _texts;                   /* currently collected texts within a component */