]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathSupport.cpp
Another assertion that got transformed in 1b1f8dd2
[lyx.git] / src / mathed / MathSupport.cpp
index 0a87fd69bae3c90f67a8a812eba790a2a3831ef6..6a815ed8985e6b81605b4f201c6ecfffb865fab0 100644 (file)
@@ -13,7 +13,8 @@
 
 #include "MathSupport.h"
 
-#include "InsetMath.h"
+#include "InsetMathFont.h"
+#include "InsetMathSymbol.h"
 #include "MathData.h"
 #include "MathParser.h"
 #include "MathStream.h"
@@ -736,6 +737,27 @@ void augmentFont(FontInfo & font, docstring const & name)
 }
 
 
+bool isAlphaSymbol(MathAtom const & at)
+{
+       if (at->asCharInset() ||
+           (at->asSymbolInset() &&
+            at->asSymbolInset()->isOrdAlpha()))
+               return true;
+
+       if (at->asFontInset()) {
+               MathData const & ar = at->asFontInset()->cell(0);
+               for (size_t i = 0; i < ar.size(); ++i) {
+                       if (!(ar[i]->asCharInset() ||
+                             (ar[i]->asSymbolInset() &&
+                              ar[i]->asSymbolInset()->isOrdAlpha())))
+                               return false;
+               }
+               return true;
+       }
+       return false;
+}
+
+
 docstring asString(MathData const & ar)
 {
        odocstringstream os;