]> git.lyx.org Git - lyx.git/blobdiff - src/Counters.cpp
fix #9826: Outline disclosure of subsection content disappears one second after
[lyx.git] / src / Counters.cpp
index 56ab1b508c1a544e6e5762aae8190a841150e54e..0b17aa1b9b84eac8b6d7f94d16cf5bdbf71af9bc 100644 (file)
@@ -265,6 +265,19 @@ int Counters::value(docstring const & ctr) const
 }
 
 
+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::step(docstring const & ctr, UpdateType utype)
 {
        CounterList::iterator it = counterList_.find(ctr);
@@ -280,13 +293,8 @@ void Counters::step(docstring const & ctr, UpdateType utype)
                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);
 }
 
 
@@ -525,8 +533,6 @@ docstring Counters::flattenLabelString(docstring const & counter,
                                       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 `"