Fix PageDown/Up temporarily.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20237 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-09-12 08:15:56 +00:00
parent 967c30e354
commit 8319910995
2 changed files with 15 additions and 5 deletions

View File

@ -1535,7 +1535,7 @@ void TextMetrics::cursorNext(Cursor & cur)
int x = cur.x_target(); int x = cur.x_target();
setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1); setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN)); text_->dispatch(cur, FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
if (cpar == cur.pit() && cpos == cur.pos()) if (cpar == cur.pit() && cpos == cur.pos())
// we have a row which is taller than the workarea. The // we have a row which is taller than the workarea. The

View File

@ -245,13 +245,23 @@ Point getPos(BufferView const & bv, DocIterator const & dit, bool boundary)
// FIXME: This does not work within mathed! // FIXME: This does not work within mathed!
CurStatus status(BufferView const * bv, DocIterator const & dit) CurStatus status(BufferView const * bv, DocIterator const & dit)
{ {
// FIXME: it's be better to have something like TextMetrics::status().
TextMetrics const & tm = bv->textMetrics(dit.bottom().text()); TextMetrics const & tm = bv->textMetrics(dit.bottom().text());
if (tm.has(dit.bottom().pit())) pit_type const pit = dit.bottom().pit();
return CUR_INSIDE; if (!tm.has(pit)) {
else if (dit.bottom().pit() < bv->anchor_ref()) if (dit.bottom().pit() < bv->anchor_ref())
return CUR_ABOVE;
else
return CUR_BELOW;
}
ParagraphMetrics const & pm = tm.parMetrics(pit);
if (pm.position() < 0)
return CUR_ABOVE; return CUR_ABOVE;
else else if (pm.position() > bv->workHeight())
return CUR_BELOW; return CUR_BELOW;
return CUR_INSIDE;
} }
namespace { namespace {