X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText3.cpp;h=fa9fa8d69f0c9d22f09682e965a693aa38280c4c;hb=8c6ac457ecc69f57ab54cd8c9b8b7893607c65d6;hp=e51a2db5c526cc5c31dbc79cdf5a67ca1f6d5d5f;hpb=9d0ea8aeff32833a90b3fe64df0c5518a9e241be;p=lyx.git diff --git a/src/Text3.cpp b/src/Text3.cpp index e51a2db5c5..fa9fa8d69f 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -69,7 +69,6 @@ #include "mathed/InsetMathHull.h" #include "mathed/MathMacroTemplate.h" -#include #include #include @@ -507,8 +506,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_CHAR_FORWARD: case LFUN_CHAR_FORWARD_SELECT: - //lyxerr << BOOST_CURRENT_FUNCTION - // << " LFUN_CHAR_FORWARD[SEL]:\n" << cur << endl; + //LYXERR0(" LFUN_CHAR_FORWARD[SEL]:\n" << cur); needsUpdate |= cur.selHandle(cmd.action == LFUN_CHAR_FORWARD_SELECT); needsUpdate |= cursorForward(cur); @@ -873,25 +871,28 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) moveCursor(cur, false); break; - case LFUN_HYPHENATION_POINT_INSERT: - specialChar(cur, InsetSpecialChar::HYPHENATION); - break; - - case LFUN_LIGATURE_BREAK_INSERT: - specialChar(cur, InsetSpecialChar::LIGATURE_BREAK); - break; - - case LFUN_DOTS_INSERT: - specialChar(cur, InsetSpecialChar::LDOTS); - break; - - case LFUN_END_OF_SENTENCE_PERIOD_INSERT: - specialChar(cur, InsetSpecialChar::END_OF_SENTENCE); - break; - - case LFUN_MENU_SEPARATOR_INSERT: - specialChar(cur, InsetSpecialChar::MENU_SEPARATOR); + case LFUN_SPECIALCHAR_INSERT: { + string const name = to_utf8(cmd.argument()); + if (name == "hyphenation") + specialChar(cur, InsetSpecialChar::HYPHENATION); + else if (name == "ligature-break") + specialChar(cur, InsetSpecialChar::LIGATURE_BREAK); + else if (name == "slash") + specialChar(cur, InsetSpecialChar::SLASH); + else if (name == "nobreakdash") + specialChar(cur, InsetSpecialChar::NOBREAKDASH); + else if (name == "dots") + specialChar(cur, InsetSpecialChar::LDOTS); + else if (name == "end-of-sentence") + specialChar(cur, InsetSpecialChar::END_OF_SENTENCE); + else if (name == "menu-separator") + specialChar(cur, InsetSpecialChar::MENU_SEPARATOR); + else if (name.empty()) + lyxerr << "LyX function 'specialchar-insert' needs an argument." << endl; + else + lyxerr << "Wrong argument for LyX function 'specialchar-insert'." << endl; break; + } case LFUN_WORD_UPCASE: changeCase(cur, text_uppercase); @@ -1739,8 +1740,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) break; default: - LYXERR(Debug::ACTION, BOOST_CURRENT_FUNCTION - << ": Command " << cmd << " not DISPATCHED by Text"); + LYXERR(Debug::ACTION, "Command " << cmd << " not DISPATCHED by Text"); cur.undispatched(); break; } @@ -1958,12 +1958,8 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, // always allow this, since we will inset a raw quote // if an inset is not allowed. break; - case LFUN_HYPHENATION_POINT_INSERT: - case LFUN_LIGATURE_BREAK_INSERT: case LFUN_HFILL_INSERT: - case LFUN_MENU_SEPARATOR_INSERT: - case LFUN_DOTS_INSERT: - case LFUN_END_OF_SENTENCE_PERIOD_INSERT: + case LFUN_SPECIALCHAR_INSERT: code = SPECIALCHAR_CODE; break; case LFUN_SPACE_INSERT: