Attached is a tested, working 1.3 patch that fixes bug 1665, following an
idea of Jean-Marc (see http://bugzilla.lyx.org/show_bug.cgi?id=1665). I
know that this is no crash, but it is very annoying for me (because we
produce many of our documents via commandline export), so I fixed it
nevertheless.
I propose to apply this both to 1.3 and 1.4. OK?
Georg
Index: src/mathed/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.299.2.21
diff -u -p -r1.299.2.21 ChangeLog
--- src/mathed/ChangeLog 26 Apr 2005 10:00:58 -0000 1.299.2.21
+++ src/mathed/ChangeLog 6 Jun 2005 12:06:10 -0000
@@ -1,3 +1,10 @@
+2005-06-06 Georg Baum <[EMAIL PROTECTED]>
+
+ * math_parser.h (latexkeys): new member requires
+ * math_factory.C (initSymbols): fill the requires field for fonts
+ * math_symbolinset.C (validate): use sym_->requires instead of
+ sym_->inset (fixes bug 1665)
+
2005-04-26 Georg Baum <[EMAIL PROTECTED]>
* math_cursor.C (interpret): treat & as special character (fixes
Index: src/mathed/math_factory.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_factory.C,v
retrieving revision 1.70.2.2
diff -u -p -r1.70.2.2 math_factory.C
--- src/mathed/math_factory.C 7 Dec 2004 10:49:53 -0000 1.70.2.2
+++ src/mathed/math_factory.C 6 Jun 2005 12:06:11 -0000
@@ -144,6 +144,12 @@ void initSymbols()
// tmp.inset _is_ the fontname here.
// create fallbacks if necessary
+ // store requirements as long as we can
+ if (tmp.inset == "msa" || tmp.inset == "msb")
+ tmp.requires = "amssymb";
+ else if (tmp.inset == "wasy")
+ tmp.requires = "wasysym";
+
// symbol font is not available sometimes
string symbol_font = "lyxsymbol";
Index: src/mathed/math_parser.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_parser.h,v
retrieving revision 1.52.2.1
diff -u -p -r1.52.2.1 math_parser.h
--- src/mathed/math_parser.h 7 Dec 2004 10:50:01 -0000 1.52.2.1
+++ src/mathed/math_parser.h 6 Jun 2005 12:06:11 -0000
@@ -39,6 +39,8 @@ struct latexkeys {
string extra;
/// how is this called as XML entity?
string xmlname;
+ /// required LaTeXFeatures
+ string requires;
};
Index: src/mathed/math_symbolinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_symbolinset.C,v
retrieving revision 1.52.2.4
diff -u -p -r1.52.2.4 math_symbolinset.C
--- src/mathed/math_symbolinset.C 19 Jan 2005 11:46:53 -0000 1.52.2.4
+++ src/mathed/math_symbolinset.C 6 Jun 2005 12:06:11 -0000
@@ -122,10 +122,8 @@ bool MathSymbolInset::takesLimits() cons
void MathSymbolInset::validate(LaTeXFeatures & features) const
{
- if (sym_->inset == "msa" || sym_->inset == "msb")
- features.require("amssymb");
- else if (sym_->inset == "wasy")
- features.require("wasysym");
+ if (!sym_->requires.empty())
+ features.require(sym_->requires);
}