From ea425ac074fa79bd623653251df49208f86ceb89 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 13 Dec 2017 17:32:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4634=20=E7=BB=84=E4=BB=B6=E5=8F=A0?= =?UTF-8?q?=E5=8A=A0=E4=BD=93=E9=AA=8C=E4=BC=98=E5=8C=96=3D>bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=3D>=E4=BF=AE=E5=A4=8D=E9=80=89=E4=B8=ADform=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/SelectionModel.java | 4 +++- designer_form/src/com/fr/design/mainframe/FormDesigner.java | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index 850539781d..850b737a36 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -81,7 +81,9 @@ public class SelectionModel { // 如果父层是scale和title两个专属容器,返回其父层,组件本身是不让被选中的 if (comp != designer.getRootComponent() && comp != designer.getParaComponent()) { XCreator parentContainer = (XCreator) comp.getParent(); - comp = parentContainer.isDedicateContainer() ? parentContainer : comp; + if (parentContainer != null) { + comp = parentContainer.isDedicateContainer() ? parentContainer : comp; + } } if (selection.removeSelectedCreator(comp) || selection.addSelectedCreator(comp)) { designer.getEditListenerTable().fireCreatorModified(comp, DesignerEvent.CREATOR_SELECTED); diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index dad299c2c9..851a2cdee6 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -1140,6 +1140,9 @@ public class FormDesigner extends TargetComponent
implements TreeSelection public boolean isCurrentComponentMovableUp() { XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); Container container = creator.getParent(); + if (container == null) { + return false; + } return creator.isMovable() && container.getComponentZOrder(creator) > 0; } @@ -1147,6 +1150,9 @@ public class FormDesigner extends TargetComponent implements TreeSelection public boolean isCurrentComponentMovableDown() { XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); Container container = creator.getParent(); + if (container == null) { + return false; + } return creator.isMovable() && container.getComponentZOrder(creator) < container.getComponentCount() - 1; }