From 7a845fdf61f35540c4866a3a9a82015a1a279004 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 23 Oct 2012 09:37:27 +0300 Subject: [PATCH] Fixed slot stylenames not being removed properly when clearing the stylenames #9576 Change-Id: I5c89d814cb9b0b28bf46a850a6ecc8d7eab56d47 --- .../ui/orderedlayout/AbstractOrderedLayoutConnector.java | 5 ++++- .../com/vaadin/client/ui/orderedlayout/VOrderedLayout.java | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java index 7a2166cde2..9707db610e 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java @@ -85,7 +85,10 @@ public abstract class AbstractOrderedLayoutConnector extends // Update slot style names List childStyles = child.getState().styles; - if (childStyles != null && !childStyles.isEmpty()) { + if (childStyles == null) { + getWidget().setSlotStyleNames(child.getWidget(), + (String[]) null); + } else { getWidget().setSlotStyleNames(child.getWidget(), childStyles.toArray(new String[childStyles .size()])); diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java index 91d6852f52..99fd681d63 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java @@ -199,8 +199,10 @@ public class VOrderedLayout extends FlowPanel { */ protected void setStyleNames(String... stylenames) { setStyleName(SLOT_CLASSNAME); - for (String stylename : stylenames) { - addStyleDependentName(stylename); + if (stylenames != null) { + for (String stylename : stylenames) { + addStyleDependentName(stylename); + } } // Ensure alignment style names are correct -- 2.39.5