Commit: e5fa738ce972460e0c1053400c00af226086b1ee
Author: Bastien Montagne
Date:   Fri Mar 31 12:13:34 2017 +0200
Branches: master
https://developer.blender.org/rBe5fa738ce972460e0c1053400c00af226086b1ee

UI cleanup: simplify Icon handling of uiDefAutoButR for PROP_POINTER.

Comes from D113, but really not related to the patch's topic!

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

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

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

diff --git a/source/blender/editors/interface/interface_utils.c 
b/source/blender/editors/interface/interface_utils.c
index df6f098ee81..636b7e4e9ce 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -127,12 +127,10 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, 
PropertyRNA *prop, int ind
                        break;
                case PROP_POINTER:
                {
-                       PointerRNA pptr;
-
-                       pptr = RNA_property_pointer_get(ptr, prop);
-                       if (!pptr.type)
-                               pptr.type = RNA_property_pointer_type(ptr, 
prop);
-                       icon = RNA_struct_ui_icon(pptr.type);
+                       if (icon == 0) {
+                               PointerRNA pptr = RNA_property_pointer_get(ptr, 
prop);
+                               icon = RNA_struct_ui_icon(pptr.type ? pptr.type 
: RNA_property_pointer_type(ptr, prop));
+                       }
                        if (icon == ICON_DOT)
                                icon = 0;

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

Reply via email to