From 3508ad8de1eb5812156ef33cae66c5b131e2b1d7 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 5 Feb 2018 15:56:42 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3272=20=E4=B9=8B=E5=89=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=A2=AB=E5=86=B2=E7=AA=81=E8=A6=86=E7=9B=96=E4=BA=86?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/JForm.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 5c42f39a09..f4d5a30b8f 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -544,9 +544,9 @@ public class JForm extends JTemplate implements BaseJForm { @Override protected void applyUndoState(FormUndoState u) { try { - //JForm的target重置 - this.setTarget((Form) u.getForm().clone()); if (this.index == FORM_TAB) { + //JForm的target重置 + this.setTarget((Form) u.getForm().clone()); JForm.this.refreshRoot(); this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue()); //撤销的时候要重新选择的body布局 @@ -554,9 +554,12 @@ public class JForm extends JTemplate implements BaseJForm { formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()})); refreshToolArea(); } else { + // 只在报表块里撤销是不需要修改外部form对象的, 因为编辑的是当前报表块. + // 修改了JForm的Target需要同步修改formDesign的Target. + Form undoForm = (Form) u.getForm().clone(); String widgetName = this.formDesign.getElementCaseContainerName(); //这儿太坑了,u.getForm() 与 getTarget内容不一样 - FormElementCaseProvider dataTable = getTarget().getElementCaseByName(widgetName); + FormElementCaseProvider dataTable = undoForm.getElementCaseByName(widgetName); this.reportComposite.setSelectedWidget(dataTable); //下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC formDesign.setElementCase(dataTable);