]> git.lyx.org Git - features.git/commitdiff
Fix bug bug 3064 and 3065:
authorAbdelrazak Younes <younes@lyx.org>
Fri, 5 Jan 2007 13:31:34 +0000 (13:31 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 5 Jan 2007 13:31:34 +0000 (13:31 +0000)
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

src/frontends/LyXView.C
src/frontends/LyXView.h
src/frontends/controllers/ControlSpellchecker.C

index 73699d16467c0c2dc4ab00aaf994f83e7c29fd4a..9017b09e9b798f39ada73d35082d06054984c9cb 100644 (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_);
index b51aa65447b6c39a31f80c82cc6d7f72a230ed3b..6c3b62a79bda46fde87f62cf9f31abd4ffbffd8e 100644 (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
index c001bd27b4ed4339f28906bcf15057539a420d33..f6af7fd50c7e04c7eb7ed66c480fb573dee5099a 100644 (file)
 #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) {