From 96b1378f83bd3763dff2c911ec767d5560303992 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Fri, 17 Oct 2008 17:03:17 +1000 Subject: Squashed commit of the following: commit eadbde83662d4b50398b03432ce5590484a3c867 Author: michi Date: Fri Oct 17 17:01:26 2008 +1000 Fixed broken rendering of headers and footers with Safari. --- cpp/src/slice2html/Gen.cpp | 91 ++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 40 deletions(-) (limited to 'cpp/src/slice2html/Gen.cpp') diff --git a/cpp/src/slice2html/Gen.cpp b/cpp/src/slice2html/Gen.cpp index 49ae1cbd617..f1e9e5b02e0 100644 --- a/cpp/src/slice2html/Gen.cpp +++ b/cpp/src/slice2html/Gen.cpp @@ -250,7 +250,6 @@ Slice::GeneratorBase::openDoc(const string& file, const string& title, const str { _out << h2; } - _indexFooter = getFooter(footer); _out.inc(); _out.inc(); } @@ -291,11 +290,11 @@ Slice::GeneratorBase::openDoc(const ContainedPtr& c) // Close an open HTML file after writing the footer. // void -Slice::GeneratorBase::closeDoc() +Slice::GeneratorBase::closeDoc(const string& footer) { _out.dec(); _out.dec(); - _out << nl << (!_indexFooter.empty() ? _indexFooter : _footer); + _out << nl << (!footer.empty() ? footer : _footer); _out << nl; } @@ -738,23 +737,24 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c) } path += imageDir + "/"; - prevImage = "\"Previous\"/"; - nextImage = "\"Next\"/"; - upImage = "\"Up\"/"; - homeImage = "\"Home\"/"; - indexImage = "\"Index\"/"; + prevImage = "\"Previous\""; + nextImage = "\"Next\""; + upImage = "\"Up\""; + homeImage = "\"Home\""; + indexImage = "\"Index\""; } _out << nl << ""; - start("div", "HeaderFooter"); - - start("table", "ButtonTable"); + start("table", "HeaderFooter"); start("tr"); + start("td align=\"left\""); + start("table"); + start("tr"); start("td"); _out << "" << homeImage << ""; - end(); + end(); // td if(!imageDir.empty() || !isFirst) { @@ -805,16 +805,22 @@ Slice::GeneratorBase::printHeaderFooter(const ContainedPtr& c) _out << "" << indexImage << ""; end(); - end(); - end(); + end(); // tr + end(); // table + end(); // td + start("td align=\"center\""); printSearch(); + end(); + start("td align=\"right\""); printLogo(c, container, onEnumPage); + end(); - _out << nl << ""; + end(); // tr + end(); // table - end(); + _out << nl << "" << nl; } void @@ -822,9 +828,7 @@ Slice::GeneratorBase::printSearch() { if(!_searchAction.empty()) { - _out << nl << "
"; - _out.inc(); - start("table", "SearchTable"); + start("table"); start("tr"); start("td"); _out << nl << "
"; _out << nl << ""; - end(); _out.dec(); - _out << nl << "
"; - end(); - end(); end(); - _out.dec(); - _out << nl << "
"; + _out << nl << ""; + end(); // td + end(); // tr + end(); // table } } @@ -863,7 +865,7 @@ Slice::GeneratorBase::printLogo(const ContainedPtr& c, const ContainerPtr& conta { _out << ""; } - _out << "\"Logo\"/"; + _out << "\"Logo\""; if(!_logoURL.empty()) { _out << ""; @@ -1646,9 +1648,10 @@ Slice::StartPageGenerator::generate(const ModulePtr& m) void Slice::StartPageGenerator::printHeaderFooter() { - start("div", "HeaderFooter"); - - start("table", "ButtonTable"); + start("table", "HeaderFooter"); + start("tr"); + start("td align=\"left\""); + start("table"); start("tr"); start("td"); string imageDir = getImageDir(); @@ -1659,17 +1662,21 @@ Slice::StartPageGenerator::printHeaderFooter() else { string src = imageDir + "/index.gif"; - _out << "\"Index"; + _out << "\"Index"; } - end(); - end(); - end(); + end(); // td + end(); // tr + end(); // table + end(); // td + start("td align=\"center\""); printSearch(); + end(); // td if(!imageDir.empty()) { - start("table", "LogoTable"); + start("td align=\"right\""); + start("table"); start("tr"); start("td"); string logoURL = getLogoURL(); @@ -1677,17 +1684,19 @@ Slice::StartPageGenerator::printHeaderFooter() { _out << ""; } - _out << "\"Logo\"/"; + _out << "\"Logo\""; if(!logoURL.empty()) { _out << ""; } - end(); - end(); - end(); + end(); // td + end(); // tr + end(); // table + end(); // td } - end(); + end(); // tr + end(); // table } Slice::FileVisitor::FileVisitor(Files& files) @@ -1774,6 +1783,7 @@ Slice::StartPageVisitor::visitModuleStart(const ModulePtr& m) TOCGenerator::TOCGenerator(const Files& files, const string& header, const string& footer) : GeneratorBase(_out, files) { + _footer = footer; openDoc("_sindex.html", "Slice API Index", header, footer); start("h1"); @@ -1820,7 +1830,8 @@ TOCGenerator::writeTOC() _symbols.sort(); _symbols.unique(); - closeDoc(); + string f = getFooter(_footer); + closeDoc(getFooter(_footer)); } const ContainedList& -- cgit v1.2.3