Merge with trunk r41411
authorMiika Hamalainen <blender@miikah.org>
Mon, 31 Oct 2011 13:18:14 +0000 (13:18 +0000)
committerMiika Hamalainen <blender@miikah.org>
Mon, 31 Oct 2011 13:18:14 +0000 (13:18 +0000)
1  2 
source/blender/blenkernel/CMakeLists.txt
source/blender/blenloader/intern/writefile.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/physics/CMakeLists.txt
source/blender/makesrna/intern/CMakeLists.txt
source/blender/modifiers/CMakeLists.txt

index 0391c16a8f77aba88a0a9a65717eeff2ba76a1cd,19d22a432dcff4803564e7dd4210fccdba851bb9..89b9f74d8516b734b89a7709ab93012d2d94a8b9
@@@ -2209,31 -2181,33 +2209,33 @@@ static void list_item_row(bContext *C, 
         *     # displayed in a template_list.
         *     template_list_controls = StringProperty(default="integer:bool:string", options={"HIDDEN"})
         *
 -       * … you’ll get a numfield for the integer prop, a check box for the bool prop, and a textfield
 +       * \85 you\92ll get a numfield for the integer prop, a check box for the bool prop, and a textfield
         * for the string prop, after the name of each item of the collection.
         */
-       else if (prop_list) {
-               PropertyRNA *prop_ctrls;
+       else if (prop_list_id) {
                row = uiLayoutRow(sub, 1);
                uiItemL(row, name, icon);
  
                /* XXX: Check, as sometimes we get an itemptr looking like
                 *      {id = {data = 0x0}, type = 0x0, data = 0x0}
 -               *      which would obviously produce a sigsev */
 +               *      which would obviously produce a sigsev\85 */
                if (itemptr->type) {
 -                      /* If the special property is set for the item, and it is a collection */
 +                      /* If the special property is set for the item, and it is a collection\85 */
-                       prop_ctrls = RNA_struct_find_property(itemptr, prop_list);
-                       if(prop_ctrls) {
-                               if(RNA_property_type(prop_ctrls) == PROP_STRING) {
-                                       char *prop_names = RNA_property_string_get_alloc(itemptr, prop_ctrls, NULL, 0, NULL);
-                                       char *id = NULL;
-                                       char *ctx = NULL;
-                                       for(id = BLI_strtok_r(prop_names, ":", &ctx); id; id = BLI_strtok_r(NULL, ":", &ctx)) {
-                                               uiItemR(row, itemptr, id, 0, NULL, 0);
-                                               MEM_freeN(id);
-                                       }
-                                       MEM_freeN(prop_names);
+                       PropertyRNA *prop_list= RNA_struct_find_property(itemptr, prop_list_id);
+                       if(prop_list && RNA_property_type(prop_list) == PROP_STRING) {
+                               int prop_names_len;
+                               char *prop_names = RNA_property_string_get_alloc(itemptr, prop_list, NULL, 0, &prop_names_len);
+                               char *prop_names_end= prop_names + prop_names_len;
+                               char *id= prop_names;
+                               char *id_next;
+                               while (id < prop_names_end) {
+                                       if ((id_next= strchr(id, ':'))) *id_next++= '\0';
+                                       else id_next= prop_names_end;
+                                       uiItemR(row, itemptr, id, 0, NULL, 0);
+                                       id= id_next;
                                }
+                               MEM_freeN(prop_names);
                        }
                }
        }