]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
DocBook: don't use a surrounding <para> for rendered insets.
[lyx.git] / src / Buffer.cpp
index c66b730d9d1ddcdcd6c59d586ef68615f88aae0a..a713f8dd55f40d705e7c0b8e93f0abd60d05df4d 100644 (file)
@@ -2144,12 +2144,23 @@ Buffer::ExportStatus Buffer::writeDocBookSource(odocstream & os,
                   << "<!-- This DocBook file was created by LyX " << lyx_version
                   << "\n  See https://www.lyx.org/ for more information -->\n";
 
+               // Prepare the name space declaration for MathML depending on document preferences.
+               string mathmlNamespace;
+               if (params().docbook_mathml_prefix != BufferParams::NoPrefix) {
+            string mathmlPrefix;
+            if (params().docbook_mathml_prefix == BufferParams::MPrefix)
+                   mathmlPrefix = "m";
+            else if (params().docbook_mathml_prefix == BufferParams::MMLPrefix)
+                   mathmlPrefix = "mml";
+                       mathmlNamespace = + " xmlns:" + mathmlPrefix + "=\"http://www.w3.org/1998/Math/MathML\"";
+           }
+
                // Directly output the root tag, based on the current type of document.
                string languageCode = params().language->code();
                string params = "xml:lang=\"" + languageCode + '"'
                                                + " xmlns=\"http://docbook.org/ns/docbook\""
                                                + " xmlns:xlink=\"http://www.w3.org/1999/xlink\""
-                                               + " xmlns:m=\"http://www.w3.org/1998/Math/MathML\""
+                                               + mathmlNamespace
                                                + " xmlns:xi=\"http://www.w3.org/2001/XInclude\""
                                                + " version=\"5.2\"";
 
@@ -3816,7 +3827,7 @@ void Buffer::Impl::updateMacros(DocIterator & it, DocIterator & scope)
                        // FIXME (Abdel), I don't understand why we pass 'it' here
                        // instead of 'macroTemplate' defined above... is this correct?
                        macros[macroTemplate.name()][it] =
-                               Impl::ScopeMacro(scope, MacroData(const_cast<Buffer *>(owner_), it));
+                               Impl::ScopeMacro(scope, MacroData(owner_, it));
                }
 
                // next paragraph
@@ -4914,6 +4925,13 @@ void Buffer::bufferRefs(TeXErrors const & terr, ErrorList & errorList) const
 }
 
 
+void Buffer::updateBuffer() const
+{
+       updateBuffer(UpdateMaster, InternalUpdate);
+       d->need_update = false;
+}
+
+
 void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
 {
        LBUFERR(!text().paragraphs().empty());