Fix for Bug #18658: | character in buttons allowing text input was being interpreted as the "menu-name | hotkey" delimeter used for menus, giving incorrect results.

This commit fixes the issue in 2.5 only. A similar fix will need to be backported/coded for trunk?
This commit is contained in:
Joshua Leung
2009-05-03 02:27:36 +00:00
parent 4cf8900c70
commit 99cc61edbc

View File

@@ -735,15 +735,17 @@ static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
static void widget_draw_text(uiFontStyle *fstyle, uiBut *but, rcti *rect)
{
// int transopts;
char *cpoin;
char *cpoin = NULL;
// ui_rasterpos_safe(x, y, but->aspect);
// if(but->type==IDPOIN) transopts= 0; // no translation, of course!
// else transopts= ui_translate_buttons();
/* cut string in 2 parts */
cpoin= strchr(but->drawstr, '|');
if(cpoin) *cpoin= 0;
/* cut string in 2 parts - only for menu entries */
if(ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS)==0) {
cpoin= strchr(but->drawstr, '|');
if(cpoin) *cpoin= 0;
}
if(but->editstr || (but->flag & UI_TEXT_LEFT))
fstyle->align= UI_STYLE_TEXT_LEFT;