The branch, master, has been updated. - Log -----------------------------------------------------------------
commit 872c71ffa61e52918a12c847ef7f87b10741d75a Author: Richard Heck <[email protected]> Date: Sat Mar 9 12:42:56 2013 -0500 Try again to fix Kornel's slowness problem. The previous attempt was 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. diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 0392b9d..7017473 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -929,16 +929,21 @@ void InsetBibtex::validate(LaTeXFeatures & features) const 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 diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index e73a6c0..6c38e1f 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -694,6 +694,10 @@ void InsetExternal::latex(otexstream & os, OutputParams const & runparams) const 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, diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 70050fd..c3bd919 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -813,12 +813,18 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const 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 } diff --git a/src/mathed/InsetFormulaMacro.cpp b/src/mathed/InsetFormulaMacro.cpp index 88b54c2..8889702 100644 --- a/src/mathed/InsetFormulaMacro.cpp +++ b/src/mathed/InsetFormulaMacro.cpp @@ -84,7 +84,7 @@ void InsetFormulaMacro::latex(otexstream & os, } -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); ----------------------------------------------------------------------- Summary of changes: src/insets/InsetBibtex.cpp | 11 ++++++++--- src/insets/InsetExternal.cpp | 4 ++++ src/insets/InsetInclude.cpp | 18 ++++++++++++------ src/mathed/InsetFormulaMacro.cpp | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) hooks/post-receive -- The LyX Source Repository
