by changing the argument type to lyx::char_type.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15382
a592a061-630c-0410-9148-
cb99ea01b6c8
cur.posLeft();
cur.pushLeft(*cur.nextInset());
}
cur.posLeft();
cur.pushLeft(*cur.nextInset());
}
- // FIXME: Change to
- // } else if (!interpret(cur, cmd.argument()[0])) {
- // when interpret accepts UCS4 characters
- } else {
- std::string arg0 = lyx::to_utf8(docstring(1, cmd.argument()[0]));
- if (!interpretChar(cur, arg0[0])) {
- cmd = FuncRequest(LFUN_FINISHED_RIGHT);
- cur.undispatched();
- }
+ } else if (!interpretChar(cur, cmd.argument()[0])) {
+ cmd = FuncRequest(LFUN_FINISHED_RIGHT);
+ cur.undispatched();
case LFUN_MATH_INSERT: {
recordUndo(cur, Undo::ATOMIC);
if (cmd.argument() == "^" || cmd.argument() == "_") {
case LFUN_MATH_INSERT: {
recordUndo(cur, Undo::ATOMIC);
if (cmd.argument() == "^" || cmd.argument() == "_") {
- std::string arg0 = lyx::to_utf8(docstring(1, cmd.argument()[0]));
- interpretChar(cur, arg0[0]);
+ interpretChar(cur, cmd.argument()[0]);
} else
cur.niceInsert(lyx::to_utf8(cmd.argument()));
break;
} else
cur.niceInsert(lyx::to_utf8(cmd.argument()));
break;
-bool InsetMathNest::interpretChar(LCursor & cur, char c)
+bool InsetMathNest::interpretChar(LCursor & cur, lyx::char_type c)
{
//lyxerr << "interpret 2: '" << c << "'" << endl;
string save_selection;
{
//lyxerr << "interpret 2: '" << c << "'" << endl;
string save_selection;
- cur.activeMacro()->setName(name + c);
+ cur.activeMacro()->setName(name + lyx::to_ascii(docstring(1, c)));
cur.niceInsert(MathAtom(new InsetMathComment));
} else if (c == '#') {
BOOST_ASSERT(cur.activeMacro());
cur.niceInsert(MathAtom(new InsetMathComment));
} else if (c == '#') {
BOOST_ASSERT(cur.activeMacro());
- cur.activeMacro()->setName(name + c);
+ cur.activeMacro()->setName(name + lyx::to_ascii(docstring(1, c)));
} else {
cur.backspace();
} else {
cur.backspace();
- cur.niceInsert(createInsetMath(string(1, c)));
+ cur.niceInsert(createInsetMath(lyx::to_ascii(docstring(1, c))));
}
return true;
}
// One character big delimiters. The others are handled in
}
return true;
}
// One character big delimiters. The others are handled in
- // the other interpret() method.
latexkeys const * l = in_word_set(name.substr(1));
if (name[0] == '\\' && l && l->inset == "big") {
string delim;
latexkeys const * l = in_word_set(name.substr(1));
if (name[0] == '\\' && l && l->inset == "big") {
string delim;
delim = "\\}";
break;
default:
delim = "\\}";
break;
default:
+ delim = lyx::to_ascii(docstring(1, c));
break;
}
if (InsetMathBig::isBigInsetDelim(delim)) {
break;
}
if (InsetMathBig::isBigInsetDelim(delim)) {
if (c == '{' || c == '}' || c == '&' || c == '$' || c == '#' ||
c == '%' || c == '_' || c == '^') {
if (c == '{' || c == '}' || c == '&' || c == '$' || c == '#' ||
c == '%' || c == '_' || c == '^') {
- cur.niceInsert(createInsetMath(string(1, c)));
+ cur.niceInsert(createInsetMath(lyx::to_ascii(docstring(1, c))));
/// interpret \p c and insert the result at the current position of
/// of \p cur. Return whether the cursor should stay in the formula.
/// interpret \p c and insert the result at the current position of
/// of \p cur. Return whether the cursor should stay in the formula.
- bool interpretChar(LCursor & cur, char c);
+ bool interpretChar(LCursor & cur, lyx::char_type c);
///
bool script(LCursor & cur, bool,
std::string const & save_selection = std::string());
///
bool script(LCursor & cur, bool,
std::string const & save_selection = std::string());