Georg Baum wrote:
> 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?
I read no response as 'yes' and applied the attached patch to 1.4
Georg
Index: src/mathed/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.497
diff -u -p -r1.497 ChangeLog
--- src/mathed/ChangeLog 8 May 2005 10:02:38 -0000 1.497
+++ src/mathed/ChangeLog 7 Jun 2005 17:19:14 -0000
@@ -1,3 +1,10 @@
+2005-06-07 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-05-07 Michael Schmitt <[EMAIL PROTECTED]>
* ref_inset.C: rename LFUN_REF_GOTO to LFUN_LABEL_GOTO
Index: src/mathed/math_factory.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_factory.C,v
retrieving revision 1.110
diff -u -p -r1.110 math_factory.C
--- src/mathed/math_factory.C 16 Mar 2005 17:06:47 -0000 1.110
+++ src/mathed/math_factory.C 7 Jun 2005 17:19:14 -0000
@@ -163,6 +163,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.58
diff -u -p -r1.58 math_parser.h
--- src/mathed/math_parser.h 19 Jan 2005 15:03:31 -0000 1.58
+++ src/mathed/math_parser.h 7 Jun 2005 17:19:14 -0000
@@ -35,6 +35,8 @@ public:
std::string extra;
/// how is this called as XML entity?
std::string xmlname;
+ /// required LaTeXFeatures
+ std::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.70
diff -u -p -r1.70 math_symbolinset.C
--- src/mathed/math_symbolinset.C 19 Jan 2005 11:44:30 -0000 1.70
+++ src/mathed/math_symbolinset.C 7 Jun 2005 17:19:14 -0000
@@ -136,10 +136,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);
}