char_type const c = d->text_[i];
if (isPrintable(c))
os += c;
- else if (c == '\t' || c == '\n')
- os += ' ';
else if (c == META_INSET)
getInset(i)->forOutliner(os, tmplen, false);
}
/// Eg, insetDisplayName(BRANCH_CODE) == _("Branch")
docstring insetDisplayName(InsetCode);
///
-static int const TOC_ENTRY_LENGTH = 128;
+static int const TOC_ENTRY_LENGTH = 120;
/// Common base class to all insets
{
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);
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
using namespace std;
{
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetFoot &>(*this)));
-
+
+ docstring tooltip;
+ text().forOutliner(tooltip, TOC_ENTRY_LENGTH);
+ docstring str = custom_label_ + ": " + tooltip;
+ tooltip = support::wrapParas(tooltip, 0, 60, 2);
+
shared_ptr<Toc> toc = buffer().tocBackend().toc("footnote");
- docstring str = custom_label_ + ": ";
- 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.
InsetFootlike::addToToc(cpit, output_active, utype);
}
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
namespace lyx {
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetMarginal &>(*this)));
+ docstring tooltip;
+ text().forOutliner(tooltip, TOC_ENTRY_LENGTH);
+ docstring const str = tooltip;
+ tooltip = support::wrapParas(tooltip, 0, 60, 2);
+
shared_ptr<Toc> toc = buffer().tocBackend().toc("marginalnote");
- docstring str;
- 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.
InsetFootlike::addToToc(cpit, output_active, utype);
}
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lstrings.h"
#include "support/Translator.h"
#include "frontends/Application.h"
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetNote &>(*this)));
- shared_ptr<Toc> toc = buffer().tocBackend().toc("note");
InsetLayout const & il = getLayout();
- docstring str = translateIfPossible(il.labelstring()) + from_ascii(": ");
- text().forOutliner(str, TOC_ENTRY_LENGTH);
- toc->push_back(TocItem(pit, 0, str, output_active, toolTipText(docstring(), 3, 60)));
+ docstring tooltip;
+ text().forOutliner(tooltip, TOC_ENTRY_LENGTH);
+ docstring str = translateIfPossible(il.labelstring()) + ": " + tooltip;
+ tooltip = support::wrapParas(tooltip, 0, 60, 2);
+
+ shared_ptr<Toc> toc = buffer().tocBackend().toc("note");
+ toc->push_back(TocItem(pit, 0, str, output_active, tooltip));
// Proceed with the rest of the inset.
bool doing_output = output_active && producesOutput();
/// e.g., "Index: ".
/// \param numlines: the number of lines in the tooltip
/// \param len: length of those lines
+ /// NOTE This routine is kind of slow. It's fine to use it within the
+ /// GUI, but definitely do not try to use it in updateBuffer or anything
+ /// of that sort.
docstring toolTipText(docstring prefix = empty_docstring(),
size_t numlines = 5, size_t len = 80) const;