commit 61181a39778ed5bcd7849ab388c402ab3f88d5cd
Author: Richard Kimberly Heck <rikih...@lyx.org>
Date:   Sat Jun 1 11:52:05 2024 -0400

    Fix bug #12981
---
 src/insets/InsetText.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 147bf986aa..ac3bc8e102 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -1209,11 +1209,12 @@ void InsetText::iterateForToc(DocIterator const & cdit, 
bool output_active,
                        dit.pos() = elem.pos;
                        bool const being_output = doing_output &&
                                !par.lookupChange(elem.pos).deleted();
-                               // && buffer().params.output_changes;
-                       elem.inset->addToToc(dit, being_output, utype, backend);
-                       if (InsetArgument const * x = 
elem.inset->asInsetArgument())
-                               if (x->isTocCaption())
-                                       arginset = x;
+                       if (being_output) {
+                               elem.inset->addToToc(dit, being_output, utype, 
backend);
+                               if (InsetArgument const * x = 
elem.inset->asInsetArgument())
+                                       if (x->isTocCaption())
+                                               arginset = x;
+                       }
                }
 
                // End custom AddToToc in paragraph layouts
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to