Commit 7989736e authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

Extend the addressbook to handle both A1 and R1C1 style addresses. [#650941]

2011-05-26  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* src/parse-util.h (gnm_conventions_dup): new
	* src/parse-util.c (gnm_conventions_dup): new
	* src/workbook-control.c (wb_control_parse_and_jump): accept both
	  both A1 and R1C1 style addresses.
parent 1f1ab9a1
2011-05-26 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/parse-util.h (gnm_conventions_dup): new
* src/parse-util.c (gnm_conventions_dup): new
* src/workbook-control.c (wb_control_parse_and_jump): accept both
both A1 and R1C1 style addresses.
2011-05-26 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/workbook-control.h (wb_control_jump): new
......
......@@ -4,6 +4,8 @@ Andreas
* Store some print range information in gnumeric files. [#649714]
* Hide Prefer CLIPBOARD preference under MS Windows. [#649675]
* Extend the goto dialog.
* Extend the addressbook to handle both A1 and R1C1 style addresses.
[#650941]
Morten:
* Fix leaks in SHEET. [#650761]
......
......@@ -1399,6 +1399,13 @@ gnm_conventions_new (void)
return gnm_conventions_new_full (sizeof (GnmConventions));
}
GnmConventions *
gnm_conventions_dup (GnmConventions const *c)
{
GnmConventions *conv = g_memdup (c, sizeof (GnmConventions));
conv->ref_count = 1;
}
/**
* gnm_conventions_unref :
* @c : #GnmConventions
......
......@@ -200,6 +200,7 @@ struct _GnmConventions {
};
GnmConventions *gnm_conventions_new (void);
GnmConventions *gnm_conventions_new_full (unsigned size);
GnmConventions *gnm_conventions_dup (GnmConventions const*c);
GnmConventions *gnm_conventions_ref (GnmConventions *c);
void gnm_conventions_unref (GnmConventions *c);
......
......@@ -280,6 +280,22 @@ wb_control_parse_and_jump (WorkbookControl *wbc, char const *text)
parse_pos_init_editpos (&pp, sv);
target = value_new_cellrange_parsepos_str (&pp, text,
GNM_EXPR_PARSE_DEFAULT);
if (target == NULL) {
GnmExprTop const *texpr;
GnmConventions *convs = gnm_conventions_dup
(sheet_get_conventions(sv->sheet));
convs->r1c1_addresses = !convs->r1c1_addresses;
texpr = gnm_expr_parse_str
(text, &pp, GNM_EXPR_PARSE_DEFAULT, convs, NULL);
if (texpr != NULL) {
target = gnm_expr_top_get_range (texpr);
gnm_expr_top_unref (texpr);
}
gnm_conventions_unref (convs);
}
if (target == NULL) {
/* Not an address; is it a name? */
GnmParsePos pp;
......
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