worth doing, as we were creating too much output for tooltips anyway.
But we need to ignore BibTeX insets altogether, as the collection of
the references, etc, is too slow.
int InsetBibtex::plaintext(odocstringstream & os,
- OutputParams const &, size_t max_length) const
+ OutputParams const & op, size_t max_length) const
{
+ docstring const reflabel = buffer().B_("References");
+
+ if (op.for_tooltip || op.for_toc) {
+ os << reflabel;
+ return reflabel.size();
+ }
+
BiblioInfo bibinfo = buffer().masterBibInfo();
bibinfo.makeCitationLabels(buffer());
vector<docstring> const & cites = bibinfo.citedEntries();
size_t start_size = os.str().size();
docstring refoutput;
- docstring const reflabel = buffer().B_("References");
-
refoutput += reflabel + "\n\n";
// Now we loop over the entries
int InsetExternal::plaintext(odocstringstream & os,
OutputParams const & runparams, size_t) const
{
+ // this is too slow for constant use
+ if (runparams.for_tooltip)
+ return 0;
+
os << '\n'; // output external material on a new line
external::writeExternal(params_, "Ascii", buffer(), os,
*(runparams.exportdata), false,
int InsetInclude::plaintext(odocstringstream & os,
OutputParams const & op, size_t) const
{
- // don't write the file just because we're making a tooltip or toc entry!!
- if (op.for_tooltip || op.for_toc || isVerbatim(params()) || isListings(params())) {
- os << '[' << screenLabel() << '\n';
- // FIXME: We don't know the encoding of the file, default to UTF-8.
- os << includedFileName(buffer(), params()).fileContents("UTF-8");
- os << "\n]";
+ // just write the filename if we're making a tooltip or toc entry
+ if (op.for_tooltip || op.for_toc) {
+ os << '[' << screenLabel() << '\n'
+ << getParam("filename") << "\n]";
+ return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+ }
+
+ if (isVerbatim(params()) || isListings(params())) {
+ os << '[' << screenLabel() << '\n'
+ // FIXME: We don't know the encoding of the file, default to UTF-8.
+ << includedFileName(buffer(), params()).fileContents("UTF-8")
+ << "\n]";
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
}
}
-int InsetFormulaMacro::plaintext(odocstringstream & os, OutputParams const & runparams, int max_length) const
+int InsetFormulaMacro::plaintext(odocstringstream & os, OutputParams const & runparams, size_t) const
{
odocstringstream oss;
WriteStream wi(oss, false, true, WriteStream::wsDefault, runparams.encoding);