From af7dfbdda302e55fb8a62ab224184abccab3d167 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 10 Jun 2018 15:23:04 +0200 Subject: Bug 395343 - caller graph can be improved by having caller on left & callee on right Caller graph will now have the called function on the right hand side. --- src/dot.cpp | 18 +++++++++++++----- src/dot.h | 3 ++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/dot.cpp b/src/dot.cpp index 5adc2ab..0df70c5 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -3071,14 +3071,19 @@ QCString computeMd5Signature(DotNode *root, bool renderParents, bool backArrows, const QCString &title, - QCString &graphStr + QCString &graphStr, + const char *rank ) { //printf("computeMd5Signature\n"); QGString buf; FTextStream md5stream(&buf); writeGraphHeader(md5stream,title); - if (lrRank) + if (rank) + { + md5stream << " rankdir=\"" << rank << "\";" << endl; + } + else if (lrRank) { md5stream << " rankdir=\"LR\";" << endl; } @@ -3132,14 +3137,15 @@ static bool updateDotGraph(DotNode *root, bool lrRank, bool renderParents, bool backArrows, - const QCString &title=QCString() + const QCString &title=QCString(), + const char *rank = NULL ) { QCString theGraph; // TODO: write graph to theGraph, then compute md5 checksum QCString md5 = computeMd5Signature( root,gt,format,lrRank,renderParents, - backArrows,title,theGraph); + backArrows,title,theGraph, rank); QFile f(baseName+".dot"); if (f.open(IO_WriteOnly)) { @@ -3872,6 +3878,7 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma QCString absImgName = absBaseName+"."+imgExt; bool regenerate = FALSE; + if (updateDotGraph(m_startNode, DotNode::CallGraph, absBaseName, @@ -3879,7 +3886,8 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma TRUE, // lrRank FALSE, // renderParents m_inverse, // backArrows - m_startNode->label() + m_startNode->label(), + (m_inverse ? "RL" : "LR") ) || !checkDeliverables(graphFormat==GOF_BITMAP ? absImgName : usePDFLatex ? absPdfName : absEpsName, diff --git a/src/dot.h b/src/dot.h index ab6a316..37832af 100644 --- a/src/dot.h +++ b/src/dot.h @@ -137,7 +137,8 @@ class DotNode bool lrRank, bool renderParents, bool backArrows, const QCString &title, - QCString &graphStr + QCString &graphStr, + const char *rank ); }; -- cgit v0.12