Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java	(revision 11796)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java	(revision 11797)
@@ -108,9 +108,4 @@
 
     /**
-     * A rectangle with size 0x0
-     */
-    public static final Rectangle ZERO_BOX = new Rectangle(0, 0, 0, 0);
-
-    /**
      * The default style a simple node should use for it's text
      */
@@ -138,17 +133,13 @@
      */
     public TextLabel text;
-    // Either boxProvider or box is not null. If boxProvider is different from
-    // null, this means, that the box can still change in future, otherwise
-    // it is fixed.
+    /**
+     * The {@link HorizontalTextAlignment} for this text.
+     */
+    public HorizontalTextAlignment hAlign;
+    /**
+     * The {@link VerticalTextAlignment} for this text.
+     */
+    public VerticalTextAlignment vAlign;
     protected BoxProvider boxProvider;
-    protected Rectangle box;
-    /**
-     * The {@link HorizontalTextAlignment} for this text.
-     */
-    public HorizontalTextAlignment hAlign;
-    /**
-     * The {@link VerticalTextAlignment} for this text.
-     */
-    public VerticalTextAlignment vAlign;
 
     /**
@@ -157,9 +148,8 @@
      * @param text The text to display
      * @param boxProvider The box provider to use
-     * @param box The initial box to use.
      * @param hAlign The {@link HorizontalTextAlignment}
      * @param vAlign The {@link VerticalTextAlignment}
      */
-    public BoxTextElement(Cascade c, TextLabel text, BoxProvider boxProvider, Rectangle box,
+    public BoxTextElement(Cascade c, TextLabel text, BoxProvider boxProvider,
             HorizontalTextAlignment hAlign, VerticalTextAlignment vAlign) {
         super(c, 5f);
@@ -169,27 +159,6 @@
         this.text = text;
         this.boxProvider = boxProvider;
-        this.box = box == null ? ZERO_BOX : box;
         this.hAlign = hAlign;
         this.vAlign = vAlign;
-    }
-
-    /**
-     * Create a new {@link BoxTextElement} with a dynamic box
-     * @param env The MapCSS environment
-     * @param boxProvider The box provider that computes the box.
-     * @return A new {@link BoxTextElement} or <code>null</code> if the creation failed.
-     */
-    public static BoxTextElement create(Environment env, BoxProvider boxProvider) {
-        return create(env, boxProvider, null);
-    }
-
-    /**
-     * Create a new {@link BoxTextElement} with a fixed box
-     * @param env The MapCSS environment
-     * @param box The box
-     * @return A new {@link BoxTextElement} or <code>null</code> if the creation failed.
-     */
-    public static BoxTextElement create(Environment env, Rectangle box) {
-        return create(env, null, box);
     }
 
@@ -198,8 +167,7 @@
      * @param env The MapCSS environment
      * @param boxProvider The box provider.
-     * @param box The box. Only considered if boxProvider is null.
      * @return A new {@link BoxTextElement} or <code>null</code> if the creation failed.
      */
-    public static BoxTextElement create(Environment env, BoxProvider boxProvider, Rectangle box) {
+    public static BoxTextElement create(Environment env, BoxProvider boxProvider) {
         initDefaultParameters();
 
@@ -244,5 +212,5 @@
         }
 
-        return new BoxTextElement(c, text, boxProvider, box, hAlign, vAlign);
+        return new BoxTextElement(c, text, boxProvider, hAlign, vAlign);
     }
 
@@ -252,13 +220,5 @@
      */
     public Rectangle getBox() {
-        if (boxProvider != null) {
-            BoxProviderResult result = boxProvider.get();
-            if (!result.isTemporary()) {
-                box = result.getBox();
-                boxProvider = null;
-            }
-            return result.getBox();
-        }
-        return box;
+        return boxProvider.get().getBox();
     }
 
@@ -285,17 +245,16 @@
                vAlign == that.vAlign &&
                Objects.equals(text, that.text) &&
-               Objects.equals(boxProvider, that.boxProvider) &&
-               Objects.equals(box, that.box);
+               Objects.equals(boxProvider, that.boxProvider);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(super.hashCode(), text, boxProvider, box, hAlign, vAlign);
+        return Objects.hash(super.hashCode(), text, boxProvider, hAlign, vAlign);
     }
 
     @Override
     public String toString() {
-        return "BoxTextElemStyle{" + super.toString() + ' ' + text.toStringImpl()
-                + " box=" + box + " hAlign=" + hAlign + " vAlign=" + vAlign + '}';
+        return "BoxTextElement{" + super.toString() + ' ' + text.toStringImpl()
+                + " box=" + getBox() + " hAlign=" + hAlign + " vAlign=" + vAlign + '}';
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 11796)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 11797)
@@ -376,5 +376,5 @@
     @Override
     public String toString() {
-        StringBuilder s = new StringBuilder(64).append("NodeElemStyle{").append(super.toString());
+        StringBuilder s = new StringBuilder(64).append("NodeElement{").append(super.toString());
         if (mapImage != null) {
             s.append(" icon=[" + mapImage + ']');
