chiark / gitweb /
shapelib: Fix sort key colour abbrev
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 14 May 2022 11:48:36 +0000 (12:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 14 May 2022 11:50:16 +0000 (12:50 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
docs/bundles.rst
src/shapelib.rs

index dafe41aa38216351ae2dfc004ed0c62ffe7a7760..2df212a75922134308d1ddfd10497d91c776aa14 100644 (file)
@@ -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 <https://www.chiark.greenend.org.uk/~ianmdlvl/otter/1.0.0/docs/README.html>`_
index dfcb269ed6ba63e693e3b1acb49e8e9fe90d04a0..138f5a43a74df8c6a5521d865a7994088c84983c 100644 (file)
@@ -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());