GNOME Bugzilla – Bug 661499
Namespaces lead to long names and graphs stretch off the page.
Last modified: 2012-05-19 12:26:52 UTC
Created attachment 198818 [details] [review] A diff -U 2 patch. Big C++ projects require the use of namespaces. While that helps keep code organized, it leads to very long names when you write things out in full. Doxygen's graphs include the full names of things, and one can get names like dingleblatter::learning::logpopper::prepareToDoWork as the label of a node. Doxygen's nice diagrams that show class inheritance and function calls get warped by these names. The boxes become highly elongated, and they don't fit well onto a page or a screen. So, this patch folds long names. It adds a function to src/dot.cpp .
Hi Greg, I like the idea, but I do not understand the magic computations you do with foldlength. Can you explain? Is it there to prevent that a single or small number of characters end up alone on the last line?
The basic idea there is to try to keep the lengths of the lines (after folding) similar. For instance, assume foldlength starts at 17, but the first good spot to fold is (hypothetically) 35 characters in. In that case, your box is going to be 35 characters long, so it would be silly to continue with a relatively short foldlength of 17. You might as well increase it to allow the second line to be about the same length as the first. Ideally, all the lines would be nearly the same length. One could write some fancy code to optimize it, but this does a reasonable approximation. Or, do you mean the "e-p > foldlength/3" ? That's there to ensure that we don't split of a tiny short section onto the final line.
I'll include a variant of your patch in the next subversion update.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.1. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.