mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Fix bug #9616
This commit is contained in:
parent
67db7e1c10
commit
cb70946960
@ -601,6 +601,16 @@ bool Encodings::isMathAlpha(char_type c)
|
||||
}
|
||||
|
||||
|
||||
bool Encodings::isUnicodeTextOnly(char_type c)
|
||||
{
|
||||
if (isASCII(c) || isMathAlpha(c))
|
||||
return false;
|
||||
|
||||
CharInfoMap::const_iterator const it = unicodesymbols.find(c);
|
||||
return it == unicodesymbols.end() || it->second.mathcommand().empty();
|
||||
}
|
||||
|
||||
|
||||
Encoding const *
|
||||
Encodings::fromLyXName(string const & name, bool allowUnsafe) const
|
||||
{
|
||||
|
@ -286,6 +286,12 @@ public:
|
||||
* letters and accented characters that are output as math commands.
|
||||
*/
|
||||
static bool isMathAlpha(char_type c);
|
||||
/**
|
||||
* Do we have to wrap in \text this character when in mathmode?
|
||||
* This is true if \p c is not ascii and the "mathalpha" flag is not
|
||||
* set and a mathcommand is not defined in the unicodesymbols file.
|
||||
*/
|
||||
static bool isUnicodeTextOnly(char_type c);
|
||||
/**
|
||||
* Register \p c as a mathmode command.
|
||||
*/
|
||||
|
@ -1856,7 +1856,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
|
||||
cur.niceInsert(createInsetMath("sim", buf));
|
||||
return true;
|
||||
}
|
||||
if (currentMode() == InsetMath::MATH_MODE && !isAsciiOrMathAlpha(c)) {
|
||||
if (currentMode() == InsetMath::MATH_MODE && Encodings::isUnicodeTextOnly(c)) {
|
||||
MathAtom at = createInsetMath("text", buf);
|
||||
at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
|
||||
cur.niceInsert(at);
|
||||
|
Loading…
Reference in New Issue
Block a user