From 4052facca6f5ce5b4002928fdeb6d4d557c80bf4 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 1 Apr 2011 20:15:43 +0000 Subject: [PATCH] If we encounter a macro we don't recognize, then export this bit of math as an image. The math macro now exports as XHTML + MathML and can be viewed in Firefox. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38190 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathMacro.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index ca123afad5..bc01712343 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -753,13 +753,23 @@ void MathMacro::maple(MapleStream & os) const void MathMacro::mathmlize(MathStream & os) const { - os << expanded_.cell(0); + MathData const & data = expanded_.cell(0); + if (data.empty()) { + // this means that we do not recognize the macro + throw MathExportException(); + } + os << data; } void MathMacro::htmlize(HtmlStream & os) const { - os << expanded_.cell(0); + MathData const & data = expanded_.cell(0); + if (data.empty()) { + // this means that we do not recognize the macro + throw MathExportException(); + } + os << data; } -- 2.39.2