diff options
-rw-r--r-- | src/compound.xsd | 1 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 43 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 46 | ||||
-rw-r--r-- | src/xmldocvisitor.cpp | 8 | ||||
-rw-r--r-- | testing/006/indexpage.xml | 3 |
5 files changed, 57 insertions, 44 deletions
diff --git a/src/compound.xsd b/src/compound.xsd index a1c9784..2521a2e 100644 --- a/src/compound.xsd +++ b/src/compound.xsd @@ -473,7 +473,6 @@ <xsd:element name="title" type="docTitleType" minOccurs="0" /> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> <xsd:element name="para" type="docParaType" minOccurs="1" maxOccurs="unbounded" /> - <xsd:element name="simplesectsep" type="docEmptyType" minOccurs="0"/> </xsd:sequence> </xsd:sequence> <xsd:attribute name="kind" type="DoxSimpleSectKind" /> diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 9939ef2..c70f2c5 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -44,27 +44,30 @@ static QCString convertIndexWordToAnchor(const QString &word) QCString result; const char *str = word.data(); unsigned char c; - while ((c = *str++)) - { - if ((c >= 'a' && c <= 'z') || // ALPHA - (c >= 'A' && c <= 'A') || // ALPHA - (c >= '0' && c <= '9') || // DIGIT - c == '-' || - c == '.' || - c == '_' || - c == '~' - ) - { - result += c; - } - else + if (str) + { + while ((c = *str++)) { - char enc[4]; - enc[0] = '%'; - enc[1] = hex[(c & 0xf0) >> 4]; - enc[2] = hex[c & 0xf]; - enc[3] = 0; - result += enc; + if ((c >= 'a' && c <= 'z') || // ALPHA + (c >= 'A' && c <= 'A') || // ALPHA + (c >= '0' && c <= '9') || // DIGIT + c == '-' || + c == '.' || + c == '_' || + c == '~' + ) + { + result += c; + } + else + { + char enc[4]; + enc[0] = '%'; + enc[1] = hex[(c & 0xf0) >> 4]; + enc[2] = hex[c & 0xf]; + enc[3] = 0; + result += enc; + } } } return result; diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 68f0f06..eed36bc 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -38,17 +38,20 @@ static QCString escapeLabelName(const char *s) QCString result; const char *p=s; char c; - while ((c=*p++)) + if (p) { - switch (c) + while ((c=*p++)) { - case '%': result+="\\%"; break; - case '|': result+="\\texttt{\"|}"; break; - case '!': result+="\"!"; break; - case '{': result+="\\lcurly{}"; break; - case '}': result+="\\rcurly{}"; break; - case '~': result+="````~"; break; // to get it a bit better in index together with other special characters - default: result+=c; + switch (c) + { + case '%': result+="\\%"; break; + case '|': result+="\\texttt{\"|}"; break; + case '!': result+="\"!"; break; + case '{': result+="\\lcurly{}"; break; + case '}': result+="\\rcurly{}"; break; + case '~': result+="````~"; break; // to get it a bit better in index together with other special characters + default: result+=c; + } } } return result; @@ -73,19 +76,22 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s) const char *p=s; char str[2]; str[1]=0; char c; - while ((c=*p++)) + if (p) { - switch (c) + while ((c=*p++)) { - case '!': m_t << "\"!"; break; - case '"': m_t << "\"\""; break; - case '@': m_t << "\"@"; break; - case '|': m_t << "\\texttt{\"|}"; break; - case '[': m_t << "["; break; - case ']': m_t << "]"; break; - case '{': m_t << "\\lcurly{}"; break; - case '}': m_t << "\\rcurly{}"; break; - default: str[0]=c; filter(str); break; + switch (c) + { + case '!': m_t << "\"!"; break; + case '"': m_t << "\"\""; break; + case '@': m_t << "\"@"; break; + case '|': m_t << "\\texttt{\"|}"; break; + case '[': m_t << "["; break; + case ']': m_t << "]"; break; + case '{': m_t << "\\lcurly{}"; break; + case '}': m_t << "\\rcurly{}"; break; + default: str[0]=c; filter(str); break; + } } } return result; diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index cab4578..f74a6a2 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -337,9 +337,13 @@ void XmlDocVisitor::visit(DocIndexEntry *ie) "</indexentry>"; } -void XmlDocVisitor::visit(DocSimpleSectSep *) +void XmlDocVisitor::visit(DocSimpleSectSep *sep) { - m_t << "<simplesectsep/>"; + if (sep->parent() && sep->parent()->kind()==DocNode::Kind_SimpleSect) + { + visitPost((DocSimpleSect*)sep->parent()); // end current section + visitPre((DocSimpleSect*)sep->parent()); // start new section + } } void XmlDocVisitor::visit(DocCite *cite) diff --git a/testing/006/indexpage.xml b/testing/006/indexpage.xml index edb2904..1afe69b 100644 --- a/testing/006/indexpage.xml +++ b/testing/006/indexpage.xml @@ -7,7 +7,8 @@ <para> <simplesect kind="author"> <para>John Doe </para> - <simplesectsep/> + </simplesect> + <simplesect kind="author"> <para>Jane Doe </para> </simplesect> <simplesect kind="authors"> |