]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetERT.cpp
New DocBook support
[lyx.git] / src / insets / InsetERT.cpp
index f18234344acdfd97861a87663959412486f0e2a6..eb4567175e5bff28c97fce6e0ef41374d8ac782a 100644 (file)
@@ -25,6 +25,7 @@
 #include "Lexer.h"
 #include "LyXAction.h"
 #include "OutputParams.h"
+#include "xml.h"
 #include "ParagraphParameters.h"
 #include "Paragraph.h"
 
@@ -90,25 +91,24 @@ int InsetERT::plaintext(odocstringstream & os,
 }
 
 
-int InsetERT::docbook(odocstream & os, OutputParams const &) const
+void InsetERT::docbook(XMLStream & xs, OutputParams const &) const
 {
        // FIXME can we do the same thing here as for LaTeX?
        ParagraphList::const_iterator par = paragraphs().begin();
        ParagraphList::const_iterator end = paragraphs().end();
 
-       int lines = 0;
+       xs << XMLStream::ESCAPE_NONE << "<!-- ";
        while (par != end) {
                pos_type siz = par->size();
-               for (pos_type i = 0; i < siz; ++i)
-                       os.put(par->getChar(i));
+               for (pos_type i = 0; i < siz; ++i) {
+                       xs << par->getChar(i);
+               }
                ++par;
                if (par != end) {
-                       os << "\n";
-                       ++lines;
+                       xs << "\n";
                }
        }
-
-       return lines;
+       xs << XMLStream::ESCAPE_NONE << " -->";
 }
 
 
@@ -134,12 +134,6 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
        FuncStatus & status) const
 {
        switch (cmd.action()) {
-       case LFUN_INSET_EDIT:
-               status.setEnabled(tempfile_ == 0);
-               return true;
-       case LFUN_INSET_END_EDIT:
-               status.setEnabled(tempfile_ != 0);
-               return true;
        case LFUN_INSET_INSERT:
                status.setEnabled(false);
                return true;
@@ -189,7 +183,7 @@ string InsetERT::params2string(CollapseStatus status)
 }
 
 
-docstring InsetERT::xhtml(XHTMLStream &, OutputParams const &) const
+docstring InsetERT::xhtml(XMLStream &, OutputParams const &) const
 {
        return docstring();
 }