]> granicus.if.org Git - graphviz/commitdiff
take a reference instead of a pointer in Visio::Render::PrintEdgeShape
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Apr 2021 01:42:00 +0000 (18:42 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Apr 2021 04:30:38 +0000 (21:30 -0700)
Similar to the previous commits, this function assumes its input pointer is
non-null, so we may as well use the more convenient C++ syntax for this. This
will also ease some upcoming changes to convert the underlying raw pointers to
smart pointers.

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

index 2e546cf6a2bd743b025adf620fb0ec565c3b0b6b..a965c0c7bb1cf5c1c30005ccd23383a02467eb2d 100644 (file)
@@ -192,7 +192,7 @@ namespace Visio
                        bool firstConnector = true;
                        for (Graphics::const_iterator nextGraphic = _graphics.begin(), lastGraphic = _graphics.end(); nextGraphic != lastGraphic; ++nextGraphic)
                                if (firstConnector && PrintEdgeShape(job,
-                                       _graphics[0],
+                                       *_graphics[0],
                                        beginId == _nodeIds.end() ? 0 : beginId->second,
                                        endId == _nodeIds.end() ? 0 : endId->second,
                                        EDGE_TYPE(agroot(edge))))
@@ -337,9 +337,9 @@ namespace Visio
                gvputs(job, "</Shape>\n");
        }
        
-       bool Render::PrintEdgeShape(GVJ_t* job, const Graphicgraphic, unsigned int beginId, unsigned int endId, int edgeType)
+       bool Render::PrintEdgeShape(GVJ_t* job, const Graphic &graphic, unsigned int beginId, unsigned int endId, int edgeType)
        {
-               if (const Connection* connection = graphic->GetConnection())
+               if (const Connection* connection = graphic.GetConnection())
                {
                        pointf first = connection->GetFirst();
                        pointf last = connection->GetLast();
@@ -458,7 +458,7 @@ namespace Visio
                        PrintTexts(job);
                        
                        /* output Line, Fill, Geom */
-                       graphic->Print(job, first, last, edgeType != ET_LINE && edgeType != ET_PLINE);
+                       graphic.Print(job, first, last, edgeType != ET_LINE && edgeType != ET_PLINE);
                        
                        gvputs(job, "</Shape>\n");
                        return true;
index 9a7a0951a05e3b8bce95f91487c8770b267ee5dd..cd14d79cfacf6618ee8d4ad0243afe10746d8f8b 100644 (file)
@@ -64,7 +64,7 @@ namespace Visio
                void PrintInnerShape(GVJ_t* job, const Graphic& graphic, unsigned int outerId, boxf outerBounds);
                
                /* output the graphic as an edge connector, given the start and end node ids */
-               bool PrintEdgeShape(GVJ_t* job, const Graphicgraphic, unsigned int beginId, unsigned int endId, int edgeType);
+               bool PrintEdgeShape(GVJ_t* job, const Graphic &graphic, unsigned int beginId, unsigned int endId, int edgeType);
                
                /* output all the collected texts */
                void PrintTexts(GVJ_t* job);