[Bf-blender-cvs] [cf9d5db] master: Fix T41156: UILayout.prop_enum() does not observe "text" parameter override

Bastien Montagne noreply at git.blender.org
Wed Jul 23 14:35:15 CEST 2014


Commit: cf9d5db75b4c8599b6669a49c40e40938ac6a34b
Author: Bastien Montagne
Date:   Wed Jul 23 14:31:44 2014 +0200
Branches: master
https://developer.blender.org/rBcf9d5db75b4c8599b6669a49c40e40938ac6a34b

Fix T41156: UILayout.prop_enum() does not observe "text" parameter override

We do have odd behaviors with name and expanded enums, but in this case it did
not made any sense at all! :)

Note the error was not in RNA, but in C UILayout api itself...

===================================================================

M	source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index ec95670..645eb60 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1323,9 +1323,9 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
 
 	for (a = 0; item[a].identifier; a++) {
 		if (item[a].value == ivalue) {
-			const char *item_name = CTX_IFACE_(RNA_property_translation_context(prop), item[a].name);
+			const char *item_name = name ? name : CTX_IFACE_(RNA_property_translation_context(prop), item[a].name);
 
-			uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, item_name ? item_name : name, icon ? icon : item[a].icon);
+			uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, item_name, icon ? icon : item[a].icon);
 			break;
 		}
 	}




More information about the Bf-blender-cvs mailing list