]> 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 9d078780a9a08d4a876ac80c14bf73ef34487716..1a0eb1b5bece05e73a06a2be8b4033ca650be9d9 100644 (file)
@@ -23,8 +23,8 @@
 #include "support/LOstream.h"
 #include "debug.h"
 
+
 using std::ostream;
-using std::endl;
 
 
 InsetMarginal::InsetMarginal()
@@ -35,39 +35,33 @@ InsetMarginal::InsetMarginal()
 }
 
 
-Inset * InsetMarginal::Clone() 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);
 }
 
 
-string const InsetMarginal::EditMessage() const
+string const InsetMarginal::editMessage() const
 {
        return _("Opened Marginal Note Inset");
 }
 
 
-int InsetMarginal::Latex(Buffer const * buf,
+int InsetMarginal::latex(Buffer const * buf,
                         ostream & os, bool fragile, bool fp) const
 {
-       os << "\\marginpar{%\n";
+       os << "%\n\\marginpar{";
        
-       int i = inset->Latex(buf, os, fragile, fp);
-       os << "}%\n";
+       int const i = inset.latex(buf, os, fragile, fp);
+       os << "%\n}";
        
        return i + 2;
 }
-
-
-bool InsetMarginal::InsertInsetAllowed(Inset * in) const
-{
-       if ((in->LyxCode() == Inset::FOOT_CODE) ||
-           (in->LyxCode() == Inset::MARGIN_CODE)) {
-               return false;
-       }
-       return true;
-}