From: Matthew Fernandez <matthew.fernandez@gmail.com> Date: Thu, 1 Apr 2021 02:12:35 +0000 (-0700) Subject: use C++11 in-class member initialization to remove the need for an explicit ctor X-Git-Tag: 2.47.1~10^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c4fbc2d2f27dca4ba2ce3eac2eaf616a9a31b1b;p=graphviz use C++11 in-class member initialization to remove the need for an explicit ctor This is an equivalent way of saying the same thing. --- diff --git a/plugin/visio/VisioRender.cpp b/plugin/visio/VisioRender.cpp index 34cc6d4dd..387bfc5ad 100644 --- a/plugin/visio/VisioRender.cpp +++ b/plugin/visio/VisioRender.cpp @@ -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"); diff --git a/plugin/visio/VisioRender.h b/plugin/visio/VisioRender.h index d019a06cf..b4e2c5740 100644 --- a/plugin/visio/VisioRender.h +++ b/plugin/visio/VisioRender.h @@ -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 */