]> 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 86bba7f28efcd51249a71be4cac387699f115792..1a0eb1b5bece05e73a06a2be8b4033ca650be9d9 100644 (file)
@@ -23,8 +23,8 @@
 #include "support/LOstream.h"
 #include "debug.h"
 
+
 using std::ostream;
-using std::endl;
 
 
 InsetMarginal::InsetMarginal()
@@ -35,50 +35,33 @@ InsetMarginal::InsetMarginal()
 }
 
 
-Inset * InsetMarginal::Clone() const
-{
-    InsetMarginal * result = new InsetMarginal;
-    result->inset->init(inset);
-    
-    result->collapsed = collapsed;
-    return result;
-}
-
-
-char const * InsetMarginal::EditMessage() const
+InsetMarginal::InsetMarginal(InsetMarginal const & in, bool same_id)
+       : InsetFootlike(in, same_id)
 {
-       return _("Opened Marginal Note Inset");
+       setLabel(_("margin"));
+       setInsetName("Marginal");
 }
 
 
-int InsetMarginal::Latex(Buffer const * buf,
-                        ostream & os, bool fragile, bool fp) const
+Inset * InsetMarginal::clone(Buffer const &, bool same_id) const
 {
-    os << "\\marginpar{%\n";
-    
-    int i = inset->Latex(buf, os, fragile, fp);
-    os << "}%\n";
-    
-    return i + 2;
+       return new InsetMarginal(*const_cast<InsetMarginal *>(this), same_id);
 }
 
 
-bool InsetMarginal::InsertInsetAllowed(Inset * in) const
+string const InsetMarginal::editMessage() const
 {
-    if ((in->LyxCode() == Inset::FOOT_CODE) ||
-       (in->LyxCode() == Inset::MARGIN_CODE)) {
-       return false;
-    }
-    return true;
+       return _("Opened Marginal Note Inset");
 }
 
 
-#if 0
-LyXFont InsetMarginal::GetDrawFont(BufferView * bv,
-                                  LyXParagraph * p, int pos) const
+int InsetMarginal::latex(Buffer const * buf,
+                        ostream & os, bool fragile, bool fp) const
 {
-    LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
-    fn.decSize().decSize();
-    return fn;
+       os << "%\n\\marginpar{";
+       
+       int const i = inset.latex(buf, os, fragile, fp);
+       os << "%\n}";
+       
+       return i + 2;
 }
-#endif