Add some constness and remove some useless code.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27220 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-10-31 23:32:52 +00:00
parent 864fd8d7de
commit 87dbdca653

View File

@ -294,12 +294,10 @@ TeXOnePar(Buffer const & buf,
BufferParams const & bparams = buf.params(); BufferParams const & bparams = buf.params();
ParagraphList const & paragraphs = text.paragraphs(); ParagraphList const & paragraphs = text.paragraphs();
ParagraphList::const_iterator priorpit = pit; ParagraphList::const_iterator const priorpit =
if (priorpit != paragraphs.begin()) pit == paragraphs.begin() ? pit : boost::prior(pit);
--priorpit; ParagraphList::const_iterator const nextpit =
ParagraphList::const_iterator nextpit = pit; pit == paragraphs.end() ? pit : boost::next(pit);
if (nextpit != paragraphs.end())
++nextpit;
OutputParams runparams = runparams_in; OutputParams runparams = runparams_in;
runparams.isLastPar = nextpit == paragraphs.end(); runparams.isLastPar = nextpit == paragraphs.end();
@ -586,10 +584,9 @@ TeXOnePar(Buffer const & buf,
case LATEX_ENVIRONMENT: { case LATEX_ENVIRONMENT: {
// if its the last paragraph of the current environment // if its the last paragraph of the current environment
// skip it otherwise fall through // skip it otherwise fall through
ParagraphList::const_iterator next = nextpit; if (nextpit != paragraphs.end() &&
(nextpit->layout() != pit->layout()
if (next != paragraphs.end() && (next->layout() != pit->layout() || nextpit->params().depth() != pit->params().depth()))
|| next->params().depth() != pit->params().depth()))
break; break;
} }