]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetEnvironment.cpp
Inset::addToToc(): change signature. Use DocIterator instead of ParConstIterator...
[lyx.git] / src / insets / InsetEnvironment.cpp
index 1e2455e49197f8ffd3beee31e843c94b02404046..4dba48eb3e2411c0df0f696b9466a7000bc7038d 100644 (file)
 
 #include "InsetEnvironment.h"
 
+#include "Buffer.h"
 #include "BufferParams.h"
-#include "support/gettext.h"
 #include "Layout.h"
 #include "OutputParams.h"
 #include "output_latex.h"
 #include "TexRow.h"
 #include "TextClass.h"
 
+#include "support/gettext.h"
+
 using namespace std;
 
 namespace lyx {
 
 
-InsetEnvironment::InsetEnvironment
-               (BufferParams const & bp, docstring const & name)
-       : InsetText(bp), layout_(bp.textClass()[name]), name_(name)
+InsetEnvironment::InsetEnvironment(Buffer const & buf, docstring const & name)
+       : InsetText(buf), layout_(buf.params().documentClass()[name]), name_(name)
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
 }
 
 
-InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
-       : InsetText(in), layout_(in.layout_)
-{}
-
-
-Inset * InsetEnvironment::clone() const
-{
-       return new InsetEnvironment(*this);
-}
-
-
 void InsetEnvironment::write(ostream & os) const
 {
        os << "Environment " << to_utf8(name()) << "\n";
@@ -68,12 +58,12 @@ int InsetEnvironment::latex(odocstream & os,
                            OutputParams const & runparams) const
 {
        // FIXME UNICODE
-       os << from_utf8(layout_->latexheader);
+       os << from_utf8(layout_.latexheader);
        TexRow texrow;
        latexParagraphs(buffer(), text_, os, texrow, runparams,
-                       layout_->latexparagraph);
+                       layout_.latexparagraph);
        // FIXME UNICODE
-       os << from_utf8(layout_->latexfooter);
+       os << from_utf8(layout_.latexfooter);
        return texrow.rows();
 }
 
@@ -89,7 +79,7 @@ int InsetEnvironment::plaintext(odocstream & os,
 }
 
 
-LayoutPtr const & InsetEnvironment::layout() const
+Layout const & InsetEnvironment::layout() const
 {
        return layout_;
 }