+void Counters::saveValue(docstring const & ctr) const
+{
+ CounterList::const_iterator const cit = counterList_.find(ctr);
+ if (cit == counterList_.end()) {
+ lyxerr << "value: Counter does not exist: "
+ << to_utf8(ctr) << endl;
+ return;
+ }
+ Counter const & cnt = cit->second;
+ Counter & ccnt = const_cast<Counter &>(cnt);
+ ccnt.saveValue();
+}
+
+
+void Counters::restoreValue(docstring const & ctr) const
+{
+ CounterList::const_iterator const cit = counterList_.find(ctr);
+ if (cit == counterList_.end()) {
+ lyxerr << "value: Counter does not exist: "
+ << to_utf8(ctr) << endl;
+ return;
+ }
+ Counter const & cnt = cit->second;
+ Counter & ccnt = const_cast<Counter &>(cnt);
+ ccnt.restoreValue();
+}
+
+
+void Counters::resetSlaves(docstring const & count)
+{
+ for (auto & ctr : counterList_) {
+ if (ctr.second.master() == count) {
+ ctr.second.reset();
+ resetSlaves(ctr.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);
+}
+
+