git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23509 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-03-06 10:14:36 +00:00
parent a56dec8330
commit 3ba3389ede

View File

@ -32,6 +32,7 @@
#include "InsetList.h" #include "InsetList.h"
#include "Layout.h" #include "Layout.h"
#include "Length.h" #include "Length.h"
#include "LyXFunc.h"
#include "LyXRC.h" #include "LyXRC.h"
#include "MetricsInfo.h" #include "MetricsInfo.h"
#include "paragraph_funcs.h" #include "paragraph_funcs.h"
@ -1615,8 +1616,14 @@ void TextMetrics::cursorPrevious(Cursor & cur)
pos_type cpos = cur.pos(); pos_type cpos = cur.pos();
pit_type cpar = cur.pit(); pit_type cpar = cur.pit();
int x = cur.x_target(); // Memorize current position.
setCursorFromCoordinates(cur, x, 0); Point p = bv_->getPos(cur, cur.boundary());
// Scroll one full page.
lyx::dispatch(FuncRequest(LFUN_SCROLL, "page up"));
// Try to place the cursor to the same coordinates.
setCursorFromCoordinates(cur, p.x_, p.y_);
// And move one line up in order to acknowledge in inset movement and/or
// selection.
cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP)); cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP));
if (cpar == cur.pit() && cpos == cur.pos()) if (cpar == cur.pit() && cpos == cur.pos())
@ -1634,8 +1641,14 @@ void TextMetrics::cursorNext(Cursor & cur)
pos_type cpos = cur.pos(); pos_type cpos = cur.pos();
pit_type cpar = cur.pit(); pit_type cpar = cur.pit();
int x = cur.x_target(); // Memorize current position.
setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1); Point p = bv_->getPos(cur, cur.boundary());
// Scroll one full page.
lyx::dispatch(FuncRequest(LFUN_SCROLL, "page down"));
// Try to place the cursor to the same coordinates.
setCursorFromCoordinates(cur, p.x_, p.y_);
// And move one line down in order to acknowledge in inset movement and/or
// selection.
cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN)); cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
if (cpar == cur.pit() && cpos == cur.pos()) if (cpar == cur.pit() && cpos == cur.pos())