Fix T94594: Incorrect spreadsheet data set region type in old files
This completes 1a721c5dbe
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.
This commit is contained in:
parent
b7ad58b945
commit
1b9e103a30
Notes:
blender-bot
2023-02-14 05:01:20 +01:00
Referenced by issue #94594, Error spam in console when Spreadsheet Editor is open
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue