]> source.dussan.org Git - vaadin-framework.git/commitdiff
One more fix for #1875. Closing #1875
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Wed, 2 Jul 2008 15:41:09 +0000 (15:41 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Wed, 2 Jul 2008 15:41:09 +0000 (15:41 +0000)
svn changeset:5010/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java

index 36db8c8ac7cad52a3074b7a7da5201fccf61436f..1dbb3e13fefc809dd28a8274e20babad61db6f64 100644 (file)
@@ -346,78 +346,73 @@ public abstract class IOrderedLayout extends Panel implements Container {
             }
 
             // Set horizontal alignment
-            if (BrowserInfo.get().isIE()) {
-                DOM.setElementAttribute(getElement(), "align",
-                        horizontalAlignment);
-            } else {
-                // use one-cell table to implement horizontal alignments, only
-                // for values other than "left" (which is default)
-                // build one cell table
-                if (!horizontalAlignment.equals("left")) {
-                    if (td == null) {
-
-                        // The previous positioning has been left (or
-                        // unspecified).
-                        // Thus we need to create a one-cell-table to position
-                        // this
-                        // element.
-
-                        final Element table = DOM.createTable();
-                        final Element tBody = DOM.createTBody();
-                        final Element tr = DOM.createTR();
-                        td = DOM.createTD();
-                        final Element itable = DOM.createTable();
-                        final Element itBody = DOM.createTBody();
-                        final Element itr = DOM.createTR();
-                        final Element itd = DOM.createTD();
-                        DOM.appendChild(table, tBody);
-                        DOM.appendChild(tBody, tr);
-                        DOM.appendChild(tr, td);
-                        DOM.appendChild(td, itable);
-                        DOM.appendChild(itable, itBody);
-                        DOM.appendChild(itBody, itr);
-                        DOM.appendChild(itr, itd);
-                        DOM.setElementAttribute(table, "cellpadding", "0");
-                        DOM.setElementAttribute(table, "cellspacing", "0");
-                        DOM.setStyleAttribute(table, "width", "100%");
-                        DOM.setElementAttribute(itable, "cellpadding", "0");
-                        DOM.setElementAttribute(itable, "cellspacing", "0");
-
-                        // move possible content to cell
-                        while (DOM.getChildCount(getElement()) > 0) {
-                            Element content = DOM.getFirstChild(getElement());
-                            if (content != null) {
-                                DOM.removeChild(getElement(), content);
-                                DOM.appendChild(itd, content);
-                            }
-                        }
 
-                        DOM.appendChild(getElement(), table);
-                    }
-                    DOM.setElementAttribute(td, "align", horizontalAlignment);
-                } else if (td != null) {
-
-                    // In this case we are requested to position this left
-                    // while as it has had some other position in the past.
-                    // Thus the one-cell wrapper table must be removed.
-
-                    // Move content to main container
-                    Element itd = DOM.getFirstChild(DOM.getFirstChild(DOM
-                            .getFirstChild(DOM.getFirstChild(td))));
-                    while (DOM.getChildCount(itd) > 0) {
-                        Element content = DOM.getFirstChild(itd);
+            // use one-cell table to implement horizontal alignments, only
+            // for values other than "left" (which is default)
+            // build one cell table
+            if (!horizontalAlignment.equals("left")) {
+                if (td == null) {
+
+                    // The previous positioning has been left (or
+                    // unspecified).
+                    // Thus we need to create a one-cell-table to position
+                    // this
+                    // element.
+
+                    final Element table = DOM.createTable();
+                    final Element tBody = DOM.createTBody();
+                    final Element tr = DOM.createTR();
+                    td = DOM.createTD();
+                    final Element itable = DOM.createTable();
+                    final Element itBody = DOM.createTBody();
+                    final Element itr = DOM.createTR();
+                    final Element itd = DOM.createTD();
+                    DOM.appendChild(table, tBody);
+                    DOM.appendChild(tBody, tr);
+                    DOM.appendChild(tr, td);
+                    DOM.appendChild(td, itable);
+                    DOM.appendChild(itable, itBody);
+                    DOM.appendChild(itBody, itr);
+                    DOM.appendChild(itr, itd);
+                    DOM.setElementAttribute(table, "cellpadding", "0");
+                    DOM.setElementAttribute(table, "cellspacing", "0");
+                    DOM.setStyleAttribute(table, "width", "100%");
+                    DOM.setElementAttribute(itable, "cellpadding", "0");
+                    DOM.setElementAttribute(itable, "cellspacing", "0");
+
+                    // move possible content to cell
+                    while (DOM.getChildCount(getElement()) > 0) {
+                        Element content = DOM.getFirstChild(getElement());
                         if (content != null) {
-                            DOM.removeChild(itd, content);
-                            DOM.appendChild(getElement(), content);
+                            DOM.removeChild(getElement(), content);
+                            DOM.appendChild(itd, content);
                         }
                     }
 
-                    // Remove unneeded table element
-                    DOM.removeChild(getElement(), DOM
-                            .getFirstChild(getElement()));
-
-                    td = null;
+                    DOM.appendChild(getElement(), table);
                 }
+                DOM.setElementAttribute(td, "align", horizontalAlignment);
+            } else if (td != null) {
+
+                // In this case we are requested to position this left
+                // while as it has had some other position in the past.
+                // Thus the one-cell wrapper table must be removed.
+
+                // Move content to main container
+                Element itd = DOM.getFirstChild(DOM.getFirstChild(DOM
+                        .getFirstChild(DOM.getFirstChild(td))));
+                while (DOM.getChildCount(itd) > 0) {
+                    Element content = DOM.getFirstChild(itd);
+                    if (content != null) {
+                        DOM.removeChild(itd, content);
+                        DOM.appendChild(getElement(), content);
+                    }
+                }
+
+                // Remove unneeded table element
+                DOM.removeChild(getElement(), DOM.getFirstChild(getElement()));
+
+                td = null;
             }
         }