Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74345 - in trunk/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-09-11 12:57:25


Author: danieljames
Date: 2011-09-11 12:57:23 EDT (Sun, 11 Sep 2011)
New Revision: 74345
URL: http://svn.boost.org/trac/boost/changeset/74345

Log:
Quickbook: Close any open sections at end of document.
Added:
   trunk/tools/quickbook/test/section_1_5-unclosed.gold (contents, props changed)
   trunk/tools/quickbook/test/section_1_5-unclosed.quickbook (contents, props changed)
Text files modified:
   trunk/tools/quickbook/src/doc_info_actions.cpp | 14 ++++++++++++++
   trunk/tools/quickbook/src/quickbook.cpp | 4 ----
   trunk/tools/quickbook/test/Jamfile.v2 | 1 +
   3 files changed, 15 insertions(+), 4 deletions(-)

Modified: trunk/tools/quickbook/src/doc_info_actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/doc_info_actions.cpp (original)
+++ trunk/tools/quickbook/src/doc_info_actions.cpp 2011-09-11 12:57:23 EDT (Sun, 11 Sep 2011)
@@ -407,6 +407,20 @@
             return;
         }
 
+ // Close any open sections.
+ if (actions.section_level != 0) {
+ detail::outwarn(actions.filename)
+ << "Warning missing [endsect] detected at end of file."
+ << std::endl;
+
+ while(actions.section_level > 0) {
+ out << "</section>";
+ --actions.section_level;
+ }
+
+ actions.qualified_section_id.clear();
+ }
+
         // We've finished generating our output. Here's what we'll do
         // *after* everything else.
         out << "\n</" << actions.doc_type << ">\n\n";

Modified: trunk/tools/quickbook/src/quickbook.cpp
==============================================================================
--- trunk/tools/quickbook/src/quickbook.cpp (original)
+++ trunk/tools/quickbook/src/quickbook.cpp 2011-09-11 12:57:23 EDT (Sun, 11 Sep 2011)
@@ -116,10 +116,6 @@
         actions& actor)
     {
         bool r = parse_file(filein_, actor);
- if (actor.section_level != 0)
- detail::outwarn(filein_)
- << "Warning missing [endsect] detected at end of file."
- << std::endl;
 
         if(actor.error_count)
         {

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2011-09-11 12:57:23 EDT (Sun, 11 Sep 2011)
@@ -46,6 +46,7 @@
     [ quickbook-test include_1_6-2 ]
     [ quickbook-test section_1_4 ]
     [ quickbook-test section_1_5 ]
+ [ quickbook-test section_1_5-unclosed ]
     [ quickbook-test heading_1_1 ]
     [ quickbook-test heading_1_3 ]
     [ quickbook-test heading_1_6 ]

Added: trunk/tools/quickbook/test/section_1_5-unclosed.gold
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/section_1_5-unclosed.gold 2011-09-11 12:57:23 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="unclosed_section" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Unclosed section</title>
+ <section id="unclosed_section.unclosed">
+ <title><link linkend="unclosed_section.unclosed">Unclosed Section should be closed
+ with a warning</link></title>
+ </section>
+</article>

Added: trunk/tools/quickbook/test/section_1_5-unclosed.quickbook
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/section_1_5-unclosed.quickbook 2011-09-11 12:57:23 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,5 @@
+[article Unclosed section
+[quickbook 1.5]
+]
+
+[section:unclosed Unclosed Section should be closed with a warning]
\ No newline at end of file


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk