Commit 59a50e7b authored by Morten Welinder's avatar Morten Welinder

Make things work again on Solaris. Cleanup stuff.

parent 2697a062
1999-07-05 Morten Welinder <terra@diku.dk>
* src/style.c (style_font_new_simple): Reinstate negative caching.
* src/xml-io.c (xml_set_gnome_canvas_points): Handle zero point
case. Don't rely on return value from sprintf.
* src/dialog-function-select.c (function_definition_update): Kill
warnings.
* src/dialog-analysis-tools.c (dummy_fun): Make static.
(summary_stat_signal_fun): Ditto.
(confidence_signal_fun): Ditto.
(kth_largest_signal_fun): Ditto.
(kth_smallest_signal_fun): Ditto.
(tool_dialog_range): Ditto.
(selection_made): Ditto.
(dialog_data_analysis): Kill warning.
* src/analysis-tools.c (descriptive_stat_tool): Kill warnings.
1999-07-05 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/analysis-tools.c, src/dialog-analysis-tools.c,
......
1999-07-05 Morten Welinder <terra@diku.dk>
* src/style.c (style_font_new_simple): Reinstate negative caching.
* src/xml-io.c (xml_set_gnome_canvas_points): Handle zero point
case. Don't rely on return value from sprintf.
* src/dialog-function-select.c (function_definition_update): Kill
warnings.
* src/dialog-analysis-tools.c (dummy_fun): Make static.
(summary_stat_signal_fun): Ditto.
(confidence_signal_fun): Ditto.
(kth_largest_signal_fun): Ditto.
(kth_smallest_signal_fun): Ditto.
(tool_dialog_range): Ditto.
(selection_made): Ditto.
(dialog_data_analysis): Kill warning.
* src/analysis-tools.c (descriptive_stat_tool): Kill warnings.
1999-07-05 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/analysis-tools.c, src/dialog-analysis-tools.c,
......
1999-07-05 Morten Welinder <terra@diku.dk>
* src/style.c (style_font_new_simple): Reinstate negative caching.
* src/xml-io.c (xml_set_gnome_canvas_points): Handle zero point
case. Don't rely on return value from sprintf.
* src/dialog-function-select.c (function_definition_update): Kill
warnings.
* src/dialog-analysis-tools.c (dummy_fun): Make static.
(summary_stat_signal_fun): Ditto.
(confidence_signal_fun): Ditto.
(kth_largest_signal_fun): Ditto.
(kth_smallest_signal_fun): Ditto.
(tool_dialog_range): Ditto.
(selection_made): Ditto.
(dialog_data_analysis): Kill warning.
* src/analysis-tools.c (descriptive_stat_tool): Kill warnings.
1999-07-05 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/analysis-tools.c, src/dialog-analysis-tools.c,
......
1999-07-05 Morten Welinder <terra@diku.dk>
* src/style.c (style_font_new_simple): Reinstate negative caching.
* src/xml-io.c (xml_set_gnome_canvas_points): Handle zero point
case. Don't rely on return value from sprintf.
* src/dialog-function-select.c (function_definition_update): Kill
warnings.
* src/dialog-analysis-tools.c (dummy_fun): Make static.
(summary_stat_signal_fun): Ditto.
(confidence_signal_fun): Ditto.
(kth_largest_signal_fun): Ditto.
(kth_smallest_signal_fun): Ditto.
(tool_dialog_range): Ditto.
(selection_made): Ditto.
(dialog_data_analysis): Kill warning.
* src/analysis-tools.c (descriptive_stat_tool): Kill warnings.
1999-07-05 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/analysis-tools.c, src/dialog-analysis-tools.c,
......
1999-07-05 Morten Welinder <terra@diku.dk>
* ms-excel-read.c (ms_excel_read_supporting_wb): Warning killer.
(ms_excel_read_workbook): Ditto. Fill in some code page info.
(ms_excel_read_cell): Ditto.
* ms-biff.c (biff_getdouble): Re-instate the "BYTE" in
G_BYTE_ORDER...
(biff_getdouble): Constify.
1999-07-04 Michael Meeks <michael@edenproject.org>
* ms-formula-read.c (formula_func_data): Fixed ISREF, ISPMT.
......
......@@ -35,8 +35,8 @@
/* Helper Functions */
/*******************************************************************************/
#if G_guint8_ORDER == G_BIG_ENDIAN
double biff_getdouble (guint8 *p)
#if G_BYTE_ORDER == G_BIG_ENDIAN
double biff_getdouble (const guint8 *p)
{
double d;
int i;
......
......@@ -24,11 +24,14 @@
(*((guint8 *)(p)+2)=((n)>>16)&0xff), \
(*((guint8 *)(p)+3)=((n)>>24)&0xff))
extern double biff_getdouble (guint8 *p);
extern double biff_getdouble (const guint8 *p);
extern void biff_setdouble (guint8 *p, double d);
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
# define BIFF_GETDOUBLE(p) (*((double*)(p)))
/* MW: I have reservations about this. We are assuming not only little
* endian, but also arbitrary alignment for doubles as well as a certain
* layout (IEEE) of doubles. */
# define BIFF_GETDOUBLE(p) (*((const double*)(p)))
# define BIFF_SETDOUBLE(p,q) (*((double*)(p))=(q))
#else
# define BIFF_GETDOUBLE(p) (biff_getdouble(p))
......
......@@ -1718,12 +1718,16 @@ ms_excel_read_name (BiffQuery *q, ExcelWorkbook *wb)
{
guint16 flags = BIFF_GET_GUINT16(q->data);
guint16 fn_grp_idx;
#if 0
guint8 kb_shortcut = BIFF_GET_GUINT8(q->data+2);
#endif
guint8 name_len = BIFF_GET_GUINT8(q->data+3);
guint16 name_def_len = BIFF_GET_GUINT16(q->data+4);
guint8 *name_def_data = q->data+14+name_def_len;
#if 0
guint16 sheet_idx = BIFF_GET_GUINT16(q->data+6);
guint16 ixals = BIFF_GET_GUINT16(q->data+8); /* dup */
#endif
guint8 menu_txt_len = BIFF_GET_GUINT8(q->data+10);
guint8 descr_txt_len = BIFF_GET_GUINT8(q->data+11);
guint8 help_txt_len = BIFF_GET_GUINT8(q->data+12);
......@@ -1837,8 +1841,6 @@ ms_excel_externname(BiffQuery *q,
static void
ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
{
Cell *cell;
switch (q->ls_op) {
case BIFF_BLANK: /*
* FIXME: Not a good way of doing blanks ?
......@@ -2047,7 +2049,6 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
{
int array_col_first, array_col_last;
int array_row_first, array_row_last;
int xlp, ylp;
guint8 *data;
int data_len, options;
ExprTree *expr = NULL;
......@@ -2057,10 +2058,9 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
array_col_first = BIFF_GET_GUINT8(q->data + 4);
array_col_last = BIFF_GET_GUINT8(q->data + 5);
#if 0
/* Not handled yet */
options = BIFF_GET_GUINT16(q->data + 6);
#endif
data = q->data + 14;
data_len = BIFF_GET_GUINT16(q->data + 12);
expr = ms_excel_parse_formula (sheet, data,
......@@ -2426,11 +2426,8 @@ find_workbook (MsOle *ptr)
static void
ms_excel_read_supporting_wb (BIFF_BOF_DATA *ver, BiffQuery *q)
{
char * name;
guint8 * data;
guint32 byte_length, slen = 0;
guint16 numTabs = BIFF_GET_GUINT16 (q->data);
int i;
printf("Supporting workbook with %d Tabs\n", numTabs);
data = q->data + 2;
......@@ -2446,8 +2443,11 @@ ms_excel_read_supporting_wb (BIFF_BOF_DATA *ver, BiffQuery *q)
case 0x01 : /* chEncode */
puts("chEncode");
#if 0
for (i = 0; i < 50; ++i)
printf("%3d (%c)(%x)\n", i, data[i], data[i]);
{
int i;
for (i = 0; i < 50; ++i)
printf("%3d (%c)(%x)\n", i, data[i], data[i]);
}
#endif
break;
case 0x02 : /* chSelf */
......@@ -2461,6 +2461,8 @@ ms_excel_read_supporting_wb (BIFF_BOF_DATA *ver, BiffQuery *q)
#if 0
for (data = q->data + 2; numTabs-- > 0; ) {
char * name;
guint32 byte_length, slen;
if (ver->version == eBiffV8) {
slen = (guint32) BIFF_GET_GUINT16 (data);
name = biff_get_text (data += 2, slen, &byte_length);
......@@ -2477,7 +2479,6 @@ Workbook *
ms_excel_read_workbook (MsOle *file)
{
ExcelWorkbook *wb = NULL;
xmlNodePtr child;
cell_deep_freeze_redraws ();
......@@ -2617,7 +2618,7 @@ ms_excel_read_workbook (MsOle *file)
break;
case BIFF_FONT: /* see S59D8C.HTM */
{
BiffFontData *ptr;
/* BiffFontData *ptr; */
/* printf ("Read Font\n");
dump (q->data, q->length); */
......@@ -2751,13 +2752,18 @@ ms_excel_read_workbook (MsOle *file)
case BIFF_CODEPAGE : /* DUPLICATE 42 */
{
/* This seems to appear within a workbook */
char * page = NULL;
/* MW: And on Excel seems to drive the display
of currency amounts. */
guint16 codepage = BIFF_GET_GUINT16 (q->data);
switch(codepage)
{
case 0x01b5 :
puts("CodePage = IBM PC (Multiplan)");
case 437 :
/* US. */
puts("CodePage = IBM PC (US)");
break;
case 865 :
puts("CodePage = IBM PC (Denmark/Norway)");
break;
case 0x8000 :
puts("CodePage = Apple Macintosh");
......
......@@ -93,11 +93,15 @@ object_type_names[] =
"MS Drawing" /* 0x1E */
};
#if 0
/* HACK HACK HACK
* Use this temporarily to get a handle on nesting behaviour.
* Replace it with a thread safe state structure when we fill in the guts.
*/
/* MW: It ain't used. */
static int ms_chart_chart_depth = 0;
#endif
void
ms_obj_read_obj (BiffQuery *q, ExcelWorkbook * wb)
......
......@@ -690,10 +690,7 @@ descriptive_stat_tool (Workbook *wb, Sheet *current_sheet,
data_analysis_output_t *dao)
{
data_set_t *data_sets;
Sheet *sheet;
Cell *cell;
int vars, cols, rows, col, row, i;
int error;
int vars, cols, rows, i;
cols = input_range->end_col - input_range->start_col + 1;
rows = input_range->end_row - input_range->start_row + 1;
......
......@@ -16,8 +16,11 @@
static descriptive_stat_tool_t ds;
void dummy_fun (Workbook *wb, Sheet *sheet)
{}
static void
dummy_fun (Workbook *wb, Sheet *sheet)
{
/* Nothing. */
}
typedef void (*tool_fun_ptr_t)(Workbook *wb, Sheet *sheet);
......@@ -46,22 +49,26 @@ tool_list_t tools[] = {
{ { NULL, NULL }, NULL }
};
void summary_stat_signal_fun()
static void
summary_stat_signal_fun()
{
ds.summary_statistics = !ds.summary_statistics;
}
void confidence_signal_fun()
static void
confidence_signal_fun()
{
ds.confidence_level = !ds.confidence_level;
}
void kth_largest_signal_fun()
static void
kth_largest_signal_fun()
{
ds.kth_largest = !ds.kth_largest;
}
void kth_smallest_signal_fun()
static void
kth_smallest_signal_fun()
{
ds.kth_smallest = !ds.kth_smallest;
}
......@@ -134,7 +141,8 @@ add_check_buttons (GtkWidget *box, check_button_t *cbs)
}
}
void tool_dialog_range(Workbook *wb, Sheet *sheet, int ti)
static void
tool_dialog_range(Workbook *wb, Sheet *sheet, int ti)
{
static GtkWidget *dialog[8];
static GtkWidget *box, *hbox_x, *group_box;
......@@ -257,7 +265,7 @@ tool_dialog_loop:
}
void
static void
selection_made(GtkWidget *clist, gint row, gint column,
GdkEventButton *event, gpointer data)
{
......@@ -307,8 +315,6 @@ dialog_data_analysis (Workbook *wb, Sheet *sheet)
} else
gtk_widget_show (dialog);
main_dialog:
/* Run the dialog */
selection = gnome_dialog_run (GNOME_DIALOG (dialog));
gnome_dialog_close (GNOME_DIALOG (dialog));
......
......@@ -58,8 +58,7 @@ function_definition_update (SelectorState *selector_state)
FunctionCategory *cat;
GList *p;
GtkCList *cl;
FunctionDefinition *fd = NULL;
int i, max;
int i;
i = 0;
cl = selector_state->cl_funcs;
......
......@@ -16,8 +16,11 @@
static descriptive_stat_tool_t ds;
void dummy_fun (Workbook *wb, Sheet *sheet)
{}
static void
dummy_fun (Workbook *wb, Sheet *sheet)
{
/* Nothing. */
}
typedef void (*tool_fun_ptr_t)(Workbook *wb, Sheet *sheet);
......@@ -46,22 +49,26 @@ tool_list_t tools[] = {
{ { NULL, NULL }, NULL }
};
void summary_stat_signal_fun()
static void
summary_stat_signal_fun()
{
ds.summary_statistics = !ds.summary_statistics;
}
void confidence_signal_fun()
static void
confidence_signal_fun()
{
ds.confidence_level = !ds.confidence_level;
}
void kth_largest_signal_fun()
static void
kth_largest_signal_fun()
{
ds.kth_largest = !ds.kth_largest;
}
void kth_smallest_signal_fun()
static void
kth_smallest_signal_fun()
{
ds.kth_smallest = !ds.kth_smallest;
}
......@@ -134,7 +141,8 @@ add_check_buttons (GtkWidget *box, check_button_t *cbs)
}
}
void tool_dialog_range(Workbook *wb, Sheet *sheet, int ti)
static void
tool_dialog_range(Workbook *wb, Sheet *sheet, int ti)
{
static GtkWidget *dialog[8];
static GtkWidget *box, *hbox_x, *group_box;
......@@ -257,7 +265,7 @@ tool_dialog_loop:
}
void
static void
selection_made(GtkWidget *clist, gint row, gint column,
GdkEventButton *event, gpointer data)
{
......@@ -307,8 +315,6 @@ dialog_data_analysis (Workbook *wb, Sheet *sheet)
} else
gtk_widget_show (dialog);
main_dialog:
/* Run the dialog */
selection = gnome_dialog_run (GNOME_DIALOG (dialog));
gnome_dialog_close (GNOME_DIALOG (dialog));
......
......@@ -58,8 +58,7 @@ function_definition_update (SelectorState *selector_state)
FunctionCategory *cat;
GList *p;
GtkCList *cl;
FunctionDefinition *fd = NULL;
int i, max;
int i;
i = 0;
cl = selector_state->cl_funcs;
......
......@@ -121,32 +121,34 @@ style_font_new_simple (const char *font_name, double size, double scale, int bol
font = (StyleFont *) g_hash_table_lookup (style_font_hash, &key);
if (!font){
const GnomeDisplayFont *display_font;
GnomeFont *gnome_font;
if (g_hash_table_lookup (style_font_negative_hash, &key))
return NULL;
font = g_new0 (StyleFont, 1);
font->font_name = g_strdup (font_name);
font->size = size;
font->scale = scale;
font->is_bold = bold;
font->is_italic = italic;
display_font = gnome_get_display_font (
font->dfont = gnome_get_display_font (
font_name,
bold ? GNOME_FONT_BOLD : GNOME_FONT_BOOK,
italic,
size, scale);
if (!display_font)
if (!font->dfont) {
g_hash_table_insert (style_font_negative_hash,
font, font);
return NULL;
}
gnome_font = gnome_font_new_closest (
font->font = gnome_font_new_closest (
font_name,
bold ? GNOME_FONT_BOLD : GNOME_FONT_BOOK,
italic,
size);
font = g_new0 (StyleFont, 1);
font->font_name = g_strdup (font_name);
font->size = size;
font->scale = scale;
font->dfont = display_font;
font->font = gnome_font;
font->is_bold = bold;
font->is_italic = italic;
g_hash_table_insert (style_font_hash, font, font);
}
......
......@@ -246,7 +246,7 @@ xml_get_gnome_canvas_points (xmlNodePtr node, const char *name)
*/
static void
xml_set_gnome_canvas_points (xmlNodePtr node, const char *name,
GnomeCanvasPoints *val)
GnomeCanvasPoints *val)
{
xmlNodePtr child;
char *str, *base;
......@@ -256,13 +256,15 @@ xml_set_gnome_canvas_points (xmlNodePtr node, const char *name,
return;
if ((val->num_points < 0) || (val->num_points > 5000))
return;
base = str = g_malloc (val->num_points * 30 * sizeof (char));
base = str = g_malloc (val->num_points * 30 * sizeof (char) + 1);
if (str == NULL)
return;
for (i = 0; i < val->num_points; i++){
str += sprintf (str, "(%f %f)", val->coords[2 * i],
val->coords[2 * i + 1]);
sprintf (str, "(%f %f)", val->coords[2 * i],
val->coords[2 * i + 1]);
str += strlen (str);
}
*str = 0;
child = node->childs;
while (child != NULL){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment