Пример #1
0
static void
dump_missing_functions (void)
{
	static gboolean done = FALSE;
	int i;

	if (!done) {
		for (i = QPRO_OP_FIRST_FUNC; i <= QPRO_OP_LAST_FUNC; i++) {
			char const *name = qpro_functions[i - QPRO_OP_FIRST_FUNC].name;
			int args = qpro_functions[i - QPRO_OP_FIRST_FUNC].args;
			GnmFunc *f;
			int dummy;

			if (!name || args != ARGS_UNKNOWN)
				continue;

			f = gnm_func_lookup (name, NULL);
			if (f == 0) {
				g_warning ("%s is not known.", name);
				continue;
			}

			gnm_func_count_args (f, &dummy, &dummy);

			g_warning ("Function %s has args %s.",
				   name, f->arg_names ? f->arg_names : "?");
		}
		done = TRUE;
	}
}
Пример #2
0
int gnumeric_sheet_set_cell(GnumericSheetPtr sheet, int x, int y,
			    GSheetCellPtr cell) {
  if (!cell->is_url) {
    if (cell->all) {
      gnumeric_sheet_set_cell_as_string(sheet,x,y,cell->all);
      return 0;
    }
    gnumeric_sheet_remove_cell(sheet,x,y);
    return 0;
  }

  if (cell->url&&cell->txt) {
    GnmFunc *func = gnm_func_lookup("hyperlink",((Sheet *)sheet)->workbook);
    if (!func) {
      fprintf(stderr,"hyperlink unknown\n");
      exit(1);
    }
    GnmExpr const *expr = 
      gnm_expr_new_funcall2(func,
			    gnm_expr_new_constant(value_new_string(cell->url)),
			    gnm_expr_new_constant(value_new_string(cell->txt)));
    GnmExprTop const *texpr = gnm_expr_top_new(expr);
    GnmCell *cell2 = sheet_cell_get((Sheet*)sheet,x,y);
    if (cell2==NULL) {
      cell2 = sheet_cell_create((Sheet*)sheet,x,y);
    }
    GnmValue *val = value_new_string(cell->txt);
    //sheet_cell_set_value(cell2,val);
    gnm_cell_set_expr_and_value(cell2,texpr,val,0);
  }

  return 0;
}