]> git.lyx.org Git - features.git/commitdiff
latexParagraphs(): code polish.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 18 Dec 2010 08:31:34 +0000 (08:31 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 18 Dec 2010 08:31:34 +0000 (08:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36933 a592a061-630c-0410-9148-cb99ea01b6c8

src/output_latex.cpp

index a46af021bc490dcb8e67febf9b6a65db7f18f6c1..fb632e3e52eeab8a9c90d629642d5edb325974da 100644 (file)
@@ -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.