]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetEnvironment.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetEnvironment.cpp
index b576573b5c785c3f448f3fa6079e13242c9f5fcd..73048ab52e87a8b9bb257c337e12733ed6b131c4 100644 (file)
 #include "InsetEnvironment.h"
 
 #include "BufferParams.h"
-#include "gettext.h"
-#include "Paragraph.h"
+#include "support/gettext.h"
+#include "Layout.h"
 #include "OutputParams.h"
 #include "output_latex.h"
 #include "TexRow.h"
+#include "TextClass.h"
 
+using namespace std;
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-using std::ostream;
-
 
 InsetEnvironment::InsetEnvironment
-               (BufferParams const & bp, string const & name)
-       : InsetText(bp), layout_(bp.getTextClass()[name]), name_(from_utf8(name))
+               (BufferParams const & bp, docstring const & name)
+       : InsetText(bp), layout_(bp.getTextClass()[name]), name_(name)
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
@@ -41,9 +39,9 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
 {}
 
 
-auto_ptr<Inset> InsetEnvironment::doClone() const
+Inset * InsetEnvironment::clone() const
 {
-       return auto_ptr<Inset>(new InsetEnvironment(*this));
+       return new InsetEnvironment(*this);
 }
 
 
@@ -67,12 +65,12 @@ docstring const InsetEnvironment::editMessage() const
 
 
 int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
-                            OutputParams const & runparams) const
+                           OutputParams const & runparams) const
 {
        // FIXME UNICODE
        os << from_utf8(layout_->latexheader);
        TexRow texrow;
-       latexParagraphs(buf, paragraphs(), os, texrow, runparams,
+       latexParagraphs(buf, text_, os, texrow, runparams,
                        layout_->latexparagraph);
        // FIXME UNICODE
        os << from_utf8(layout_->latexfooter);
@@ -81,7 +79,7 @@ int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
 
 
 int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
-                                OutputParams const & runparams) const
+                               OutputParams const & runparams) const
 {
        os << '[' << to_utf8(name()) << ":\n";
        InsetText::plaintext(buf, os, runparams);
@@ -91,7 +89,7 @@ int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
 }
 
 
-Layout_ptr const & InsetEnvironment::layout() const
+LayoutPtr const & InsetEnvironment::layout() const
 {
        return layout_;
 }