Fix menu sorting
FossilOrigin-Name: e1c921ff76644e0bda3e6d584cf5002034073979db5a6a239f3dcd20a910fb7d
This commit is contained in:
parent
c49ae6bbe5
commit
5a033ec827
1 changed files with 11 additions and 2 deletions
|
@ -18,8 +18,17 @@
|
||||||
if (![otherObject isKindOfClass:MenuItem.class])
|
if (![otherObject isKindOfClass:MenuItem.class])
|
||||||
@throw [OFInvalidArgumentException exception];
|
@throw [OFInvalidArgumentException exception];
|
||||||
|
|
||||||
int x = (int)_text.longLongValue;
|
int x, y;
|
||||||
int y = (int)otherItem.text.longLongValue;
|
@try {
|
||||||
|
x = (int)_text.longLongValue;
|
||||||
|
} @catch (OFInvalidFormatException *e) {
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
@try {
|
||||||
|
y = (int)otherItem.text.longLongValue;
|
||||||
|
} @catch (OFInvalidFormatException *e) {
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (x > y)
|
if (x > y)
|
||||||
return OFOrderedAscending;
|
return OFOrderedAscending;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue