]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetmarginal.C
The BIG UNDO patch. Recodes undo handling for better use inside InsetText.
[lyx.git] / src / insets / insetmarginal.C
index 4a631bd8ccef46150748636aa2542e3fd76bb1d5..b4aa735602644e5ab46ad291ac3763b7574276b7 100644 (file)
@@ -32,38 +32,40 @@ InsetMarginal::InsetMarginal()
 }
 
 
-Inset * InsetMarginal::Clone(Buffer const &) const
+Inset * InsetMarginal::clone(Buffer const &, bool same_id) const
 {
        InsetMarginal * result = new InsetMarginal;
-       result->inset.init(&inset);
+       result->inset.init(&inset, same_id);
        
        result->collapsed = collapsed;
+       if (same_id)
+               result->id_ = id_;
        return result;
 }
 
 
-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,
                         std::ostream & os, bool fragile, bool fp) const
 {
-       os << "\\marginpar{%\n";
+       os << "%\n\\marginpar{";
        
-       int const 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
+bool InsetMarginal::insertInsetAllowed(Inset * in) const
 {
-       if ((in->LyxCode() == Inset::FOOT_CODE) ||
-           (in->LyxCode() == Inset::MARGIN_CODE)) {
+       if ((in->lyxCode() == Inset::FOOT_CODE) ||
+           (in->lyxCode() == Inset::MARGIN_CODE)) {
                return false;
        }
        return true;