diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-29 10:24:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-29 10:24:05 +0400 |
commit | 33fab0f7d7433e8d942c6eb448a14da05f1a22f2 (patch) | |
tree | 3d32596f4c58871f4a6189c02c4425e51c6adde6 /source | |
parent | 7a950c287692dc44edc23eb9daf865de8e115307 (diff) |
fix for user counts with text3d bold/italic fonts.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 25 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 |
2 files changed, 21 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 358dd1914e7..d13738808d1 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -74,12 +74,22 @@ void unlink_curve(Curve *cu) for(a=0; a<cu->totcol; a++) { if(cu->mat[a]) cu->mat[a]->id.us--; - cu->mat[a]= 0; + cu->mat[a]= NULL; } if(cu->vfont) cu->vfont->id.us--; - cu->vfont= 0; + cu->vfont= NULL; + + if(cu->vfontb) cu->vfontb->id.us--; + cu->vfontb= NULL; + + if(cu->vfonti) cu->vfonti->id.us--; + cu->vfonti= NULL; + + if(cu->vfontbi) cu->vfontbi->id.us--; + cu->vfontbi= NULL; + if(cu->key) cu->key->id.us--; - cu->key= 0; + cu->key= NULL; } /* frees editcurve entirely */ @@ -210,9 +220,12 @@ void make_local_curve(Curve *cu) */ if(cu->id.lib==0) return; - - if(cu->vfont) cu->vfont->id.lib= 0; - + + if(cu->vfont) cu->vfont->id.lib= NULL; + if(cu->vfontb) cu->vfontb->id.lib= NULL; + if(cu->vfonti) cu->vfonti->id.lib= NULL; + if(cu->vfontbi) cu->vfontbi->id.lib= NULL; + if(cu->id.us==1) { cu->id.lib= 0; cu->id.flag= LIB_LOCAL; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bccbc451427..15b35d9b35d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2735,7 +2735,7 @@ static void direct_link_curve(FileData *fd, Curve *cu) cu->strinfo= newdataadr(fd, cu->strinfo); cu->tb= newdataadr(fd, cu->tb); - if(cu->vfont==0) link_list(fd, &(cu->nurb)); + if(curve_type(cu) != OB_FONT) link_list(fd, &(cu->nurb)); else { cu->nurb.first=cu->nurb.last= 0; @@ -2766,7 +2766,7 @@ static void direct_link_curve(FileData *fd, Curve *cu) nu->bp= newdataadr(fd, nu->bp); nu->knotsu= newdataadr(fd, nu->knotsu); nu->knotsv= newdataadr(fd, nu->knotsv); - if (cu->vfont==0) nu->charidx= nu->mat_nr; + if (curve_type(cu) != OB_FONT) nu->charidx= nu->mat_nr; if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) { switch_endian_knots(nu); |