From bcf0a68ff2196b7932d440089363ba71b39cd93b Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 20 Mar 2006 08:42:39 +0000 Subject: [PATCH] tidy and remnove unused code git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22690 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSMenuView.m | 29 ++++++++--------------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac04cef6a..387af8e0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-20 Richard Frith-Macdonald + + * Source/NSMenuView.m: ([-rectOfItemAtIndex:]) remove unused code and + tidy a bit (problem pointed out by Matt Rice). + 2006-03-19 Nicolas Roard * Source/NSSliderCell.m: diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index dbd73512b..164fd7d71 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -882,15 +882,15 @@ _addLeftBorderOffsetToRect(NSRect aRect) - (NSRect) rectOfItemAtIndex: (int)index { + if (_needsSizing == YES) + { + [self sizeToFit]; + } + if (_horizontal == YES) { GSCellRect aRect; - if (_needsSizing == YES) - { - [self sizeToFit]; - } - aRect = GSIArrayItemAtIndex(cellRects, index).ext; /* FIXME: handle vertical case? */ @@ -901,25 +901,12 @@ _addLeftBorderOffsetToRect(NSRect aRect) { NSRect theRect; - if (_needsSizing == YES) - { - [self sizeToFit]; - } - /* Fiddle with the origin so that the item rect is shifted 1 pixel over * so we do not draw on the heavy line at origin.x = 0. */ - if (_horizontal == NO) - { - theRect.origin.y - = _cellSize.height * ([_itemCells count] - index - 1); - theRect.origin.x = _leftBorderOffset; - } - else - { - theRect.origin.x = _cellSize.width * (index + 1); - theRect.origin.y = 0; - } + theRect.origin.y + = _cellSize.height * ([_itemCells count] - index - 1); + theRect.origin.x = _leftBorderOffset; theRect.size = _cellSize; /* NOTE: This returns the correct NSRect for drawing cells, but nothing