X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfoot.C;h=a2297b6cd9133aee05ea456eb6f32c6a1dc16b6e;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=9f65184713e2722bbc96dd367731234d9442b5a7;hpb=63d5070bc3fc82f12e4bae453191e8f153b8524b;p=lyx.git diff --git a/src/insets/insetfoot.C b/src/insets/insetfoot.C index 9f65184713..a2297b6cd9 100644 --- a/src/insets/insetfoot.C +++ b/src/insets/insetfoot.C @@ -23,6 +23,7 @@ #include "support/LOstream.h" #include "debug.h" + using std::ostream; @@ -34,39 +35,33 @@ InsetFoot::InsetFoot() } -Inset * InsetFoot::Clone(Buffer const &) const +InsetFoot::InsetFoot(InsetFoot const & in, bool same_id) + : InsetFootlike(in, same_id) { - InsetFoot * result = new InsetFoot; - result->inset.init(&inset); + setLabel(_("foot")); + setInsetName("Foot"); +} + - result->collapsed = collapsed; - return result; +Inset * InsetFoot::clone(Buffer const &, bool same_id) const +{ + return new InsetFoot(*const_cast(this), same_id); } -string const InsetFoot::EditMessage() const +string const InsetFoot::editMessage() const { return _("Opened Footnote Inset"); } -int InsetFoot::Latex(Buffer const * buf, +int InsetFoot::latex(Buffer const * buf, ostream & os, bool fragile, bool fp) const { - os << "\\footnote{%\n"; + os << "%\n\\footnote{"; - int const i = inset.Latex(buf, os, fragile, fp); - os << "}%\n"; + int const i = inset.latex(buf, os, fragile, fp); + os << "%\n}"; return i + 2; } - - -bool InsetFoot::InsertInsetAllowed(Inset * in) const -{ - if ((in->LyxCode() == Inset::FOOT_CODE) || - (in->LyxCode() == Inset::MARGIN_CODE)) { - return false; - } - return true; -}