]> git.lyx.org Git - features.git/commitdiff
If we encounter a macro we don't recognize, then export this bit of math
authorRichard Heck <rgheck@comcast.net>
Fri, 1 Apr 2011 20:15:43 +0000 (20:15 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 1 Apr 2011 20:15:43 +0000 (20:15 +0000)
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

index ca123afad5caad8aa321b83d4b2d53096e0f3d40..bc0171234361611499fbf624279839ff506dcab0 100644 (file)
@@ -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;
 }