Fix wrong LATTEST

Thanks to Scott for testing. If a macro is unknown (displayed in red), then
macro_ is 0. The LATTEST is now adjusted and works like in MathMacro::write()
where I stole it from.
This commit is contained in:
Georg Baum 2015-02-17 21:10:12 +01:00
parent a852844739
commit 950f2acd5e

View File

@ -786,7 +786,8 @@ void MathMacro::maple(MapleStream & os) const
void MathMacro::mathmlize(MathStream & os) const void MathMacro::mathmlize(MathStream & os) const
{ {
LATTEST(macro_); // macro_ is 0 if this is an unknown macro
LATTEST(macro_ || displayMode_ != DISPLAY_NORMAL);
if (macro_) { if (macro_) {
docstring const xmlname = macro_->xmlname(); docstring const xmlname = macro_->xmlname();
if (!xmlname.empty()) { if (!xmlname.empty()) {
@ -807,7 +808,8 @@ void MathMacro::mathmlize(MathStream & os) const
void MathMacro::htmlize(HtmlStream & os) const void MathMacro::htmlize(HtmlStream & os) const
{ {
LATTEST(macro_); // macro_ is 0 if this is an unknown macro
LATTEST(macro_ || displayMode_ != DISPLAY_NORMAL);
if (macro_) { if (macro_) {
docstring const xmlname = macro_->xmlname(); docstring const xmlname = macro_->xmlname();
if (!xmlname.empty()) { if (!xmlname.empty()) {