summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-10-09 11:32:31 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-10-09 11:32:31 (GMT)
commitf23e59f2543f592bcbc2358c1d51825ab71f88bd (patch)
tree30ada6e8b0dac656322218756ea5f1b41c214830 /src/util.cpp
parentd2b8ae16cb99621827f5dd860222c27e629f5a7f (diff)
downloadDoxygen-f23e59f2543f592bcbc2358c1d51825ab71f88bd.zip
Doxygen-f23e59f2543f592bcbc2358c1d51825ab71f88bd.tar.gz
Doxygen-f23e59f2543f592bcbc2358c1d51825ab71f88bd.tar.bz2
Problem with round brackets in PS output
In case we use the doxygen inheritance diagrams in doxygen (i.e. `HAVE_DOT=NO`) for a construct like (based on #7302): ``` template <char C> struct one { }; /// The struct str_040 struct str_040 : one<'('> { }; ``` this will lead to a postscript error (epstopdf) as the `(` (and analogous the `)`) have to be escaped.
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 85536ca..e1e9fb5 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6183,6 +6183,26 @@ QCString convertToJSString(const char *s, bool applyTextDir)
return convertCharEntitiesToUTF8(growBuf.get());
}
+QCString convertToPSString(const char *s)
+{
+ static GrowBuf growBuf;
+ growBuf.clear();
+ if (s==0) return "";
+ const char *p=s;
+ char c;
+ while ((c=*p++))
+ {
+ switch (c)
+ {
+ case '(': growBuf.addStr("\\("); break;
+ case ')': growBuf.addStr("\\)"); break;
+ default: growBuf.addChar(c); break;
+ }
+ }
+ growBuf.addChar(0);
+ return growBuf.get();
+}
+
QCString convertToLaTeX(const QCString &s,bool insideTabbing,bool keepSpaces)
{
QGString result;