Merge lp:~sil2100/unity/libunity-7.0-breakage-ref-fix-autopilot into lp:~unity-team/unity/libunity-7.0-breakage

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Nick Dedekind
Approved revision: no longer in the source branch.
Merged at revision: 3095
Proposed branch: lp:~sil2100/unity/libunity-7.0-breakage-ref-fix-autopilot
Merge into: lp:~unity-team/unity/libunity-7.0-breakage
Diff against target: 51 lines (+4/-4)
4 files modified
dash/ResultView.cpp (+1/-1)
dash/ResultView.h (+1/-1)
dash/ResultViewGrid.cpp (+1/-1)
dash/ResultViewGrid.h (+1/-1)
To merge this branch: bzr merge lp:~sil2100/unity/libunity-7.0-breakage-ref-fix-autopilot
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Nick Dedekind (community) Approve
Review via email: mp+155017@code.launchpad.net

Commit message

Fix a general typo that caused failures in AP tests DashKeyNavTests suite. We need to pass the variables as references if we want to modify them - thus returning the correct column and row size in GetResultDimensions

Description of the change

- Problem:

AP tests related to the DashKeyNavTests test_dash suite are failing because of invalid row/column count of scope results.

- Fix:

The problem was a typo in the GetResultDimensions() function - we need to pass references instead of values if we are to assign any values to the rows and columns parameters inside of the function.

- Tests:

Covered by existing AP tests.

To post a comment you must log in.
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

My bad,
LGTM.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/ResultView.cpp'
2--- dash/ResultView.cpp 2013-03-11 17:20:46 +0000
3+++ dash/ResultView.cpp 2013-03-22 17:07:26 +0000
4@@ -269,7 +269,7 @@
5 return "ResultView";
6 }
7
8-void ResultView::GetResultDimensions(int rows, int columns)
9+void ResultView::GetResultDimensions(int& rows, int& columns)
10 {
11 columns = results_per_row;
12 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::min(1, columns))) : 0.0;
13
14=== modified file 'dash/ResultView.h'
15--- dash/ResultView.h 2013-03-11 17:20:46 +0000
16+++ dash/ResultView.h 2013-03-22 17:07:26 +0000
17@@ -91,7 +91,7 @@
18 std::vector<ResultViewTexture::Ptr> const& GetResultTextureContainers();
19 virtual void RenderResultTexture(ResultViewTexture::Ptr const& result_texture);
20
21- virtual void GetResultDimensions(int rows, int columns);
22+ virtual void GetResultDimensions(int& rows, int& columns);
23
24 protected:
25 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
26
27=== modified file 'dash/ResultViewGrid.cpp'
28--- dash/ResultViewGrid.cpp 2013-03-18 17:23:42 +0000
29+++ dash/ResultViewGrid.cpp 2013-03-22 17:07:26 +0000
30@@ -301,7 +301,7 @@
31 return (items_per_row) ? items_per_row : 1; // always at least one item per row
32 }
33
34-void ResultViewGrid::GetResultDimensions(int rows, int columns)
35+void ResultViewGrid::GetResultDimensions(int& rows, int& columns)
36 {
37 columns = GetItemsPerRow();
38 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::min<int>(1, results_per_row))) : 0.0;
39
40=== modified file 'dash/ResultViewGrid.h'
41--- dash/ResultViewGrid.h 2013-03-11 17:20:46 +0000
42+++ dash/ResultViewGrid.h 2013-03-22 17:07:26 +0000
43@@ -56,7 +56,7 @@
44
45 virtual void RenderResultTexture(ResultViewTexture::Ptr const& result_texture);
46
47- virtual void GetResultDimensions(int rows, int columns);
48+ virtual void GetResultDimensions(int& rows, int& columns);
49
50 protected:
51 void MouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);

Subscribers

People subscribed via source and target branches

to all changes: