From 63febc852eef5f54c5618bd4df5e22c4ef900c24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 25 Apr 2003 15:28:41 +0000 Subject: [PATCH] base insetenv directly on InsetText instead of using InsetCollapsable git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6856 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 5 +++++ src/insets/insetenv.C | 14 ++++++++------ src/insets/insetenv.h | 9 ++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 24d2d9fa5e..58e9fe2aa5 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ + +2003-04-25 André Pönitz + + * insetenv.C: derive from InsetText instead of InsetCollapsable + 2003-04-24 Lars Gullik Bjønnes * insetexternal.C (string2params): dont do anything if the string diff --git a/src/insets/insetenv.C b/src/insets/insetenv.C index a81cc7d4da..52e478f35a 100644 --- a/src/insets/insetenv.C +++ b/src/insets/insetenv.C @@ -26,10 +26,12 @@ 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); @@ -41,7 +43,7 @@ InsetEnvironment::InsetEnvironment 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_) {} @@ -54,13 +56,13 @@ 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); + InsetText::write(buf, os); } void InsetEnvironment::read(Buffer const * buf, LyXLex & lex) { - InsetCollapsable::read(buf, lex); + InsetText::read(buf, lex); } @@ -74,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; } diff --git a/src/insets/insetenv.h b/src/insets/insetenv.h index 9eb4db1954..2f67c2f0a7 100644 --- a/src/insets/insetenv.h +++ b/src/insets/insetenv.h @@ -12,10 +12,9 @@ #ifndef INSETENVIRONMENT_H #define INSETENVIRONMENT_H -#include "insetcollapsable.h" +#include "insettext.h" - -class InsetEnvironment : public InsetCollapsable { +class InsetEnvironment : public InsetText { public: /// InsetEnvironment(BufferParams const &, string const & name); @@ -34,6 +33,10 @@ public: /// string const editMessage() const; /// + Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; } + /// + bool isTextInset() const { return true; } + /// bool needFullRow() const { return true; } /** returns true if, when outputing LaTeX, font changes should be closed before generating this inset. This is needed for -- 2.39.2