From: Ian Jackson Date: Sat, 14 May 2022 11:48:36 +0000 (+0100) Subject: shapelib: Fix sort key colour abbrev X-Git-Tag: otter-1.1.0~200 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=db11330b873db49b852a95862aceda4cd4039995;p=otter.git shapelib: Fix sort key colour abbrev Signed-off-by: Ian Jackson --- diff --git a/docs/bundles.rst b/docs/bundles.rst index dafe41aa..2df212a7 100644 --- a/docs/bundles.rst +++ b/docs/bundles.rst @@ -179,6 +179,9 @@ follow the link to the latest published documentation for that format. of library pieces overhauled. ``size`` is now the in-game size, and the SVG size is obtained from the SVG. Library catalogues must be overhauled. + - In library group ``sort`` parameters, when colouring, ``_c`` + is correctly replaced by the colour *abbreviation*, rather than + the descriptive string. * - ``1`` - 0.x - `1.0.0 `_ diff --git a/src/shapelib.rs b/src/shapelib.rs index dfcb269e..138f5a43 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -1202,9 +1202,9 @@ fn process_files_entry( sort, &fe.desc.clone())?; } else { for (colour, recolourdata) in &group.d.colours { - let t_sort = sort.as_ref().map( - |s| subst(s, "_c", colour)).transpose()?; let c_abbrev = &recolourdata.abbrev; + let t_sort = sort.as_ref().map( + |s| subst(s, "_c", c_abbrev)).transpose()?; let t_item_name = subst(item_name.as_str(), "_c", c_abbrev)?; let t_src_name = subst(&fe.src_file_spec, "_c", c_abbrev); let t_src_name = t_src_name.as_ref().map(|s| s.as_str());