Changeset 5847 in josm for trunk/src/org
- Timestamp:
- 2013-04-13T22:47:23+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r5740 r5847 884 884 return null; 885 885 else 886 return (long) ((Way) osm).get NodesCount();886 return (long) ((Way) osm).getRealNodesCount(); 887 887 } 888 888 -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r5694 r5847 96 96 97 97 /** 98 * Replies the number of nodes in this way s.99 * 100 * @return the number of nodes in this way s.98 * Replies the number of nodes in this way. 99 * 100 * @return the number of nodes in this way. 101 101 * @since 1862 102 102 */ … … 104 104 public int getNodesCount() { 105 105 return nodes.length; 106 } 107 108 /** 109 * Replies the real number of nodes in this way (full number of nodes minus one if this way is closed) 110 * 111 * @return the real number of nodes in this way. 112 * @since 5847 113 * 114 * @see #getNodesCount() 115 * @see #isClosed() 116 */ 117 public int getRealNodesCount() { 118 int count = getNodesCount(); 119 return isClosed() ? count-1 : count; 106 120 } 107 121 -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r5750 r5847 267 267 } 268 268 269 int nodesNo = way.getNodesCount(); 270 if (nodesNo > 1 && way.isClosed()) { 271 nodesNo--; 272 } 269 int nodesNo = way.getRealNodesCount(); 273 270 /* note: length == 0 should no longer happen, but leave the bracket code 274 271 nevertheless, who knows what future brings */
Note:
See TracChangeset
for help on using the changeset viewer.