]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetmarginal.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetmarginal.C
index 4a631bd8ccef46150748636aa2542e3fd76bb1d5..1a0eb1b5bece05e73a06a2be8b4033ca650be9d9 100644 (file)
@@ -24,6 +24,9 @@
 #include "debug.h"
 
 
+using std::ostream;
+
+
 InsetMarginal::InsetMarginal()
        : InsetFootlike()
 {
@@ -32,39 +35,33 @@ InsetMarginal::InsetMarginal()
 }
 
 
-Inset * InsetMarginal::Clone(Buffer const &) const
+InsetMarginal::InsetMarginal(InsetMarginal const & in, bool same_id)
+       : InsetFootlike(in, same_id)
 {
-       InsetMarginal * result = new InsetMarginal;
-       result->inset.init(&inset);
-       
-       result->collapsed = collapsed;
-       return result;
+       setLabel(_("margin"));
+       setInsetName("Marginal");
 }
 
 
-string const InsetMarginal::EditMessage() const
+Inset * InsetMarginal::clone(Buffer const &, bool same_id) const
 {
-       return _("Opened Marginal Note Inset");
+       return new InsetMarginal(*const_cast<InsetMarginal *>(this), same_id);
 }
 
 
-int InsetMarginal::Latex(Buffer const * buf,
-                        std::ostream & os, bool fragile, bool fp) const
+string const InsetMarginal::editMessage() const
 {
-       os << "\\marginpar{%\n";
-       
-       int const i = inset.Latex(buf, os, fragile, fp);
-       os << "}%\n";
-       
-       return i + 2;
+       return _("Opened Marginal Note Inset");
 }
 
 
-bool InsetMarginal::InsertInsetAllowed(Inset * in) const
+int InsetMarginal::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\\marginpar{";
+       
+       int const i = inset.latex(buf, os, fragile, fp);
+       os << "%\n}";
+       
+       return i + 2;
 }