diff options
author | Hans Goudey <h.goudey@me.com> | 2022-01-03 21:54:40 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-01-03 21:54:40 +0300 |
commit | 1b9e103a308c3ba20853487e1297df0653263ac9 (patch) | |
tree | 938481dd2481cc525b3ea391da23d52bf7e7bb2e /source/blender/blenloader/intern | |
parent | b7ad58b945c3779f32d2d01dd9c0e6e1bbe4e876 (diff) |
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.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 19 |
1 files changed, 18 insertions, 1 deletions
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 |