X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetMarginal.cpp;h=094d2a22cb9e9e488add4e3cb5026f30749af7cb;hb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;hp=7761980d936f15cfc3df09baf59b5548b7395679;hpb=897436efbb9bd641b61467d185a2dfae9839e575;p=lyx.git diff --git a/src/insets/InsetMarginal.cpp b/src/insets/InsetMarginal.cpp index 7761980d93..094d2a22cb 100644 --- a/src/insets/InsetMarginal.cpp +++ b/src/insets/InsetMarginal.cpp @@ -14,37 +14,30 @@ #include "InsetMarginal.h" #include "Buffer.h" -#include "gettext.h" -#include "Paragraph.h" #include "OutputParams.h" +#include "TocBackend.h" -#include "support/std_ostream.h" +#include "support/gettext.h" +#include -namespace lyx { -using std::string; -using std::auto_ptr; -using std::ostream; +namespace lyx { InsetMarginal::InsetMarginal(BufferParams const & bp) : InsetFootlike(bp) -{ - setLabel(_("margin")); -} +{} InsetMarginal::InsetMarginal(InsetMarginal const & in) : InsetFootlike(in) -{ - setLabel(_("margin")); -} +{} -auto_ptr InsetMarginal::doClone() const +Inset * InsetMarginal::clone() const { - return auto_ptr(new InsetMarginal(*this)); + return new InsetMarginal(*this); } @@ -86,4 +79,16 @@ int InsetMarginal::docbook(Buffer const & buf, odocstream & os, } +void InsetMarginal::addToToc(Buffer const & buf, + ParConstIterator const & cpit) const +{ + ParConstIterator pit = cpit; + pit.push_back(*this); + + Toc & toc = buf.tocBackend().toc("marginalnote"); + docstring str; + str = getNewLabel(str); + toc.push_back(TocItem(pit, 0, str)); +} + } // namespace lyx