Commit 5d6a46aa authored by JodyGoldberg's avatar JodyGoldberg Committed by Jody Goldberg
Browse files

remove the i18n flags for string lists as far as I can tell they were


2005-11-02  Jody Goldberg <jody@gnome.org>

	* src/sheet-autofill.c : remove the i18n flags for string lists as far
	  as I can tell they were always true.
	(type_is_compatible) : an item might be in
	  multiple lists.  Check that the current item is in the previous list
	  or that the previous item is in the current list.
parent bf1feed3
2005-11-02 Jody Goldberg <jody@gnome.org>
* src/sheet-autofill.c : remove the i18n flags for string lists as far
as I can tell they were always true.
(type_is_compatible) : an item might be in
multiple lists. Check that the current item is in the previous list
or that the previous item is in the current list.
2005-10-25 Jody Goldberg <jody@gnome.org>
* src/sheet-filter.c (collect_unique_elements) : yes that is the type
of equality and hash we want. Remove the warning.
2005-11-01 Morten Welinder <terra@gnome.org>
* src/main-application.c: Move include of popt stuff here. It has
......
2005-11-02 Jody Goldberg <jody@gnome.org>
* src/sheet-autofill.c : remove the i18n flags for string lists as far
as I can tell they were always true.
(type_is_compatible) : an item might be in
multiple lists. Check that the current item is in the previous list
or that the previous item is in the current list.
2005-10-25 Jody Goldberg <jody@gnome.org>
* src/sheet-filter.c (collect_unique_elements) : yes that is the type
of equality and hash we want. Remove the warning.
2005-11-01 Morten Welinder <terra@gnome.org>
* src/main-application.c: Move include of popt stuff here. It has
......
......@@ -113,7 +113,6 @@ typedef struct _FillItem {
struct {
AutoFillList const *list;
int num;
int was_i18n;
} list;
struct {
GnmString *str;
......@@ -152,7 +151,7 @@ autofill_register_list (char const *const *list)
}
static gboolean
in_list (AutoFillList const *afl, char const *s, int *n, int *is_i18n)
in_list (AutoFillList const *afl, char const *s, int *n)
{
int i;
......@@ -162,7 +161,6 @@ in_list (AutoFillList const *afl, char const *s, int *n, int *is_i18n)
if (*translated_text == '*')
translated_text++;
if (g_ascii_strcasecmp (translated_text, s) == 0) {
*is_i18n = TRUE;
*n = i;
return TRUE;
}
......@@ -172,12 +170,12 @@ in_list (AutoFillList const *afl, char const *s, int *n, int *is_i18n)
}
static AutoFillList const *
matches_list (char const *s, int *n, int *is_i18n)
matches_list (char const *s, int *n)
{
GList *l;
for (l = autofill_lists; l != NULL; l = l->next) {
AutoFillList const *afl = l->data;
if (in_list (afl, s, n, is_i18n))
if (in_list (afl, s, n))
return afl;
}
return NULL;
......@@ -316,14 +314,13 @@ fill_item_new (Sheet *sheet, int col, int row)
if (value_type == VALUE_STRING) {
AutoFillList const *list;
int num, pos, endpos, i18;
int num, pos, endpos;
list = matches_list (value->v_str.val->str, &num, &i18);
list = matches_list (value->v_str.val->str, &num);
if (list) {
fi->type = FILL_STRING_LIST;
fi->v.list.list = list;
fi->v.list.num = num;
fi->v.list.was_i18n = i18;
return fi;
}
......@@ -472,24 +469,35 @@ type_is_compatible (FillItem *last, FillItem *current)
return FALSE;
if (last->type == FILL_STRING_LIST) {
/* It is possible the item is in multiple lists. If things
* disagree see if we are in the previous list, and convert
* eg May
*/
if (last->v.list.list != current->v.list.list) {
int num, is_i18n;
if (in_list (last->v.list.list,
current->v.list.list->items [current->v.list.num],
&num, &is_i18n)) {
current->v.list.list = last->v.list.list;
current->v.list.num = num;
current->v.list.was_i18n = is_i18n;
} else
return FALSE;
int num;
char const *str;
if (last->v.list.list == current->v.list.list)
return TRUE;
/* This item may be in multiple lists. Is it in the
* same list as the previous element ? */
str = current->v.list.list->items [current->v.list.num];
if (*str == '*')
str++;
if (in_list (last->v.list.list, str, &num)) {
current->v.list.list = last->v.list.list;
current->v.list.num = num;
return TRUE;
}
if (last->v.list.was_i18n != current->v.list.was_i18n)
return FALSE;
/* The previous element may be in multple lists. Is it
* in the current list ? */
str = last->v.list.list->items [last->v.list.num];
if (*str == '*')
str++;
if (in_list (current->v.list.list, str, &num)) {
last->v.list.list = current->v.list.list;
last->v.list.num = num;
return TRUE;
}
return FALSE;
}
return TRUE;
......@@ -709,11 +717,8 @@ autofill_cell (FillItem *fi, GnmCell *cell, int idx, int limit_x, int limit_y)
if (n < 0)
n += delta->v.list.list->count;
text = delta->v.list.list->items [n];
#warning we need to retrieve translations from goffice domain. This should be moved to goffice for 1.7
if (delta->v.list.was_i18n)
text = dgettext ("goffice", text);
text = dgettext ("goffice",
delta->v.list.list->items [n]);
if (*text == '*')
text++;
......
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