Fix screen update after CT bug.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16843 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-01-24 23:05:40 +00:00
parent a2dd146542
commit e4c489376c
2 changed files with 15 additions and 6 deletions

View File

@ -19,6 +19,12 @@
#include "changes.h"
#include "funcrequest.h"
#include "lyxfind.h"
// FIXME: those two headers are needed because of the
// WorkArea::redraw() call below.
#include "frontends/LyXView.h"
#include "frontends/WorkArea.h"
#include "support/lyxtime.h"
using std::string;
@ -35,7 +41,13 @@ ControlChanges::ControlChanges(Dialog & parent)
bool ControlChanges::find()
{
return findNextChange(kernel().bufferview());
// FIXME: it would be better to use an LFUN.
if (!findNextChange(kernel().bufferview()))
return false;
kernel().bufferview()->update();
kernel().lyxview().currentWorkArea()->redraw();
return true;
}
@ -80,14 +92,14 @@ docstring const ControlChanges::getChangeAuthor()
bool ControlChanges::accept()
{
kernel().dispatch(FuncRequest(LFUN_CHANGE_ACCEPT));
return findNextChange(kernel().bufferview());
return find();
}
bool ControlChanges::reject()
{
kernel().dispatch(FuncRequest(LFUN_CHANGE_REJECT));
return findNextChange(kernel().bufferview());
return find();
}

View File

@ -358,9 +358,6 @@ bool findNextChange(BufferView * bv)
bv->cursor().setCursor(cur);
bv->cursor().setSelection();
theSelection().haveSelection(bv->cursor().selection());
// if we used a lfun like in find/replace, dispatch would do
// that for us
bv->update();
return true;
}