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-16 22:33:48 +01:00
parent 31a2cb5ed2
commit bc8638bd25

View File

@ -793,7 +793,8 @@ void MathMacro::maple(MapleStream & 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_) {
docstring const xmlname = macro_->xmlname();
if (!xmlname.empty()) {
@ -814,7 +815,8 @@ void MathMacro::mathmlize(MathStream & 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_) {
docstring const xmlname = macro_->xmlname();
if (!xmlname.empty()) {