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
=== modified file 'dash/ResultView.cpp'
--- dash/ResultView.cpp 2013-03-11 17:20:46 +0000
+++ dash/ResultView.cpp 2013-03-22 17:07:26 +0000
@@ -269,7 +269,7 @@
269 return "ResultView";269 return "ResultView";
270}270}
271271
272void ResultView::GetResultDimensions(int rows, int columns)272void ResultView::GetResultDimensions(int& rows, int& columns)
273{273{
274 columns = results_per_row; 274 columns = results_per_row;
275 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::min(1, columns))) : 0.0;275 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::min(1, columns))) : 0.0;
276276
=== modified file 'dash/ResultView.h'
--- dash/ResultView.h 2013-03-11 17:20:46 +0000
+++ dash/ResultView.h 2013-03-22 17:07:26 +0000
@@ -91,7 +91,7 @@
91 std::vector<ResultViewTexture::Ptr> const& GetResultTextureContainers();91 std::vector<ResultViewTexture::Ptr> const& GetResultTextureContainers();
92 virtual void RenderResultTexture(ResultViewTexture::Ptr const& result_texture);92 virtual void RenderResultTexture(ResultViewTexture::Ptr const& result_texture);
9393
94 virtual void GetResultDimensions(int rows, int columns);94 virtual void GetResultDimensions(int& rows, int& columns);
9595
96protected:96protected:
97 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);97 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
9898
=== modified file 'dash/ResultViewGrid.cpp'
--- dash/ResultViewGrid.cpp 2013-03-18 17:23:42 +0000
+++ dash/ResultViewGrid.cpp 2013-03-22 17:07:26 +0000
@@ -301,7 +301,7 @@
301 return (items_per_row) ? items_per_row : 1; // always at least one item per row301 return (items_per_row) ? items_per_row : 1; // always at least one item per row
302}302}
303303
304void ResultViewGrid::GetResultDimensions(int rows, int columns)304void ResultViewGrid::GetResultDimensions(int& rows, int& columns)
305{305{
306 columns = GetItemsPerRow();306 columns = GetItemsPerRow();
307 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::min<int>(1, results_per_row))) : 0.0;307 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::min<int>(1, results_per_row))) : 0.0;
308308
=== modified file 'dash/ResultViewGrid.h'
--- dash/ResultViewGrid.h 2013-03-11 17:20:46 +0000
+++ dash/ResultViewGrid.h 2013-03-22 17:07:26 +0000
@@ -56,7 +56,7 @@
5656
57 virtual void RenderResultTexture(ResultViewTexture::Ptr const& result_texture);57 virtual void RenderResultTexture(ResultViewTexture::Ptr const& result_texture);
5858
59 virtual void GetResultDimensions(int rows, int columns);59 virtual void GetResultDimensions(int& rows, int& columns);
6060
61protected:61protected:
62 void MouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);62 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: