Index: applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/Attributes.java
===================================================================
--- applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/Attributes.java	(revision 36623)
+++ applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/Attributes.java	(working copy)
@@ -82,12 +82,15 @@ public class Attributes {
 	
 	private static Logger logger = Logger.getLogger(Attributes.class);
 	/** Array of doubles containg the change factro from <b>CENTIMETERS</b> to KILOMETERS, METERS, CENTIMETERS, MILLIMETERS, MILES, YARDS, FEET, INCHES, DECIMAL DEGREES*/
-	 /* Do not alter the order and the values of this array, if you need append values.*/
-	public static final double[] CHANGE = {
-			100000, 100, 1, 0.1, 160934.4, 91.44, 30.48, 2.54, 8.983152841195214E-6
-		};
+	 /* Do not alter the order and the values of this array, if you need append values.
+	  * jlopez: this array should not be used any longer, as MapContext has the updated
+	  * array of units, not Attributes. It's kept as a legacy in case any extension
+	  * still uses it, but it's not guaranteed to work with units added by extensions. */
+	public static final double[] CHANGE = MapContext.getDistanceTrans2Centimeter();
 	public static final String DEGREES="Grados";
-	/* Do not alter the order and the values of this array, if you need append values.*/
+	/* Do not alter the order and the values of this array, if you need append values.
+	 * jlopez: this code should not be here, MapContext should store all the info
+	 * related to measure units. This duplicity can lead to future problems.		   */
 	public static final double[] UNIT = {
 			0.0000025, 0.0025, 0.25, 2.5, 0.0000025, 0.025, 0.025, 0.25, 8.8E-7
 		};
@@ -182,7 +185,9 @@ public class Attributes {
 	private MediaSizeName m_type = MediaSizeName.ISO_A4;
 	private boolean m_isLandSel;
 	private OrientationRequested m_Orientation;
-	private double m_TypeUnit = CHANGE[2]; //CENTIMETROS;
+	private double m_TypeUnit = MapContext.
+			getDistanceTrans2Centimeter()[MapContext.
+			                              getDistancePosition("Centimetros")]; //CENTIMETROS;
 	private String m_NameUnit;
 	private Double m_numX=null;
 	private Double m_numY=null;
@@ -1008,10 +1013,11 @@ public class Attributes {
 	 * @param sel Type of unit.
 	 */
 	public void setUnit(int sel) {
+		double[] CHANGE = MapContext.getDistanceTrans2Centimeter();
 		m_selTypeUnit = sel;
 		m_TypeUnit = CHANGE[sel];
 		m_NameUnit = PluginServices.getText(this,MapContext.getDistanceNames()[sel]);
-		m_numX = m_numY = new Double(UNIT[sel]);
+		m_numX = m_numY = (sel >= UNIT.length) ? new Double(UNIT[2] / CHANGE[sel]) : new Double(UNIT[sel]);
 	}
 
 	/**
@@ -1067,7 +1073,8 @@ public class Attributes {
 	 */
 	public double getPixXCm(Rectangle2D rect) {
 		double value = m_sizePaper.getAncho();
-		double cm = CHANGE[2];
+		int cmPos = MapContext.getDistancePosition("Centimetros");
+		double cm = MapContext.getDistanceTrans2Centimeter()[cmPos];
 		double unidades = 0;
 		unidades = ((rect.getMaxX() - rect.getMinX()) /((value / cm)));
 		return unidades;
Index: applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutUtilities.java
===================================================================
--- applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutUtilities.java	(revision 36623)
+++ applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutUtilities.java	(working copy)
@@ -53,6 +53,7 @@ import java.util.ArrayList;
 
 import org.cresques.cts.IProjection;
 
+import com.iver.cit.gvsig.fmap.MapContext;
 import com.iver.cit.gvsig.fmap.ViewPort;
 
 
@@ -313,8 +314,9 @@ public class FLayoutUtilities {
 			return 0;
 		}
 
+		double change[] = MapContext.getDistanceTrans2Centimeter();
 		if (proj == null || viewPort.getImageSize() == null) {
-			return (long) (viewPort.getAdjustedExtent().getHeight() / wcm * Attributes.CHANGE[viewPort
+			return (long) (viewPort.getAdjustedExtent().getHeight() / wcm * change[viewPort
 																					.getMapUnits()]);
 		}
 
Index: applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameScaleBar.java
===================================================================
--- applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameScaleBar.java	(revision 36623)
+++ applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameScaleBar.java	(working copy)
@@ -97,7 +97,9 @@ public class FFrameScaleBar extends FFrame implements IFFrameViewDependence {
     private int m_numleft = 2;
     private double m_height = 0;
     private FFrameView fframeview = null;
-    private double m_typeUnit = Attributes.CHANGE[1]; //METROS;
+    private double m_typeUnit = MapContext.
+			getDistanceTrans2Centimeter()[MapContext.
+			                              getDistancePosition("Metros")]; //METROS;
     private String m_nameUnit = null;
     private double m_numUnit = 0;
     private double m_dif = 1;
Index: libraries/libFMap/src/com/iver/cit/gvsig/fmap/MapContext.java
===================================================================
--- libraries/libFMap/src/com/iver/cit/gvsig/fmap/MapContext.java	(revision 36623)
+++ libraries/libFMap/src/com/iver/cit/gvsig/fmap/MapContext.java	(working copy)
@@ -230,6 +230,14 @@ public class MapContext implements Projected {
 		}
 		return trans2meters;
 	}
+	public static double[] getDistanceTrans2Centimeter(){
+		int size=DISTANCETRANS2METER.size();
+		double[] trans2centimeters=new double[size];
+		for (int i = 0; i < size; i++) {
+			trans2centimeters[i]=((Double)DISTANCETRANS2METER.get(i)).doubleValue()*100;
+		}
+		return trans2centimeters;
+	}
 	public static int getDistancePosition(String s){
 		for (int i = 0; i < DISTANCENAMES.size(); i++) {
 			if (DISTANCENAMES.get(i).equals(s)){
