|
22 | 22 |
|
23 | 23 | #include <QTextStream> |
24 | 24 |
|
25 | | -bool GenerateSettingsCode(Configurator& configurator, const Path& export_path) { |
| 25 | +bool GenerateSettingsCode(Configurator& configurator, ExportHppMode mode, const Path& export_path) { |
26 | 26 | QFile file(export_path.AbsolutePath().c_str()); |
27 | 27 |
|
28 | 28 | const bool result_layers_file = file.open(QIODevice::WriteOnly | QIODevice::Text); |
@@ -368,10 +368,11 @@ bool GenerateSettingsCode(Configurator& configurator, const Path& export_path) { |
368 | 368 |
|
369 | 369 | if (IsArray(setting->type)) { |
370 | 370 | stream << format( |
371 | | - "\t\t\t{\"%s\", \"%s\", %s, static_cast<uint32_t>(this->%s.%s_info.size()), &this->%s.%s_info[0]},\n", |
| 371 | + "\t\t\t{\"%s\", \"%s\", %s, static_cast<uint32_t>(this->%s.%s_info.size()), this->%s.%s_info.empty() " |
| 372 | + "? nullptr : &this->%s.%s_info[0]},\n", |
372 | 373 | parameter.key.c_str(), setting->key.c_str(), ::GetLayerSettingTypeString(setting->type), |
373 | 374 | ::GetCodeData(parameter.key).c_str(), setting->key.c_str(), ::GetCodeData(parameter.key).c_str(), |
374 | | - setting->key.c_str()) |
| 375 | + setting->key.c_str(), ::GetCodeData(parameter.key).c_str(), setting->key.c_str()) |
375 | 376 | .c_str(); |
376 | 377 | } else if (IsString(setting->type)) { |
377 | 378 | stream << format("\t\t\t{\"%s\", \"%s\", %s, 1, this->%s.%s.c_str()},\n", parameter.key.c_str(), |
|
0 commit comments