diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-27 05:20:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-27 05:20:24 +0400 |
commit | 160b1d815d5ad21d5254ed3c3eaf495b2383afcc (patch) | |
tree | 76f32ffdbec2bc6ccfaacb420c83783c3ec4a13c | |
parent | dcb644af0db92f573c9f8ead458f12218352a3ee (diff) |
[#22274] Special chars = 2 characters
workaround, just remove utf from number strings until we have proper UTF editing.
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4bf4dd23bd6..0f8f84b94dc 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -28,6 +28,7 @@ #include <math.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #include "MEM_guardedalloc.h" @@ -1535,6 +1536,19 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data) data->str= MEM_callocN(sizeof(char)*data->maxlen + 1, "textedit str"); ui_get_but_string(but, data->str, data->maxlen); + if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) { + /* XXX: we dont have utf editing yet so for numbers its best to strip out utf chars + * this is so the deg' synbol isnt included in number editing fields: bug 22274 */ + int i; + for(i=0; data->str[i]; i++) { + if(!isascii(data->str[i])) { + data->str[i]= '\0'; + break; + } + } + } + + data->origstr= BLI_strdup(data->str); data->selextend= 0; data->selstartx= 0; |