fix for user counts with text3d bold/italic fonts.

This commit is contained in:
Campbell Barton 2010-09-29 06:24:05 +00:00
parent 7a950c2876
commit 33fab0f7d7
2 changed files with 21 additions and 8 deletions

View File

@ -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;

View File

@ -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);