#include "support/LOstream.h"
#include "debug.h"
+
using std::ostream;
-using std::endl;
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