]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetMarginal.cpp
Fix wrong painting of lines right of multicol
[lyx.git] / src / insets / InsetMarginal.cpp
index 377693f17b6400a1af82da12bae07a052ed0005d..9543e8f52749ebe27b1c5e1701cf04a3bde59c4a 100644 (file)
@@ -29,11 +29,11 @@ InsetMarginal::InsetMarginal(Buffer * 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 +51,17 @@ int InsetMarginal::docbook(odocstream & os,
 }
 
 
-void InsetMarginal::addToToc(DocIterator const & cpit)
+void InsetMarginal::addToToc(DocIterator const & cpit, bool output_active) 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, toolTipText()));
+       text().forToc(str, TOC_ENTRY_LENGTH);
+       toc.push_back(TocItem(pit, 0, str, output_active, toolTipText(docstring(), 3, 60)));
        // Proceed with the rest of the inset.
-       InsetFootlike::addToToc(cpit);
+       InsetFootlike::addToToc(cpit, output_active);
 }
 
 } // namespace lyx