#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
namespace lyx {
{}
-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
}
-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<InsetMarginal &>(*this)));
- Toc & toc = buffer().tocBackend().toc("marginalnote");
docstring str;
- str = text().getPar(0).asString();
- toc.push_back(TocItem(pit, 0, str));
+ text().forOutliner(str, TOC_ENTRY_LENGTH);
+ std::shared_ptr<Toc> 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