Differences From Artifact [5ee318d452]:
- File src/MenuItem.m — part of check-in [89fbd7a152] at 2025-03-20 13:21:56 on branch trunk — Make more use of convenience methods (user: js, size: 916) [annotate] [blame] [check-ins using]
To Artifact [c51eda1a22]:
- File
src/MenuItem.m
— part of check-in
[75e920ae30]
at
2025-03-29 14:25:43
on branch trunk
— Switch from clang-format to manual formatting
clang-format does too many weird things. (user: js, size: 924) [annotate] [blame] [check-ins using]
1 2 3 | #import "MenuItem.h" @implementation MenuItem | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #import "MenuItem.h" @implementation MenuItem + (instancetype)itemWithText: (OFString *)text action: (OFString *)action { return [[self alloc] initWithText: text action: action]; } - (instancetype)initWithText: (OFString *)text action: (OFString *)action { self = [super init]; _text = [text copy]; _action = [action copy]; return self; } - (OFComparisonResult)compare: (id)otherObject { MenuItem *otherItem; if (![otherObject isKindOfClass: MenuItem.class]) @throw [OFInvalidArgumentException exception]; int x, y; @try { x = _text.intValue; } @catch (OFInvalidFormatException *e) { x = 0; |
︙ | ︙ |