diff options
author | David Boddie <dboddie@trolltech.com> | 2009-05-20 12:29:10 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-05-20 12:29:10 (GMT) |
commit | 095fe67c4a669f038ea7c14613efe5cb9453fa74 (patch) | |
tree | d5bb5d35f59d26b5992c13e36146e805c37eb27e /tools | |
parent | 675c41f92fa72753fea364b73639fd9e0c7cc0d5 (diff) | |
parent | 3f705ded78ed54ec63ca09cc81dfb68bc2235190 (diff) | |
download | Qt-095fe67c4a669f038ea7c14613efe5cb9453fa74.zip Qt-095fe67c4a669f038ea7c14613efe5cb9453fa74.tar.gz Qt-095fe67c4a669f038ea7c14613efe5cb9453fa74.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'tools')
-rw-r--r-- | tools/linguist/shared/java.cpp | 16 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 29 |
2 files changed, 32 insertions, 13 deletions
diff --git a/tools/linguist/shared/java.cpp b/tools/linguist/shared/java.cpp index 912a8d7..4c244d2 100644 --- a/tools/linguist/shared/java.cpp +++ b/tools/linguist/shared/java.cpp @@ -58,7 +58,7 @@ enum { Tok_Eof, Tok_class, Tok_return, Tok_tr, Tok_Comment, Tok_String, Tok_Colon, Tok_Dot, Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen, Tok_RightParen, Tok_Comma, Tok_Semicolon, - Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq }; + Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq, Tok_null }; class Scope { @@ -142,7 +142,11 @@ static int getToken() case 'c': if ( yyIdent == QLatin1String("class") ) return Tok_class; - break; + break; + case 'n': + if ( yyIdent == QLatin1String("null") ) + return Tok_null; + break; } } switch ( yyIdent.at(0).toLatin1() ) { @@ -382,9 +386,11 @@ static bool matchInteger( qlonglong *number) static bool matchStringOrNull(QString &s) { bool matches = matchString(s); - qlonglong num = 0; - if (!matches) matches = matchInteger(&num); - return matches && num == 0; + if (!matches) { + matches = (yyTok == Tok_null); + if (matches) yyTok = getToken(); + } + return matches; } /* diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 7702628..13d52bf 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2079,7 +2079,17 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela CodeMarker *marker, CodeMarker::SynopsisStyle style) { if (!section.members.isEmpty()) { - out() << "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; + bool twoColumn = false; + if (style == CodeMarker::SeparateList) { + twoColumn = (section.members.count() >= 16); + } else if (section.members.first()->type() == Node::Property) { + twoColumn = (section.members.count() >= 5); + } + if (twoColumn) + out() << "<p><table width=\"100%\" border=\"0\" cellpadding=\"0\"" + " cellspacing=\"0\">\n" + << "<tr><td width=\"45%\" valign=\"top\">"; + out() << "<ul>\n"; int i = 0; NodeList::ConstIterator m = section.members.begin(); @@ -2089,17 +2099,22 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela continue; } - out() << "<tr><td class=\"memItemLeft\" nowrap align=\"right\" valign=\"top\">"; + if (twoColumn && i == (int) (section.members.count() + 1) / 2) + out() << "</ul></td><td valign=\"top\"><ul>\n"; + + out() << "<li><div class=\"fn\"></div>"; if (style == CodeMarker::Accessors) out() << "<b>"; generateSynopsis(*m, relative, marker, style); if (style == CodeMarker::Accessors) out() << "</b>"; - out() << "</td></tr>\n"; + out() << "</li>\n"; i++; ++m; } - out() << "</table>\n"; + out() << "</ul>\n"; + if (twoColumn) + out() << "</td></tr>\n</table></p>\n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -2114,7 +2129,7 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, const N { QList<QPair<ClassNode *, int> >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { - out() << "<li><div bar=2 class=\"fn\"></div>"; + out() << "<li><div class=\"fn\"></div>"; out() << (*p).second << " "; if ((*p).second == 1) { out() << section.singularMember; @@ -2410,9 +2425,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)" static const QString linkTag("link"); for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (i != 0) - html += " </td><td class=\"memItemRight\" valign=\"bottom\">"; + if (src.at(i) == charLangle && src.at(i + 1) == charAt) { i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { QString link = linkForNode( |