diff options
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 3 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index f7dab0c0935..5a47cc148d2 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -49,6 +49,7 @@ #include "BKE_fcurve.h" #include "BKE_global.h" #include "BKE_key.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_report.h" #include "BKE_animsys.h" @@ -1298,7 +1299,7 @@ static int separate_exec(bContext *C, wmOperator *op) newob = newbase->object; newcu = newob->data = BKE_curve_copy(oldcu); newcu->editnurb = NULL; - oldcu->id.us--; /* because new curve is a copy: reduce user count */ + id_us_min(&oldcu->id); /* because new curve is a copy: reduce user count */ /* 3. put new object in editmode, clear it and set separated nurbs */ make_editNurb(newob); diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index ea6b6154be8..1eee5d04c56 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -51,6 +51,7 @@ #include "BKE_curve.h" #include "BKE_depsgraph.h" #include "BKE_font.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_report.h" @@ -538,7 +539,7 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, const cu = obedit->data; cu->vfont = BKE_vfont_builtin_get(); - cu->vfont->id.us++; + id_us_plus(&cu->vfont->id); for (tmp = firstline, a = 0; nbytes < MAXTEXT && a < totline; tmp = tmp->next, a++) { size_t nchars_line, nbytes_line; @@ -1727,7 +1728,7 @@ static int font_open_exec(bContext *C, wmOperator *op) if (pprop->prop) { /* when creating new ID blocks, use is already 1, but RNA * pointer se also increases user, so this compensates it */ - font->id.us--; + id_us_min(&font->id); RNA_id_pointer_create(&font->id, &idptr); RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr); |