Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73221 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-07-18 19:48:08


Author: danieljames
Date: 2011-07-18 19:48:07 EDT (Mon, 18 Jul 2011)
New Revision: 73221
URL: http://svn.boost.org/trac/boost/changeset/73221

Log:
Quickbook: Move the callout id state into actions_class.
Text files modified:
   trunk/tools/quickbook/src/actions.cpp | 9 ++-------
   trunk/tools/quickbook/src/actions_class.cpp | 1 +
   trunk/tools/quickbook/src/actions_class.hpp | 1 +
   3 files changed, 4 insertions(+), 7 deletions(-)

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-07-18 19:48:07 EDT (Mon, 18 Jul 2011)
@@ -1131,11 +1131,6 @@
         }
     }
 
- namespace detail
- {
- int callout_id = 0;
- }
-
     void do_template_action(quickbook::actions& actions, value template_list,
             file_position pos)
     {
@@ -1226,7 +1221,7 @@
                 for(unsigned int i = 0; i < size; ++i)
                 {
                     std::string callout_id = actions.doc_id +
- boost::lexical_cast<std::string>(detail::callout_id + i);
+ boost::lexical_cast<std::string>(actions.callout_id_count + i);
 
                     std::string code;
                     code += "'''";
@@ -1297,7 +1292,7 @@
             BOOST_FOREACH(value c, symbol->callouts)
             {
                 std::string callout_id = actions.doc_id +
- boost::lexical_cast<std::string>(detail::callout_id++);
+ boost::lexical_cast<std::string>(actions.callout_id_count++);
 
                 std::string callout_value;
                 actions.push();

Modified: trunk/tools/quickbook/src/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions_class.cpp (original)
+++ trunk/tools/quickbook/src/actions_class.cpp 2011-07-18 19:48:07 EDT (Mon, 18 Jul 2011)
@@ -55,6 +55,7 @@
         , source_mode("c++")
 
     // temporary or global state
+ , callout_id_count(0)
         , template_depth(0)
         , templates()
         , error_count(0)

Modified: trunk/tools/quickbook/src/actions_class.hpp
==============================================================================
--- trunk/tools/quickbook/src/actions_class.hpp (original)
+++ trunk/tools/quickbook/src/actions_class.hpp 2011-07-18 19:48:07 EDT (Mon, 18 Jul 2011)
@@ -93,6 +93,7 @@
         std::stack<string_symbols> macro_stack;
 
     // temporary or global state
+ int callout_id_count;
         int template_depth;
         template_stack templates;
         int error_count;


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