]> granicus.if.org Git - graphviz/commitdiff
take a reference instead of a pointer in Visio::Render::PrintInnerShape
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Apr 2021 01:38:57 +0000 (18:38 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Apr 2021 04:30:38 +0000 (21:30 -0700)
Similar to the previous commit, 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 70dca710dae6ba7191a83ec6d8b4d1c47448e900..2e546cf6a2bd743b025adf620fb0ec565c3b0b6b 100644 (file)
@@ -157,7 +157,7 @@ namespace Visio
                        /* output subshapes */
                        gvputs(job, "<Shapes>\n");
                        for (Graphics::const_iterator nextGraphic = _graphics.begin(), lastGraphic = _graphics.end(); nextGraphic != lastGraphic; ++nextGraphic)
-                               PrintInnerShape(job, *nextGraphic, outerShapeId, outerBounds);
+                               PrintInnerShape(job, **nextGraphic, outerShapeId, outerBounds);
                        gvputs(job, "</Shapes>\n");
                                
                        gvputs(job, "</Shape>\n");
@@ -305,9 +305,9 @@ namespace Visio
                gvputs(job, "</Shape>\n");
        }
        
-       void Render::PrintInnerShape(GVJ_t* job, const Graphicgraphic, unsigned int outerId, boxf outerBounds)
+       void Render::PrintInnerShape(GVJ_t* job, const Graphic &graphic, unsigned int outerId, boxf outerBounds)
        {
-               boxf innerBounds = graphic->GetBounds();
+               boxf innerBounds = graphic.GetBounds();
                
                /* compute scale. if infinite, scale by 0 instead */
                double xscale = 1.0 / (outerBounds.UR.x - outerBounds.LL.x);
@@ -332,7 +332,7 @@ namespace Visio
                gvputs(job, "</Misc>\n");
                
                /* output Line, Fill, Geom */
-               graphic->Print(job, innerBounds.LL, innerBounds.UR, true);
+               graphic.Print(job, innerBounds.LL, innerBounds.UR, true);
 
                gvputs(job, "</Shape>\n");
        }
index 6cf5abdcd6fc67536f836f437e5ddd645388af6f..9a7a0951a05e3b8bce95f91487c8770b267ee5dd 100644 (file)
@@ -61,7 +61,7 @@ namespace Visio
                void PrintOuterShape(GVJ_t* job, const Graphic &graphic);
                
                /* output the graphic as a subshape of a top level shape, given its id and bounds */
-               void PrintInnerShape(GVJ_t* job, const Graphic* graphic, unsigned int outerId, boxf outerBounds);
+               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 Graphic* graphic, unsigned int beginId, unsigned int endId, int edgeType);