fix compilation errors

This commit is contained in:
ebbit1q
2025-11-28 10:48:54 +01:00
committed by GitHub
parent cf0a84a8a7
commit 5512aad587
7 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ public:
RealSize defaultSymbolSize(double font_size);
/// The spacing between symbols, accounting for font size
RealSize SymbolFont::spacingSize(double font_size);
RealSize spacingSize(double font_size);
DECLARE_REFLECTION();
};
+1 -1
View File
@@ -167,7 +167,7 @@ void AddCSVWindow::onOk(wxCommandEvent&) {
/// Perform the import
wxBusyCursor wait;
// Read the file
auto& file = std::ifstream(file_path->GetValue().ToStdString());
auto file = std::ifstream(file_path->GetValue().ToStdString());
if (file.fail()) {
queue_message(MESSAGE_ERROR, _ERROR_("add card csv file not found"));
EndModal(wxID_ABORT);
+1 -1
View File
@@ -175,7 +175,7 @@ void AddJSONWindow::onOk(wxCommandEvent&) {
/// Perform the import
wxBusyCursor wait;
// Read the file
auto& file = std::ifstream(file_path->GetValue().ToStdString());
auto file = std::ifstream(file_path->GetValue().ToStdString());
if (file.fail()) {
queue_message(MESSAGE_ERROR, _ERROR_("add card json file not found"));
EndModal(wxID_ABORT);
+1 -1
View File
@@ -40,7 +40,7 @@ inline static Value* get_card_field_container(Game& game, IndexMap<FieldP, Value
return it->get();
}
inline static Value* get_container(IndexMap<FieldP, ValueP>& map, String& type, String& key_name, bool ignore_field_not_found) {
inline static Value* get_container(IndexMap<FieldP, ValueP>& map, const String& type, const String& key_name, bool ignore_field_not_found) {
// find value container to update
IndexMap<FieldP, ValueP>::const_iterator it = map.find(key_name);
if (it == map.end()) {
+6 -6
View File
@@ -222,7 +222,7 @@ inline static CardP json_to_mse_card(boost::json::object& jv, Set* set) {
if (jv.contains("extra_data") && jv["extra_data"].is_object()) {
boost::json::object datav = jv["extra_data"].as_object();
for (auto it = datav.begin(); it != datav.end(); ++it) {
StyleSheetP& stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
StyleSheetP stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
if (!stylesheet) continue;
IndexMap<FieldP, ValueP>& stylesheet_data = card->extraDataFor(*stylesheet);
boost::json::object stylesheet_datav = it->value().as_object();
@@ -245,9 +245,9 @@ inline static SetP json_to_mse_set(boost::json::object& jv) {
if (!jv.contains("stylesheet")) {
throw ScriptError(_ERROR_("json set without stylesheet"));
}
GameP& game = Game::byName(wxString(jv["game"].as_string().c_str()));
StyleSheetP& stylesheet = StyleSheet::byGameAndName(*game, wxString(jv["stylesheet"].as_string().c_str()));
SetP& set = make_intrusive<Set>(stylesheet);
GameP game = Game::byName(wxString(jv["game"].as_string().c_str()));
StyleSheetP stylesheet = StyleSheet::byGameAndName(*game, wxString(jv["stylesheet"].as_string().c_str()));
SetP set = make_intrusive<Set>(stylesheet);
// set fields
if (jv.contains("set_info") && jv["set_info"].is_object()) {
boost::json::object datav = jv["set_info"].as_object();
@@ -262,7 +262,7 @@ inline static SetP json_to_mse_set(boost::json::object& jv) {
if (jv.contains("styling") && jv["styling"].is_object()) {
boost::json::object datav = jv["styling"].as_object();
for (auto it = datav.begin(); it != datav.end(); ++it) {
StyleSheetP& stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
StyleSheetP stylesheet = StyleSheet::byGameAndName(*set->game, it->key_c_str());
if (!stylesheet) continue;
IndexMap<FieldP, ValueP>& stylesheet_data = set->stylingDataFor(*stylesheet);
boost::json::object stylesheet_datav = it->value().as_object();
@@ -528,7 +528,7 @@ inline static boost::json::object mse_to_json(const Set* set) {
return setv;
}
inline static boost::json::value mse_to_json(ScriptValueP& sv, Set* set) {
inline static boost::json::value mse_to_json(const ScriptValueP& sv, Set* set) {
ScriptType type = sv->type();
// special types
if (ScriptObject<PackItemP>* i = dynamic_cast<ScriptObject<PackItemP>*>(sv.get())) return mse_to_json(i->getValue());
+2 -2
View File
@@ -186,7 +186,7 @@ void TokenIterator::readToken() {
pos += 23; // "include localized file:"
const char* newlines = "\r\n";
auto eol = find_first_of(pos, end, newlines, newlines + 2);
String include_file = trim(StringView(pos, eol)) + _("_") + settings.locale;
String include_file = String(trim(StringView(pos, eol))) + _("_") + settings.locale;
// include_file("filename_en")
addToken(TOK_NAME, "include_file", pos - 23);
addToken(TOK_LPAREN, "(", pos);
@@ -197,7 +197,7 @@ void TokenIterator::readToken() {
pos += 18; // "include dark file:"
const char* newlines = "\r\n";
auto eol = find_first_of(pos, end, newlines, newlines + 2);
String include_file = trim(StringView(pos, eol)) + (settings.darkMode() ? _("_dark") : _(""));
String include_file = String(trim(StringView(pos, eol))) + (settings.darkMode() ? _("_dark") : _(""));
// include_file("filename_dark")
addToken(TOK_NAME, "include_file", pos - 18);
addToken(TOK_LPAREN, "(", pos);