Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74349 - in trunk/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-09-11 13:00:19


Author: danieljames
Date: 2011-09-11 13:00:18 EDT (Sun, 11 Sep 2011)
New Revision: 74349
URL: http://svn.boost.org/trac/boost/changeset/74349

Log:
Quickbook: Trim trailing whitespace in code blocks.
Text files modified:
   trunk/tools/quickbook/src/post_process.cpp | 2 +
   trunk/tools/quickbook/test/import.gold | 47 ++++++++++++++++++++++++++++++++++++++++
   trunk/tools/quickbook/test/import.quickbook | 1
   3 files changed, 50 insertions(+), 0 deletions(-)

Modified: trunk/tools/quickbook/src/post_process.cpp
==============================================================================
--- trunk/tools/quickbook/src/post_process.cpp (original)
+++ trunk/tools/quickbook/src/post_process.cpp 2011-09-11 13:00:18 EDT (Sun, 11 Sep 2011)
@@ -352,6 +352,7 @@
             {
                 if (*i == '\n')
                 {
+ state.printer_.trim_spaces();
                     state.out += '\n';
                     ++i;
                     if (i != l && *i != '\r')
@@ -359,6 +360,7 @@
                 }
                 else if (*i == '\r')
                 {
+ state.printer_.trim_spaces();
                     state.out += '\n';
                     ++i;
                     if (i != l && *i != '\n')

Modified: trunk/tools/quickbook/test/import.gold
==============================================================================
--- trunk/tools/quickbook/test/import.gold (original)
+++ trunk/tools/quickbook/test/import.gold 2011-09-11 13:00:18 EDT (Sun, 11 Sep 2011)
@@ -89,4 +89,51 @@
 <phrase role="special">}</phrase>
 </programlisting>
   </para>
+ <para>
+<programlisting><phrase role="keyword">class</phrase> <phrase role="identifier">x</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+
+ <co id="import.c0" linkends="import.c1" /><phrase role="identifier">x</phrase><phrase role="special">()</phrase> <phrase role="special">:</phrase> <phrase role="identifier">n</phrase><phrase role="special">(</phrase><phrase role="number">0</phrase><phrase role="special">)</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="special">}</phrase>
+
+ <co id="import.c2" linkends="import.c3" /><phrase role="special">~</phrase><phrase role="identifier">x</phrase><phrase role="special">()</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="special">}</phrase>
+
+ <co id="import.c4" linkends="import.c5" /><phrase role="keyword">int</phrase> <phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="identifier">n</phrase><phrase role="special">;</phrase>
+ <phrase role="special">}</phrase>
+
+ <co id="import.c6" linkends="import.c7" /><phrase role="keyword">void</phrase> <phrase role="identifier">set</phrase><phrase role="special">(</phrase><phrase role="keyword">int</phrase> <phrase role="identifier">n_</phrase><phrase role="special">)</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="identifier">n</phrase> <phrase role="special">=</phrase> <phrase role="identifier">n_</phrase><phrase role="special">;</phrase>
+ <phrase role="special">}</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <calloutlist>
+ <callout arearefs="import.c0" id="import.c1">
+ <para>
+ Constructor
+ </para>
+ </callout>
+ <callout arearefs="import.c2" id="import.c3">
+ <para>
+ Destructor
+ </para>
+ </callout>
+ <callout arearefs="import.c4" id="import.c5">
+ <para>
+ Get the <code><phrase role="identifier">n</phrase></code> member variable
+ </para>
+ </callout>
+ <callout arearefs="import.c6" id="import.c7">
+ <para>
+ Set the <code><phrase role="identifier">n</phrase></code> member variable
+ </para>
+ </callout>
+ </calloutlist>
 </article>

Modified: trunk/tools/quickbook/test/import.quickbook
==============================================================================
--- trunk/tools/quickbook/test/import.quickbook (original)
+++ trunk/tools/quickbook/test/import.quickbook 2011-09-11 13:00:18 EDT (Sun, 11 Sep 2011)
@@ -10,3 +10,4 @@
 
 [foo_c]
 
+[class_]
\ 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