diff --git a/src/frontends/controllers/ControlChanges.C b/src/frontends/controllers/ControlChanges.C index 9c67cc57c5..e9d266145c 100644 --- a/src/frontends/controllers/ControlChanges.C +++ b/src/frontends/controllers/ControlChanges.C @@ -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(); } diff --git a/src/lyxfind.C b/src/lyxfind.C index d8e08dd803..9e92f3b63b 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -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; }