[Bf-blender-cvs] [1b9e103a308] master: Fix T94594: Incorrect spreadsheet data set region type in old files

Hans Goudey noreply at git.blender.org
Mon Jan 3 19:54:50 CET 2022


Commit: 1b9e103a308c3ba20853487e1297df0653263ac9
Author: Hans Goudey
Date:   Mon Jan 3 12:54:40 2022 -0600
Branches: master
https://developer.blender.org/rB1b9e103a308c3ba20853487e1297df0653263ac9

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.

===================================================================

M	source/blender/blenloader/intern/versioning_300.c

===================================================================

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



More information about the Bf-blender-cvs mailing list