]> git.lyx.org Git - lyx.git/commitdiff
two patches from john
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 4 Feb 2002 11:30:25 +0000 (11:30 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 4 Feb 2002 11:30:25 +0000 (11:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3479 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlSpellchecker.C

index 843b8e72416ab06154956d8dd0e19ef256074723..b8cc2a399602e9d9110ff57171ba20df22682d84 100644 (file)
@@ -742,6 +742,9 @@ void BufferView::Pimpl::tripleClick(int /*x*/, int /*y*/, unsigned int button)
 
 void BufferView::Pimpl::selectionRequested()
 {
+       if (!available())
+               return;
        string const sel(bv_->getLyXText()->selectionAsString(bv_->buffer(),
                                                              false)); 
        if (!sel.empty()) {
index 38b7be22ab47710be916981109f230672d35f481..0d81928b388f6ee0d0cd59ba5037c3c86ebc24dc 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-01  John Levon  <moz@compsoc.man.ac.uk>
+
+       * BufferView_pimpl.C: fix crash on close buffer 
+       during selection (#227)
 2002-01-27  Herbert Voss  <voss@lyx.org>
 
        * buffer.C: link old Figure to new graphic inset
index db1ded68ac4d10114e96f8e2a2b785f059a0ac44..5b5bf2d3fec15913c36ce80888496f2fad37464d 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-01  John Levon  <moz@compsoc.man.ac.uk>
+
+       * ControlSpellchecker.C: clear any selection left
+       (bug #211)
 2002-02-01  Herbert Voss  <voss@lyx.org>
 
        * ControlGraphics.[C] (readBB): search only, if it is a
index f336253c2dcf98a0e1b8c7aadfdca1cae85be83b..2571de4e14ff494819eec997aab19a243b93ffe1 100644 (file)
@@ -34,6 +34,7 @@
 #include "lyxrc.h"
 #include "BufferView.h"
 #include "LyXView.h" 
+#include "lyxtext.h"
 #include "gettext.h"
 #include "support/lstrings.h"
 #include "language.h"
@@ -109,6 +110,11 @@ void ControlSpellchecker::check()
        result_ = SpellBase::ISP_OK;
        stop_ = false;
        
+       // clear any old selection
+       LyXText * text = lv_.view()->getLyXText();
+       lv_.view()->toggleSelection(true);
+       lv_.view()->update(text, BufferView::SELECT);
        while ((result_==SpellBase::ISP_OK || result_==SpellBase::ISP_IGNORE) &&
               !stop_) {
                word_ = lv_.view()->nextWord(newval_);