Fix bug bug 3064 and 3065:

http://bugzilla.lyx.org/show_bug.cgi?id=3064
http://bugzilla.lyx.org/show_bug.cgi?id=3065

* LyXView::currentWorkArea(): new access methods.

* ControlSpellchecker::check(): add a WorkArea::redraw() call to update the screen



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16529 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-01-05 13:31:34 +00:00
parent 8b9a33b656
commit 325cecdea4
3 changed files with 27 additions and 0 deletions

View File

@ -100,6 +100,20 @@ void LyXView::setWorkArea(WorkArea * work_area)
}
// FIXME, there's only one WorkArea per LyXView possible for now.
WorkArea const * LyXView::currentWorkArea() const
{
return work_area_;
}
// FIXME, there's only one WorkArea per LyXView possible for now.
WorkArea * LyXView::currentWorkArea()
{
return work_area_;
}
Buffer * LyXView::buffer() const
{
BOOST_ASSERT(work_area_);

View File

@ -74,8 +74,15 @@ public:
std::vector<int> const & workAreaIds() const { return work_area_ids_; }
/// FIXME: rename to setCurrentWorkArea()
void setWorkArea(frontend::WorkArea * work_area);
/// return the current WorkArea (the one that has the focus).
frontend::WorkArea const * currentWorkArea() const;
/// FIXME: This non-const access is needed because of
/// a mis-designed \c ControlSpellchecker.
frontend::WorkArea * currentWorkArea();
/**
* This is called after the concrete view has been created.
* We have to have the toolbar and the other stuff created

View File

@ -40,6 +40,10 @@
#include "support/docstring.h"
#include "frontends/Alert.h"
// FIXME: those two headers are needed because of the
// WorkArea::redraw() call below.
#include "frontends/lyxview.h"
#include "frontends/WorkArea.h"
using std::advance;
using std::distance;
@ -251,6 +255,8 @@ void ControlSpellchecker::check()
// if we used a lfun like in find/replace, dispatch would do
// that for us
kernel().bufferview()->update();
// FIXME: this Controller is very badly designed...
kernel().lyxview().currentWorkArea()->redraw();
// set suggestions
if (res != SpellBase::OK && res != SpellBase::IGNORED_WORD) {