]> git.lyx.org Git - lyx.git/commitdiff
Fix intitle context checking for info insets
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 3 Mar 2023 13:54:04 +0000 (14:54 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 3 Mar 2023 13:54:52 +0000 (14:54 +0100)
src/insets/InsetInfo.cpp
src/insets/InsetText.cpp
src/insets/InsetText.h

index 46d656c817c9ad9d78a221f321867717e368c566..123b1ee3b08430499dbe55938b0e860fea42bc15 100644 (file)
@@ -796,8 +796,12 @@ void InsetInfo::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
        // in the original Buffer. This is especially important for VCS.
        // Otherwise, we could in principle have different settings here
        // than in the Buffer we were exporting.
-       if (buffer().isClone())
+       // However, we need to check whether the inset is in an intitle
+       // context.
+       if (buffer().isClone()) {
+               InsetText::checkIntitleContext(it);
                return;
+       }
        BufferParams const & bp = buffer().params();
        params_.lang = it.paragraph().getFontSettings(bp, it.pos()).language();
        InsetCollapsible::updateBuffer(it, utype, deleted);
index 99324aaeaf3f99270896c7877d962654b6dc320d..27b6a49b5a9b94c5261f7c03596f16e78aaf0b4b 100644 (file)
@@ -1080,6 +1080,20 @@ bool InsetText::forceLocalFontSwitch() const
 }
 
 
+void InsetText::checkIntitleContext(ParIterator const & it)
+{
+       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;
+               }
+       }
+}
+
+
 void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        ParIterator it2 = it;
@@ -1100,17 +1114,7 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype, bool cons
                        cnt.restoreLastLayout();
                        // FIXME cnt.restoreLastCounter()?
                }
-               // Record if 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;
-                       }
-               }
+               checkIntitleContext(it);
        } else {
                DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
                // Note that we do not need to call:
index b9e2dc936ebed495464cbdd0660f7775c33ed718..bbff948c83fcc88e131e1b708e7db7cccd4d3e2b 100644 (file)
@@ -125,6 +125,9 @@ public:
 
        ///
        void fixParagraphsFont();
+       /// Check and record if this inset is embedded in a title layout
+       /// This is needed to decide when \maketitle is output.
+       void checkIntitleContext(ParIterator const & it);
 
        /// does the inset contain changes ?
        bool isChanged() const override { return is_changed_; }