Browse Source

Merge pull request #47 in DESIGN/design from ~NEIL/design-10:feature/10.0 to feature/10.0

* commit 'db0625962057aac67311eab623dd0dd5a24c9652':
  1
  兼容
  REPORT-8226 除了report相关的公式, 其他公式放core.
master
superman 7 years ago
parent
commit
28e0ea9be7
  1. 21
      designer-base/src/com/fr/design/formula/FunctionNAD.java

21
designer-base/src/com/fr/design/formula/FunctionNAD.java

@ -1,12 +1,15 @@
package com.fr.design.formula;
import java.util.Locale;
import com.fr.base.FRContext;
import com.fr.script.CalculatorEmbeddedFunction;
import com.fr.stable.StringUtils;
import com.fr.stable.script.Function;
import java.util.Locale;
public class FunctionNAD extends AbstractNameAndDescription {
private Function fn;
FunctionNAD(Function fn) {
@ -20,13 +23,15 @@ public class FunctionNAD extends AbstractNameAndDescription {
public String getDesc() {
if (fn == null) {
return StringUtils.EMPTY;
} else {
if (Locale.CHINA.equals(FRContext.getLocale())) {
return fn.getCN();
} else {
return fn.getEN();
}
}
Locale locale = FRContext.getLocale();
String describtion = fn.getDescribtion(locale);
if (describtion.startsWith(CalculatorEmbeddedFunction.LOCALE_PREFIX)) {
// 老的自定义函数兼容, 没有重写getDescribtion
return Locale.CHINA.equals(locale) ? fn.getCN() : fn.getEN();
}
return describtion;
}
@Override

Loading…
Cancel
Save