Revision: 36591
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36591
Author:   campbellbarton
Date:     2011-05-10 05:07:24 +0000 (Tue, 10 May 2011)
Log Message:
-----------
entering non utf8 text in filepaths in the file selector would get incorrectly 
stripped.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c 
2011-05-10 03:03:53 UTC (rev 36590)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c 
2011-05-10 05:07:24 UTC (rev 36591)
@@ -262,14 +262,12 @@
 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));
        }
-
-       return !(but->flag & UI_BUT_NO_UTF8);
+       else {
+               return !(but->flag & UI_BUT_NO_UTF8);
+       }
 }
 
 /* ********************** button apply/revert ************************/
@@ -1679,7 +1677,7 @@
 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) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to