@@ -1012,16 +1012,8 @@ def change_edit_mode(self, edit_mode, **kwargs):
10121012 if (
10131013 edit_mode == self .state .all_edit_modes ["view_mode" ]
10141014 ): # after edit mode we are again in view mode
1015- self .state .general_sections = convert_string2number (
1016- self .state .general_sections
1017- )
1018- self .state .materials_section = convert_string2number (
1019- self .state .materials_section
1020- )
1021- self .state .dc_sections = convert_string2number (self .state .dc_sections )
1022- self .state .result_description_section = convert_string2number (
1023- self .state .result_description_section
1024- )
1015+ self .convert_string2num_all_sections ()
1016+
10251017 # for now we don't convert the function section, because it
10261018 # works itself with strings, e.g.
10271019 # 'SYMBOLIC_FUNCTION_OF_SPACE_TIME' is a string even if it
@@ -1034,6 +1026,8 @@ def change_export_mode(self, export_mode, **kwargs):
10341026 """Reaction to change of state.export_mode."""
10351027 # revert export status to "INFO"
10361028 self .state .export_status = self .state .all_export_statuses ["info" ]
1029+ self .convert_string2num_all_sections ()
1030+
10371031
10381032 """------------------- Controller functions -------------------"""
10391033
@@ -1111,6 +1105,21 @@ def click_save_button(self, **kwargs):
11111105
11121106 """ --- Other helper functions"""
11131107
1108+ def convert_string2num_all_sections (self ):
1109+ """Converts string to num wherever possible for all considered
1110+ sections."""
1111+ self .state .general_sections = convert_string2number (
1112+ self .state .general_sections
1113+ )
1114+ self .state .materials_section = convert_string2number (
1115+ self .state .materials_section
1116+ )
1117+ self .state .dc_sections = convert_string2number (self .state .dc_sections )
1118+ self .state .result_description_section = convert_string2number (
1119+ self .state .result_description_section
1120+ )
1121+
1122+
11141123 def determine_master_mat_ind_for_current_selection (self ):
11151124 """Determines the real master/source material of the currently selected
11161125 material. Accounts for CLONING MATERIAL MAP by going one step further
0 commit comments