]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetBranch.cpp
Use the much faster forOutliner also to get the tooltip text.
[features.git] / src / insets / InsetBranch.cpp
index 6c78d443c05a0a682fb85519ff06974e8fcf99f4..7d2d4d51cb36adb9529326219c0d75bbad96c9c4 100644 (file)
@@ -356,11 +356,15 @@ void InsetBranch::addToToc(DocIterator const & cpit, bool output_active,
 {
        DocIterator pit = cpit;
        pit.push_back(CursorSlice(const_cast<InsetBranch &>(*this)));
-
+       
+       docstring tooltip;
+       text().forOutliner(tooltip, TOC_ENTRY_LENGTH);
+       docstring str = params_.branch + ": " + tooltip;
+       tooltip = support::wrapParas(tooltip, 0, 60, 2);
+       
        shared_ptr<Toc> toc = buffer().tocBackend().toc("branch");
-       docstring str = params_.branch + ": ";
-       text().forOutliner(str, TOC_ENTRY_LENGTH);
-       toc->push_back(TocItem(pit, 0, str, output_active, toolTipText(docstring(), 3, 60)));
+       toc->push_back(TocItem(pit, 0, str, output_active, tooltip));
+       
        // Proceed with the rest of the inset.
        bool const doing_output = output_active && isBranchSelected();
        InsetCollapsable::addToToc(cpit, doing_output, utype);