]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
DocBook: escape IDs for InsetRef.
[lyx.git] / src / insets / InsetNote.cpp
index 31df791f59a0e237df21bbc194a60b598da16804..fa84c61c87c7df75914027e180e48e0fff6e3be2 100644 (file)
@@ -28,6 +28,7 @@
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "OutputParams.h"
+#include "output_docbook.h"
 #include "ParIterator.h"
 #include "TextClass.h"
 #include "TocBackend.h"
@@ -260,27 +261,28 @@ int InsetNote::plaintext(odocstringstream & os,
 }
 
 
-int InsetNote::docbook(odocstream & os, OutputParams const & runparams_in) const
+void InsetNote::docbook(XMLStream & xs, OutputParams const & runparams_in) const
 {
        if (params_.type == InsetNoteParams::Note)
-               return 0;
+               return;
 
        OutputParams runparams(runparams_in);
        if (params_.type == InsetNoteParams::Comment) {
-               os << "<remark>\n";
+               xs << xml::StartTag("remark");
+               xs << xml::CR();
                runparams.inComment = true;
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
        }
+       // Greyed out text is output as such (no way to mark text as greyed out with DocBook).
 
-       int const n = InsetText::docbook(os, runparams);
-
-       if (params_.type == InsetNoteParams::Comment)
-               os << "\n</remark>\n";
+       InsetText::docbook(xs, runparams);
 
-       // Return how many newlines we issued.
-       //return int(count(str.begin(), str.end(), '\n'));
-       return n + 1 + 2;
+       if (params_.type == InsetNoteParams::Comment) {
+               xs << xml::CR();
+               xs << xml::EndTag("remark");
+               xs << xml::CR();
+       }
 }