From 5034de4cb7cdabdbda27d9c1ac398f7652ceae71 Mon Sep 17 00:00:00 2001 From: eason Date: Fri, 8 Oct 2021 10:32:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=BC=E5=AE=B9=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84cpt=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/fit/menupane/ReportFitAttrAction.java | 2 +- .../design/report/fit/menupane/TemplateFitAttrPane.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index 7f66596a9..c0e257739 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -81,7 +81,7 @@ public class ReportFitAttrAction extends JTemplateAction { } final FitProvider wbTpl = (FitProvider) jwb.getTarget(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); - TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(); + TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(jwb); showReportFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane); } diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java index 393cbfc71..8854b0ee9 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java @@ -1,6 +1,5 @@ package com.fr.design.report.fit.menupane; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.JTemplate; import com.fr.design.report.fit.BaseFitAttrPane; @@ -15,7 +14,10 @@ import java.awt.event.ItemListener; public class TemplateFitAttrPane extends BaseFitAttrPane { - public TemplateFitAttrPane() { + private JTemplate jwb; + + public TemplateFitAttrPane(JTemplate jwb) { + this.jwb = jwb; initComponents(); } @@ -23,7 +25,7 @@ public class TemplateFitAttrPane extends BaseFitAttrPane { protected void initComponents() { super.initComponents(); for (FitAttrModel fitAttrModel : fitAttrModelList) { - if (fitAttrModel.isAvailable(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) { + if (fitAttrModel.isAvailable(jwb)) { populateModel(fitAttrModel); break; } @@ -71,7 +73,6 @@ public class TemplateFitAttrPane extends BaseFitAttrPane { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if(isTemplateSingleSet()){ - JTemplate jwb = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jwb != null) { FitProvider wbTpl = (FitProvider) jwb.getTarget(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr();