Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-09-16 05:35:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-09-16 05:35:52 +0400
commitabb37f4152ea8945fdffdc956acdd3002e54db2d (patch)
tree0e8200b6bb31654553b52e24e22a49ca1ed5c98a /source/blender/editors/interface
parent7e2977b051d6aecd8effe89f11db5373bc0dc3b1 (diff)
replace RNA_property_array_length with RNA_property_array_check where the length of the array is only used to check if the property is an array or not.
(this isnt reliable since arrays can be zero length).
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c8
-rw-r--r--source/blender/editors/interface/interface_anim.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 111757da01f..e02cdf018c0 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1646,19 +1646,19 @@ void ui_set_but_val(uiBut *but, double value)
if (RNA_property_editable(&but->rnapoin, prop)) {
switch (RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if (RNA_property_array_length(&but->rnapoin, prop))
+ if (RNA_property_array_check(prop))
RNA_property_boolean_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_boolean_set(&but->rnapoin, prop, value);
break;
case PROP_INT:
- if (RNA_property_array_length(&but->rnapoin, prop))
+ if (RNA_property_array_check(prop))
RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, (int)value);
else
RNA_property_int_set(&but->rnapoin, prop, (int)value);
break;
case PROP_FLOAT:
- if (RNA_property_array_length(&but->rnapoin, prop))
+ if (RNA_property_array_check(prop))
RNA_property_float_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_float_set(&but->rnapoin, prop, value);
@@ -3027,7 +3027,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
but->rnapoin = *ptr;
but->rnaprop = prop;
- if (RNA_property_array_length(&but->rnapoin, but->rnaprop))
+ if (RNA_property_array_check(but->rnaprop))
but->rnaindex = index;
else
but->rnaindex = 0;
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 3feb563d3ee..5b6b889a6c6 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -144,7 +144,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
return 0;
}
- if (RNA_property_array_length(&but->rnapoin, but->rnaprop) != 0) {
+ if (RNA_property_array_check(but->rnaprop) != 0) {
if (but->rnaindex == -1) {
if (G.debug & G_DEBUG)
printf("ERROR: create expression failed - can't create expression for entire array\n");