aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-03-16 11:25:35 +0200
committerHenri Sara <henri.sara@gmail.com>2017-03-16 11:25:35 +0200
commit41878d8943db8d9db98cf8e752b3ffba9bb8fd59 (patch)
treee224bcc532a377ab02317571dc64ca4010cbeb09 /server/src/main/java/com
parent28a815fb833087c1825365ac9b22c097e6d28ca5 (diff)
downloadvaadin-framework-41878d8943db8d9db98cf8e752b3ffba9bb8fd59.tar.gz
vaadin-framework-41878d8943db8d9db98cf8e752b3ffba9bb8fd59.zip
Correctly write margin info for FormLayout into design files (#8804)
Fixes #8800
Diffstat (limited to 'server/src/main/java/com')
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractLayout.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractLayout.java b/server/src/main/java/com/vaadin/ui/AbstractLayout.java
index fe073eb687..7e62176e7c 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractLayout.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractLayout.java
@@ -105,10 +105,16 @@ public abstract class AbstractLayout extends AbstractComponentContainer
*/
protected void writeMargin(Element design, MarginInfo margin,
MarginInfo defMargin, DesignContext context) {
- if (margin.hasAll() || margin.hasNone()) {
+ if (defMargin.getBitMask() == margin.getBitMask()) {
+ // Default, no need to write
+ } else if (margin.hasNone()) {
+ // Write "margin='false'"
DesignAttributeHandler.writeAttribute("margin", design.attributes(),
- margin.hasAll(), defMargin.hasAll(), boolean.class,
- context);
+ false, true, boolean.class, context);
+ } else if (margin.hasAll()) {
+ // Write "margin"
+ DesignAttributeHandler.writeAttribute("margin", design.attributes(),
+ true, false, boolean.class, context);
} else {
DesignAttributeHandler.writeAttribute("margin-left",