]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.cpp
New attempt on #9906: allow following hyperlinks via context menu.
[lyx.git] / src / insets / InsetText.cpp
index 7f881f708acc39b94ba08107fb19d003339ed55d..10b15c88edad34abd39a31fb90b9223ff2700e91 100644 (file)
@@ -591,7 +591,7 @@ int InsetText::plaintext(odocstringstream & os,
 
 void InsetText::docbook(XMLStream & xs, OutputParams const & rp) const
 {
-    docbook(xs, rp, WriteEverything);
+       docbook(xs, rp, WriteEverything);
 }
 
 
@@ -612,13 +612,13 @@ void InsetText::docbook(XMLStream & xs, OutputParams const & rp, XHTMLOptions op
 
        InsetLayout const & il = getLayout();
        if (opts & WriteOuterTag && !il.docbooktag().empty() && il.docbooktag() != "NONE") {
-        docstring attrs = docstring();
-        if (!il.docbookattr().empty())
-            attrs += from_ascii(il.docbookattr());
-        if (il.docbooktag() == "link")
-            attrs += from_ascii(" xlink:href=\"") + text_.asString() + from_ascii("\"");
-        xs << xml::StartTag(il.docbooktag(), attrs);
-    }
+               docstring attrs = docstring();
+               if (!il.docbookattr().empty())
+                       attrs += from_ascii(il.docbookattr());
+               if (il.docbooktag() == "link")
+                       attrs += from_ascii(" xlink:href=\"") + text_.asString() + from_ascii("\"");
+               xs << xml::StartTag(il.docbooktag(), attrs);
+       }
 
        // No need for labels that are generated from counters.
 
@@ -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: