| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/table/table_view.h" | 5 #include "views/controls/table/table_view.h" |
| 6 | 6 |
| 7 #include <commctrl.h> | 7 #include <commctrl.h> |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 if (is_sorted()) { | 1399 if (is_sorted()) { |
| 1400 if (add) | 1400 if (add) |
| 1401 UpdateItemsLParams(start, length); | 1401 UpdateItemsLParams(start, length); |
| 1402 else | 1402 else |
| 1403 UpdateItemsLParams(0, 0); | 1403 UpdateItemsLParams(0, 0); |
| 1404 } | 1404 } |
| 1405 | 1405 |
| 1406 LVITEM item = {0}; | 1406 LVITEM item = {0}; |
| 1407 if (add) { | 1407 if (add) { |
| 1408 const bool has_groups = model_->HasGroups(); | 1408 const bool has_groups = model_->HasGroups(); |
| 1409 item.mask = has_groups ? (LVIF_GROUPID | LVIF_PARAM) : LVIF_PARAM; | |
| 1410 for (int i = start; i < start + length; ++i) { | 1409 for (int i = start; i < start + length; ++i) { |
| 1410 item.mask = has_groups ? (LVIF_GROUPID | LVIF_PARAM) : LVIF_PARAM; |
| 1411 item.iItem = i; | 1411 item.iItem = i; |
| 1412 if (has_groups) | 1412 if (has_groups) |
| 1413 item.iGroupId = model_->GetGroupID(i); | 1413 item.iGroupId = model_->GetGroupID(i); |
| 1414 if (model_->ShouldIndent(i)) { |
| 1415 item.mask |= LVIF_INDENT; |
| 1416 item.iIndent = 1; |
| 1417 } |
| 1414 item.lParam = i; | 1418 item.lParam = i; |
| 1415 ListView_InsertItem(list_view_, &item); | 1419 ListView_InsertItem(list_view_, &item); |
| 1416 } | 1420 } |
| 1417 } | 1421 } |
| 1418 | 1422 |
| 1419 memset(&item, 0, sizeof(LVITEM)); | 1423 memset(&item, 0, sizeof(LVITEM)); |
| 1420 item.mask = | 1424 item.mask = |
| 1421 (table_type_ == ICON_AND_TEXT) ? (LVIF_IMAGE | LVIF_TEXT) : LVIF_TEXT; | 1425 (table_type_ == ICON_AND_TEXT) ? (LVIF_IMAGE | LVIF_TEXT) : LVIF_TEXT; |
| 1422 item.stateMask = 0; | 1426 item.stateMask = 0; |
| 1423 for (int j = 0; j < column_count_; ++j) { | 1427 for (int j = 0; j < column_count_; ++j) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 } | 1611 } |
| 1608 | 1612 |
| 1609 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { | 1613 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { |
| 1610 if (view_index_ == -1) | 1614 if (view_index_ == -1) |
| 1611 model_index_ = -1; | 1615 model_index_ = -1; |
| 1612 else | 1616 else |
| 1613 model_index_ = table_view_->ViewToModel(view_index_); | 1617 model_index_ = table_view_->ViewToModel(view_index_); |
| 1614 } | 1618 } |
| 1615 | 1619 |
| 1616 } // namespace views | 1620 } // namespace views |
| OLD | NEW |