[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14293] trunk/blender/source/blender/src/ filesel.c: fix for odd error with image loading broke normal file loading

Campbell Barton ideasman42 at gmail.com
Mon Mar 31 16:57:09 CEST 2008


Revision: 14293
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14293
Author:   campbellbarton
Date:     2008-03-31 16:57:09 +0200 (Mon, 31 Mar 2008)

Log Message:
-----------
fix for odd error with image loading broke normal file loading

Modified Paths:
--------------
    trunk/blender/source/blender/src/filesel.c

Modified: trunk/blender/source/blender/src/filesel.c
===================================================================
--- trunk/blender/source/blender/src/filesel.c	2008-03-31 14:29:40 UTC (rev 14292)
+++ trunk/blender/source/blender/src/filesel.c	2008-03-31 14:57:09 UTC (rev 14293)
@@ -1414,7 +1414,6 @@
 	struct direntry *files;
 	char name[FILE_MAX];
 	int a;
-	int dirlen, filelen;
 
 	/* check for added length of dir and filename - annoying, but now that dir names can already be FILE_MAX
 	   we need to prevent overwriting. Alternative of shortening the name behind the user's back is greater evil 
@@ -1891,24 +1890,25 @@
 							do_draw= 1;
 						}
 					} else {
-						if(event==MIDDLEMOUSE && sfile->type) filesel_execute(sfile);
+						if( strcmp(sfile->file, sfile->filelist[act].relname)) {
+							BLI_strncpy(sfile->file, sfile->filelist[act].relname, sizeof(sfile->file));
+							do_draw = 1;
+							
 #ifdef INTERNATIONAL
-						else if (sfile->type==FILE_LOADFONT) {
-							/* Font Preview */
-							if( strcmp(sfile->file, sfile->filelist[act].relname)) {
+							if (sfile->type==FILE_LOADFONT && event!=MIDDLEMOUSE) {
+								/* Font Preview */
 								char tmpstr[240];
-								do_draw= 1;
-								BLI_strncpy(sfile->file, sfile->filelist[act].relname, sizeof(sfile->file));
 								if (sfile->f_fp) {
 									sprintf (tmpstr, "%s%s", sfile->dir, sfile->file);
 									
-									if (!FTF_GetNewFont ((const unsigned char *)tmpstr, 0, U.fontsize))
+									if (!FTF_GetNewFont ((const unsigned char *)tmpstr, 0, U.fontsize)) {
 										error ("No font file");
-									
+									}
 								}
 							}
+#endif
 						}
-#endif
+						if(event==MIDDLEMOUSE && sfile->type) filesel_execute(sfile);
 					}
 				}
 			}





More information about the Bf-blender-cvs mailing list