1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
diff -urN evolution-data-server-2.28.3.1/libedataserver/e-source.c evolution-data-server-2.28.3.1-patch/libedataserver/e-source.c
--- evolution-data-server-2.28.3.1/libedataserver/e-source.c 2009-08-07 16:20:30.000000000 +0300
+++ evolution-data-server-2.28.3.1-patch/libedataserver/e-source.c 2010-03-03 03:17:43.901896131 +0200
@@ -690,7 +690,7 @@
guint32 *color_return)
{
const gchar *color_spec;
- guint32 color;
+ guint32 color, color0, color1;
g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
@@ -699,9 +699,23 @@
if (color_spec == NULL)
return FALSE;
+ /* check for 2 bytes per color */
+ if (strlen(color_spec) == 13 &&
+ sscanf (color_spec, "#%04x%08x", &color0, &color1) != 1) {
+ /* Just toss out the least significant parts,
+ * should be close enough */
+ color = (color0 >> 8 & 0xff);
+ color <<= 8;
+ color |= (color1 >> 24 & 0xff);
+ color <<= 8;
+ color |= (color1 >> 8 & 0xff);
+ goto done;
+ }
+
if (sscanf (color_spec, "#%06x", &color) != 1)
return FALSE;
+done:
if (color_return != NULL)
*color_return = color;
|