Fix crash when entering unhandled math objects in toolbar

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1195 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-11-03 16:45:08 +00:00
parent a6b2d503fb
commit 7c095d4330
3 changed files with 27 additions and 15 deletions

View File

@ -1,3 +1,10 @@
2000-11-03 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/frontends/xforms/Toolbar_pimpl.C: do not crash if mathed has
not returned a pixmap for "math-insert".
* src/LyXAction.C (init): sort the entries a bit.
2000-11-03 Juergen Vigna <jug@sad.it>
* src/insets/insettabular.h: added fixed number to update codes so

View File

@ -155,6 +155,7 @@ void LyXAction::init()
{ LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"),
ReadOnly },
{ LFUN_CANCEL, "cancel", N_("Cancel"), NoBuffer },
{ LFUN_INSET_CAPTION, "caption-insert", "", Noop },
{ LFUN_LEFT, "char-backward", N_("Go one char back"),
ReadOnly },
{ LFUN_RIGHT, "char-forward", N_("Go one char forward"),
@ -167,6 +168,7 @@ void LyXAction::init()
{ LFUN_SEQUENCE, "command-sequence", "", Noop },
{ LFUN_COPY, "copy", N_("Copy"), ReadOnly },
{ LFUN_CUT, "cut", N_("Cut"), Noop },
{ LFUN_DATE_INSERT, "date-insert", "", Noop },
{ LFUN_BACKSPACE, "delete-backward", "", Noop },
{ LFUN_BACKSPACE_SKIP, "delete-backward-skip", "", Noop },
{ LFUN_DELETE, "delete-forward", "", Noop },
@ -201,6 +203,8 @@ void LyXAction::init()
{ LFUN_FILE_OPEN, "file-open", "", NoBuffer },
{ LFUN_MENUSEARCH, "find-replace", N_("Find & Replace"),
ReadOnly },
{ LFUN_INSET_FLOAT, "float-insert", "", Noop },
{ LFUN_FLOATSOPERATE, "floats-operate", "", ReadOnly },
{ LFUN_BOLD, "font-bold", N_("Toggle bold"), Noop },
{ LFUN_CODE, "font-code", N_("Toggle code style"), Noop },
{ LFUN_DEFAULT, "font-default", N_("Default font style"),
@ -224,9 +228,6 @@ void LyXAction::init()
{ LFUN_INSET_FOOTNOTE, "footnote-insert",
N_("Insert Footnote"), Noop },
#endif
{ LFUN_INSET_MARGINAL, "marginalnote-insert",
N_("Insert Marginalnote"), Noop },
{ LFUN_FLOATSOPERATE, "floats-operate", "", ReadOnly },
{ LFUN_RIGHTSEL, "forward-select", N_("Select next char"),
ReadOnly },
{ LFUN_HFILL, "hfill-insert",
@ -284,6 +285,7 @@ void LyXAction::init()
{ LFUN_END, "line-end", N_("Go to end of line"), ReadOnly },
{ LFUN_ENDSEL, "line-end-select",
N_("Select to end of line"), ReadOnly },
{ LFUN_INSET_LIST, "list-insert", "", Noop },
{ LFUN_LOA_INSERT, "loa-insert",
N_("Insert list of algorithms"), Noop },
{ LFUN_LOAVIEW, "loa-view",
@ -297,6 +299,8 @@ void LyXAction::init()
{ LFUN_LOTVIEW, "lot-view",
N_("View list of tables"), ReadOnly },
{ LFUN_QUIT, "lyx-quit", N_("Exit"), NoBuffer },
{ LFUN_INSET_MARGINAL, "marginalnote-insert",
N_("Insert Marginalnote"), Noop },
#ifndef NEW_INSETS
{ LFUN_MARGINMELT, "marginpar-insert",
N_("Insert Margin note"), Noop },
@ -323,6 +327,7 @@ void LyXAction::init()
{ LFUN_MENU_OPEN_BY_NAME, "menu-open", "", NoBuffer },
{ LFUN_MENU_SEPARATOR, "menu-separator-insert", "", Noop },
{ LFUN_META_FAKE, "meta-prefix", "", NoBuffer },
{ LFUN_INSET_MINIPAGE, "minipage-insert", "", Noop },
{ LFUN_INSERT_NOTE, "note-insert", "", Noop },
{ LFUN_GOTONOTE, "note-next", "", ReadOnly },
{ LFUN_OPENSTUFF, "open-stuff", "", ReadOnly },
@ -332,6 +337,7 @@ void LyXAction::init()
N_("Select next paragraph"), ReadOnly },
{ LFUN_GOTO_PARAGRAPH, "paragraph-goto",
N_("Go to paragraph"), ReadOnly },
{ LFUN_PARAGRAPH_SPACING, "paragraph-spacing", "", Noop },
{ LFUN_UP_PARAGRAPH, "paragraph-up",
N_("Go one paragraph up"), ReadOnly },
{ LFUN_UP_PARAGRAPHSEL, "paragraph-up-select",
@ -355,6 +361,8 @@ void LyXAction::init()
N_("Insert cross reference"), ReadOnly },
{ LFUN_NEXT, "screen-down", "", ReadOnly },
{ LFUN_NEXTSEL, "screen-down-select", "", ReadOnly },
{ LFUN_SCREEN_FONT_UPDATE, "screen-font-update",
"", NoBuffer },
{ LFUN_CENTER, "screen-recenter", "", ReadOnly },
{ LFUN_PRIOR, "screen-up", "", ReadOnly },
{ LFUN_PRIORSEL, "screen-up-select", "", ReadOnly },
@ -371,6 +379,7 @@ void LyXAction::init()
{ LFUN_GOTOFILEROW, "server-goto-file-row", "", Noop },
{ LFUN_NOTIFY, "server-notify", "", ReadOnly },
{ LFUN_SETXY, "server-set-xy", "", ReadOnly },
{ LFUN_SET_COLOR, "set-color", "", Noop },
{ LFUN_SPELLCHECK, "spellchecker", "", Noop },
{ LFUN_INSERT_MATH, "symbol-insert", "", Noop },
{ LFUN_SHIFT_TAB, "tab-backward", "", Noop },
@ -385,6 +394,7 @@ void LyXAction::init()
{ LFUN_TEX, "tex-mode", N_("Toggle TeX style"), Noop },
{ LFUN_INSET_TEXT, "text-insert",
N_("Insert a new Text Inset"), Noop },
{ LFUN_INSET_THEOREM, "theorem-insert", "", Noop },
{ LFUN_TOC_INSERT, "toc-insert",
N_("Insert table of contents"), Noop },
{ LFUN_TOCVIEW, "toc-view",
@ -418,15 +428,6 @@ void LyXAction::init()
{ LFUN_WORDRIGHTSEL, "word-forward-select", "", ReadOnly },
{ LFUN_LOWCASE_WORD, "word-lowcase", "", Noop },
{ LFUN_UPCASE_WORD, "word-upcase", "", Noop },
{ LFUN_DATE_INSERT, "date-insert", "", Noop },
{ LFUN_PARAGRAPH_SPACING, "paragraph-spacing", "", Noop },
{ LFUN_SET_COLOR, "set-color", "", Noop },
{ LFUN_INSET_MINIPAGE, "minipage-insert", "", Noop },
{ LFUN_INSET_FLOAT, "float-insert", "", Noop },
{ LFUN_INSET_LIST, "list-insert", "", Noop },
{ LFUN_INSET_THEOREM, "theorem-insert", "", Noop },
{ LFUN_INSET_CAPTION, "caption-insert", "", Noop },
{ LFUN_SCREEN_FONT_UPDATE, "screen-font-update", "", NoBuffer },
{ LFUN_NOACTION, "", "", Noop }
};

View File

@ -306,12 +306,16 @@ void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) {
}
if (act == LFUN_INSERT_MATH && !arg.empty()) {
lyxerr[Debug::GUI] << "Using mathed-provided icon" << endl;
char const ** pixmap = get_pixmap_from_symbol(arg.c_str(),
buttonwidth,
height);
fl_set_pixmapbutton_data(obj, const_cast<char **>(pixmap));
return;
if (pixmap) {
lyxerr[Debug::GUI] << "Using mathed-provided icon"
<< endl;
fl_set_pixmapbutton_data(obj,
const_cast<char **>(pixmap));
return;
}
}
lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;