Cube  Check-in [e1c921ff76]

Overview
Comment:Fix menu sorting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e1c921ff76644e0bda3e6d584cf5002034073979db5a6a239f3dcd20a910fb7d
User & Date: js on 2025-03-10 20:52:18
Other Links: manifest | tags
Context
2025-03-11
01:20
Make use of the new -[OFString intValue] check-in: 09eb96f339 user: js tags: trunk
2025-03-10
20:52
Fix menu sorting check-in: e1c921ff76 user: js tags: trunk
20:45
Fix server segfaulting on start check-in: 9cb357d9b6 user: js tags: trunk
Changes

Modified src/MenuItem.m from [b6800d39f8] to [f7a80f995c].

14
15
16
17
18
19
20


21
22









23
24
25
26
27
28
29
14
15
16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38







+
+
-
-
+
+
+
+
+
+
+
+
+







- (OFComparisonResult)compare:(id)otherObject
{
	MenuItem *otherItem;

	if (![otherObject isKindOfClass:MenuItem.class])
		@throw [OFInvalidArgumentException exception];

	int x, y;
	@try {
	int x = (int)_text.longLongValue;
	int y = (int)otherItem.text.longLongValue;
		x = (int)_text.longLongValue;
	} @catch (OFInvalidFormatException *e) {
		x = 0;
	}
	@try {
		y = (int)otherItem.text.longLongValue;
	} @catch (OFInvalidFormatException *e) {
		y = 0;
	}

	if (x > y)
		return OFOrderedAscending;
	if (x < y)
		return OFOrderedDescending;

	return OFOrderedSame;