]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfoot.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetfoot.C
index 43f2e17fca06bd1b320d03ac0af93ee72f9e2f2c..a2297b6cd9133aee05ea456eb6f32c6a1dc16b6e 100644 (file)
 #include "support/LOstream.h"
 #include "debug.h"
 
+
 using std::ostream;
 
 
 InsetFoot::InsetFoot()
        : InsetFootlike()
 {
-    setLabel(_("foot"));
-    setInsetName("Foot");
+       setLabel(_("foot"));
+       setInsetName("Foot");
 }
 
 
-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);
-
-    result->collapsed = collapsed;
-    return result;
+       setLabel(_("foot"));
+       setInsetName("Foot");
 }
 
 
-string const InsetFoot::EditMessage() const
+Inset * InsetFoot::clone(Buffer const &, bool same_id) const
 {
-    return _("Opened Footnote Inset");
+       return new InsetFoot(*const_cast<InsetFoot *>(this), same_id);
 }
 
 
-int InsetFoot::Latex(Buffer const * buf,
-                    ostream & os, bool fragile, bool fp) const
+string const InsetFoot::editMessage() const
 {
-    os << "\\footnote{%\n";
-    
-    int const i = inset.Latex(buf, os, fragile, fp);
-    os << "}%\n";
-    
-    return i + 2;
+       return _("Opened Footnote Inset");
 }
 
 
-bool InsetFoot::InsertInsetAllowed(Inset * in) const
+int InsetFoot::latex(Buffer const * buf,
+                    ostream & os, bool fragile, bool fp) const
 {
-    if ((in->LyxCode() == Inset::FOOT_CODE) ||
-       (in->LyxCode() == Inset::MARGIN_CODE)) {
-       return false;
-    }
-    return true;
+       os << "%\n\\footnote{";
+       
+       int const i = inset.latex(buf, os, fragile, fp);
+       os << "%\n}";
+       
+       return i + 2;
 }