Nux

Merge lp:~azzar1/nux/fix-916088 into lp:nux/2.0

Proposed by Andrea Azzarone
Status: Merged
Approved by: Jay Taoko
Approved revision: 541
Merged at revision: 544
Proposed branch: lp:~azzar1/nux/fix-916088
Merge into: lp:nux/2.0
Diff against target: 88 lines (+12/-19)
1 file modified
Nux/GridHLayout.cpp (+12/-19)
To merge this branch: bzr merge lp:~azzar1/nux/fix-916088
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+88970@code.launchpad.net

Description of the change

Fixes a crash. Make check is ok.

To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) :
review: Approve
lp:~azzar1/nux/fix-916088 updated
538. By Andrea Azzarone

Merge trunk.

539. By Andrea Azzarone

Merge trunk.

540. By Andrea Azzarone

Ooops.

541. By Andrea Azzarone

Fixes

Revision history for this message
Jay Taoko (jaytaoko) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/GridHLayout.cpp'
2--- Nux/GridHLayout.cpp 2012-01-17 04:34:19 +0000
3+++ Nux/GridHLayout.cpp 2012-01-20 22:20:31 +0000
4@@ -80,6 +80,7 @@
5 {
6 if ((*it) == child)
7 break;
8+ ++position;
9 }
10
11 return position;
12@@ -93,7 +94,9 @@
13 {
14 if (position == pos)
15 return (*it);
16- }
17+
18+ ++position;
19+ }
20
21 return NULL;
22 }
23@@ -618,25 +621,13 @@
24 return NULL;
25 }
26
27- if ((direction == KEY_NAV_LEFT) && ((position % nun_column) == 0))
28- {
29- // Left edge
30- return NULL;
31- }
32-
33- if ((direction == KEY_NAV_RIGHT) && (position == (position / nun_column) * nun_column + (nun_column -1)))
34- {
35- // right edge
36- return NULL;
37- }
38-
39 if ((direction == KEY_NAV_UP) && ((position / nun_column) == 0))
40 {
41 // top edge
42 return NULL;
43 }
44
45- if ((direction == KEY_NAV_DOWN) && ((position / nun_column) == nun_row))
46+ if ((direction == KEY_NAV_DOWN) && ((position / nun_column) == (nun_row - 1)))
47 {
48 // bottom edge
49 return NULL;
50@@ -668,12 +659,12 @@
51
52 while (key_nav_focus == NULL)
53 {
54- ++it;
55 int pos = GetChildPos(*it);
56
57 if ((it == _layout_element_list.end()) || (pos == (pos / nun_column) * nun_column + (nun_column -1)))
58 break;
59
60+ ++it;
61 key_nav_focus = (*it)->KeyNavIteration(direction);
62 }
63
64@@ -686,7 +677,9 @@
65 {
66 --it;
67 }
68- return (*it)->KeyNavIteration(direction);
69+
70+ if (it != _layout_element_list.end())
71+ return (*it)->KeyNavIteration(direction);
72 }
73
74 if (direction == KEY_NAV_DOWN)
75@@ -694,10 +687,10 @@
76 for (int i = 0; i < nun_column; ++i)
77 {
78 ++it;
79- if (it == _layout_element_list.end())
80- return NULL;
81 }
82- return (*it)->KeyNavIteration(direction);
83+
84+ if (it != _layout_element_list.end())
85+ return (*it)->KeyNavIteration(direction);
86 }
87 }
88 else

Subscribers

People subscribed via source and target branches

to all changes: