diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-10-27 20:10:16 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-10-27 20:10:16 (GMT) |
commit | d2aec1bac5dbf774dd640b36aa0a6d7c1288c570 (patch) | |
tree | 7b31e0941321a116a730c80e26726da9202178c3 /src/htmldocvisitor.cpp | |
parent | a62d9f8f1c2c97d454ff33bc1a4911d1362d9766 (diff) | |
download | Doxygen-d2aec1bac5dbf774dd640b36aa0a6d7c1288c570.zip Doxygen-d2aec1bac5dbf774dd640b36aa0a6d7c1288c570.tar.gz Doxygen-d2aec1bac5dbf774dd640b36aa0a6d7c1288c570.tar.bz2 |
Release-1.6.1-20091027
Diffstat (limited to 'src/htmldocvisitor.cpp')
-rw-r--r-- | src/htmldocvisitor.cpp | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index fa25951..49a0de2 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -34,6 +34,34 @@ static const int NUM_HTML_LIST_TYPES = 4; static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"}; +static QCString convertIndexWordToAnchor(const QString &word) +{ + static char hex[] = "0123456789abcdef"; + uint i; + QCString result; + for (i=0;i<word.length();i++) + { + int c = word.at(i); + if (isId(c)) + { + result+=c; + } + else if (isspace(c)) + { + result+="_"; + } + else + { + char cs[3]; + cs[0]=hex[c>>4]; + cs[1]=hex[c&0xf]; + cs[2]=0; + result+=cs; + } + } + return result; +} + static bool mustBeOutsideParagraph(DocNode *n) { switch (n->kind()) @@ -293,7 +321,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) case DocVerbatim::XmlOnly: /* nothing */ break; - + case DocVerbatim::Dot: { static int dotindex = 1; @@ -470,8 +498,20 @@ void HtmlDocVisitor::visit(DocFormula *f) } } -void HtmlDocVisitor::visit(DocIndexEntry *) +void HtmlDocVisitor::visit(DocIndexEntry *e) { + QCString anchor = convertIndexWordToAnchor(e->entry()); + if (e->member()) + { + anchor.prepend(e->member()->anchor()+"_"); + } + m_t << "<a name=\"" << anchor << "\"></a>"; + //printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n", + // e->entry().data(), + // e->scope() ? e->scope()->name().data() : "<null>", + // e->member() ? e->member()->name().data() : "<null>" + // ); + Doxygen::indexList.addIndexItem(e->scope(),e->member(),anchor,e->entry()); } void HtmlDocVisitor::visit(DocSimpleSectSep *) |