]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathChar.cpp
In mathmode, treat nonascii chars with diacritical marks as an input method
[features.git] / src / mathed / InsetMathChar.cpp
index 46083a439eebb75bce0fbaadab1b79a290641add..a4640f2d159416572d37994cc2c6f5141e453171 100644 (file)
 #include "MetricsInfo.h"
 
 #include "Dimension.h"
+#include "Encoding.h"
+#include "LaTeXFeatures.h"
 #include "TextPainter.h"
 
 #include "frontends/FontMetrics.h"
 
 #include "support/debug.h"
 #include "support/lstrings.h"
+#include "support/textutils.h"
 
 
 namespace lyx {
@@ -39,7 +42,7 @@ static bool isBinaryOp(char_type c)
 
 static bool slanted(char_type c)
 {
-       return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
+       return isAlphaASCII(c) || Encodings::isMathAlpha(c);
 }
 
 
@@ -135,6 +138,13 @@ void InsetMathChar::write(WriteStream & os) const
 }
 
 
+void InsetMathChar::validate(LaTeXFeatures & features) const
+{
+       if (char_ >= 0x80)
+               encodings.validate(char_, features, true);
+}
+
+
 void InsetMathChar::normalize(NormalStream & os) const
 {
        os << "[char ";