summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorEleni Maria Stea <elenimaria.stea@canonical.com>2014-10-08 10:14:09 +0300
committerEleni Maria Stea <elenimaria.stea@canonical.com>2014-10-08 10:14:09 +0300
commit83f97594d92f3f988cf5279199eebb12d69b6515 (patch)
treedab505f153e70eb11ece864045dd4c829c3fdaec /unity-shared
parentb1a98ef88aeebee5f1783640d099fdc1a641e6fb (diff)
fixes in the coding style etc
(bzr r3875.3.3)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/LayoutSystem.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/unity-shared/LayoutSystem.cpp b/unity-shared/LayoutSystem.cpp
index 40a2a4485..7456e0ed7 100644
--- a/unity-shared/LayoutSystem.cpp
+++ b/unity-shared/LayoutSystem.cpp
@@ -40,33 +40,27 @@ void LayoutSystem::LayoutWindowsNearest(LayoutWindow::Vector& windows, nux::Geom
if (windows.empty())
return;
- std::stable_sort(windows.begin(), windows.end(),
- [](const LayoutWindow::Ptr& a, const LayoutWindow::Ptr& b)
- {
- int acentery = a->geo.y + a->geo.height / 2;
- int bcentery = b->geo.y + b->geo.height / 2;
- return acentery < bcentery;
- });
+ std::stable_sort(windows.begin(), windows.end(), [](LayoutWindow::Ptr const& a, LayoutWindow::Ptr const& b) {
+ int acentery = a->geo.y + a->geo.height / 2;
+ int bcentery = b->geo.y + b->geo.height / 2;
+ return acentery < bcentery;
+ });
LayoutGridWindows(windows, max_bounds, final_bounds);
- std::vector<LayoutWindow::Vector> rows = GetRows(windows, max_bounds);
+ std::vector<LayoutWindow::Vector> const& rows = GetRows(windows, max_bounds);
LayoutWindow::Vector ordered_windows;
for (auto row : rows)
{
- std::stable_sort(row.begin(), row.end(),
- [](const LayoutWindow::Ptr& a, const LayoutWindow::Ptr& b)
- {
- int acenterx = a->geo.x + a->geo.width / 2;
- int bcenterx = b->geo.x + b->geo.width / 2;
- return acenterx < bcenterx;
- });
+ std::stable_sort(row.begin(), row.end(), [](LayoutWindow::Ptr const& a, LayoutWindow::Ptr const& b) {
+ int acenterx = a->geo.x + a->geo.width / 2;
+ int bcenterx = b->geo.x + b->geo.width / 2;
+ return acenterx < bcenterx;
+ });
- for (auto win : row)
- {
+ for (auto const& win : row)
ordered_windows.push_back(win);
- }
}
LayoutGridWindows(ordered_windows, max_bounds, final_bounds);