X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetMarginal.cpp;h=1c1df328e96ba4e31c07d12ba9c585e59ccbdfeb;hb=d4550b7a4d64e9ff772cf3a7635cb4ca532fb340;hp=b4e6e8b39e2a3e53c564d3ed18e68c7b4bda940b;hpb=78c45693ef3f99a7671443238b448f4a69fd7717;p=lyx.git diff --git a/src/insets/InsetMarginal.cpp b/src/insets/InsetMarginal.cpp index b4e6e8b39e..1c1df328e9 100644 --- a/src/insets/InsetMarginal.cpp +++ b/src/insets/InsetMarginal.cpp @@ -20,20 +20,21 @@ #include "support/docstream.h" #include "support/gettext.h" +#include "support/lstrings.h" namespace lyx { -InsetMarginal::InsetMarginal(Buffer const & buf) +InsetMarginal::InsetMarginal(Buffer * buf) : InsetFootlike(buf) {} -int InsetMarginal::plaintext(odocstream & os, - OutputParams const & runparams) const +int InsetMarginal::plaintext(odocstringstream & os, + OutputParams const & runparams, size_t max_length) const { os << '[' << buffer().B_("margin") << ":\n"; - InsetText::plaintext(os, runparams); + InsetText::plaintext(os, runparams, max_length); os << "\n]"; return PLAINTEXT_NEWLINE + 1; // one char on a separate line @@ -51,17 +52,19 @@ int InsetMarginal::docbook(odocstream & os, } -void InsetMarginal::addToToc(DocIterator const & cpit) +void InsetMarginal::addToToc(DocIterator const & cpit, bool output_active, + UpdateType utype) const { DocIterator pit = cpit; - pit.push_back(CursorSlice(*this)); + pit.push_back(CursorSlice(const_cast(*this))); - Toc & toc = buffer().tocBackend().toc("marginalnote"); docstring str; - str = getNewLabel(str); - toc.push_back(TocItem(pit, 0, str)); + text().forOutliner(str, TOC_ENTRY_LENGTH); + std::shared_ptr toc = buffer().tocBackend().toc("marginalnote"); + toc->push_back(TocItem(pit, 0, str, output_active)); + // Proceed with the rest of the inset. - InsetFootlike::addToToc(cpit); + InsetFootlike::addToToc(cpit, output_active, utype); } } // namespace lyx