Fix T37543: Multiline 3D Text saved in edit mode breaks on load
This commit is contained in:
@@ -116,6 +116,8 @@ void BKE_curve_editfont_free(Curve *cu)
|
||||
MEM_freeN(ef);
|
||||
cu->editfont = NULL;
|
||||
}
|
||||
|
||||
MEM_SAFE_FREE(cu->selboxes);
|
||||
}
|
||||
|
||||
void BKE_curve_editNurb_keyIndex_free(EditNurb *editnurb)
|
||||
|
||||
@@ -3360,6 +3360,8 @@ static void lib_link_curve(FileData *fd, Main *main)
|
||||
|
||||
cu->ipo = newlibadr_us(fd, cu->id.lib, cu->ipo); // XXX deprecated - old animation system
|
||||
cu->key = newlibadr_us(fd, cu->id.lib, cu->key);
|
||||
|
||||
cu->selboxes = NULL; /* runtime, clear */
|
||||
|
||||
cu->id.flag -= LIB_NEED_LINK;
|
||||
}
|
||||
|
||||
@@ -1475,13 +1475,6 @@ void load_editText(Object *obedit)
|
||||
memcpy(cu->strinfo, ef->textbufinfo, (cu->len) * sizeof(CharInfo));
|
||||
|
||||
cu->len = strlen(cu->str);
|
||||
|
||||
/* this memory system is weak... */
|
||||
|
||||
if (cu->selboxes) {
|
||||
MEM_freeN(cu->selboxes);
|
||||
cu->selboxes = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void free_editText(Object *obedit)
|
||||
|
||||
@@ -351,7 +351,7 @@ static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata)
|
||||
load_editNurb(obedit);
|
||||
if (freedata) free_editNurb(obedit);
|
||||
}
|
||||
else if (obedit->type == OB_FONT && freedata) {
|
||||
else if (obedit->type == OB_FONT) {
|
||||
load_editText(obedit);
|
||||
if (freedata) free_editText(obedit);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ typedef struct Curve {
|
||||
float linewidth;
|
||||
|
||||
char *str;
|
||||
struct SelBox *selboxes;
|
||||
struct SelBox *selboxes; /* runtime variable for drawing selections (editmode data) */
|
||||
struct EditFont *editfont;
|
||||
|
||||
char family[24];
|
||||
|
||||
Reference in New Issue
Block a user