[Bf-blender-cvs] [6c1ef12e802] temp-spreadsheet-row-filter: Move assigning column runtime data to the main draw function

Hans Goudey noreply at git.blender.org
Mon Apr 19 23:53:37 CEST 2021


Commit: 6c1ef12e802917b1450c36e22df16c6415d81c93
Author: Hans Goudey
Date:   Mon Apr 19 16:38:21 2021 -0500
Branches: temp-spreadsheet-row-filter
https://developer.blender.org/rB6c1ef12e802917b1450c36e22df16c6415d81c93

Move assigning column runtime data to the main draw function

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

M	source/blender/editors/space_spreadsheet/space_spreadsheet.cc

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

diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
index 82b42734611..59b91a4e7c5 100644
--- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
+++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
@@ -344,10 +344,6 @@ static void update_visible_columns(ListBase &columns, DataSource &data_source)
       if (used_ids.add(column_id)) {
         SpreadsheetColumnID *new_id = spreadsheet_column_id_copy(&column_id);
         SpreadsheetColumn *new_column = spreadsheet_column_new(new_id);
-
-        /* Copy the current data type to the column storage for convenience. */
-        spreadsheet_column_assign_runtime_data(new_column, values->type(), values->name());
-
         BLI_addtail(&columns, new_column);
       }
     }
@@ -376,6 +372,9 @@ static void spreadsheet_main_region_draw(const bContext *C, ARegion *region)
     const ColumnValues *values = scope.add(std::move(values_ptr), __func__);
     const int width = get_column_width_in_pixels(*values);
     spreadsheet_layout.columns.append({values, width});
+
+    /* Copy the current data type to the column storage for convenience. */
+    spreadsheet_column_assign_runtime_data(column, values->type(), values->name());
   }
 
   const int tot_rows = data_source->tot_rows();



More information about the Bf-blender-cvs mailing list