}
+Counters::Counters() : appendix_(false), subfloat_(false)
+{
+ layout_stack_.push_back(0);
+ counter_stack_.push_back(0);
+}
+
+
void Counters::newCounter(docstring const & newc,
docstring const & masterc,
docstring const & ls,
it->second.reset();
counter_stack_.clear();
counter_stack_.push_back(from_ascii(""));
+ layout_stack_.clear();
layout_stack_.push_back(0);
}
void Counters::beginEnvironment()
{
- docstring cnt = counter_stack_.back();
- counter_stack_.push_back(cnt);
- deque<docstring>::const_iterator it = counter_stack_.begin();
- deque<docstring>::const_iterator en = counter_stack_.end();
-// docstring d;
-// for (; it != en; ++it)
-// d += " --> " + *it;
-// LYXERR0(counter_stack_.size() << ": " << d);
+ counter_stack_.push_back(counter_stack_.back());
}
{
LASSERT(!counter_stack_.empty(), return);
counter_stack_.pop_back();
- deque<docstring>::const_iterator it = counter_stack_.begin();
- deque<docstring>::const_iterator en = counter_stack_.end();
-// docstring d;
-// for (; it != en; ++it)
-// d += " --> " + *it;
-// LYXERR0(counter_stack_.size() << ": " << d);
}
class Counters {
public:
///
- Counters() : appendix_(false), subfloat_(false) {}
+ Counters();
/// Add new counter newc having masterc as its master,
/// ls as its label, and lsa as its appendix label.
void newCounter(docstring const & newc,
/// Call this when entering things like footnotes, where there is now
/// no "last layout" and we want to restore the "last layout" on exit.
void clearLastLayout() { layout_stack_.push_back(0); }
- /// Call then when existing things like footnotes.
+ /// Call this when existing things like footnotes.
void restoreLastLayout() { layout_stack_.pop_back(); }
///
void saveLastCounter()