Text::dispatch(): Make sure the cursor is visible before doing anything.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23127 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-22 12:22:28 +00:00
parent 6564e9bb4e
commit 2ed1153c8c

View File

@ -388,14 +388,17 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
{
LYXERR(Debug::ACTION, "Text::dispatch: cmd: " << cmd);
BufferView * bv = &cur.bv();
TextMetrics & tm = bv->textMetrics(this);
if (!tm.has(cur.pit()))
lyx::dispatch(FuncRequest(LFUN_SCREEN_RECENTER));
// FIXME: We use the update flag to indicates wether a singlePar or a
// full screen update is needed. We reset it here but shall we restore it
// at the end?
cur.noUpdate();
BOOST_ASSERT(cur.text() == this);
BufferView * bv = &cur.bv();
TextMetrics & tm = cur.bv().textMetrics(this);
CursorSlice oldTopSlice = cur.top();
bool oldBoundary = cur.boundary();
bool sel = cur.selection();