public com.sun.star.sheet.FunctionArgument[] getArguments() {
   int count = functionDescription.getParameterCount();
   final boolean infinite = functionDescription.isInfiniteParameterCount();
   if (infinite) {
     count = 30;
   }
   final FunctionArgument[] args = new FunctionArgument[count];
   for (int i = 0; i < args.length; i++) {
     final int pos = infinite ? 0 : i;
     args[i] = new FunctionArgument();
     args[i].Description = functionDescription.getParameterDescription(pos, defaultLocale);
     args[i].Name = functionDescription.getParameterDisplayName(pos, defaultLocale);
     args[i].IsOptional = !functionDescription.isParameterMandatory(pos);
   }
   return args;
 }
  public String createFormula(String[] arguments)
      throws com.sun.star.lang.DisposedException, com.sun.star.lang.IllegalArgumentException,
          com.sun.star.uno.Exception {
    final boolean infinite = functionDescription.isInfiniteParameterCount();
    final int count = functionDescription.getParameterCount();
    if (!infinite && arguments.length > count) {
      throw new com.sun.star.lang.IllegalArgumentException();
    }

    final StringBuffer formula = new StringBuffer(getName());
    formula.append('(');
    for (int i = 0; i < arguments.length; ++i) {
      if (arguments[i].length() == 0) {
        break;
      }
      formula.append(arguments[i]);
      if (i < (arguments.length - 1) && arguments[i + 1].length() != 0) {
        formula.append(';');
      }
    }
    formula.append(')');
    return formula.toString();
  }