From c3a2438fac60a690a7fc2db8e158e891f9875c2c Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 25 Mar 2013 21:29:48 +0000 Subject: [PATCH] Use wGetColorForColormap() when allocating border pixel. Cut down on code duplication by using the new wGetColorForColormap() function in allocFrameBorderPixel(). --- src/framewin.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/framewin.c b/src/framewin.c index 67cda92e..8413c2ab 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -34,6 +34,7 @@ #include "WindowMaker.h" #include "GNUstep.h" #include "texture.h" +#include "resources.h" #include "screen.h" #include "wcore.h" #include "framewin.h" @@ -65,14 +66,8 @@ static void allocFrameBorderPixel(Colormap colormap, char *color_name, unsigned *pixel = NULL; - if (!XParseColor(dpy, colormap, color_name, &xcol)) { - wwarning(_("could not parse color \"%s\""), color_name); + if (! wGetColorForColormap(colormap, color_name, &xcol)) return; - } - if (!XAllocColor(dpy, colormap, &xcol)) { - wwarning(_("could not allocate color \"%s\""), color_name); - return; - } *pixel = wmalloc(sizeof(unsigned long)); if (*pixel)