From: Abdelrazak Younes Date: Fri, 5 Jan 2007 13:31:34 +0000 (+0000) Subject: Fix bug bug 3064 and 3065: X-Git-Tag: 1.6.10~11329 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=325cecdea4a49c1bc85566a8642c5e3ced583dc4;p=features.git 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 --- diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 73699d1646..9017b09e9b 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -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_); diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index b51aa65447..6c3b62a79b 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -74,8 +74,15 @@ public: std::vector 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 diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C index c001bd27b4..f6af7fd50c 100644 --- a/src/frontends/controllers/ControlSpellchecker.C +++ b/src/frontends/controllers/ControlSpellchecker.C @@ -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) {