From 6bb98d076f53f243d05e94f7689cc049ba047223 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Wed, 30 May 2007 06:44:18 +0000 Subject: [PATCH] * removed the "dirty trick" to append a row with wrong start and end (but start and end inside of the buffer limits) for the last empty row behind a newline. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18576 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TextMetrics.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index ba87f122d8..622ca32688 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -245,12 +245,9 @@ bool TextMetrics::redoParagraph(pit_type const pit) // Make sure that if a par ends in newline, there is one more row // under it - // FIXME this is a dirty trick. Now the _same_ position in the - // paragraph occurs in _two_ different rows, and has two different - // display positions, leading to weird behaviour when moving up/down. if (z > 0 && par.isNewline(z - 1)) { - Row row(z - 1); - row.endpos(z - 1); + Row row(z); + row.endpos(z); setRowWidth(right_margin, pit, row); setHeightOfRow(pit, row); pm.rows().push_back(row); @@ -332,7 +329,7 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit, // The test on par.size() is to catch zero-size pars, which // would trigger the assert in Paragraph::getInset(). //inset = par.size() ? par.getInset(row.pos()) : 0; - if (!par.empty() + if (row.pos() < par.size() && par.isInset(row.pos())) { switch(par.getInset(row.pos())->display()) { @@ -790,7 +787,8 @@ void TextMetrics::setHeightOfRow(pit_type const pit, if (pit == 0 && row.pos() == 0) maxasc += 20; if (pit + 1 == pit_type(pars.size()) && - row.endpos() == par.size()) + row.endpos() == par.size() && + !(row.endpos() > 0 && par.isNewline(row.endpos() - 1))) maxdesc += 20; } -- 2.39.2