Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75257 - in branches/quickbook-dev/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-11-02 03:59:13


Author: danieljames
Date: 2011-11-02 03:59:12 EDT (Wed, 02 Nov 2011)
New Revision: 75257
URL: http://svn.boost.org/trac/boost/changeset/75257

Log:
Quickbook: Trim leading underscores in normalized ids.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/id_manager.cpp | 13 +++++++++++++
   branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold | 2 +-
   2 files changed, 14 insertions(+), 1 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/id_manager.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/id_manager.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/id_manager.cpp 2011-11-02 03:59:12 EDT (Wed, 02 Nov 2011)
@@ -303,6 +303,19 @@
             std::size_t dst = prefix;
             size += prefix;
 
+ if (src >= id.length()) {
+ return id_;
+ }
+
+ while (src < id.length() && id[src] == '_') {
+ ++src;
+ }
+
+ if (src >= id.length()) {
+ id_.append('_');
+ return id_;
+ }
+
             while (src < id.length() && dst < size) {
                 if (id[src] == '_') {
                     do {

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold 2011-11-02 03:59:12 EDT (Wed, 02 Nov 2011)
@@ -32,7 +32,7 @@
     6</link>
   </bridgehead>
   <bridgehead renderas="sect1" id="heading_test_1_6.h9">
- <phrase id="heading_test_1_6._bold"/><link linkend="heading_test_1_6._bold"><emphasis
+ <phrase id="heading_test_1_6.bold"/><link linkend="heading_test_1_6.bold"><emphasis
     role="bold">Bold</emphasis></link>
   </bridgehead>
   <bridgehead renderas="sect1" id="heading_test_1_6.h10">


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