|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63733 - in trunk/tools/quickbook: detail doc test
From: daniel_james_at_[hidden]
Date: 2010-07-08 03:12:45
Author: danieljames
Date: 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
New Revision: 63733
URL: http://svn.boost.org/trac/boost/changeset/63733
Log:
Fix documentation info handling in included files. Refs #3907.
Added:
trunk/tools/quickbook/test/include_1_6-2.gold (contents, props changed)
trunk/tools/quickbook/test/include_1_6-2.quickbook
- copied, changed from r63732, /trunk/tools/quickbook/test/include_1_5.quickbook
trunk/tools/quickbook/test/include_1_6.gold (contents, props changed)
trunk/tools/quickbook/test/include_1_6.quickbook
- copied, changed from r63732, /trunk/tools/quickbook/test/include_1_5.quickbook
Text files modified:
trunk/tools/quickbook/detail/actions.cpp | 28 ++++++++++++++++++++++++----
trunk/tools/quickbook/doc/quickbook.qbk | 4 ++++
trunk/tools/quickbook/test/Jamfile.v2 | 2 ++
trunk/tools/quickbook/test/include_1_5.quickbook | 3 ++-
trunk/tools/quickbook/test/include_1_6-2.quickbook | 3 +--
trunk/tools/quickbook/test/include_1_6.quickbook | 4 +---
6 files changed, 34 insertions(+), 10 deletions(-)
Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp (original)
+++ trunk/tools/quickbook/detail/actions.cpp 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -1389,10 +1389,23 @@
std::swap(actions.filename, filein);
// save the doc info strings
- actions.doc_type.swap(doc_type);
- actions.doc_id.swap(doc_id);
- actions.doc_dirname.swap(doc_dirname);
- actions.doc_last_revision.swap(doc_last_revision);
+ if(qbk_version_n >= 106) {
+ doc_type = actions.doc_type;
+ doc_id = actions.doc_id;
+ doc_dirname = actions.doc_dirname;
+ doc_last_revision = actions.doc_last_revision;
+ }
+ else {
+ actions.doc_type.swap(doc_type);
+ actions.doc_id.swap(doc_id);
+ actions.doc_dirname.swap(doc_dirname);
+ actions.doc_last_revision.swap(doc_last_revision);
+ }
+
+ // save the version info
+ unsigned qbk_major_version_store = qbk_major_version;
+ unsigned qbk_minor_version_store = qbk_minor_version;
+ unsigned qbk_version_n_store = qbk_version_n;
// scope the macros
string_symbols macro = actions.macro;
@@ -1420,6 +1433,13 @@
actions.doc_id.swap(doc_id);
actions.doc_dirname.swap(doc_dirname);
actions.doc_last_revision.swap(doc_last_revision);
+
+ if(qbk_version_n >= 106 || qbk_version_n_store >= 106)
+ {
+ qbk_major_version = qbk_major_version_store;
+ qbk_minor_version = qbk_minor_version_store;
+ qbk_version_n = qbk_version_n_store;
+ }
// restore the macros
actions.macro = macro;
Modified: trunk/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- trunk/tools/quickbook/doc/quickbook.qbk (original)
+++ trunk/tools/quickbook/doc/quickbook.qbk 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -207,6 +207,10 @@
* Preparing for quickbook 1.6:
* When automatically generating ids for headers, use the quickbook
source, rather than the generated docbook.
+ * Fix id generation in included files. It wasn't correctly using the
+ main document's documentation id.
+ * Correctly restore the quickbook version switch after including a file
+ with a different version.
[endsect]
Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 (original)
+++ trunk/tools/quickbook/test/Jamfile.v2 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -30,6 +30,8 @@
#[ quickbook-test xinclude ]
[ quickbook-test import ]
[ quickbook-test include_1_5 ]
+ [ quickbook-test include_1_6 ]
+ [ quickbook-test include_1_6-2 ]
[ quickbook-test section_1_4 ]
[ quickbook-test section_1_5 ]
[ quickbook-test heading ]
Modified: trunk/tools/quickbook/test/include_1_5.quickbook
==============================================================================
--- trunk/tools/quickbook/test/include_1_5.quickbook (original)
+++ trunk/tools/quickbook/test/include_1_5.quickbook 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -6,4 +6,5 @@
[include include-sub.quickbook]
[include include-sub2.quickbook]
[include:foo include-sub2.quickbook]
-[include empty.quickbook]
\ No newline at end of file
+[include empty.quickbook]
+
Added: trunk/tools/quickbook/test/include_1_6-2.gold
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/include_1_6-2.gold 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -0,0 +1,20 @@
+<?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="include-test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Include Test</title>
+ <articleinfo>
+ </articleinfo>
+ <section id="include-test.test">
+ <title><link linkend="include-test.test"> Test</link></title>
+ <para>
+ Just testing.
+ </para>
+ </section>
+ <section id="foo.test">
+ <title><link linkend="foo.test"> Test</link></title>
+ <para>
+ Just testing.
+ </para>
+ </section>
+</article>
Copied: trunk/tools/quickbook/test/include_1_6-2.quickbook (from r63732, /trunk/tools/quickbook/test/include_1_5.quickbook)
==============================================================================
--- /trunk/tools/quickbook/test/include_1_5.quickbook (original)
+++ trunk/tools/quickbook/test/include_1_6-2.quickbook 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -1,9 +1,8 @@
[article Include Test
- [quickbook 1.5]
+ [quickbook 1.6]
[id include-test]
]
[include include-sub.quickbook]
[include include-sub2.quickbook]
[include:foo include-sub2.quickbook]
-[include empty.quickbook]
\ No newline at end of file
Added: trunk/tools/quickbook/test/include_1_6.gold
==============================================================================
--- (empty file)
+++ trunk/tools/quickbook/test/include_1_6.gold 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -0,0 +1,20 @@
+<?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="include-test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Include Test</title>
+ <articleinfo>
+ </articleinfo>
+ <section id="include-test.test">
+ <title><link linkend="include-test.test"> Test</link></title>
+ <para>
+ Just testing.
+ </para>
+ </section>
+ <section id="foo.test">
+ <title><link linkend="foo.test"> Test</link></title>
+ <para>
+ Just testing.
+ </para>
+ </section>
+</article>
Copied: trunk/tools/quickbook/test/include_1_6.quickbook (from r63732, /trunk/tools/quickbook/test/include_1_5.quickbook)
==============================================================================
--- /trunk/tools/quickbook/test/include_1_5.quickbook (original)
+++ trunk/tools/quickbook/test/include_1_6.quickbook 2010-07-08 03:12:43 EDT (Thu, 08 Jul 2010)
@@ -1,9 +1,7 @@
[article Include Test
- [quickbook 1.5]
+ [quickbook 1.6]
[id include-test]
]
-[include include-sub.quickbook]
[include include-sub2.quickbook]
[include:foo include-sub2.quickbook]
-[include empty.quickbook]
\ 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