#include "texrow.h"
#include "vspace.h"
+#include "insets/insetbibitem.h"
#include "insets/insetoptarg.h"
#include "support/lstrings.h"
-#ifdef HAVE_LOCALE
-#endif
-
using lyx::support::subst;
using std::endl;
using std::ostream;
using std::string;
-extern string bibitemWidest(Buffer const &);
-
namespace {
os, texrow, runparams);
}
}
- lyxerr[Debug::LATEX] << "TeXDeeper...done " << &*par << endl;
+ lyxerr[Debug::LATEX] << "TeXDeeper...done " << endl;
return par;
}
texrow.newline();
}
- lyxerr[Debug::LATEX] << "TeXEnvironment...done " << &*par << endl;
- return par; // ale970302
+ if (par != paragraphs.end() && lyxerr.debugging(Debug::LATEX))
+ lyxerr << "TeXEnvironment...done " << &*par << endl;
+ return par;
}
if (bparams.inputenc == "auto" &&
language->encoding() != previous_language->encoding()) {
os << "\\inputencoding{"
- << language->encoding()->LatexName()
+ << language->encoding()->latexName()
<< "}\n";
texrow.newline();
}
os << everypar;
bool need_par = pit->simpleTeXOnePar(buf, bparams,
- outerFont(pit - paragraphs.begin(), paragraphs),
+ outerFont(std::distance(paragraphs.begin(), pit), paragraphs),
os, texrow, runparams);
// Make sure that \\par is done with the font of the last
// We do not need to use to change the font for the last paragraph
// or for a command.
LyXFont const outerfont =
- outerFont(pit - paragraphs.begin(),
-paragraphs);
+ outerFont(std::distance(paragraphs.begin(), pit),
+ paragraphs);
LyXFont const font =
(pit->empty()
}
}
- if (boost::next(pit) == const_cast<ParagraphList&>(paragraphs).end()
+ if (boost::next(pit) == paragraphs.end()
&& language->babel() != doc_language->babel()) {
// Since \selectlanguage write the language to the aux file,
// we need to reset the language at the end of footnote or
texrow.newline();
}
- lyxerr[Debug::LATEX] << "TeXOnePar...done " << &*boost::next(pit) << endl;
+ if (boost::next(pit) != paragraphs.end() &&
+ lyxerr.debugging(Debug::LATEX))
+ lyxerr << "TeXOnePar...done " << &*boost::next(pit) << endl;
return ++pit;
}
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator endpar = paragraphs.end();
+ BOOST_ASSERT(runparams.par_begin <= runparams.par_end);
+ // if only part of the paragraphs will be outputed
+ if (runparams.par_begin != runparams.par_end) {
+ par = boost::next(paragraphs.begin(), runparams.par_begin);
+ endpar = boost::next(paragraphs.begin(), runparams.par_end);
+ // runparams will be passed to nested paragraphs, so
+ // we have to reset the range parameters.
+ const_cast<OutputParams&>(runparams).par_begin = 0;
+ const_cast<OutputParams&>(runparams).par_end = 0;
+ }
+
// if only_body
while (par != endpar) {
+ ParagraphList::const_iterator lastpar = par;
// well we have to check if we are in an inset with unlimited
// length (all in one row) if that is true then we don't allow
// any special options in the paragraph and also we don't allow
if (layout->is_environment) {
par = TeXOnePar(buf, paragraphs, par, os, texrow,
- runparams, everypar);
+ runparams, everypar);
} else if (layout->isEnvironment() ||
!par->params().leftIndent().zero())
{
texrow, runparams);
} else {
par = TeXOnePar(buf, paragraphs, par, os, texrow,
- runparams, everypar);
+ runparams, everypar);
}
} else {
par = TeXOnePar(buf, paragraphs, par, os, texrow,
- runparams, everypar);
+ runparams, everypar);
}
+ if (std::distance(lastpar, par) >= std::distance(lastpar, endpar))
+ break;
}
// It might be that we only have a title in this document
if (was_title && !already_title) {