diff --git a/CHANGES.md b/CHANGES.md index 91905fc8..8970462e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,7 +18,8 @@ Features: * Merge String capitilization changes by @SoaringMoon. Bug fixes: - * Make viewer image rotate button operate clockwise to match dropdown options. + * Make viewer image rotate button operate clockwise to match dropdown options. (#9) + * Fix storage/retrieval of Stylesheet Settings when the stylesheet name includes spaces. (#8) ------------------------------------------------------------------------------ HEAD: new items added as changes are made diff --git a/src/data/settings.cpp b/src/data/settings.cpp index 4a7eaf39..4ee6ae12 100644 --- a/src/data/settings.cpp +++ b/src/data/settings.cpp @@ -223,8 +223,10 @@ ColumnSettings& Settings::columnSettingsFor(const Game& game, const Field& field } return cs; } -StyleSheetSettings& Settings::stylesheetSettingsFor(const StyleSheet& stylesheet) { - StyleSheetSettingsP& ss = stylesheet_settings[stylesheet.name()]; +StyleSheetSettings& Settings::stylesheetSettingsFor(const StyleSheet& stylesheet) { + // Use the canonical form here since the stylesheet name will be used as a stored key. + // This does introduce the possibility of collision if two stylesheets return the same value canonically, but I think that's just a necessary risk. + StyleSheetSettingsP& ss = stylesheet_settings[canonical_name_form(stylesheet.name())]; if (!ss) ss = make_intrusive(); ss->useDefault(default_stylesheet_settings); // update default settings return *ss;