[#22274] Special chars = 2 characters
workaround, just remove utf from number strings until we have proper UTF editing.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user