]> git.lyx.org Git - lyx.git/commitdiff
DocBook: adapt code for older GCC.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Sat, 19 Sep 2020 21:55:07 +0000 (23:55 +0200)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Sat, 19 Sep 2020 21:55:07 +0000 (23:55 +0200)
src/Paragraph.cpp

index 8da67e35089566542c78f066989d945aa5727ddf..7f707bc9f190e8392af99f0fea379517bf477373 100644 (file)
@@ -3366,10 +3366,17 @@ std::vector<docstring> Paragraph::simpleDocBookOnePar(Buffer const & buf,
                if (getInset(i) != nullptr && getInset(i)->lyxCode() == NEWLINE_CODE) {
                        if (!ignore_fonts)
                                xs->closeFontTags();
+
+                       // Output one paragraph (i.e. one string entry in generatedParagraphs).
                        generatedParagraphs.push_back(os.str());
-                       os = odocstringstream();
+
+                       // Create a new XMLStream for the new paragraph, completely independent from the previous one. This implies
+                       // that the string stream must be reset.
+                       os.str(from_ascii(""));
                        delete xs;
                        xs = new XMLStream(os);
+
+                       // Restore the fonts for the new paragraph, so that the right tags are opened for the new entry.
                        if (!ignore_fonts) {
                                font_old = outerfont.fontInfo();
                                fs = old_fs;