From 79fc6377d2df1616b10a780b2f7886928cd18663 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Wed, 19 May 2010 12:35:06 +0000 Subject: [PATCH] Fix for #4479 svn changeset:13258/svn branch:6.3 --- src/com/vaadin/ui/AbsoluteLayout.java | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java index b2f0f5539f..c3d6168426 100644 --- a/src/com/vaadin/ui/AbsoluteLayout.java +++ b/src/com/vaadin/ui/AbsoluteLayout.java @@ -83,10 +83,10 @@ public class AbsoluteLayout extends AbstractLayout { public class ComponentPosition implements Serializable { private int zIndex = -1; - private float topValue = -1; - private float rightValue = -1; - private float bottomValue = -1; - private float leftValue = -1; + private Float topValue = null; + private Float rightValue = null; + private Float bottomValue = null; + private Float leftValue = null; private int topUnits; private int rightUnits; @@ -119,7 +119,7 @@ public class AbsoluteLayout extends AbstractLayout { } else { value = ""; } - String unit = value.replaceAll("[0-9\\.]+", ""); + String unit = value.replaceAll("[0-9\\.\\-]+", ""); if (!unit.equals("")) { value = value.substring(0, value.indexOf(unit)).trim(); } @@ -154,16 +154,16 @@ public class AbsoluteLayout extends AbstractLayout { public String getCSSString() { String s = ""; - if (topValue >= 0) { + if (topValue != null) { s += "top:" + topValue + UNIT_SYMBOLS[topUnits] + ";"; } - if (rightValue >= 0) { + if (rightValue != null) { s += "right:" + rightValue + UNIT_SYMBOLS[rightUnits] + ";"; } - if (bottomValue >= 0) { + if (bottomValue != null) { s += "bottom:" + bottomValue + UNIT_SYMBOLS[bottomUnits] + ";"; } - if (leftValue >= 0) { + if (leftValue != null) { s += "left:" + leftValue + UNIT_SYMBOLS[leftUnits] + ";"; } if (zIndex >= 0) { @@ -212,14 +212,14 @@ public class AbsoluteLayout extends AbstractLayout { } public float getTopValue() { - return topValue; + return topValue == null ? 0 : rightValue.floatValue(); } /** * @return the rightValue */ public float getRightValue() { - return rightValue; + return rightValue == null ? 0 : rightValue.floatValue(); } /** @@ -236,7 +236,7 @@ public class AbsoluteLayout extends AbstractLayout { * @return the bottomValue */ public float getBottomValue() { - return bottomValue; + return bottomValue == null ? 0 : bottomValue.floatValue(); } /** @@ -253,7 +253,7 @@ public class AbsoluteLayout extends AbstractLayout { * @return the leftValue */ public float getLeftValue() { - return leftValue; + return leftValue == null ? 0 : leftValue.floatValue(); } /** -- 2.39.5