Browse Source

Pull request #2420: REPORT-34955 linux设计器选中某个字体后 切换单元格后字体未重新设置未默认字体

Merge in DESIGN/design from ~HADES/design:final/10.0 to final/10.0

* commit 'cc2fa9218f2e7d57efc68bed04be779729b19b35':
  REPORT-34955 linux设计器选中某个字体后 切换单元格后字体未重新设置未默认字体
final/10.0
Kara 4 years ago
parent
commit
dcfac922cc
  1. 10
      designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java

10
designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java

@ -3,6 +3,7 @@
*/ */
package com.fr.design.actions.cell.style; package com.fr.design.actions.cell.style;
import com.fr.stable.os.OperatingSystem;
import java.awt.Dimension; import java.awt.Dimension;
import javax.swing.ComboBoxModel; import javax.swing.ComboBoxModel;
@ -49,6 +50,7 @@ public class ReportFontNameAction extends AbstractStyleAction {
public void setFontName(String fontName) { public void setFontName(String fontName) {
Object object = this.getValue(UIComboBox.class.getName()); Object object = this.getValue(UIComboBox.class.getName());
boolean find = false;
if (object != null && object instanceof UIComboBox) { if (object != null && object instanceof UIComboBox) {
UIComboBox comboBox = (UIComboBox) object; UIComboBox comboBox = (UIComboBox) object;
ComboBoxModel comboBoxModel = comboBox.getModel(); ComboBoxModel comboBoxModel = comboBox.getModel();
@ -60,9 +62,17 @@ public class ReportFontNameAction extends AbstractStyleAction {
comboBox.removeActionListener(this); comboBox.removeActionListener(this);
comboBox.setSelectedIndex(i); comboBox.setSelectedIndex(i);
comboBox.addActionListener(this); comboBox.addActionListener(this);
find = true;
break; break;
} }
} }
// linux设计器下面 找不到默认就是第一个字体
boolean access = OperatingSystem.isLinux() && !find && comboBoxModel.getSize() > 0;
if (access) {
comboBox.removeActionListener(this);
comboBox.setSelectedIndex(0);
comboBox.addActionListener(this);
}
} }
} }

Loading…
Cancel
Save