Author: abelevich
Date: 2011-01-14 07:27:00 -0500 (Fri, 14 Jan 2011)
New Revision: 21019
Modified:
trunk/core/api/src/main/java/org/richfaces/renderkit/util/HtmlDimensions.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/util/HtmlUtil.java
trunk/ui/common/ui/src/test/java/org/richfaces/component/util/HtmlUtilTest.java
Log:
RF-10215 HtmlDimensions: formatSize corrections
Modified: trunk/core/api/src/main/java/org/richfaces/renderkit/util/HtmlDimensions.java
===================================================================
---
trunk/core/api/src/main/java/org/richfaces/renderkit/util/HtmlDimensions.java 2011-01-14
12:09:00 UTC (rev 21018)
+++
trunk/core/api/src/main/java/org/richfaces/renderkit/util/HtmlDimensions.java 2011-01-14
12:27:00 UTC (rev 21019)
@@ -91,7 +91,7 @@
public static String formatSize(String size) {
if (size != null) {
String incomingSize = size.trim();
- if (!incomingSize.isEmpty()) {
+ if (incomingSize.length() > 0) {
char lastChar = incomingSize.charAt(incomingSize.length() - 1);
if (Character.isDigit(lastChar)) {
return incomingSize + "px";
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/util/HtmlUtil.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/util/HtmlUtil.java 2011-01-14
12:09:00 UTC (rev 21018)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/util/HtmlUtil.java 2011-01-14
12:27:00 UTC (rev 21019)
@@ -48,20 +48,6 @@
private HtmlUtil() {
}
- public static String qualifySize(String sizeDeclaration) {
- String trimmedValue = sizeDeclaration.trim();
-
- if (trimmedValue.length() != 0) {
- char lastChar = trimmedValue.charAt(trimmedValue.length() - 1);
-
- if (Character.isDigit(lastChar)) {
- return sizeDeclaration + "px";
- }
- }
-
- return sizeDeclaration;
- }
-
public static String addToSize(String declaration, String delta) {
Double doubleDelta = HtmlDimensions.decode(delta);
Double decoded = HtmlDimensions.decode(declaration);
Modified: trunk/ui/common/ui/src/test/java/org/richfaces/component/util/HtmlUtilTest.java
===================================================================
---
trunk/ui/common/ui/src/test/java/org/richfaces/component/util/HtmlUtilTest.java 2011-01-14
12:09:00 UTC (rev 21018)
+++
trunk/ui/common/ui/src/test/java/org/richfaces/component/util/HtmlUtilTest.java 2011-01-14
12:27:00 UTC (rev 21019)
@@ -47,17 +47,6 @@
super.tearDown();
}
- public void testQualifySize() throws Exception {
- assertEquals("", HtmlUtil.qualifySize(""));
- assertEquals("100px", HtmlUtil.qualifySize("100px"));
- assertEquals("100px", HtmlUtil.qualifySize("100"));
- assertEquals("100pt", HtmlUtil.qualifySize("100pt"));
- assertEquals("100in", HtmlUtil.qualifySize("100in"));
- assertEquals("100cm", HtmlUtil.qualifySize("100cm"));
- assertEquals("100em", HtmlUtil.qualifySize("100em"));
- assertEquals("100%", HtmlUtil.qualifySize("100%"));
- }
-
public void testAddToSize() throws Exception {
assertEquals("120px", HtmlUtil.addToSize("100",
"20px"));
assertEquals("120px", HtmlUtil.addToSize("100px",
"20"));