[PATCH] (issue1839) Consider more than one location in ld_locations

Wald Commits scm-commit at wald.intevation.org
Fri Aug 28 16:24:11 CEST 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1440771841 -7200
# Node ID cc1f59766e495bb330f342536e99d86b5c000e29
# Parent  be28bb0c7f501482e534e422455dd55163056685
(issue1839) Consider more than one location in ld_locations.

diff -r be28bb0c7f50 -r cc1f59766e49 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Fri Aug 28 12:56:53 2015 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Aug 28 16:24:01 2015 +0200
@@ -3197,13 +3197,33 @@
     </dc:macro>
 
     <dc:macro name="artifact-range">
-      <dc:variable name="fromkm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/>
-      <dc:variable name="tokm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/>
-      <dc:if test="$fromkm > $tokm">
-        <dc:message>Inverting KM filter.</dc:message>
-        <dc:variable name="fromkm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/>
-        <dc:variable name="tokm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/>
-      </dc:if>
+      <dc:choose>
+        <dc:when test="dc:coalesce(dc:get('ld_locations'), ' ') != ' '">
+          <dc:variable name="fromkm" type="number"
+                       expr="dc:min-number(dc:find-all('\d*\.?\d*',
+                             dc:get('ld_locations')))"/>
+          <dc:variable name="tokm" type="number"
+                       expr="dc:max-number(dc:find-all('\d*\.?\d*',
+                             dc:get('ld_locations')))"/>
+        </dc:when>
+        <dc:otherwise>
+          <dc:variable name="fromkm" type="number"
+                       expr="dc:fromValue(dc:get('ld_mode'),
+                             dc:get('ld_locations'), dc:get('ld_from'))"/>
+          <dc:variable name="tokm" type="number"
+                       expr="dc:toValue(dc:get('ld_mode'),
+                             dc:get('ld_locations'), dc:get('ld_to'))"/>
+          <dc:if test="$fromkm > $tokm">
+            <dc:message>Inverting KM filter.</dc:message>
+            <dc:variable name="fromkm" type="number"
+                         expr="dc:toValue(dc:get('ld_mode'),
+                               dc:get('ld_locations'), dc:get('ld_to'))"/>
+            <dc:variable name="tokm" type="number"
+                         expr="dc:fromValue(dc:get('ld_mode'),
+                               dc:get('ld_locations'), dc:get('ld_from'))"/>
+          </dc:if>
+        </dc:otherwise>
+      </dc:choose>
       <dc:macro-body/>
     </dc:macro>
 


More information about the Dive4Elements-commits mailing list