]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetenv.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetenv.C
index 7de871f3c9129c87eaa7a896922c066ad314cb8b..fd2d2cca4fecf2f374c78977f9afed1094a5f72c 100644 (file)
 
 #include "bufferparams.h"
 #include "gettext.h"
-#include "paragraph_funcs.h"
+#include "paragraph.h"
+#include "output_latex.h"
 #include "texrow.h"
 
-using std::endl;
+
+namespace lyx {
+
+using std::string;
 using std::auto_ptr;
 using std::ostream;
 
@@ -26,9 +30,9 @@ InsetEnvironment::InsetEnvironment
                (BufferParams const & bp, string const & name)
        : InsetText(bp), layout_(bp.getLyXTextClass()[name])
 {
-       setInsetName(name);
-       autoBreakRows = true;
-       drawFrame_ = ALWAYS;
+       setInsetName(from_utf8(name));
+       setAutoBreakRows(true);
+       setDrawFrame(true);
 }
 
 
@@ -37,7 +41,7 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
 {}
 
 
-auto_ptr<InsetBase> InsetEnvironment::clone() const
+auto_ptr<InsetBase> InsetEnvironment::doClone() const
 {
        return auto_ptr<InsetBase>(new InsetEnvironment(*this));
 }
@@ -45,7 +49,7 @@ auto_ptr<InsetBase> InsetEnvironment::clone() const
 
 void InsetEnvironment::write(Buffer const & buf, ostream & os) const
 {
-       os << "Environment " << getInsetName() << "\n";
+       os << "Environment " << to_utf8(getInsetName()) << "\n";
        InsetText::write(buf, os);
 }
 
@@ -56,20 +60,22 @@ void InsetEnvironment::read(Buffer const & buf, LyXLex & lex)
 }
 
 
-string const InsetEnvironment::editMessage() const
+docstring const InsetEnvironment::editMessage() const
 {
        return _("Opened Environment Inset: ") + getInsetName();
 }
 
 
-int InsetEnvironment::latex(Buffer const & buf, ostream & os,
-                           LatexRunParams const & runparams) const
+int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
+                           OutputParams const & runparams) const
 {
-       os << layout_->latexheader;
+       // FIXME UNICODE
+       os << from_utf8(layout_->latexheader);
        TexRow texrow;
-       latexParagraphs(buf, paragraphs, os, texrow, runparams,
+       latexParagraphs(buf, paragraphs(), os, texrow, runparams,
                        layout_->latexparagraph);
-       os << layout_->latexfooter;
+       // FIXME UNICODE
+       os << from_utf8(layout_->latexfooter);
        return texrow.rows();
 }
 
@@ -78,3 +84,6 @@ LyXLayout_ptr const & InsetEnvironment::layout() const
 {
        return layout_;
 }
+
+
+} // namespace lyx