]> git.lyx.org Git - features.git/commitdiff
Fix wrong LATTEST
authorGeorg Baum <baum@lyx.org>
Mon, 16 Feb 2015 21:33:48 +0000 (22:33 +0100)
committerGeorg Baum <baum@lyx.org>
Mon, 16 Feb 2015 21:33:48 +0000 (22:33 +0100)
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.

src/mathed/MathMacro.cpp

index c7339528614cc4f571570fbe799e0dd3ce19924f..2ff4dcede7e8967f662589e7633dae6853733527 100644 (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()) {