Index: doc/options.txt
===================================================================
--- doc/options.txt	(revision 3673)
+++ doc/options.txt	(working copy)
@@ -633,11 +633,12 @@
 ;--process-destination
 : 	Splits all motorway_link, trunk_link, primary_link, secondary_link,
 and tertiary_link ways tagged with destination into two or three parts where 
-the second part is additionally tagged with mkgmap:dest_hint=true.
+the second part is additionally tagged with mkgmap:dest_hint=*.
 The code checks for the tags destination, destination:lanes, 
 destination:street and some variants with :forward/:backward like
 destination:forward or destination:lanes:backward. If a value for
-destination is found, the tag destination is set to it and the way is split.
+destination is found, the special tag mkgmap:dest_hint is set to  
+it  and the way is split.
 This happens before the style rules are processed.
 This allows to use any routable Garmin type (except 0x08 and 0x09)
 for that part so that the Garmin device tells the name of
Index: doc/styles/internal-tags.txt
===================================================================
--- doc/styles/internal-tags.txt	(revision 3673)
+++ doc/styles/internal-tags.txt	(working copy)
@@ -120,7 +120,7 @@
 | +mkgmap:exit_hint_name+  | The +name+ tag value of the links exit node | 'process-exits'    
 | +mkgmap:exit_hint_ref+  | The +ref+ tag value of the links exit node | 'process-exits'    
 | +mkgmap:exit_hint_exit_to+  | The +exit_to+ tag value of the links exit node | 'process-exits'    
-| +mkgmap:dest_hint+  | +true+ for the part on link roads that should contain destination information about the link | 'process-destination'    
+| +mkgmap:dest_hint+  | The tag is set to a reasonable destination value for the part on link roads that should contain destination information about the link | 'process-destination'    
 | +mkgmap:synthesised+  | The value is +yes+ if the way was added by the make-opposite-cycleways option | 'make-opposite-cycleways'
 | +mkgmap:mp_created+  | The value is +true+ if the way was created by the internal multi-polygon-relation handling | none
 |=========================================================
Index: src/uk/me/parabola/mkgmap/main/StyleTester.java
===================================================================
--- src/uk/me/parabola/mkgmap/main/StyleTester.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/main/StyleTester.java	(working copy)
@@ -686,6 +686,22 @@
 			public void printStats(String header) {
 				// TODO Auto-generated method stub
 			}
+
+			@Override
+			public boolean containsExpression(String exp) {
+				if (rules == null) {
+					// this method must be called after prepare() is called so
+					// that we have rules to which the finalize rules can be applied
+					throw new IllegalStateException("First call prepare() before setting the finalize rules");
+				}
+				for (Rule rule : rules){
+					if (rule.containsExpression(exp))
+						return true;
+				}
+				if (getFinalizeRule()!= null && getFinalizeRule().containsExpression(exp))
+					return true;
+				return false;
+			}
 		}
 
 		/**
Index: src/uk/me/parabola/mkgmap/osmstyle/ActionRule.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/ActionRule.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/osmstyle/ActionRule.java	(working copy)
@@ -184,4 +184,9 @@
 		if (statsLog.isInfoEnabled())
 			statsLog.info(header,"stats (rule/evals/true)", this.toString() + "/" + numEval + "/" + numTrue);
 	}
+
+	@Override
+	public boolean containsExpression(String exp) {
+		return expression.toString().contains(exp);
+	}
 }
Index: src/uk/me/parabola/mkgmap/osmstyle/ExpressionRule.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/ExpressionRule.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/osmstyle/ExpressionRule.java	(working copy)
@@ -113,4 +113,9 @@
 		if (statsLog.isInfoEnabled())
 			statsLog.info(header,"stats (rule/evals/true)", this.toString() + "/" + numEval + "/" + numTrue);
 	}
+
+	@Override
+	public boolean containsExpression(String exp) {
+		return expression.toString().contains(exp);
+	}
 }
Index: src/uk/me/parabola/mkgmap/osmstyle/RuleSet.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/RuleSet.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/osmstyle/RuleSet.java	(working copy)
@@ -288,5 +288,24 @@
 		if (finalizeRule != null)
 			finalizeRule.printStats(header);
 	}
+	
+	@Override
+	public boolean containsExpression(String exp) {
+		if (rules == null) {
+			// this method must be called after prepare() is called so
+			// that we have rules to which the finalize rules can be applied
+			throw new IllegalStateException("First call prepare() before setting the finalize rules");
+		}
+		for (Rule rule : rules){
+			if (rule.containsExpression(exp))
+				return true;
+		}
+		if (finalizeRule != null){
+			if (finalizeRule.containsExpression(exp))
+				return true;
+		}
+		return false;
+	}
 
+	
 } 
\ No newline at end of file
Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(working copy)
@@ -172,7 +172,11 @@
 		nodeRules = style.getNodeRules();
 		lineRules = style.getLineRules();
 		polygonRules = style.getPolygonRules();
-		
+		// perform legacy test, older versions of mkgmap used to set mkgmap:dest_hint=true
+		// newer version will set it to a reasonable destination string
+		if (lineRules.containsExpression("$mkgmap:dest_hint='true'")){
+			log.error("At least one 'lines' rule in the style contains the expression mkgmap:dest_hint=true, it should be changed to mkgmap:dest_hint=*");
+		}
 		housenumberGenerator = new HousenumberGenerator(props);
 		
 		driveOn = props.getProperty("drive-on", null);
Index: src/uk/me/parabola/mkgmap/reader/osm/LinkDestinationHook.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/LinkDestinationHook.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/reader/osm/LinkDestinationHook.java	(working copy)
@@ -153,8 +153,11 @@
 							destSourceTagKey = "destination:street";
 							destinationTag = w.getTag(destSourceTagKey);
 						}
-						if (destinationTag != null && "destination".equals(destSourceTagKey) == false){
-							w.addTag("destination", destinationTag);
+						
+					}
+					if (destinationTag != null){
+						w.addTag("mkgmap:dest_hint_work", destinationTag);
+						if ("destination".equals(destSourceTagKey) == false){
 							if (log.isDebugEnabled()){
 								if (destSourceTagKey.startsWith("destination:lanes"))
 									log.debug("Use",destSourceTagKey,"as destination tag because there is one lane information only. Way ",w.getId(),w.toTagString());
@@ -162,9 +165,6 @@
 									log.debug("Use",destSourceTagKey,"as destination tag. Way ",w.getId(),w.toTagString());
 							}
 						}
-						
-					}
-					if (destinationTag != null){
 						destinationLinkWays.put(w.getId(), w);
 					}
 				}
@@ -453,7 +453,7 @@
 	 * and/or the option process-destination is set and the destination tag is
 	 * set. The mid part way is tagged additionally with the following tags:
 	 * <ul>
-	 * <li>mkgmap:dest_hint=true (for destinations)</li>
+	 * <li>mkgmap:dest_hint=* (for destinations)</li>
 	 * <li>mkgmap:exit_hint=true (for exits)</li>
 	 * <li>mkgmap:exit_hint_ref: Tagged with the ref tag value of the motorway
 	 * junction node</li>
@@ -464,7 +464,7 @@
 	 * </ul>
 	 * Style implementors can use the common Garmin code 0x09 for motorway_links
 	 * and any other routable id (except 0x08 and 0x09) for the links with
-	 * mkgmap:exit_hint=true and/or mkgmap:dest_hint=true. The naming of this
+	 * mkgmap:exit_hint=true and/or mkgmap:dest_hint=*. The naming of this
 	 * middle way can be typically assigned from destination, ref, destination:ref, 
 	 * mkgmap:exit_hint_ref, mkgmap:exit_hint_name and/or mkgmap:exit_hint_exit_to.
 	 */
@@ -476,8 +476,7 @@
 		log.debug(destinationLinkWays.size(),"links with destination tag");
 		while (linksWithDestination.isEmpty()== false) {
 			Way linkWay = linksWithDestination.poll();
-			String destination = linkWay.getTag("destination");
-
+			String destination = linkWay.getTag("mkgmap:dest_hint_work");
 			if (log.isDebugEnabled())
 				log.debug("Check way",linkWay.getId(),linkWay.toTagString());
 			
@@ -490,7 +489,8 @@
 			Set<Way> nextWays = adjacentWays.get(c);
 			if (nextWays != null) {
 				for (Way connectedWay : nextWays) {
-					String nextDest = connectedWay.getTag("destination");
+					String nextDest = connectedWay.getTag("mkgmap:dest_hint_work");
+					
 					if (log.isDebugEnabled())
 						log.debug("Followed by",connectedWay.getId(),connectedWay.toTagString());
 
@@ -615,9 +615,12 @@
 								log.info("Way", w, "is too short to cut at least 20m from it. Cannot create exit hint.");
 							} else {
 								hintWay.addTag("mkgmap:exit_hint", "true");
-								
-								if (processDestinations && hintWay.getTag("destination") != null) {
-									hintWay.addTag("mkgmap:dest_hint", "true");
+								if (processDestinations) {
+									String hint = hintWay.getTag("mkgmap:dest_hint_work");
+									if (hint != null){
+										hintWay.deleteTag("mkgmap:dest_hint_work");
+										hintWay.addTag("mkgmap:dest_hint", hint);
+									}
 								}
 								if (exitNode.getTag("ref") != null)
 									hintWay.addTag("mkgmap:exit_hint_ref", exitNode.getTag("ref"));
@@ -705,7 +708,13 @@
 					if (hintWay == null) {
 						log.info("Way", w, "is too short to cut at least 20m from it. Cannot create destination hint.");
 					} else {
-						hintWay.addTag("mkgmap:dest_hint", "true");
+						String hint = hintWay.getTag("mkgmap:dest_hint_work");
+						if (hint != null){
+							hintWay.deleteTag("mkgmap:dest_hint_work");
+							hintWay.addTag("mkgmap:dest_hint", hint);
+						} else {
+							log.error("Internal error in process_destination with way",hintWay);
+						}
 						
 						if (log.isInfoEnabled())
 							log.info("Cut off exit hint way", hintWay, hintWay.toTagString());
@@ -758,6 +767,7 @@
 		// referenced in the style file
 		Set<String> tags = new HashSet<String>();
 		tags.add("highway");
+		tags.add("destination");
 		tags.add("destination:lanes");
 		tags.add("destination:lanes:forward");
 		tags.add("destination:lanes:backward");
Index: src/uk/me/parabola/mkgmap/reader/osm/Rule.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/Rule.java	(revision 3673)
+++ src/uk/me/parabola/mkgmap/reader/osm/Rule.java	(working copy)
@@ -56,5 +56,7 @@
 	public void printStats(String header);
 
 	public Rule getFinalizeRule();
+
+	public boolean containsExpression(String exp);
 	
 }
Index: resources/help/en/options
===================================================================
--- resources/help/en/options	(revision 3673)
+++ resources/help/en/options	(working copy)
@@ -630,12 +630,12 @@
 --process-destination
 	Splits all motorway_link, trunk_link, primary_link, secondary_link,
 	and tertiary_link ways tagged with destination into two or three parts where 
-	the second part is additionally tagged with mkgmap:dest_hint=true.
+	the second part is additionally tagged with mkgmap:dest_hint=*.
 	The code checks for the tags destination, destination:lanes, 
 	destination:street and some variants with :forward/:backward like
 	destination:forward or destination:lanes:backward. If a value for
-	destination is found, the tag destination is set to it and the way is split.
-	This happens before the style rules are processed.
+	destination is found, the special tag mkgmap:dest_hint is set to 
+	it and the way is split. This happens before the style rules are processed.
 	This allows to use any routable Garmin type (except 0x08 and 0x09)
 	for that part so that the Garmin device tells the name of
 	this part as hint which destination to follow.     
Index: resources/styles/default/lines
===================================================================
--- resources/styles/default/lines	(revision 3673)
+++ resources/styles/default/lines	(working copy)
@@ -50,14 +50,12 @@
 # which may add info to a part of these highway=*_link roads:
 # motorway_link, trunk_link, primary_link, secondary_link, tertiary_link
 # build destination hint 
-dest_hint=* { delete dest_hint }
-mkgmap:dest_hint=true
-  { set dest_hint = '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |
-         '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' | 
-         '${destination|subst:;=> |subst:/=> }';
+mkgmap:dest_hint=*
+  { set dest_hint = '${destination:ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' |
+         '${ref|subst: =>} ${mkgmap:dest_hint|subst:;=> |subst:/=> }' | 
+         '${mkgmap:dest_hint|subst:;=> |subst:/=> }';
        }
 # build exit hint 
-exit_hint=* { delete exit_hint }
 mkgmap:exit_hint=true 
   { set exit_hint = 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' | 
          'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' | 
@@ -67,7 +65,7 @@
        }
   
 # use destination hint and/or exit hint to build name              
-(mkgmap:exit_hint=true | mkgmap:dest_hint=true)
+(mkgmap:exit_hint=true | mkgmap:dest_hint=*)
   {	name '${exit_hint} ${dest_hint}' | 	'${dest_hint}' | 		'${exit_hint}' }
 # end of rules for process-exits and process-destination options	
   
@@ -129,12 +127,12 @@
 # Ways sorted roughly by descending order of class
 highway=motorway & network=e-road [0x01 resolution 14-14 continue]
 highway=motorway  [0x01 road_class=4 road_speed=7 resolution 15]
-highway=motorway_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=true) [0x06 road_class=3 road_speed=2 resolution 20]
+highway=motorway_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x06 road_class=3 road_speed=2 resolution 20]
 highway=motorway_link [0x09 road_class=3 road_speed=2 resolution 20]
 
 highway=trunk & ( network=e-road | int_ref=* ) [0x02 resolution 15-17 continue]
 highway=trunk [0x02 road_class=4 road_speed=5 resolution 18]
-highway=trunk_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=true) [0x06 road_class=3 road_speed=2 resolution 20]
+highway=trunk_link & (mkgmap:exit_hint=true | mkgmap:dest_hint=*) [0x06 road_class=3 road_speed=2 resolution 20]
 highway=trunk_link [0x09 road_class=3 road_speed=2 resolution 20]
 highway=* & motorroad=yes [0x02 road_class=4 road_speed=4 resolution 18]
 highway=primary & ( network=e-road | int_ref=* ) [0x03 resolution 17-18 continue]
