summaryrefslogtreecommitdiffstats
path: root/src/dot.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2002-07-28 20:14:48 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2002-07-28 20:14:48 (GMT)
commit9c8ea2e90bb38ba21675799fe364fc7a546b020c (patch)
treeeb4c65d3676c6ecd00dc532bcb6420f9eb71aa32 /src/dot.cpp
parenta2bf2ebcf009a45c53748f0c7f9182c017c0bcd9 (diff)
downloadDoxygen-9c8ea2e90bb38ba21675799fe364fc7a546b020c.zip
Doxygen-9c8ea2e90bb38ba21675799fe364fc7a546b020c.tar.gz
Doxygen-9c8ea2e90bb38ba21675799fe364fc7a546b020c.tar.bz2
Release-1.2.17-20020728
Diffstat (limited to 'src/dot.cpp')
-rw-r--r--src/dot.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/dot.cpp b/src/dot.cpp
index a5ad72b..2e9ca54 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -75,7 +75,24 @@ static bool convertMapFile(QTextStream &t,const char *mapName)
//printf("ReadLine `%s'\n",buf);
if (strncmp(buf,"rect",4)==0)
{
+ // obtain the url and the coordinates in the order used by graphviz-1.5
sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y2,&x2,&y1);
+ // later versions of graphviz corrected the y coordinate order
+ // the rule is that y2>=y1, so test and switch if needed
+ if (y2<y1)
+ {
+ int temp=y2;
+ y2=y1;
+ y1=temp;
+ }
+ // there shouldn't be any need for this for known versions of graphviz
+ // but it can't do any harm to check that x follows the rules as well
+ if (x2<x1)
+ {
+ int temp=x2;
+ x2=x1;
+ x1=temp;
+ }
char *refPtr = url;
char *urlPtr = strchr(url,'$');
//printf("url=`%s'\n",url);
@@ -230,7 +247,7 @@ class DotNodeList : public QList<DotNode>
/*! helper function that deletes all nodes in a connected graph, given
* one of the graph's nodes
*/
-static void deleteNodes(DotNode *node,SIntDict<DotNode> *skipNodes=0)
+static void deleteNodes(DotNode *node,SDict<DotNode> *skipNodes=0)
{
//printf("deleteNodes skipNodes=%p\n",skipNodes);
static DotNodeList deletedNodes;
@@ -311,7 +328,7 @@ void DotNode::removeParent(DotNode *n)
if (m_parents) m_parents->remove(n);
}
-void DotNode::deleteNode(DotNodeList &deletedList,SIntDict<DotNode> *skipNodes)
+void DotNode::deleteNode(DotNodeList &deletedList,SDict<DotNode> *skipNodes)
{
if (m_deleted) return; // avoid recursive loops in case the graph has cycles
m_deleted=TRUE;
@@ -337,7 +354,7 @@ void DotNode::deleteNode(DotNodeList &deletedList,SIntDict<DotNode> *skipNodes)
}
// add this node to the list of deleted nodes.
//printf("skipNodes=%p find(%p)=%p\n",skipNodes,this,skipNodes ? skipNodes->find((int)this) : 0);
- if (skipNodes==0 || skipNodes->find((int)this)==0)
+ if (skipNodes==0 || skipNodes->find((char*)this)==0)
{
//printf("deleting\n");
deletedList.append(this);
@@ -933,13 +950,13 @@ DotGfxHierarchyTable::DotGfxHierarchyTable()
DotGfxHierarchyTable::~DotGfxHierarchyTable()
{
//printf("DotGfxHierarchyTable::~DotGfxHierarchyTable\n");
- SIntDict<DotNode> skipNodes(17);
+ SDict<DotNode> skipNodes(17);
skipNodes.setAutoDelete(TRUE);
DotNode *n = m_rootNodes->first();
while (n)
{
//printf("adding %s %p\n",n->label().data(),n);
- skipNodes.append((int)n,n);
+ skipNodes.append((char*)n,n);
n=m_rootNodes->next();
}
n = m_rootNodes->first();