Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-10 09:07:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-10 09:07:24 +0400
commit2a14b0b3276909f84923a63583d4e193ec595397 (patch)
treec18172f65772ca5a65850eeb683536d974fae6d1 /source
parent2889f5ae2c8636037462791c013c22dbdfed81de (diff)
entering non utf8 text in filepaths in the file selector would get incorrectly stripped.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_handlers.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index ae5af185442..e2910d33b12 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -262,14 +262,12 @@ static int ui_is_a_warp_but(uiBut *but)
static int ui_is_utf8_but(uiBut *but)
{
if (but->rnaprop) {
- int subtype= RNA_property_subtype(but->rnaprop);
-
- if(ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) {
- return TRUE;
- }
+ const int subtype= RNA_property_subtype(but->rnaprop);
+ return !(ELEM3(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME));
+ }
+ else {
+ return !(but->flag & UI_BUT_NO_UTF8);
}
-
- return !(but->flag & UI_BUT_NO_UTF8);
}
/* ********************** button apply/revert ************************/
@@ -1679,7 +1677,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
{
if(but) {
- if(!ui_is_utf8_but(but)) {
+ if(ui_is_utf8_but(but)) {
int strip= BLI_utf8_invalid_strip(but->editstr, strlen(but->editstr));
/* not a file?, strip non utf-8 chars */
if(strip) {