Browse Source

Merge pull request #1407 in DESIGN/design from ~HARRISON/design:release/10.0 to release/10.0

* commit '5433e90036069c4d51d2e6fd2098edfaac5d27e7':
  REPORT-26263 切换远程目录到tomcat,放置一段时间切回本地,出现切换失败的弹窗,实际切换成功 修复 npe 。
feature/big-screen
Harrison 5 years ago
parent
commit
18aed834f6
  1. 8
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  2. 20
      designer-form/src/test/java/com/fr/design/mainframe/JFormTest.java

8
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -543,8 +543,12 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
*/
public boolean canUndo() {
//报表块最多撤销至编辑报表块的第一步,不能撤销表单中的操作
boolean inECUndoForm = undoState.getFormReportType() == BaseUndoState.STATE_BEFORE_FORM_REPORT && formDesign.isReportBlockEditing();
return !inECUndoForm && this.getUndoManager().canUndo();
boolean inECUndoForm = undoState != null
&& undoState.getFormReportType() == BaseUndoState.STATE_BEFORE_FORM_REPORT
&& formDesign.isReportBlockEditing();
return !inECUndoForm
&& this.getUndoManager() != null
&& this.getUndoManager().canUndo();
}
// 返回当前的body,

20
designer-form/src/test/java/com/fr/design/mainframe/JFormTest.java

@ -0,0 +1,20 @@
package com.fr.design.mainframe;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
public class JFormTest {
@Test
public void testRun() {
JForm mockForm = EasyMock.partialMockBuilder(JForm.class).addMockedMethod("getUndoManager").createMock();
try {
mockForm.canUndo();
} catch (Exception e) {
Assert.fail();
}
}
}
Loading…
Cancel
Save