From 1b9e103a308c3ba20853487e1297df0653263ac9 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 3 Jan 2022 12:54:40 -0600 Subject: Fix T94594: Incorrect spreadsheet data set region type in old files This completes 1a721c5dbec928b0e by versioning old files to correct the region type. The "tools" region type is relatively standard for this type of region and doesn't require any changes to the theme, unlike the "nav bar" type, which would have been a reasonable choice. --- source/blender/blenloader/intern/versioning_300.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 803e33aa8ad..035aa293b62 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -2509,5 +2509,22 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } FOREACH_NODETREE_END; + + /* Update spreadsheet data set region type. */ + 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; + LISTBASE_FOREACH (ARegion *, region, regionbase) { + if (region->regiontype == RGN_TYPE_CHANNELS) { + region->regiontype = RGN_TYPE_TOOLS; + } + } + } + } + } + } } -} +} \ No newline at end of file -- cgit v1.2.3