Fix line count off-by-one for single-par verbatims

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21293 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2007-10-30 16:22:56 +00:00
parent bc86ac1804
commit af84c0957d

View File

@ -254,15 +254,18 @@ TeXOnePar(Buffer const & buf,
LayoutPtr style;
if (runparams_in.verbatim) {
Font const outerfont =
outerFont(std::distance(paragraphs.begin(), pit),
paragraphs);
int dist = std::distance(paragraphs.begin(), pit);
Font const outerfont = outerFont(dist, paragraphs);
// No newline if only one paragraph in this lyxtext
if (dist > 0) {
os << '\n';
texrow.newline();
}
/*bool need_par = */ pit->latex(buf, bparams, outerfont,
os, texrow, runparams_in);
os << '\n';
texrow.newline();
return ++pit;
}