(x_build_heuristic_mask): Use x_alloc_image_color.
authorGerd Moellmann <gerd@gnu.org>
Sun, 28 Oct 2001 20:57:00 +0000 (20:57 +0000)
committerGerd Moellmann <gerd@gnu.org>
Sun, 28 Oct 2001 20:57:00 +0000 (20:57 +0000)
src/ChangeLog
src/xfns.c

index ef7fdb2..f7273b4 100644 (file)
@@ -5,6 +5,8 @@
 
 2001-10-28  Gerd Moellmann  <gerd@gnu.org>
 
+       * xfns.c (x_build_heuristic_mask): Use x_alloc_image_color.
+       
        * xfns.c (x_build_heuristic_mask): Fix a bug not incrementing
        a loop counter.
 
index fb71e47..96ddd1f 100644 (file)
@@ -8196,17 +8196,9 @@ x_build_heuristic_mask (f, img, how)
       if (i == 3 && NILP (how))
        {
          char color_name[30];
-         XColor exact, color;
-         Colormap cmap;
-
          sprintf (color_name, "#%04x%04x%04x", rgb[0], rgb[1], rgb[2]);
-         
-         cmap = FRAME_X_COLORMAP (f);
-         if (XLookupColor (dpy, cmap, color_name, &exact, &color))
-           {
-             bg = color.pixel;
-             use_img_background = 0;
-           }
+         bg = x_alloc_image_color (f, img, build_string (color_name), 0);
+         use_img_background = 0;
        }
     }