Commit 94ca1328 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

We do not need the VARARG vs FIXED flags anymore min_args vs max_args is


2005-04-23  Jody Goldberg <jody@gnome.org>

	* ms-formula-read.c (excel_func_desc) : We do not need the VARARG vs
	  FIXED flags anymore min_args vs max_args is enough.  Replace both
	  with XL_STD.
	(make_function) : No need to generate warnings about VAR vs FIXED
	* ms-formula-write.c (write_funcall) : Use max_args from the func
	  descriptor
parent 3e553ec2
......@@ -19,6 +19,7 @@ Release Critical
Worries
-------
: buttons in sheet manager resize vertically
: provide undo for dropped objects from sheet_objects_clear
: undo of pasting copy/cut of objects
: Select graph, Copy, and paste to Emacs: used to crash, but now it
......
2005-04-23 Jody Goldberg <jody@gnome.org>
* ms-formula-read.c (excel_func_desc) : We do not need the VARARG vs
FIXED flags anymore min_args vs max_args is enough. Replace both
with XL_STD.
(make_function) : No need to generate warnings about VAR vs FIXED
* ms-formula-write.c (write_funcall) : Use max_args from the func
descriptor
2005-05-07 Jean Brefort <jean.brefort@normalesup.org>
* ms-chart.c: (excel_chart_series_new), (ai), (series), (siindex),
......
#ifndef GNUMERIC_EXCEL_BIFF_TYPES_H
#define GNUMERIC_EXCEL_BIFF_TYPES_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_EXCEL_BIFF_TYPES_H
#define GNM_EXCEL_BIFF_TYPES_H
/*
* biff-types.h: A long and dull list of BIFF types.
*
* Author:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2004 Michael Meeks, Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
*/
#define BIFF_DIMENSIONS_v0 0x000
......@@ -333,4 +335,4 @@
#define BIFF_CHART_gelframe 0x1066
#define BIFF_CHART_boppopcustom 0x1067
#endif /* GNUMERIC_EXCEL_BIFF_TYPES_H */
#endif /* GNM_EXCEL_BIFF_TYPES_H */
......@@ -3,10 +3,11 @@
* boot.c: MS Excel support for Gnumeric
*
* Author:
* Michael Meeks (michael@ximian.com)
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2003 Michael Meeks, Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#include <gnumeric-config.h>
#include <gnumeric.h>
......@@ -35,6 +36,7 @@
#include <gsf/gsf-outfile-msole.h>
#include <gsf/gsf-structured-blob.h>
#include <glib/gi18n.h>
#include <string.h>
GNM_PLUGIN_MODULE_HEADER;
......@@ -320,17 +322,6 @@ go_plugin_init (GOPlugin *plugin, GOCmdContext *cc)
fprintf (stderr, "%s : min_args < 0\n", name);
if (fd->max_args < 0)
fprintf (stderr, "%s : min_args < 0\n", name);
if (fd->min_args != fd->max_args) {
if (0 == (fd->flags & XL_VARARG))
fprintf (stderr, "%s : should be vararg\n", name);
if (fd->flags & XL_FIXED)
fprintf (stderr, "%s : should not be fixed\n", name);
} else {
if (fd->flags & XL_VARARG)
fprintf (stderr, "%s : should not be vararg\n", name);
if (0 == (fd->flags & XL_FIXED))
fprintf (stderr, "%s : should be fixed\n", name);
}
if (fd->known_args != NULL &&
fd->num_known_args != strlen (fd->known_args))
fprintf (stderr, "%s : num_expected_args inconsistent\n", name);
......
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* boot.h: Start/Stop support
*
* Author:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#ifndef GNUMERIC_BOOT_H
#define GNUMERIC_BOOT_H
#ifndef GNM_BOOT_H
#define GNM_BOOT_H
#include <glib.h>
......@@ -20,4 +23,4 @@ extern gint ms_excel_chart_debug;
extern gint ms_excel_write_debug;
extern gint ms_excel_object_debug;
#endif /* GNUMERIC_BOOT_H */
#endif /* GNM_BOOT_H */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
Unix SMB/CIFS implementation.
a implementation of MD4 designed for use in the SMB authentication protocol
......
#ifndef GNUMERIC_EXCEL_ESCHER_TYPES_H
#define GNUMERIC_EXCEL_ESCHER_TYPES_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_EXCEL_ESCHER_TYPES_H
#define GNM_EXCEL_ESCHER_TYPES_H
/**
* escher-types.h: A long and dull list of types used
* in the MS drawing layer.
*
* Author:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
**/
/**
* See S59FDC.HTM for the spec.
* MS use similar names with 'msofbt' prefix.
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#define DggContainer 0xf000 /* Drawing Group Container */
......@@ -50,4 +49,4 @@
#define OleObject 0xf11f
#define UserDefined 0xf122
#endif
#endif /* GNM_EXCEL_ESCHER_TYPES_H */
......@@ -3,7 +3,7 @@
/*
* excel-xml-read.c : Read MS Excel's xml
*
* Copyright (C) 2003 Jody Goldberg (jody@gnome.org)
* Copyright (C) 2003-2005 Jody Goldberg (jody@gnome.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* excel-xml-read.h : Import MS Excel (tm) XML generated by version XP
*
* Copyright (C) 2003 Jody Goldberg (jody@gnome.org)
* Copyright (C) 2003-2005 Jody Goldberg (jody@gnome.org)
**/
#ifndef EXCEL_XML_READ_H
#define EXCEL_XML_READ_H
......
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* excel.h: Excel support interface to gnumeric
*
* Authors:
* Michael Meeks (michael@ximian.com)
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2004 Michael Meeks, Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#ifndef GNM_MS_EXCEL_H
#define GNM_MS_EXCEL_H
......
#ifndef GNUMERIC_EXCEL_FORMULA_TYPES_H
#define GNUMERIC_EXCEL_FORMULA_TYPES_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_EXCEL_FORMULA_TYPES_H
#define GNM_EXCEL_FORMULA_TYPES_H
/**
* formula-types.h: A long and dull list of function record types.
* formula-types.h: The formula records
*
* Author:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
**/
/**
* See S59E2B.HTM for the spec.
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#define FORMULA_PTG_EXPR 0x01
#define FORMULA_PTG_TBL 0x02
......@@ -72,15 +72,14 @@
#define FORMULA_PTG_MAX 0x7f
typedef enum {
XL_STD = 0,
/* To catch the magic extension entry */
XL_MAGIC = 1 << 0,
/* fixed and vararg are opposites, be verbose for clarity */
XL_FIXED = 1 << 1,
XL_VARARG = 1 << 2,
XL_VOLATILE = 1 << 3,
XL_XLM = 1 << 4,
XL_UNKNOWN = 1 << 5
XL_VOLATILE = 1 << 1,
XL_XLM = 1 << 2,
XL_UNKNOWN = 1 << 3
} ExcelFuncFlag;
typedef struct {
......@@ -106,4 +105,4 @@ typedef struct {
extern ExcelFuncDesc const excel_func_desc[];
extern int excel_func_desc_size;
#endif /* GNUMERIC_EXCEL_FORMULA_TYPES_H */
#endif /* GNM_EXCEL_FORMULA_TYPES_H */
#ifndef GNUMERIC_EXCEL_MD5_H
#define GNUMERIC_EXCEL_MD5_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_EXCEL_MD5_H
#define GNM_EXCEL_MD5_H
/*
**********************************************************************
......@@ -62,4 +63,4 @@ void wvMD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
******************************* (cut) ********************************
*/
#endif
#endif /* GNM_EXCEL_MD5_H */
......@@ -3,11 +3,11 @@
* ms-biff.c: MS Excel Biff support...
*
* Author:
* Michael Meeks (michael@ximian.com)
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2002 Michael Meeks
* 2002-2004 Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#include <gnumeric-config.h>
......
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-biff.h: MS Excel BIFF support for Gnumeric
*
* Author:
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2002 Michael Meeks
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#ifndef GNUMERIC_BIFF_H
#define GNUMERIC_BIFF_H
#ifndef GNM_BIFF_H
#define GNM_BIFF_H
#include <gsf/gsf.h>
#include "rc4.h"
......@@ -113,4 +116,4 @@ void ms_biff_put_2byte (BiffPut *bp, guint16 opcode, guint16 data);
unsigned ms_biff_max_record_len (BiffPut const *bp);
#endif /* GNUMERIC_BIFF_H */
#endif /* GNM_BIFF_H */
......@@ -5,7 +5,7 @@
* Author:
* Jody Goldberg (jody@gnome.org)
*
* (C) 1999-2004 Jody Goldberg
* (C) 1999-2005 Jody Goldberg
**/
#include <gnumeric-config.h>
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-chart.h: MS Excel Chart support for Gnumeric
*
* Author:
* Jody Goldberg (jody@gnome.org)
*
* (C) 1999-2004 Jody Goldberg
* (C) 1999-2005 Jody Goldberg
**/
#ifndef GNUMERIC_MS_CHART_H
#define GNUMERIC_MS_CHART_H
#ifndef GNM_MS_CHART_H
#define GNM_MS_CHART_H
#include "excel.h"
#include "ms-excel-read.h"
#include "ms-container.h"
......@@ -23,4 +24,4 @@ gboolean ms_excel_chart_read_BOF (BiffQuery *q, MSContainer *container,
void ms_excel_chart_write (ExcelWriteState *ewb, SheetObject *so);
void ms_excel_chart_extract_styles (ExcelWriteState *ewb, SheetObject *so);
#endif /* GNUMERIC_MS_CHART_H */
#endif /* GNM_MS_CHART_H */
......@@ -7,7 +7,7 @@
* Author:
* Jody Goldberg (jody@gnome.org)
*
* (C) 2000-2004 Jody Goldberg
* (C) 2000-2005 Jody Goldberg
**/
#include <gnumeric-config.h>
......
#ifndef MS_OFFICE_CONTAINER_H
#define MS_OFFICE_CONTAINER_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_EXCEL_CONTAINER_H
#define GNM_EXCEL_CONTAINER_H
/**
* ms-container.h: A meta container to handle object import for charts,
* workbooks and sheets.
*
* Author:
* Jody Goldberg (jody@gnome.org)
*
* (C) 2000-2005 Jody Goldberg
**/
#include "excel.h"
#include "ms-biff.h"
......@@ -54,11 +65,11 @@ void ms_container_realize_objs (MSContainer *c);
GnmExpr const *ms_container_parse_expr (MSContainer *c,
guint8 const *data, int length);
Sheet *ms_container_sheet (MSContainer const *c);
GOFormat *ms_container_get_fmt (MSContainer const *c, unsigned indx);
PangoAttrList *ms_container_get_markup (MSContainer const *c, unsigned indx);
Sheet *ms_container_sheet (MSContainer const *c);
GOFormat *ms_container_get_fmt (MSContainer const *c, unsigned indx);
PangoAttrList *ms_container_get_markup (MSContainer const *c, unsigned indx);
PangoAttrList *ms_container_read_markup (MSContainer const *c,
guint8 const *data, int txo_len,
char const *str);
#endif /* MS_OFFICE_CONTAINER_H */
#endif /* GNM_EXCEL_CONTAINER_H */
/* vim: set sw=8: */
/*
* ms-escher.c: MS Office drawing layer support
*
* Copyright (C) 2000-2002
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (mmeeks@gnu.org)
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNUMERIC_MS_OFFICE_ESCHER_H
#define GNUMERIC_MS_OFFICE_ESCHER_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_MS_OFFICE_ESCHER_H
#define GNM_MS_OFFICE_ESCHER_H
/**
* ms-escher.h: MS Office drawing layer support
*
* Author:
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2002 Jody Goldberg, Michael Meeks
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#include "ms-excel-read.h"
#include "ms-container.h"
......@@ -33,4 +34,4 @@ MSEscherWriter *ms_escher_writer_new (BiffPut *bp);
void ms_escher_writer_commit (MSEscherWriter *ew);
#endif
#endif /* GNUMERIC_MS_OFFICE_ESCHER_H */
#endif /* GNM_MS_OFFICE_ESCHER_H */
#ifndef GNUMERIC_EXCEL_BIFF_H
#define GNUMERIC_EXCEL_BIFF_H
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef GNM_EXCEL_BIFF_H
#define GNM_EXCEL_BIFF_H
/**
* ms-excel-biff.h: MS Excel BIFF header for Gnumeric
* contains data about the Excel BIFF records
*
* Author:
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#include "excel.h"
......@@ -80,4 +83,4 @@ extern void free_ms_biff_bof_data (MsBiffBofData *data) ;
#include "biff-types.h"
#endif
#endif /* GNM_EXCEL_BIFF_H */
......@@ -2,7 +2,12 @@
/**
* ms-excel.c: MS Excel import
*
* (C) 1998-2004 Jody Goldberg, Michael Meeks
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-excel.h: MS Excel support for Gnumeric
*
* Author:
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2004 Michael Meeks, Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#ifndef GNUMERIC_MS_EXCEL_H
#define GNUMERIC_MS_EXCEL_H
#ifndef GNM_MS_EXCEL_READ_H
#define GNM_MS_EXCEL_READ_H
#include "ms-biff.h"
#include "ms-excel-biff.h"
......@@ -144,4 +145,4 @@ void excel_unexpected_biff (BiffQuery *q, char const *state, int debug_level);
void excel_read_cleanup (void);
void excel_read_init (void);
#endif
#endif /* GNM_MS_EXCEL_READ_H */
......@@ -5,7 +5,7 @@
* Author:
* Jon K Hellan (hellan@acm.org)
*
* (C) 1999-2004 Jon K Hellan
* (C) 1999-2005 Jon K Hellan
**/
#include <gnumeric-config.h>
......
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-excel-util.h: Utility functions for MS Excel import / export
*
* Author:
* Jon K Hellan (hellan@acm.org)
*
* (C) 1999-2004 Jon K Hellan
* (C) 1999-2005 Jon K Hellan
**/
#ifndef GNUMERIC_MS_EXCEL_UTIL_H
#define GNUMERIC_MS_EXCEL_UTIL_H
#ifndef GNM_MS_EXCEL_UTIL_H
#define GNM_MS_EXCEL_UTIL_H
#include <glib.h>
#include <stdlib.h>
......@@ -63,4 +64,4 @@ typedef struct {
XL_font_width const *xl_lookup_font_specs (char const *name);
void destroy_xl_font_widths (void);
#endif /* GNUMERIC_MS_EXCEL_UTIL_H */
#endif /* GNM_MS_EXCEL_UTIL_H */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-excel-write.h: MS Excel export
*
* Author:
* Michael Meeks (michael@ximian.com)
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2004 Jody Goldberg, Michael Meeks
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#ifndef GNUMERIC_MS_EXCEL_WRITE_H
#define GNUMERIC_MS_EXCEL_WRITE_H
#ifndef GNM_MS_EXCEL_WRITE_H
#define GNM_MS_EXCEL_WRITE_H
#include "ms-biff.h"
#include "ms-excel-biff.h"
......@@ -138,4 +140,4 @@ int excel_write_get_externsheet_idx (ExcelWriteState *wb,
int excel_write_map_errcode (GnmValue const *v);
#endif
#endif /* GNM_MS_EXCEL_WRITE_H */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-excel-xf.h: MS Excel support for Gnumeric
*
* Authors:
* Michael Meeks (michael@ximian.com)
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2001 Michael Meeks, Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#ifndef GNUMERIC_MS_EXCEL_XF_H
#define GNUMERIC_MS_EXCEL_XF_H
#ifndef GNM_MS_EXCEL_XF_H
#define GNM_MS_EXCEL_XF_H
#include "style.h"
#include "style-border.h"
......@@ -51,4 +53,4 @@ typedef struct _BiffXFData {
GnmStyle *mstyle;
} BiffXFData;
#endif
#endif /* GNM_MS_EXCEL_XF_H */
This diff is collapsed.
/*
* ms-formula-read.h: MS Excel -> Gnumeric formula conversion
*
* Author:
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998, 1999, 2000 Michael Meeks
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
*/
#ifndef GNUMERIC_MS_FORMULA_R_H
#define GNUMERIC_MS_FORMULA_R_H
#ifndef GNM_MS_FORMULA_R_H
#define GNM_MS_FORMULA_R_H
#include <glib.h>
......@@ -22,4 +24,4 @@ excel_parse_formula (MSContainer const *container,
gboolean shared,
gboolean *array_element);
#endif
#endif /* GNM_MS_FORMULA_R_H */
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* ms-formula-write.c: MS Excel <- Gnumeric formula conversion
* See: S59E2B.HTM
* ms-formula-write.c: export GnmExpr to xls
*
* Author:
* Michael Meeks (michael@ximian.com)
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2001 Michael Meeks
* 2002-2005 Jody Goldberg
* (C) 2002-2005 Jody Goldberg
*/
#include <gnumeric-config.h>
......@@ -487,8 +486,7 @@ write_funcall (PolishData *pd, GnmExpr const *expr,
{
static guint8 const zeros [12];
/* excel is limited to 128 args max */
int max_args = 126, num_args = 0;
int num_args = 0;
gboolean prompt = FALSE;
gboolean cmdequiv = FALSE;
char const *arg_types = NULL;
......@@ -522,19 +520,14 @@ write_funcall (PolishData *pd, GnmExpr const *expr,
push_guint16 (pd, 0); /* reserved */
}
}
} else {
} else
arg_types = ef->efunc->known_args;
if (ef->efunc->flags & XL_FIXED)
max_args = ef->efunc->num_known_args;
}
for (ptr = expr->func.arg_list ; ptr != NULL; ptr = ptr->next, num_args++)
if (num_args >= max_args) {
if (num_args >= ef->efunc->max_args) {
gnm_io_warning (pd->ewb->io_context,
((max_args == 128)
? _("Too many arguments for function '%s', MS Excel expects exactly %d and we have %d")
: _("Too many arguments for function '%s', MS Excel can only handle %d not %d")),
ef->efunc->name, max_args, num_args);
_("Too many arguments for function '%s', MS Excel can only handle %d not %d"),
ef->efunc->name, ef->efunc->max_args, num_args);
break;
} else { /* convert the args */
if (arg_types != NULL && *arg_types) {
......@@ -559,7 +552,7 @@ write_funcall (PolishData *pd, GnmExpr const *expr,
for ( ; num_args < ef->efunc->min_args ; num_args++)
push_guint8 (pd, FORMULA_PTG_MISSARG);
if (ef->efunc->flags & XL_VARARG) {
if (ef->efunc->min_args != ef->efunc->max_args) {
push_guint8 (pd, FORMULA_PTG_FUNC_VAR + op_class);
push_guint8 (pd, num_args | (prompt ? 0x80 : 0));
push_guint16 (pd, ef->idx | (cmdequiv ? 0x8000 : 0));
......
/*
* ms-formula-read.h: MS Excel -> Gnumeric formula conversion
*
* Author:
* Michael Meeks (michael@ximian.com)
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2001 Michael Meeks
* 2002-2003 Jody Goldberg
* (C) 2002-2005 Jody Goldberg
*/
#ifndef GNUMERIC_MS_FORMULA_WRITE_H
#define GNUMERIC_MS_FORMULA_WRITE_H
#ifndef GNM_MS_FORMULA_WRITE_H
#define GNM_MS_FORMULA_WRITE_H
#include <gnumeric.h>
#include "excel.h"
......@@ -31,4 +31,4 @@ void excel_write_prep_expressions (ExcelWriteState *ewb);
void excel_write_prep_expr (ExcelWriteState *ewb, GnmExpr const *expr);
void excel_write_prep_sheet (ExcelWriteState *ewb, Sheet const *sheet);
#endif /* GNUMERIC_MS_FORMULA_W_H */
#endif /* GNM_MS_FORMULA_W_H */
......@@ -3,9 +3,12 @@
/*
* ms-obj.c: MS Excel Object support for Gnumeric
*
* Copyright (C) 2000-2004
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (mmeeks@gnu.org)
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......
#ifndef GNUMERIC_MS_OBJ_H
#define GNUMERIC_MS_OBJ_H
#ifndef GNM_MS_OBJ_H
#define GNM_MS_OBJ_H
/**
* ms-obj.h: MS Excel Graphic Object support for Gnumeric
*
* Author:
* Michael Meeks (michael@ximian.com)
* Authors:
* Jody Goldberg (jody@gnome.org)
* Michael Meeks (michael@ximian.com)
*
* (C) 1998-2004 Michael Meeks, Jody Goldberg
* (C) 1998-2001 Michael Meeks
* (C) 2002-2005 Jody Goldberg
**/
#include "ms-excel-read.h"
......@@ -135,4 +136,4 @@ void ms_objv8_write_scrollbar (BiffPut *bp);
void ms_objv8_write_listbox (BiffPut *bp, gboolean filtered);
void ms_objv8_write_chart (BiffPut *bp, SheetObject *sog);
#endif /* GNUMERIC_MS_OBJ_H */
#endif /* GNM_MS_OBJ_H */
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* vim: set sw=8 ts=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* ms-chart.h: MS Excel Pivot support for Gnumeric
*
......@@ -8,8 +8,8 @@
* (C) 2005 Jody Goldberg
**/
#ifndef GNUMERIC_MS_PIVOT_H
#define GNUMERIC_MS_PIVOT_H
#ifndef GNM_MS_PIVOT_H
#define GNM_MS_PIVOT_H
#include <gsf/gsf.h>
#include "ms-container.h"
......@@ -19,4 +19,4 @@ void excel_read_pivot_caches (ExcelWorkbook *ewb,
BiffQuery const *content_query,
GsfInfile *parent);
#endif /* GNUMERIC_MS_PIVOT_H */