From 652fc735e7e2594f66f74d5add89fd8eb0b45f79 Mon Sep 17 00:00:00 2001 From: xiaohu Date: Mon, 11 Jul 2016 14:52:45 +0800 Subject: [PATCH] update --- designer/src/com/fr/poly/PolyComponetsBar.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/poly/PolyComponetsBar.java b/designer/src/com/fr/poly/PolyComponetsBar.java index b4625080e8..1413a26e1c 100644 --- a/designer/src/com/fr/poly/PolyComponetsBar.java +++ b/designer/src/com/fr/poly/PolyComponetsBar.java @@ -36,10 +36,11 @@ public class PolyComponetsBar extends JToolBar { setFloatable(false); setBackground(UIConstants.NORMAL_BACKGROUND); setLayout(FRGUIPaneFactory.create1ColumnGridLayout()); - serIcons = new SerIcon[(typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM) + 1]; + int typeLen = typeName.length < MAX_BAR_NUM ? typeName.length : MAX_BAR_NUM; + serIcons = new SerIcon[typeLen + 1]; serIcons[0] = new SerIcon(PolyECBlock.class, Inter.getLocText("Poly-Report_Block"), "Poly-Report_Block"); this.add(serIcons[0]); - for (int i = 0, len = typeName.length; i < len && i < MAX_BAR_NUM; i++) { + for (int i = 0; i < typeLen; i++) { BaseChart[] rowChart = BaseChartGetter.getStaticChartTypes(typeName[i].getPlotID()); serIcons[i + 1] = new SerIcon(rowChart[0], Inter.getLocText(typeName[i].getName()), typeName[i].getName()); this.add(serIcons[i + 1]);