mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
rewritten retrying part of reader, it is now implemented how it should have been from the start.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@175 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -31,7 +31,7 @@ void deserialize_from_clipboard(T& object, Package& package, const String& data)
|
||||
shared_ptr<wxStringInputStream> stream( new wxStringInputStream(data) );
|
||||
Reader reader(stream, _("clipboard"));
|
||||
WITH_DYNAMIC_ARG(clipboard_package, &package);
|
||||
reader.handle(object);
|
||||
reader.handle_greedy(object);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : CardDataObject
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ void addStatsDimensionsForFields();
|
||||
// special behaviour of reading/writing GamePs: only read/write the name
|
||||
|
||||
void Reader::handle(GameP& game) {
|
||||
game = Game::byName(value);
|
||||
game = Game::byName(getValue());
|
||||
}
|
||||
void Writer::handle(const GameP& game) {
|
||||
if (game) handle(game->name());
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ IndexMap<FieldP, ValueP>& Set::stylingDataFor(const StyleSheet& stylesheet) {
|
||||
// we delayed the reading of the data, read it now
|
||||
styling->data.init(stylesheet.styling_fields);
|
||||
Reader reader(new_shared1<wxStringInputStream>(styling->unread_data), _("styling data of ") + stylesheet.stylesheetName());
|
||||
reader.handle(styling->data);
|
||||
reader.handle_greedy(styling->data);
|
||||
styling->unread_data.clear();
|
||||
}
|
||||
return styling->data;
|
||||
|
||||
@@ -170,7 +170,7 @@ void Settings::read() {
|
||||
shared_ptr<wxFileInputStream> file = new_shared1<wxFileInputStream>(filename);
|
||||
if (!file->Ok()) return; // failure is not an error
|
||||
Reader reader(file, filename);
|
||||
reader.handle(*this);
|
||||
reader.handle_greedy(*this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ void Reader::handle(StyleSheetP& stylesheet) {
|
||||
if (!game_for_reading()) {
|
||||
throw InternalError(_("game_for_reading not set"));
|
||||
}
|
||||
stylesheet = StyleSheet::byGameAndName(*game_for_reading(), value);
|
||||
stylesheet = StyleSheet::byGameAndName(*game_for_reading(), getValue());
|
||||
}
|
||||
void Writer::handle(const StyleSheetP& stylesheet) {
|
||||
if (stylesheet) handle(stylesheet->stylesheetName());
|
||||
|
||||
Reference in New Issue
Block a user