changeset 96812:eb46d3216494

apply fix from Chong Yidong to NS port ns_set_background_color(), and clean up comparison use of result from NS_FACE_BACKGROUND
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Sat, 19 Jul 2008 17:01:36 +0000
parents 24381a4165c3
children ece3c792fb2e
files src/ChangeLog src/nsfns.m src/nsfont.m src/nsterm.m
diffstat 4 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Jul 19 16:56:31 2008 +0000
+++ b/src/ChangeLog	Sat Jul 19 17:01:36 2008 +0000
@@ -1,3 +1,11 @@
+2008-07-19  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+	* nsfns.m (ns_set_background_color): Apply patch from Chong Yidong to
+	fix crash.
+	* nsterm.m (ns_maybe_dumpglyphs_background): Compare result from
+	NS_FACE_BACKGROUND with 0 instead of nil.
+	* nsfont.m (nsfont_draw): Same.
+
 2008-07-18  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Makefile.in (SOME_MACHINE_LISP): Remove ns-carbon-compat.elc.
--- a/src/nsfns.m	Sat Jul 19 16:56:31 2008 +0000
+++ b/src/nsfns.m	Sat Jul 19 17:01:36 2008 +0000
@@ -400,7 +400,7 @@
       face = FRAME_DEFAULT_FACE (f);
       if (face)
         {
-          col = NS_FACE_BACKGROUND (face);
+          col = ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f);
           face->background
 	     = (EMACS_UINT) [[col colorWithAlphaComponent: alpha] retain];
           [col release];
--- a/src/nsfont.m	Sat Jul 19 16:56:31 2008 +0000
+++ b/src/nsfont.m	Sat Jul 19 17:01:36 2008 +0000
@@ -968,7 +968,7 @@
         }
 
       if (!s->face->stipple)
-        [(NS_FACE_BACKGROUND (face) != nil
+        [(NS_FACE_BACKGROUND (face) != 0
           ? ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f)
           : FRAME_BACKGROUND_COLOR (s->f)) set];
       else
@@ -988,7 +988,7 @@
          : FRAME_FOREGROUND_COLOR (s->f));
   /*PENDING: find another way to pass this */
   bgCol = (ns_tmp_flags != NS_DUMPGLYPH_FOREGROUND ? nil
-           : (NS_FACE_BACKGROUND (face) != nil
+           : (NS_FACE_BACKGROUND (face) != 0
               ? ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f)
               : FRAME_BACKGROUND_COLOR (s->f)));
 
--- a/src/nsterm.m	Sat Jul 19 16:56:31 2008 +0000
+++ b/src/nsterm.m	Sat Jul 19 17:01:36 2008 +0000
@@ -2692,7 +2692,7 @@
           else
             face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
           if (!face->stipple)
-            [(NS_FACE_BACKGROUND (face) != nil
+            [(NS_FACE_BACKGROUND (face) != 0
               ? ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f)
               : FRAME_BACKGROUND_COLOR (s->f)) set];
           else