From 86413db4701601e71b87f4294dd90f4c5c7ec123 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 26 Aug 2020 14:56:07 +0700 Subject: [PATCH] =?UTF-8?q?REPORT-37872=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1-=E6=89=93=E4=B8=8D=E5=BC=80=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XWAbsoluteLayout.java | 6 +++++- .../java/com/fr/design/form/util/FormDesignerUtils.java | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7c852f2820..b98c2a952d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -433,7 +433,11 @@ public class XWAbsoluteLayout extends XLayoutContainer { @Override public XLayoutContainer getTopLayout() { - XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); + XLayoutContainer parentXLayoutContainer = XCreatorUtils.getParentXLayoutContainer(this); + if (parentXLayoutContainer == null) { + return this; + } + XLayoutContainer xTopLayout = parentXLayoutContainer.getTopLayout(); if (xTopLayout != null && !xTopLayout.isEditable()) { return xTopLayout; } else { diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 85ec9474db..46377b1adf 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -17,6 +17,9 @@ public class FormDesignerUtils { * @return */ public static boolean isAppRelayout(FormDesigner designer) { + if (!designer.getRootComponent().acceptType(WFitLayout.class)) { + return false; + } return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout(); }