]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetenv.C
* In the process of fixing the math background color bug, this commit transfer backgr...
[lyx.git] / src / insets / insetenv.C
index 24f18050b94725fa320d1547f909d74e194a93f7..53926417e0ba4f313a4fe9235508f82d718acb06 100644 (file)
@@ -15,6 +15,7 @@
 #include "bufferparams.h"
 #include "gettext.h"
 #include "paragraph.h"
+#include "outputparams.h"
 #include "output_latex.h"
 #include "texrow.h"
 
@@ -30,7 +31,7 @@ InsetEnvironment::InsetEnvironment
                (BufferParams const & bp, string const & name)
        : InsetText(bp), layout_(bp.getLyXTextClass()[name])
 {
-       setInsetName(name);
+       setInsetName(from_utf8(name));
        setAutoBreakRows(true);
        setDrawFrame(true);
 }
@@ -49,7 +50,7 @@ auto_ptr<InsetBase> InsetEnvironment::doClone() const
 
 void InsetEnvironment::write(Buffer const & buf, ostream & os) const
 {
-       os << "Environment " << getInsetName() << "\n";
+       os << "Environment " << to_utf8(getInsetName()) << "\n";
        InsetText::write(buf, os);
 }
 
@@ -62,13 +63,12 @@ void InsetEnvironment::read(Buffer const & buf, LyXLex & lex)
 
 docstring const InsetEnvironment::editMessage() const
 {
-       // FIXME UNICODE
-       return _("Opened Environment Inset: ") + from_utf8(getInsetName());
+       return _("Opened Environment Inset: ") + getInsetName();
 }
 
 
 int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
-                           OutputParams const & runparams) const
+                            OutputParams const & runparams) const
 {
        // FIXME UNICODE
        os << from_utf8(layout_->latexheader);
@@ -81,6 +81,17 @@ int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
 }
 
 
+int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
+                                OutputParams const & runparams) const
+{
+       os << '[' << to_utf8(getInsetName()) << ":\n";
+       InsetText::plaintext(buf, os, runparams);
+       os << "\n]";
+
+       return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+}
+
+
 LyXLayout_ptr const & InsetEnvironment::layout() const
 {
        return layout_;