From ffea94c5e603043d1146180ae14590255278a37e Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 18 Dec 2010 08:31:34 +0000 Subject: [PATCH] latexParagraphs(): code polish. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36933 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/output_latex.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index a46af021bc..fb632e3e52 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -925,11 +925,7 @@ void latexParagraphs(Buffer const & buf, OutputParams const & runparams, string const & everypar) { - bool was_title = false; - bool already_title = false; BufferParams const & bparams = buf.params(); - DocumentClass const & tclass = bparams.documentClass(); - ParagraphList const & paragraphs = text.paragraphs(); bool const maintext = text.isMainText(); bool const is_child = buf.masterBuffer() != &buf; @@ -967,6 +963,7 @@ void latexParagraphs(Buffer const & buf, texrow.newline(); } + ParagraphList const & paragraphs = text.paragraphs(); LASSERT(runparams.par_begin <= runparams.par_end, /**/); // if only part of the paragraphs will be outputed bool const partial_export = (runparams.par_begin != runparams.par_end); @@ -983,11 +980,14 @@ void latexParagraphs(Buffer const & buf, pit_type pit = par_begin; // lastpit is for the language check after the loop. pit_type lastpit; - ParagraphList::const_iterator par; - // if only_body + // variables used in the loop: + bool was_title = false; + bool already_title = false; + DocumentClass const & tclass = bparams.documentClass(); + for (; pit < par_end; ++pit) { lastpit = pit; - par = paragraphs.constIterator(pit); + ParagraphList::const_iterator par = paragraphs.constIterator(pit); // FIXME This check should not be needed. We should // perhaps issue an error if it is.