Browse Source

Merge pull request #2427 in DESIGN/design from final/10.0 to release/10.0

* commit 'dcfac922cc563519f55cfd829eea5b2a17c2b8f2':
  REPORT-34955 linux设计器选中某个字体后 切换单元格后字体未重新设置未默认字体
feature/big-screen
superman 4 years ago
parent
commit
58ca3f4c93
  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