The following patch tries to fix bug 1451, but I am not sure I did
things right. Basically what happens when switching document is the
following call stack


BufferView::buffer
BufferView::Pimpl::buffer
Dialogs::updateBufferDependent
ControlConnectBD::updateSlot(true)
ControlDialog<ControlConnectBD>::update()
ControlSpellchecker::setParams()
ControlSpellchecker::startSession()

What the patch does is to implement a better (?)
ControlSpellchecker::updateSlot(). Angus, I would really appreciate if
you could look at this.

There is still a problem: in some cases,
ControlDialog<ControlConnectBD>::hide() is called, and it enventually
invokes ControlSpellchecker::endSession(), which moves the cursor to
the right. I am not sure how to fix that...

BTW, Why is ControlSpellChecker derived from ControlDialog, but not
ControlTabular? 

JMarc

Index: src/frontends/controllers/ControlSpellchecker.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v
retrieving revision 1.36.2.4
diff -u -p -r1.36.2.4 ControlSpellchecker.C
--- src/frontends/controllers/ControlSpellchecker.C	10 May 2005 15:00:13 -0000	1.36.2.4
+++ src/frontends/controllers/ControlSpellchecker.C	24 May 2005 16:58:17 -0000
@@ -59,6 +59,13 @@ void ControlSpellchecker::clearParams()
 }
 
 	
+void ControlSpellchecker::updateSlot(bool switched)
+{
+	if (switched)
+		hide();
+}
+
+
 void ControlSpellchecker::startSession()
 {
 	lyxerr[Debug::GUI] << "spell startSession" << endl;
Index: src/frontends/controllers/ControlSpellchecker.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.h,v
retrieving revision 1.14.2.3
diff -u -p -r1.14.2.3 ControlSpellchecker.h
--- src/frontends/controllers/ControlSpellchecker.h	7 Dec 2004 10:49:05 -0000	1.14.2.3
+++ src/frontends/controllers/ControlSpellchecker.h	24 May 2005 16:58:17 -0000
@@ -83,6 +83,10 @@ private:
 	/// not needed.
 	virtual void apply() {}
 
+	/** Instantiation of ControlConnectBD private virtual method.
+	    Slot connected to update signal. */
+	virtual void updateSlot(bool);
+
 	/// current word being checked and lang code
 	WordLangTuple word_;
 

Reply via email to