Fix #110341: Appended text looses user after reload

Even if a text datablock was "used" by in the Text Editor, it would be
lost after save/reload if no fake user is set.

This is not in line with other datablocks if they are used by an editor
(e.g. images, clips, masks etc.).

Now handle this with `IDWALK_CB_USER_ONE` (instead of `IDWALK_CB_NOP`)
in `id_refcount_recompute_callback` >
`BKE_screen_foreach_id_screen_area` which re-ensures a user is set.

(Bit on shaky ground here, but this seems like this is how this is
handled for other editors "consuming" a datablock).

Pull Request: https://projects.blender.org/blender/blender/pulls/110344
This commit is contained in:
Philipp Oeser 2023-07-21 14:41:45 +02:00
parent 70b382100a
commit af100b768b

View file

@ -138,7 +138,7 @@ void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area
}
case SPACE_TEXT: {
SpaceText *st = (SpaceText *)sl;
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, st->text, IDWALK_CB_NOP);
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, st->text, IDWALK_CB_USER_ONE);
break;
}
case SPACE_SCRIPT: {