Commit b519fbd3 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Take units in pixels or points. (sheet_{col,row}_set_default_size_pixels)


2000-07-09  Jody Goldberg <jgoldberg@home.com>

	* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
	  points.
	(sheet_{col,row}_set_default_size_pixels) : new functions.  This
	  interface sucks.  Clean it up.

	* src/parser.y : Optionally insert a place holder when an
	  unknown function is found.

	* src/func.c (function_add_placeholder) : New function, moved from the
	  XL import code.

	* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
	  change.
	* src/workbook.c (workbook_set_auto_expr) : Ditto.

	* src/application.c (application_dpi_to_pixels) : New function.
	* src/item-bar.c (item_bar_fonts_init) : Use it here.
	* src/sheet-view.c (sheet_view_get_style_font) : And here.
	* src/style.c (font_init) : and here.

2000-07-08  Jody Goldberg <jgoldberg@home.com>

	* src/parse-util.c (cellref_r1c1_get) : Make stricter.
	(r1c1_get_item) : Ditto.

2000-07-08  Jody Goldberg <jgoldberg@home.com>

	* plugins/Makefile.am (SUBDIRS) : Enable applix.

2000-07-08  Jody Goldberg <jgoldberg@home.com>

	* src/parse-util.c (col_from_name) : Add optional arg to indicate
	  where parsing stoped.  Similar to strtod.

2000-07-07  Jody Goldberg <jgoldberg@home.com>

	* src/xml-io.c (xml_write_style_border) : Trivial optimization.  No
	  need to save colour for STYLE_BORDER_NONE.
	(xml_read_style_border) : Ditto.
parent ecf30b65
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
2000-07-09 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_col_row_default_init) : Take units in pixels or
points.
(sheet_{col,row}_set_default_size_pixels) : new functions. This
interface sucks. Clean it up.
* src/parser.y : Optionally insert a place holder when an
unknown function is found.
* src/func.c (function_add_placeholder) : New function, moved from the
XL import code.
* src/expr.c (expr_parse_string) : gnumeric_expr_parser signature
change.
* src/workbook.c (workbook_set_auto_expr) : Ditto.
* src/application.c (application_dpi_to_pixels) : New function.
* src/item-bar.c (item_bar_fonts_init) : Use it here.
* src/sheet-view.c (sheet_view_get_style_font) : And here.
* src/style.c (font_init) : and here.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (cellref_r1c1_get) : Make stricter.
(r1c1_get_item) : Ditto.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Enable applix.
2000-07-08 Jody Goldberg <jgoldberg@home.com>
* src/parse-util.c (col_from_name) : Add optional arg to indicate
where parsing stoped. Similar to strtod.
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* src/xml-io.c (xml_write_style_border) : Trivial optimization. No
need to save colour for STYLE_BORDER_NONE.
(xml_read_style_border) : Ditto.
2000-07-08 Morten Welinder <terra@diku.dk>
* src/sheet.c (sheet_cell_foreach_range): Change traversal order
......
......@@ -27,16 +27,16 @@ Requirements
You need:
gnome-libs-1.0.57
gnome-print-0.20
gnome-xml-1.8.7 (gnome-xml 2.x not supported yet)
libglade-0.13
libole2-0.1.4
glib-1.2.7
gtk+-1.2.7
gnome-libs >= 1.0.57 (gnome-libs 2.0 is not supported)
gnome-print == 0.20
gnome-xml == 1.8.7 (gnome-xml 2.x not supported yet)
libglade == 0.13
libole2 == 0.1.6
glib >= 1.2.7 (glib-libs 1.3 is not supported)
gtk+ >= 1.2.7 (gnome-libs 1.3 is not supported)
Optionally:
bonobo-0.14
bonobo == 0.16 (Still in CVS)
Notes regarding plugins
-----------------------
......
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* xml2.c (xml2ParseStyleRegionBorders) : Make border color is optional
for style STYLE_BORDER_NONE.
/* vim: set sw=8:
* $Id$
*/
/* vim: set sw=8: */
/*
* xml2.c : a test harness for the sax based xml parse routines.
......@@ -718,6 +716,7 @@ xml2ParseStyleRegionBorders (XML2ParseState *state, CHAR const **attrs)
g_return_if_fail (state->style != NULL);
/* Colour is optional */
for (; attrs[0] && attrs[1] ; attrs += 2) {
if (xml2ParseAttrColour (attrs, "Color", &colour)) ;
else if (xml2ParseAttrInt (attrs, "Style", &pattern)) ;
......@@ -725,13 +724,12 @@ xml2ParseStyleRegionBorders (XML2ParseState *state, CHAR const **attrs)
xml2UnknownAttr (state, attrs, "StyleBorder");
}
if (colour != NULL && pattern >= 0) {
if (pattern >= STYLE_BORDER_NONE) {
MStyleElementType const type = MSTYLE_BORDER_TOP +
state->state - STATE_BORDER_TOP;
MStyleBorder *border =
style_border_fetch ((StyleBorderType)pattern, colour,
style_border_get_orientation (type));
if (border)
mstyle_set_border (state->style, type, border);
}
}
......
2000-07-07 Jody Goldberg <jgoldberg@home.com>
* xml2.c (xml2ParseStyleRegionBorders) : Make border color is optional
for style STYLE_BORDER_NONE.
/* vim: set sw=8:
* $Id$
*/
/* vim: set sw=8: */
/*
* xml2.c : a test harness for the sax based xml parse routines.
......@@ -718,6 +716,7 @@ xml2ParseStyleRegionBorders (XML2ParseState *state, CHAR const **attrs)
g_return_if_fail (state->style != NULL);
/* Colour is optional */
for (; attrs[0] && attrs[1] ; attrs += 2) {
if (xml2ParseAttrColour (attrs, "Color", &colour)) ;
else if (xml2ParseAttrInt (attrs, "Style", &pattern)) ;
......@@ -725,13 +724,12 @@ xml2ParseStyleRegionBorders (XML2ParseState *state, CHAR const **attrs)
xml2UnknownAttr (state, attrs, "StyleBorder");
}
if (colour != NULL && pattern >= 0) {
if (pattern >= STYLE_BORDER_NONE) {
MStyleElementType const type = MSTYLE_BORDER_TOP +
state->state - STATE_BORDER_TOP;
MStyleBorder *border =
style_border_fetch ((StyleBorderType)pattern, colour,
style_border_get_orientation (type));
if (border)
mstyle_set_border (state->style, type, border);
}
}
......
......@@ -253,7 +253,7 @@ application_workbook_get_by_index (int i)
return close.wb;
}
float
inline float
application_display_dpi_get (gboolean const horizontal)
{
return horizontal ? app.horizontal_dpi : app.vertical_dpi;
......@@ -268,6 +268,13 @@ application_display_dpi_set (gboolean const horizontal, float const val)
app.vertical_dpi = val;
}
float
application_dpi_to_pixels ()
{
return MIN (application_display_dpi_get (FALSE),
application_display_dpi_get (TRUE)) / 72.;
}
/**
* application_history_get_list:
*
......
......@@ -26,6 +26,7 @@ void application_history_write_config (void);
float application_display_dpi_get (gboolean const horizontal);
void application_display_dpi_set (gboolean const horizontal, float const);
float application_dpi_to_pixels ();
gboolean application_use_auto_complete_get (void);
void application_use_auto_complete_set (gboolean use_auto_complete);
......
......@@ -333,7 +333,7 @@ dialog_cell_sort_ok (SortFlow *sf)
if (sf->header) {
division = divstart + string_pos_in_list(txt, sf->colnames_header);
} else {
division = col_from_name(txt);
division = parse_col_name (txt, NULL);
}
} else {
if (sf->header) {
......
......@@ -189,7 +189,7 @@ expr_parse_string (char const *expr, ParsePos const *pp,
ExprTree *tree;
g_return_val_if_fail (expr != NULL, NULL);
switch (gnumeric_expr_parser (expr, pp, TRUE, desired_format, &tree)) {
switch (gnumeric_expr_parser (expr, pp, TRUE, FALSE, desired_format, &tree)) {
case PARSE_OK:
*error_msg = NULL;
return tree;
......
......@@ -244,6 +244,47 @@ function_add_nodes (FunctionCategory *category,
return fndef;
}
/* Handle unknown functions on import without losing their names */
static Value *
unknownFunctionHandler (FunctionEvalInfo *ei, GList *expr_node_list)
{
return value_new_error (ei->pos, gnumeric_err_NAME);
}
/*
* When importing it is useful to keep track of unknown function names.
* We may be missing a plugin or something similar.
*
* TODO : Eventully we should be able to keep track of these
* and replace them with something else. Possibly even reordering the
* arguments.
*/
FunctionDefinition *
function_add_placeholder (char const *name, char const *type)
{
FunctionCategory *cat;
FunctionDefinition *func = func_lookup_by_name (name, NULL);
g_return_val_if_fail (func == NULL, func);
cat = function_get_category (_("Unknown Function"));
/*
* TODO TODO TODO : should add a
* function_add_{nodes,args}_fake
* This will allow a user to load a missing
* plugin to supply missing functions.
*/
func = function_add_nodes (cat, g_strdup (name),
"", "...", NULL,
&unknownFunctionHandler);
/* WISHLIST : it would be nice to have a log if these. */
g_warning ("Unknown %sfunction : %s", type, name);
return func;
}
gpointer
function_def_get_user_data (const FunctionDefinition *fndef)
{
......
......@@ -93,6 +93,7 @@ FunctionDefinition *function_add_nodes (FunctionCategory *parent,
char const *arg_names,
char **help,
FunctionNodes *fn);
FunctionDefinition *function_add_placeholder (char const *name, char const *type);
gpointer function_def_get_user_data (const FunctionDefinition *fndef);
void function_def_set_user_data (FunctionDefinition *fndef,
......
......@@ -88,8 +88,7 @@ item_bar_fonts_init (ItemBar *item_bar)
{
double const zoom_factor =
item_bar->sheet_view->sheet->last_zoom_factor_used;
double const res = MIN(application_display_dpi_get (FALSE),
application_display_dpi_get (TRUE)) / 72.;
double const res = application_dpi_to_pixels ();
StyleFont * const normal_font =
style_font_new_simple (DEFAULT_FONT, DEFAULT_SIZE,
res*zoom_factor, FALSE, FALSE);
......
......@@ -147,10 +147,13 @@ cellref_a1_get (CellRef *out, const char *in, CellPos const *pos)
}
static gboolean
r1c1_get_item (int *num, unsigned char *rel, const char * *const in)
r1c1_get_item (int *num, unsigned char *rel, char const * *in)
{
gboolean neg = FALSE;
if (**in == '\0')
return FALSE;
if (**in == '[') {
(*in)++;
*rel = TRUE;
......@@ -192,21 +195,19 @@ cellref_r1c1_get (CellRef *out, const char *in, CellPos const *pos)
out->row = pos->row;
out->sheet = NULL;
if (!*in)
return FALSE;
while (*in) {
if (*in == 'R') {
in++;
if (!r1c1_get_item (&out->row, &out->row_relative, &in))
return FALSE;
} else if (*in == 'C') {
} else
return FALSE;
if (*in == 'C') {
in++;
if (!r1c1_get_item (&out->col, &out->col_relative, &in))
return FALSE;
} else
return FALSE;
}
out->col--;
out->row--;
......@@ -305,21 +306,31 @@ col_name (int col)
* Converts a column name into an integer
**/
int
col_from_name (const char *cell_str)
parse_col_name (const char *cell_str, const char **endptr)
{
char c;
int col = 0;
if (endptr)
*endptr = cell_str;
c = toupper ((unsigned char)*cell_str++);
if (c < 'A' || c > 'Z')
return FALSE;
return 0;
col = c - 'A';
c = toupper ((unsigned char)*cell_str);
if (c >= 'A' && c <= 'Z')
if (c >= 'A' && c <= 'Z') {
col = ((col + 1) * ('Z' - 'A' + 1)) + (c - 'A');
cell_str++;
}
if (col >= SHEET_MAX_COLS)
return FALSE;
else
return 0;
if (endptr)
*endptr = cell_str;
return col;
}
......
......@@ -7,7 +7,6 @@
* Names
*/
const char *col_name (int col);
int col_from_name (const char *cell_str);
char *cellref_name (CellRef const *cell_ref,
ParsePos const *pp, gboolean no_sheetname);
......@@ -23,6 +22,7 @@ const char *cell_pos_name (CellPos const *pos);
const char *cell_name (Cell const *cell);
/* Various parsing routines */
int parse_col_name (const char *cell_str, const char **endptr);
gboolean parse_cell_name (const char *cell_str, int *col, int *row,
gboolean strict, int *chars_read);
gboolean parse_cell_name_or_range (const char *cell_str, int *col, int *row,
......@@ -49,6 +49,7 @@ typedef enum {
ParseErr gnumeric_expr_parser (const char *expr,
const ParsePos *pp,
gboolean use_excel_range_conventions,
gboolean create_place_holder_for_unknown_func,
StyleFormat **desired_format,
ExprTree **result);
......
......@@ -205,6 +205,7 @@ static char parser_decimal_point;
static char parser_separator;
static char parser_array_col_separator;
static gboolean parser_use_excel_reference_conventions;
static gboolean parser_create_place_holder_for_unknown_func;
static ExprTree **parser_result;
......@@ -379,20 +380,24 @@ exp: CONSTANT { $$ = $1; }
}
| STRING '(' arg_list ')' {
FunctionDefinition *func = func_lookup_by_name (
$1->constant.value->v_str.val->str,
char *name = $1->constant.value->v_str.val->str;
FunctionDefinition *f = func_lookup_by_name (name,
parser_pos->wb);
/* THINK TODO : Do we want to make this workbook local ?? */
if (f == NULL && parser_create_place_holder_for_unknown_func)
f = function_add_placeholder (name, "");
unregister_allocation ($3);
unregister_allocation ($1); expr_tree_unref ($1);
if (func == NULL) {
if (f == NULL) {
/* TODO : Get rid of ParseErr and replace it with something richer. */
parser_error = PARSE_ERR_SYNTAX;
return ERROR;
}
$$ = register_expr_allocation (expr_tree_new_funcall (func, $3));
$$ = register_expr_allocation (expr_tree_new_funcall (f, $3));
}
| sheetref string_opt_quote {
NamedExpression *expr_name;
......@@ -758,6 +763,7 @@ yyerror (char *s)
ParseErr
gnumeric_expr_parser (const char *expr, const ParsePos *pp,
gboolean use_excel_range_conventions,
gboolean create_place_holder_for_unknown_func,
StyleFormat **desired_format, ExprTree **result)
{
struct lconv *locinfo;
......@@ -776,6 +782,7 @@ gnumeric_expr_parser (const char *expr, const ParsePos *pp,
*parser_desired_format = NULL;
parser_use_excel_reference_conventions = use_excel_range_conventions;
parser_create_place_holder_for_unknown_func = create_place_holder_for_unknown_func;
locinfo = localeconv ();
if (locinfo->decimal_point && locinfo->decimal_point[0] &&
......
......@@ -952,10 +952,8 @@ sheet_view_get_style_font (const Sheet *sheet, MStyle const * const mstyle)
/* Scale the font size by the average scaling factor for the
* display. 72dpi is base size
*/
double const zoom = sheet->last_zoom_factor_used;
double const res = MIN(application_display_dpi_get (FALSE),
application_display_dpi_get (TRUE)) / 72.;
double const res = application_dpi_to_pixels ();
return mstyle_get_font (mstyle, zoom * res);
}
......
......@@ -952,10 +952,8 @@ sheet_view_get_style_font (const Sheet *sheet, MStyle const * const mstyle)
/* Scale the font size by the average scaling factor for the
* display. 72dpi is base size
*/
double const zoom = sheet->last_zoom_factor_used;
double const res = MIN(application_display_dpi_get (FALSE),
application_display_dpi_get (TRUE)) / 72.;
double const res = application_dpi_to_pixels ();
return mstyle_get_font (mstyle, zoom * res);
}
......
......@@ -3270,8 +3270,8 @@ sheet_move_range (CommandContext *context,
}
static void
col_row_info_init (Sheet *sheet, double pts, int margin_a, int margin_b,
gboolean is_horizontal)
sheet_col_row_default_init (Sheet *sheet, double units, int margin_a, int margin_b,
gboolean is_horizontal, gboolean is_pts)
{
ColRowInfo *cri = is_horizontal
? &sheet->cols.default_style
......@@ -3283,8 +3283,13 @@ col_row_info_init (Sheet *sheet, double pts, int margin_a, int margin_b,
cri->hard_size = FALSE;
cri->visible = TRUE;
cri->spans = NULL;
cri->size_pts = pts;
if (is_pts) {
cri->size_pts = units;
colrow_compute_pixels_from_pts (sheet, cri, is_horizontal);
} else {
cri->size_pixels = units;
colrow_compute_pts_from_pixels (sheet, cri, is_horizontal);
}
}
/************************************************************************/
......@@ -3434,7 +3439,12 @@ sheet_col_get_default_size_pts (Sheet const *sheet)
void
sheet_col_set_default_size_pts (Sheet *sheet, double width_pts)
{
col_row_info_init (sheet, width_pts, 2, 2, TRUE);
sheet_col_row_default_init (sheet, width_pts, 2, 2, TRUE, TRUE);
}
void
sheet_col_set_default_size_pixels (Sheet *sheet, int width_pixels)
{
sheet_col_row_default_init (sheet, width_pixels, 2, 2, TRUE, FALSE);
}