From af84c0957dee3e841ba6fe5325ca620dcdf39116 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Tue, 30 Oct 2007 16:22:56 +0000 Subject: [PATCH] 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 --- src/output_latex.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 8532b403fa..de5718eae8 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -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; }