Commit 2abd0f81 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa
Browse files

Accept underscores in identifiers.

1998-09-23  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/parser.y (yylex): Accept underscores in identifiers.

	* src/xml-io.c (readXmlCell): Set the content of the cell even if
	the file contains NULLS.

	* src/style.c (style_font_new): Better tolerance to missing fonts.

	* src/xml-io.c: Remove geometry setting: it has some bad side
	effects.

	* src/func.c (constants_init): Add a GNUMERIC_VERSION constant.
parent 06767dfa
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/parser.y (yylex): Accept underscores in identifiers.
* src/xml-io.c (readXmlCell): Set the content of the cell even if
the file contains NULLS.
* src/style.c (style_font_new): Better tolerance to missing fonts.
* src/xml-io.c: Remove geometry setting: it has some bad side
effects.
* src/func.c (constants_init): Add a GNUMERIC_VERSION constant.
Tue Sep 22 20:50:11 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* src/xml-io.c: set-up for compression of output. Should be tunable
......
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/parser.y (yylex): Accept underscores in identifiers.
* src/xml-io.c (readXmlCell): Set the content of the cell even if
the file contains NULLS.
* src/style.c (style_font_new): Better tolerance to missing fonts.
* src/xml-io.c: Remove geometry setting: it has some bad side
effects.
* src/func.c (constants_init): Add a GNUMERIC_VERSION constant.
Tue Sep 22 20:50:11 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* src/xml-io.c: set-up for compression of output. Should be tunable
......
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/parser.y (yylex): Accept underscores in identifiers.
* src/xml-io.c (readXmlCell): Set the content of the cell even if
the file contains NULLS.
* src/style.c (style_font_new): Better tolerance to missing fonts.
* src/xml-io.c: Remove geometry setting: it has some bad side
effects.
* src/func.c (constants_init): Add a GNUMERIC_VERSION constant.
Tue Sep 22 20:50:11 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* src/xml-io.c: set-up for compression of output. Should be tunable
......
1998-09-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/parser.y (yylex): Accept underscores in identifiers.
* src/xml-io.c (readXmlCell): Set the content of the cell even if
the file contains NULLS.
* src/style.c (style_font_new): Better tolerance to missing fonts.
* src/xml-io.c: Remove geometry setting: it has some bad side
effects.
* src/func.c (constants_init): Add a GNUMERIC_VERSION constant.
Tue Sep 22 20:50:11 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* src/xml-io.c: set-up for compression of output. Should be tunable
......
......@@ -6,6 +6,7 @@ bin_PROGRAMS = gnumeric
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DGNUMERIC_VERSION=\""$(VERSION)"\" \
-I$(includedir) \
$(GNOME_INCLUDEDIR)
......
......@@ -10,6 +10,11 @@
#include "gnumeric.h"
#include "dialogs.h"
/*
* We need to get rid of that so that we will be able
* to list everybody. Somethign like guname would be
* nice
*/
void
dialog_about (void)
{
......@@ -20,6 +25,7 @@ dialog_about (void)
"Chris Lahey, Number format engine.",
"Tom Dyas, Plugin support.",
"Federico Mena, Canvas support.",
"Adrian Likins, Documentation, debugging",
NULL
};
......
......@@ -10,6 +10,11 @@
#include "gnumeric.h"
#include "dialogs.h"
/*
* We need to get rid of that so that we will be able
* to list everybody. Somethign like guname would be
* nice
*/
void
dialog_about (void)
{
......@@ -20,6 +25,7 @@ dialog_about (void)
"Chris Lahey, Number format engine.",
"Tom Dyas, Plugin support.",
"Federico Mena, Canvas support.",
"Adrian Likins, Documentation, debugging",
NULL
};
......
......@@ -32,7 +32,11 @@ iterate_cellrange_callback (Sheet *sheet, int col, int row, Cell *cell, void *us
int cont;
if (!cell->value){
printf ("iterate_cellrange_callback: Cell has no value\n");
/*
* FIXME: If this is a formula, is it worth recursing on
* this one? IFF !(cell->flags & CELL_ERROR) &&
* cell->generation != cell->sheet->workbook->generation?
*/
return TRUE;
}
......@@ -155,7 +159,7 @@ functions_init (void)
void
constants_init (void)
{
Value *true, *false;
Value *true, *false, *version;
/* FALSE */
false = g_new (Value, 1);
......@@ -167,6 +171,12 @@ constants_init (void)
true->type = VALUE_INTEGER;
true->v.v_int = 1;
/* GNUMERIC_VERSION */
version = g_new (Value, 1);
version->type = VALUE_FLOAT;
version->v.v_float = atof (GNUMERIC_VERSION);
symbol_install ("FALSE", SYMBOL_VALUE, false);
symbol_install ("TRUE", SYMBOL_VALUE, true);
symbol_install ("GNUMERIC_VERSION", SYMBOL_VALUE, version);
}
......@@ -448,12 +448,12 @@ int yylex (void)
}
}
if (isalpha (c) || c == '$'){
if (isalpha (c) || c == '_' || c == '$'){
char *start = parser_expr - 1;
char *str;
int len;
while (isalnum (*parser_expr) || *parser_expr == '$')
while (isalnum (*parser_expr) || *parser_expr == '_' || *parser_expr == '$')
parser_expr++;
len = parser_expr - start;
......
......@@ -11,6 +11,9 @@
#include "format.h"
#include "color.h"
#define DEFAULT_FONT "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*"
#define DEFAULT_SIZE 14
static GHashTable *style_format_hash;
static GHashTable *style_font_hash;
static GHashTable *style_border_hash;
......@@ -74,11 +77,33 @@ style_font_new (char *font_name, int units)
font = (StyleFont *) g_hash_table_lookup (style_font_hash, &key);
if (!font){
font = g_new0 (StyleFont, 1);
font->font_name = g_strdup (font_name);
font->units = units;
font->font = gdk_font_load (font_name);
g_hash_table_insert (style_font_hash, font, font);
GdkFont *gdk_font;
gdk_font = gdk_font_load (font_name);
if (gdk_font){
font = g_new0 (StyleFont, 1);
font->font_name = g_strdup (font_name);
font->units = units;
font->font = gdk_font_load (font_name);
g_hash_table_insert (style_font_hash, font, font);
} else {
/*
* If we cant use the specified font, try:
* - Loading the default font instead
* - Loading fixed font
*/
if (!strcmp (font_name, "fixed"))
g_error ("Can not load fixed font\n");
if (!strcmp (font_name, DEFAULT_FONT))
font_name = "fixed";
else
font_name = DEFAULT_FONT;
return style_font_new (font_name, DEFAULT_SIZE);
}
}
font->ref_count++;
......@@ -231,7 +256,7 @@ style_new (void)
style->valid_flags = STYLE_ALL;
style->format = style_format_new ("General");
style->font = style_font_new ("-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*", 14);
style->font = style_font_new (DEFAULT_FONT, DEFAULT_SIZE);
style->border = style_border_new_plain ();
style->fore_color = style_color_new (0, 0, 0);
style->back_color = style_color_new (0xffff, 0xffff, 0xffff);
......
......@@ -1187,7 +1187,8 @@ static Cell *readXmlCell(parseXmlContextPtr ctxt, xmlNodePtr tree) {
cell_set_text(ret, v);
g_free (v);
}
} else
cell_set_text (ret, "");
return(ret);
}
......@@ -1443,7 +1444,7 @@ static Workbook *readXmlWorkbook(parseXmlContextPtr ctxt, xmlNodePtr tree) {
xmlGetIntValue(child, "Width", &width);
xmlGetIntValue(child, "Height", &height);
gtk_widget_set_usize(ret->toplevel, width, height);
/* gtk_widget_set_usize(ret->toplevel, width, height); */
}
child = xmlSearchChild(tree, "Style");
......
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