>>>>> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> On Sep 15, 2005, at 10:05 AM, Jean-Marc Lasgouttes wrote:
>>  A question: does the crash only happen when there is no document
>> open, or all the time?

Bennett> Only when there's no document open.

Good. Does the following patch help?

JMarc

Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2283
diff -u -p -r1.2283 ChangeLog
--- src/ChangeLog	19 Sep 2005 10:18:36 -0000	1.2283
+++ src/ChangeLog	19 Sep 2005 12:35:39 -0000
@@ -1,5 +1,10 @@
 2005-09-19  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
+	* lyxfunc.C (processKeySym): do not call LCursor::getEncoding if
+	there is no document.
+
+2005-09-19  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
 	* rowpainter.C (paintFirst): use a 'labeladdon' for TOP_* labels,
 	as is already done for "chapter".
 
Index: src/lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.668
diff -u -p -r1.668 lyxfunc.C
--- src/lyxfunc.C	19 Sep 2005 09:55:49 -0000	1.668
+++ src/lyxfunc.C	19 Sep 2005 12:35:39 -0000
@@ -243,9 +243,11 @@ void LyXFunc::processKeySym(LyXKeySymPtr
 		return;
 	}
 
-	Encoding const * encoding = view()->cursor().getEncoding();
+	Encoding const * encoding = 0;
+	if (view()->available())
+		encoding = view()->cursor().getEncoding();
 
-	encoded_last_key = keysym->getISOEncoded(encoding ? encoding->Name() : "");
+	encoded_last_key = keysym->getISOEncoded(encoding ? encoding->Name() : string());
 
 	// Do a one-deep top-level lookup for
 	// cancel and meta-fake keys. RVDK_PATCH_5

Reply via email to