commit 3049ecc26ef02393a51dc7d7aeb691e8b97479c2
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri Aug 22 16:27:56 2025 +0200

    Do not make the parent or other counter active with SetParentCounter or 
SetOtherCounter
---
 src/Counters.cpp | 14 ++++++++------
 src/Counters.h   |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/Counters.cpp b/src/Counters.cpp
index 694c8fd9c9..76e0e4ec2d 100644
--- a/src/Counters.cpp
+++ b/src/Counters.cpp
@@ -376,11 +376,11 @@ void Counters::stepParent(docstring const & ctr, 
UpdateType utype)
                       << to_utf8(ctr) << endl;
                return;
        }
-       step(it->second.parent(), utype);
+       step(it->second.parent(), utype, false);
 }
 
 
-void Counters::step(docstring const & ctr, UpdateType /* deleted */)
+void Counters::step(docstring const & ctr, UpdateType /* deleted */, bool 
const set_active)
 {
        CounterList::iterator it = counterList_.find(ctr);
        if (it == counterList_.end()) {
@@ -391,11 +391,13 @@ void Counters::step(docstring const & ctr, UpdateType /* 
deleted */)
 
        it->second.step();
        if (!it->second.stepOtherCounter().empty())
-               step(it->second.stepOtherCounter(), InternalUpdate);
+               step(it->second.stepOtherCounter(), InternalUpdate, false);
 
-       LBUFERR(!counter_stack_.empty());
-       counter_stack_.pop_back();
-       counter_stack_.push_back(ctr);
+       if (set_active) {
+               LBUFERR(!counter_stack_.empty());
+               counter_stack_.pop_back();
+               counter_stack_.push_back(ctr);
+       }
 
        resetChildren(ctr);
 }
diff --git a/src/Counters.h b/src/Counters.h
index 60dea5736f..5e256cfc2e 100644
--- a/src/Counters.h
+++ b/src/Counters.h
@@ -167,7 +167,7 @@ public:
        /// Increment by one counter named by \c ctr, and zeroes child
        /// counter(s) for which it is the parent.
        /// \param utype determines whether we track the counters.
-       void step(docstring const & ctr, UpdateType utype);
+       void step(docstring const & ctr, UpdateType utype, bool const 
set_active = true);
        /// Reset all counters, and all the internal data structures
        /// used for keeping track of their values.
        void reset();
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to