]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetenv.C
fix #832
[lyx.git] / src / insets / insetenv.C
index 74c200cda7659d015dcf8ce3c56c3cb7374313a9..52e478f35abd47d00b3b75b35b4dbeb349452f5c 100644 (file)
@@ -26,20 +26,24 @@ using std::endl;
 
 InsetEnvironment::InsetEnvironment
                (BufferParams const & bp, string const & name)
-       : InsetCollapsable(bp)
+       : InsetText(bp)
 {
-       setLabel(name);
+       //setLabel(name);
        setInsetName(name);
+       autoBreakRows = true;
+       drawFrame_ = ALWAYS;
        // needs more stuff in lyxlayout. coming in later patches.
        //LyXTextClass const & tc = bp.getLyXTextClass();
        //LyXLayout_ptr const & layout = tc.getEnv(name);
        //header_ = layout->latexheader;
        //footer_ = layout->latexfooter;
+       header_ = "\\begin{" + name + "}";
+       footer_ = "\\end{" + name + "}";
 }
 
 
 InsetEnvironment::InsetEnvironment(InsetEnvironment const & in, bool same_id)
-       : InsetCollapsable(in, same_id), header_(in.header_), footer_(in.footer_)
+       : InsetText(in, same_id), header_(in.header_), footer_(in.footer_)
 {}
 
 
@@ -51,14 +55,14 @@ Inset * InsetEnvironment::clone(Buffer const &, bool same_id) const
 
 void InsetEnvironment::write(Buffer const * buf, ostream & os) const
 {
-       os << "Environment" << getInsetName() << "\"\n";
-       InsetCollapsable::write(buf, os);
+       os << "Environment " << getInsetName() << "\n";
+       InsetText::write(buf, os);
 }
 
 
 void InsetEnvironment::read(Buffer const * buf, LyXLex & lex)
 {
-       InsetCollapsable::read(buf, lex);
+       InsetText::read(buf, lex);
 }
 
 
@@ -72,7 +76,7 @@ int InsetEnvironment::latex(Buffer const * buf,
                         ostream & os, bool fragile, bool fp) const
 {
        os << header_;
-       int i = inset.latex(buf, os, fragile, fp);
+       int i = InsetText::latex(buf, os, fragile, fp);
        os << footer_;
        return i;
 }