diff options
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 8cf840f665b..05762c479ff 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -796,6 +796,26 @@ static void version_node_join_geometry_for_multi_input_socket(bNodeTree *ntree) } } +static ARegion *do_versions_add_region_if_not_found(ListBase *regionbase, + int region_type, + const char *name, + int link_after_region_type) +{ + ARegion *link_after_region = NULL; + LISTBASE_FOREACH (ARegion *, region, regionbase) { + if (region->regiontype == region_type) { + return NULL; + } + if (region->regiontype == link_after_region_type) { + link_after_region = region; + } + } + ARegion *new_region = MEM_callocN(sizeof(ARegion), name); + new_region->regiontype = region_type; + BLI_insertlinkafter(regionbase, link_after_region, new_region); + return new_region; +} + /* NOLINTNEXTLINE: readability-function-size */ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) { @@ -1832,5 +1852,22 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ + + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_SPREADSHEET) { + ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : + &sl->regionbase; + ARegion *new_footer = do_versions_add_region_if_not_found( + regionbase, RGN_TYPE_FOOTER, "footer for spreadsheet", RGN_TYPE_HEADER); + if (new_footer != NULL) { + new_footer->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP : + RGN_ALIGN_BOTTOM; + } + } + } + } + } } } |