--- ./CVS/core/gui/Source/NSMenuItemCell.m	Mon Nov 18 09:41:14 2002
+++ ./CVS.build/gui/Source/NSMenuItemCell.m	Fri Jan 24 16:14:29 2003
@@ -389,9 +389,17 @@
   NSSize	size;
   NSPoint	position;
 
-  cellFrame = [self imageRectForBounds: cellFrame];
   size = [_imageToDisplay size];
+  if ([_menuItem hasSubmenu])
+  {
+    cellFrame = [self keyEquivalentRectForBounds: cellFrame];
+    position.x = cellFrame.origin.x + cellFrame.size.width - size.width;
+  }
+  else
+  {
+    cellFrame = [self imageRectForBounds: cellFrame];
   position.x = MAX(NSMidX(cellFrame) - (size.width/2.), 0.);
+  }
   position.y = MAX(NSMidY(cellFrame) - (size.height/2.), 0.);
   /*
    * Images are always drawn with their bottom-left corner at the origin
@@ -409,32 +417,6 @@
 			    inView:(NSView *)controlView
 {
   cellFrame = [self keyEquivalentRectForBounds: cellFrame];
-
-  if ([_menuItem hasSubmenu])
-    {
-      NSSize	size;
-      NSPoint	position;
-      NSImage	*imageToDraw;
-
-      if (_cell.is_highlighted)
-	imageToDraw = arrowImageH;
-      else
-	imageToDraw = arrowImage;
-      size = [imageToDraw size];
-      position.x = cellFrame.origin.x + cellFrame.size.width - size.width;
-      position.y = MAX(NSMidY(cellFrame) - (size.height/2.), 0.);
-      /*
-       * Images are always drawn with their bottom-left corner at the origin
-       * so we must adjust the position to take account of a flipped view.
-       */
-      if ([controlView isFlipped])
-	position.y += size.height;
-
-      if (nil != _backgroundColor)
-	[imageToDraw setBackgroundColor: _backgroundColor];
-      [imageToDraw compositeToPoint: position operation: NSCompositeSourceOver];
-    }
-  else
     [self _drawText: [_menuItem keyEquivalent] inFrame: cellFrame];
 }
 
@@ -593,7 +575,14 @@
     }
   else
     {
+    if ([_menuItem hasSubmenu])
+      if (_cell.is_highlighted)
+        _imageToDisplay = arrowImageH;
+      else
+        _imageToDisplay = arrowImage;
+    else
       _imageToDisplay = [_menuItem image];
+
       _titleToDisplay = [_menuItem title];
     }
 
@@ -615,7 +604,7 @@
     [self drawTitleWithFrame: cellFrame inView: controlView];
 
   // Draw the key equivalent
-  if (_keyEquivalentWidth > 0)
+  if (_keyEquivalentWidth > 0 && !_imageToDisplay)
     [self drawKeyEquivalentWithFrame: cellFrame inView: controlView];
 
   [controlView unlockFocus];
