[LyX/master] Consider nesting when checking whether an inset is in a title

Juergen Spitzmueller spitz at lyx.org
Sun Aug 9 09:36:58 UTC 2020


commit e417597597d9be12cd792343ae9b958854ab4df8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 9 12:01:49 2020 +0200

    Consider nesting when checking whether an inset is in a title
    
    Amends 0bddf448ef5
---
 src/insets/InsetText.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index e448a3f..10b15c8 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -873,6 +873,14 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
 		// Record in this inset is embedded in a title layout
 		// This is needed to decide when \maketitle is output.
 		intitle_context_ = it.paragraph().layout().intitle;
+		// Also check embedding layouts
+		size_t const n = it.depth();
+		for (size_t i = 0; i < n; ++i) {
+			if (it[i].paragraph().layout().intitle) {
+				intitle_context_ = true;
+				break;
+			}
+		}
 	} else {
 		DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
 		// Note that we do not need to call:


More information about the lyx-cvs mailing list