After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647324 - Color format tags fail in some locales
Color format tags fail in some locales
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
0.8.x
Other Windows
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2011-04-09 22:52 UTC by Urmas
Modified: 2011-04-09 23:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
suggested patch (405 bytes, patch)
2011-04-09 23:12 UTC, Andreas J. Guelzow
none Details | Review

Description Urmas 2011-04-09 22:52:35 UTC
In some locales, in particular 'ru', the color tags generated for number formats(analog of [Red]) are not recognized.
Comment 1 Andreas J. Guelzow 2011-04-09 22:56:23 UTC
reassigning to goffice
Comment 2 Andreas J. Guelzow 2011-04-09 22:59:25 UTC
Note that in go_format_token2 there are 2 possibilities to get a color_token:

	case '[':
		switch (str[1]) {
		case 's': case 'S':
		case 'm': case 'M':
		case 'h': case 'H': {
			char c = g_ascii_toupper (str[1]);
			len++;
			while (g_ascii_toupper (str[len]) == c)
				len++;
			if (str[len] == ']') {
				t = (c == 'S'
				     ? TOK_ELAPSED_S
				     : (c == 'M'
					? TOK_ELAPSED_M
					: TOK_ELAPSED_H));
				tt = TT_ALLOWED_IN_DATE | TT_STARTS_DATE;
			} else
				t = TOK_COLOR;
			break;
		}
(...)
		default:
			if (g_ascii_isalpha (str[1]))
				t = TOK_COLOR;
			else
				goto error;
			break;
		}

In either case the first letter of the colour name needs to return true for g_ascii_isalpha. Clearly that's not true for all translated names.
Comment 3 Andreas J. Guelzow 2011-04-09 23:12:07 UTC
Created attachment 185621 [details] [review]
suggested patch

We will be checking for supported colour names later anyways. So at this time we should assume that we are seeing a colour name.
Comment 4 Morten Welinder 2011-04-09 23:29:54 UTC
Patch passes all samples/formats.xls tests.

Go ahead.
Comment 5 Andreas J. Guelzow 2011-04-09 23:53:18 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.