]> 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 a92dd470188a146ae467e04e9ca644f2cf279c8b..1a0eb1b5bece05e73a06a2be8b4033ca650be9d9 100644 (file)
@@ -24,6 +24,9 @@
 #include "debug.h"
 
 
+using std::ostream;
+
+
 InsetMarginal::InsetMarginal()
        : InsetFootlike()
 {
@@ -32,13 +35,17 @@ 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");
+}
+
+
+Inset * InsetMarginal::clone(Buffer const &, bool same_id) const
+{
+       return new InsetMarginal(*const_cast<InsetMarginal *>(this), same_id);
 }
 
 
@@ -49,7 +56,7 @@ string const InsetMarginal::editMessage() const
 
 
 int InsetMarginal::latex(Buffer const * buf,
-                        std::ostream & os, bool fragile, bool fp) const
+                        ostream & os, bool fragile, bool fp) const
 {
        os << "%\n\\marginpar{";
        
@@ -58,13 +65,3 @@ int InsetMarginal::latex(Buffer const * buf,
        
        return i + 2;
 }
-
-
-bool InsetMarginal::insertInsetAllowed(Inset * in) const
-{
-       if ((in->lyxCode() == Inset::FOOT_CODE) ||
-           (in->lyxCode() == Inset::MARGIN_CODE)) {
-               return false;
-       }
-       return true;
-}