X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfoot.C;h=a2297b6cd9133aee05ea456eb6f32c6a1dc16b6e;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=f6cdfb05efec919625b24ad1de7c5886f9e02356;hpb=bcd1410de124f3c251b745e50de69077cf8db27e;p=lyx.git diff --git a/src/insets/insetfoot.C b/src/insets/insetfoot.C index f6cdfb05ef..a2297b6cd9 100644 --- a/src/insets/insetfoot.C +++ b/src/insets/insetfoot.C @@ -24,6 +24,9 @@ #include "debug.h" +using std::ostream; + + InsetFoot::InsetFoot() : InsetFootlike() { @@ -32,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, - std::ostream & os, bool fragile, bool fp) const +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; -}