+
+
+void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
+ pit_type par_end, bool full_source)
+{
+ OutputParams runparams;
+ runparams.nice = true;
+ runparams.flavor = OutputParams::LATEX;
+ runparams.linelen = lyxrc.ascii_linelen;
+ // No side effect of file copying and image conversion
+ runparams.dryrun = true;
+
+ /* Support for docbook temprarily commented out. */
+ if (full_source) {
+ os << "% Preview source code\n\n";
+ if (isLatex())
+ writeLaTeXSource(os, filePath(), runparams, true, true);
+ else {
+ writeDocBookSource(os, fileName(), runparams, false);
+ }
+ } else {
+ runparams.par_begin = par_begin;
+ runparams.par_end = par_end;
+ if (par_begin + 1 == par_end)
+ os << "% Preview source code for paragraph " << par_begin << "\n\n";
+ else
+ os << "% Preview source code from paragraph " << par_begin
+ << " to " << par_end - 1 << "\n\n";
+ // output paragraphs
+ if (isLatex()) {
+ texrow().reset();
+ latexParagraphs(*this, paragraphs(), os, texrow(), runparams);
+ } else {
+ // DocBook
+ docbookParagraphs(paragraphs(), *this, os, runparams);
+ }
+ }
+}
+
+
+ErrorList const & Buffer::errorList(string const & type) const
+{
+ static ErrorList const emptyErrorList;
+ std::map<std::string, ErrorList>::const_iterator I = errorLists_.find(type);
+ if (I == errorLists_.end())
+ return emptyErrorList;
+
+ return I->second;
+}
+
+
+ErrorList & Buffer::errorList(string const & type)
+{
+ return errorLists_[type];
+}
+
+
+} // namespace lyx