Fix attached. This happens, e.g., when switching to a textclass not containing 
a charstyle contained in
the document.

- Martin

Index: factory.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/factory.C,v
retrieving revision 1.95
diff -u -p -r1.95 factory.C
--- factory.C   14 Aug 2004 15:55:17 -0000      1.95
+++ factory.C   29 Apr 2005 20:41:46 -0000
@@ -417,7 +417,14 @@ InsetBase * readInset(LyXLex & lex, Buff
                        lex.next();
                        string s = lex.getString();
                        CharStyles::iterator found_cs = tclass.charstyle(s);
-                       inset.reset(new InsetCharStyle(buf.params(), found_cs));
+                       if (found_cs != tclass.charstyles().end())
+                               inset.reset(new InsetCharStyle(buf.params(), 
found_cs));
+                       else {
+                               lyxerr << "unknown CharStyle type '" << s << 
"'" << std::endl;
+                               while (lex.isOK() && lex.getString() != 
"\\end_inset")
+                                       lex.next();
+                               return 0;
+                       }
                } else if (tmptok == "Branch") {
                        inset.reset(new InsetBranch(buf.params(),
                                                    InsetBranchParams()));

Attachment: pgpFolZYP6pus.pgp
Description: PGP signature

Reply via email to