}
+void Counters::resetSlaves(docstring const & ctr)
+{
+ CounterList::iterator it = counterList_.begin();
+ CounterList::iterator const end = counterList_.end();
+ for (; it != end; ++it) {
+ if (it->second.master() == ctr) {
+ it->second.reset();
+ resetSlaves(it->first);
+ }
+ }
+}
+
+
+void Counters::stepMaster(docstring const & ctr, UpdateType utype)
+{
+ CounterList::iterator it = counterList_.find(ctr);
+ if (it == counterList_.end()) {
+ lyxerr << "step: Counter does not exist: "
+ << to_utf8(ctr) << endl;
+ return;
+ }
+ step(it->second.master(), utype);
+}
+
+
void Counters::step(docstring const & ctr, UpdateType utype)
{
CounterList::iterator it = counterList_.find(ctr);
counter_stack_.pop_back();
counter_stack_.push_back(ctr);
}
- it = counterList_.begin();
- CounterList::iterator const end = counterList_.end();
- for (; it != end; ++it) {
- if (it->second.master() == ctr) {
- it->second.reset();
- }
- }
+
+ resetSlaves(ctr);
}
"DC", "DCC", "DCCC", "CM"
};
- if (n > 1000 || n < 1)
+ if (n >= 1000 || n < 1)
return from_ascii("??");
int val = n;
};
}
-} // namespace anon
+} // namespace
docstring Counters::labelItem(docstring const & ctr,
string const & lang,
vector<docstring> & callers) const
{
- docstring label;
-
if (find(callers.begin(), callers.end(), counter) != callers.end()) {
// recursion detected
lyxerr << "Warning: Recursion in label for counter `"